Skip to content

Commit 24af61d

Browse files
waleedlatif1abhinavDhulipalagreptile-apps[bot]
authored
feat(dagster): expand integration with 9 new tools and full GraphQL validation (#4013)
* feat(blocks): add dagster block * type safety improvements Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * unify error handeling across dg tool * update icon to daggy * update icon to daggy * feat(dagster): expand integration with 9 new tools and full GraphQL validation - Add 9 new tools: delete_run, get_run_logs, reexecute_run, list_schedules, start_schedule, stop_schedule, list_sensors, start_sensor, stop_sensor - Fix GraphQL union type handling across all tools (replace invalid `... on Error` with concrete union member fragments per Dagster schema) - Fix TerminateRunFailure, InvalidStepError, InvalidOutputError handling in existing tools - Rename graphql.ts → utils.ts for clarity - Wire all 14 operations into the Dagster block with proper conditions and param remapping - Update icon to dagster logo SVG and set bgColor to white - Add block wiring guidance to the add-tools skill * fix(dagster): replace invalid `... on Error` interface spreads with concrete union members - list_runs: InvalidPipelineRunsFilterError + PythonError - list_jobs: RepositoryNotFoundError + PythonError - reexecute_run: PipelineNotFoundError, RunConflict, UnauthorizedError, PythonError - terminate_run: RunNotFoundError, UnauthorizedError, PythonError - delete_run: RunNotFoundError, UnauthorizedError, PythonError - list_sensors: RepositoryNotFoundError + PythonError - start_sensor: SensorNotFoundError, UnauthorizedError, PythonError - stop_sensor: UnauthorizedError + PythonError - stop_schedule: fix $id variable type String! → String (matches nullable schema arg) - dagster.mdx: add manual intro description section * docs * fix(dagster): add RunConfigValidationInvalid handling to launch_run and use concrete error types * fix(dagster): replace ... on Error with concrete RunNotFoundError + PythonError in get_run and get_run_logs * fix(dagster): add missing LaunchRunResult union members (InvalidSubsetError, PresetNotFoundError, ConflictingExecutionParamsError, NoModeProvidedError) * fix(dagster): always override jobName in list_runs params to prevent stale launch_run value leaking --------- Co-authored-by: abhinavDhulipala <abhinav.dhulipala@berkeley.edu> Co-authored-by: abhinavDhulipala <46908860+abhinavDhulipala@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent 5c7b057 commit 24af61d

File tree

28 files changed

+3345
-3
lines changed

28 files changed

+3345
-3
lines changed

.agents/skills/add-tools/SKILL.md

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ export * from './types'
266266

267267
## Registering Tools
268268

269-
After creating tools, remind the user to:
269+
After creating tools:
270270
1. Import tools in `apps/sim/tools/registry.ts`
271-
2. Add to the `tools` object with snake_case keys:
271+
2. Add to the `tools` object with snake_case keys (alphabetically):
272272
```typescript
273273
import { serviceActionTool } from '@/tools/{service}'
274274

@@ -278,6 +278,130 @@ export const tools = {
278278
}
279279
```
280280

281+
## Wiring Tools into the Block (Required)
282+
283+
After registering in `tools/registry.ts`, you MUST also update the block definition at `apps/sim/blocks/blocks/{service}.ts`. This is not optional — tools are only usable from the UI if they are wired into the block.
284+
285+
### 1. Add to `tools.access`
286+
287+
```typescript
288+
tools: {
289+
access: [
290+
// existing tools...
291+
'service_new_action', // Add every new tool ID here
292+
],
293+
config: { ... }
294+
}
295+
```
296+
297+
### 2. Add operation dropdown options
298+
299+
If the block uses an operation dropdown, add an option for each new tool:
300+
301+
```typescript
302+
{
303+
id: 'operation',
304+
type: 'dropdown',
305+
options: [
306+
// existing options...
307+
{ label: 'New Action', id: 'new_action' }, // id maps to what tools.config.tool returns
308+
],
309+
}
310+
```
311+
312+
### 3. Add subBlocks for new tool params
313+
314+
For each new tool, add subBlocks covering all its required params (and optional ones where useful). Apply `condition` to show them only for the right operation, and mark required params with `required`:
315+
316+
```typescript
317+
// Required param for new_action
318+
{
319+
id: 'someParam',
320+
title: 'Some Param',
321+
type: 'short-input',
322+
placeholder: 'e.g., value',
323+
condition: { field: 'operation', value: 'new_action' },
324+
required: { field: 'operation', value: 'new_action' },
325+
},
326+
// Optional param — put in advanced mode
327+
{
328+
id: 'optionalParam',
329+
title: 'Optional Param',
330+
type: 'short-input',
331+
condition: { field: 'operation', value: 'new_action' },
332+
mode: 'advanced',
333+
},
334+
```
335+
336+
### 4. Update `tools.config.tool`
337+
338+
Ensure the tool selector returns the correct tool ID for every new operation. The simplest pattern:
339+
340+
```typescript
341+
tool: (params) => `service_${params.operation}`,
342+
// If operation dropdown IDs already match tool IDs, this requires no change.
343+
```
344+
345+
If the dropdown IDs differ from tool IDs, add explicit mappings:
346+
347+
```typescript
348+
tool: (params) => {
349+
const map: Record<string, string> = {
350+
new_action: 'service_new_action',
351+
// ...
352+
}
353+
return map[params.operation] ?? `service_${params.operation}`
354+
},
355+
```
356+
357+
### 5. Update `tools.config.params`
358+
359+
Add any type coercions needed for new params (runs at execution time, after variable resolution):
360+
361+
```typescript
362+
params: (params) => {
363+
const result: Record<string, unknown> = {}
364+
if (params.limit != null && params.limit !== '') result.limit = Number(params.limit)
365+
if (params.newParamName) result.toolParamName = params.newParamName // rename if IDs differ
366+
return result
367+
},
368+
```
369+
370+
### 6. Add new outputs
371+
372+
Add any new fields returned by the new tools to the block `outputs`:
373+
374+
```typescript
375+
outputs: {
376+
// existing outputs...
377+
newField: { type: 'string', description: 'Description of new field' },
378+
}
379+
```
380+
381+
### 7. Add new inputs
382+
383+
Add new subBlock param IDs to the block `inputs` section:
384+
385+
```typescript
386+
inputs: {
387+
// existing inputs...
388+
someParam: { type: 'string', description: 'Param description' },
389+
optionalParam: { type: 'string', description: 'Optional param description' },
390+
}
391+
```
392+
393+
### Block wiring checklist
394+
395+
- [ ] New tool IDs added to `tools.access`
396+
- [ ] Operation dropdown has an option for each new tool
397+
- [ ] SubBlocks cover all required params for each new tool
398+
- [ ] SubBlocks have correct `condition` (only show for the right operation)
399+
- [ ] Optional/rarely-used params set to `mode: 'advanced'`
400+
- [ ] `tools.config.tool` returns correct ID for every new operation
401+
- [ ] `tools.config.params` handles any ID remapping or type coercions
402+
- [ ] New outputs added to block `outputs`
403+
- [ ] New params added to block `inputs`
404+
281405
## V2 Tool Pattern
282406

283407
If creating V2 tools (API-aligned outputs), use `_v2` suffix:
@@ -299,7 +423,9 @@ All tool IDs MUST use `snake_case`: `{service}_{action}` (e.g., `x_create_tweet`
299423
- [ ] All optional outputs have `optional: true`
300424
- [ ] No raw JSON dumps in outputs
301425
- [ ] Types file has all interfaces
302-
- [ ] Index.ts exports all tools
426+
- [ ] Index.ts exports all tools and re-exports types (`export * from './types'`)
427+
- [ ] Tools registered in `tools/registry.ts`
428+
- [ ] Block wired: `tools.access`, dropdown options, subBlocks, `tools.config`, outputs, inputs
303429

304430
## Final Validation (Required)
305431

apps/docs/components/icons.tsx

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4929,6 +4929,49 @@ export function SSHIcon(props: SVGProps<SVGSVGElement>) {
49294929
)
49304930
}
49314931

4932+
export function DagsterIcon(props: SVGProps<SVGSVGElement>) {
4933+
return (
4934+
<svg {...props} viewBox='21 21 518 518' fill='none' xmlns='http://www.w3.org/2000/svg'>
4935+
<path
4936+
d='M221.556 440.815C221.562 442.771 221.97 444.704 222.757 446.494C223.543 448.285 224.689 449.894 226.125 451.221C227.56 452.548 229.254 453.565 231.1 454.208C232.946 454.851 234.905 455.107 236.854 454.959C310.941 449.655 380.913 397.224 403.252 315.332C404.426 310.622 407.96 308.26 412.669 308.26C415.082 308.357 417.36 309.402 419.009 311.168C420.658 312.933 421.545 315.278 421.477 317.694C421.477 335.953 398.006 383.674 364.442 411.368C362.731 412.807 361.367 414.614 360.452 416.654C359.536 418.694 359.092 420.914 359.154 423.149C359.188 424.967 359.58 426.76 360.308 428.425C361.036 430.091 362.086 431.596 363.397 432.855C364.708 434.114 366.254 435.101 367.948 435.761C369.641 436.421 371.448 436.739 373.264 436.699C376.205 436.699 380.913 434.931 386.795 429.627C410.266 408.412 455 348.909 455 283.508C455 187.624 380.872 105 277.418 105C185.106 105 105.138 180.414 105.138 267.611C105.138 325.345 151.004 368.937 211.56 368.937C258.019 368.937 300.945 335.953 312.708 290.58C313.881 285.87 317.402 283.508 322.11 283.508C324.525 283.606 326.804 284.65 328.455 286.415C330.106 288.181 330.996 290.525 330.933 292.942C330.933 313.564 292.122 385.484 213.327 385.484C194.509 385.484 170.996 380.18 154.524 370.746C152.319 369.677 149.917 369.075 147.469 368.978C145.594 368.906 143.725 369.223 141.979 369.909C140.232 370.594 138.647 371.634 137.321 372.962C135.996 374.291 134.96 375.879 134.278 377.627C133.596 379.376 133.283 381.247 133.359 383.122C133.435 385.524 134.123 387.867 135.357 389.929C136.592 391.991 138.332 393.703 140.414 394.904C162.173 407.334 188.047 413.757 214.501 413.757C280.359 413.757 340.335 368.978 357.98 302.997C359.154 298.287 362.688 295.926 367.383 295.926C369.797 296.023 372.077 297.067 373.728 298.832C375.379 300.598 376.269 302.943 376.205 305.359C376.205 332.459 327.992 419.655 235.087 426.727C231.492 426.994 228.123 428.579 225.625 431.18C223.128 433.78 221.679 437.211 221.556 440.815V440.815Z'
4937+
fill='#4F43DD'
4938+
/>
4939+
<path
4940+
d='M313.62 215.178C326.301 215.083 338.748 218.589 349.517 225.288C350.605 219.33 351.206 213.292 351.312 207.236C351.312 179.266 329.995 154.211 304.038 154.211C283.853 154.211 271.233 170.937 271.233 191.6C271.137 202.763 275.057 213.588 282.279 222.098C292.062 217.431 302.782 215.064 313.62 215.178V215.178Z'
4941+
fill='white'
4942+
/>
4943+
<path
4944+
d='M374.439 316.505C378.042 304.185 379.63 295.635 379.63 290.083C379.52 287.685 378.493 285.421 376.761 283.76C375.028 282.099 372.724 281.168 370.325 281.16C368.089 281.202 365.932 281.99 364.196 283.399C362.46 284.808 361.244 286.757 360.743 288.936C359.762 292.983 357.664 303.95 355.593 310.912C356.449 308.306 357.231 305.658 357.94 302.97C359.114 298.246 362.648 295.898 367.342 295.898C369.756 295.991 372.035 297.033 373.687 298.796C375.338 300.559 376.228 302.902 376.165 305.318C376.054 309.115 375.446 312.881 374.356 316.519L374.439 316.505Z'
4945+
fill='#352D8E'
4946+
/>
4947+
<path
4948+
d='M424.418 303.632C424.305 301.237 423.278 298.977 421.55 297.317C419.821 295.658 417.522 294.724 415.126 294.709C412.893 294.754 410.739 295.543 409.006 296.952C407.272 298.36 406.059 300.308 405.558 302.485C404.564 306.629 402.424 317.761 400.325 324.709H400.422C401.444 321.615 402.396 318.48 403.183 315.289C404.357 310.565 407.891 308.217 412.599 308.217C415.012 308.311 417.29 309.353 418.939 311.116C420.588 312.88 421.475 315.223 421.408 317.637C421.341 320.569 420.938 323.485 420.207 326.325C423.134 316.049 424.418 308.618 424.418 303.632Z'
4949+
fill='#352D8E'
4950+
/>
4951+
<path
4952+
d='M313.619 215.178C319.921 215.166 326.196 216.007 332.272 217.678C335.462 213.326 337.056 208.008 336.786 202.618C336.516 197.228 334.398 192.095 330.789 188.084C327.18 184.073 322.3 181.428 316.97 180.594C311.64 179.761 306.185 180.789 301.524 183.507L311.189 199.419L293.089 191.587C290.637 195.545 289.407 200.139 289.555 204.793C289.702 209.446 291.22 213.953 293.917 217.747C300.34 216.016 306.967 215.152 313.619 215.178V215.178Z'
4953+
fill='#030615'
4954+
/>
4955+
<path
4956+
d='M174.172 317.583C181.797 317.583 187.979 311.399 187.979 303.771C187.979 296.143 181.797 289.959 174.172 289.959C166.547 289.959 160.365 296.143 160.365 303.771C160.365 311.399 166.547 317.583 174.172 317.583Z'
4957+
fill='#352D8E'
4958+
/>
4959+
<path
4960+
d='M174.172 262.335C181.797 262.335 187.979 256.151 187.979 248.523C187.979 240.895 181.797 234.711 174.172 234.711C166.547 234.711 160.365 240.895 160.365 248.523C160.365 256.151 166.547 262.335 174.172 262.335Z'
4961+
fill='#352D8E'
4962+
/>
4963+
<path
4964+
d='M146.558 289.958C154.183 289.958 160.364 283.774 160.364 276.146C160.364 268.518 154.183 262.334 146.558 262.334C138.932 262.334 132.751 268.518 132.751 276.146C132.751 283.774 138.932 289.958 146.558 289.958Z'
4965+
fill='#352D8E'
4966+
/>
4967+
<path
4968+
d='M208.688 368.91H211.45C257.909 368.91 300.835 335.927 312.598 290.554C313.771 285.844 317.292 283.482 322 283.482C324.415 283.579 326.694 284.624 328.345 286.389C329.996 288.155 330.886 290.499 330.823 292.916C330.612 297.737 329.522 302.479 327.606 306.908C327.939 306.393 328.23 305.853 328.476 305.292C331.969 297.304 333.774 288.679 333.777 279.96C333.777 266.41 324.361 257.571 310.844 257.571C287.276 257.571 282.554 278.151 272.614 300.154C262.3 322.999 243.357 347.709 195.586 347.709C145.951 347.709 94.9487 312.944 107.389 242.253C107.54 241.369 107.665 240.582 107.761 239.85C105.939 248.982 105.014 258.272 105 267.584C105.138 324.491 149.582 367.585 208.688 368.91Z'
4969+
fill='#352D8E'
4970+
/>
4971+
</svg>
4972+
)
4973+
}
4974+
49324975
export function DatabricksIcon(props: SVGProps<SVGSVGElement>) {
49334976
return (
49344977
<svg {...props} viewBox='0 0 241 266' fill='none' xmlns='http://www.w3.org/2000/svg'>

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
CloudWatchIcon,
3333
ConfluenceIcon,
3434
CursorIcon,
35+
DagsterIcon,
3536
DatabricksIcon,
3637
DatadogIcon,
3738
DevinIcon,
@@ -218,6 +219,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
218219
cloudwatch: CloudWatchIcon,
219220
confluence_v2: ConfluenceIcon,
220221
cursor_v2: CursorIcon,
222+
dagster: DagsterIcon,
221223
databricks: DatabricksIcon,
222224
datadog: DatadogIcon,
223225
devin: DevinIcon,

0 commit comments

Comments
 (0)