Skip to content

Commit 3f7839c

Browse files
committed
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
1 parent 8da2ee0 commit 3f7839c

File tree

24 files changed

+2038
-78
lines changed

24 files changed

+2038
-78
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: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,29 @@ export function ConditionalIcon(props: SVGProps<SVGSVGElement>) {
124124
)
125125
}
126126

127+
export function CredentialIcon(props: SVGProps<SVGSVGElement>) {
128+
return (
129+
<svg {...props} viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
130+
<circle cx='8' cy='15' r='4' stroke='currentColor' strokeWidth='1.75' />
131+
<path d='M11.83 13.17L20 5' stroke='currentColor' strokeWidth='1.75' strokeLinecap='round' />
132+
<path
133+
d='M18 7l2 2'
134+
stroke='currentColor'
135+
strokeWidth='1.75'
136+
strokeLinecap='round'
137+
strokeLinejoin='round'
138+
/>
139+
<path
140+
d='M15 10l2 2'
141+
stroke='currentColor'
142+
strokeWidth='1.75'
143+
strokeLinecap='round'
144+
strokeLinejoin='round'
145+
/>
146+
</svg>
147+
)
148+
}
149+
127150
export function NoteIcon(props: SVGProps<SVGSVGElement>) {
128151
return (
129152
<svg
@@ -4908,7 +4931,7 @@ export function SSHIcon(props: SVGProps<SVGSVGElement>) {
49084931

49094932
export function DagsterIcon(props: SVGProps<SVGSVGElement>) {
49104933
return (
4911-
<svg {...props} viewBox='0 0 560 560' fill='none' xmlns='http://www.w3.org/2000/svg'>
4934+
<svg {...props} viewBox='21 21 518 518' fill='none' xmlns='http://www.w3.org/2000/svg'>
49124935
<path
49134936
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'
49144937
fill='#4F43DD'

0 commit comments

Comments
 (0)