@trydreamstate/cli 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -16
- package/agent-plugin/.claude-plugin/plugin.json +1 -1
- package/agent-plugin/.codex-plugin/plugin.json +1 -1
- package/agent-plugin/hooks/approve-readonly.sh +15 -0
- package/agent-plugin/hooks/hooks.json +17 -0
- package/agent-plugin/skills/crm/SKILL.md +2 -2
- package/agent-plugin/skills/diagnostics/SKILL.md +3 -1
- package/agent-plugin/skills/dreamstate/SKILL.md +15 -5
- package/agent-plugin/skills/first-win/SKILL.md +2 -2
- package/agent-plugin/skills/inbox-replies/SKILL.md +3 -1
- package/agent-plugin/skills/knowledge/SKILL.md +3 -5
- package/agent-plugin/skills/linkedin-posts/SKILL.md +3 -1
- package/agent-plugin/skills/linkedin-warm-signals/SKILL.md +2 -2
- package/agent-plugin/skills/list-building/SKILL.md +5 -10
- package/agent-plugin/skills/list-building/column-authoring.md +1 -1
- package/agent-plugin/skills/list-building/sourcing.md +2 -2
- package/agent-plugin/skills/outreach/SKILL.md +2 -2
- package/agent-plugin/skills/outreach/steps-and-timing.md +1 -1
- package/agent-plugin/skills/plays/SKILL.md +3 -3
- package/agent-plugin/skills/reddit-posts/SKILL.md +3 -1
- package/agent-plugin/skills/skill-authoring/SKILL.md +3 -1
- package/agent-plugin/skills/social/SKILL.md +4 -6
- package/agent-plugin/skills/visibility/SKILL.md +2 -6
- package/agent-plugin/skills/workflows/SKILL.md +3 -3
- package/agent-plugin/skills/workflows/lifecycle-and-enrollment.md +1 -1
- package/agent-plugin/skills/worksheet-tidy/SKILL.md +3 -1
- package/agent-plugin/skills/writing/SKILL.md +3 -5
- package/agent-plugin/skills/x-posts/SKILL.md +3 -1
- package/dist/agentGuidance.generated.json +35 -0
- package/dist/capabilityPosture.d.ts +12 -0
- package/dist/capabilityPosture.d.ts.map +1 -0
- package/dist/capabilityPosture.js +39 -0
- package/dist/client.d.ts +33 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +155 -64
- package/dist/commandTable.d.ts +26 -0
- package/dist/commandTable.d.ts.map +1 -0
- package/dist/commandTable.js +54 -0
- package/dist/commands/sequences.d.ts +3 -2
- package/dist/commands/sequences.d.ts.map +1 -1
- package/dist/commands/sequences.js +17 -34
- package/dist/commands/shared.d.ts +4 -26
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +136 -158
- package/dist/commands/workflows.d.ts +3 -2
- package/dist/commands/workflows.d.ts.map +1 -1
- package/dist/commands/workflows.js +17 -39
- package/dist/errors.d.ts +74 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +84 -0
- package/dist/gatedRun.d.ts +79 -0
- package/dist/gatedRun.d.ts.map +1 -0
- package/dist/gatedRun.js +346 -0
- package/dist/generated/packVerbs.generated.json +492 -0
- package/dist/generated/runContract.generated.d.ts +4 -0
- package/dist/generated/runContract.generated.d.ts.map +1 -0
- package/dist/generated/runContract.generated.js +7 -0
- package/dist/idempotency.d.ts +38 -0
- package/dist/idempotency.d.ts.map +1 -0
- package/dist/idempotency.js +106 -0
- package/dist/index.d.ts +22 -35
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +405 -378
- package/dist/registryManifest.d.ts +6 -0
- package/dist/registryManifest.d.ts.map +1 -0
- package/dist/registryManifest.js +66 -0
- package/dist/runContract.d.ts +10 -0
- package/dist/runContract.d.ts.map +1 -0
- package/dist/runContract.js +13 -0
- package/dist/runWait.d.ts +2 -2
- package/dist/runWait.d.ts.map +1 -1
- package/dist/runWait.js +3 -14
- package/dist/schemaCoercion.d.ts +20 -0
- package/dist/schemaCoercion.d.ts.map +1 -0
- package/dist/schemaCoercion.js +123 -0
- package/dist/skillInstaller.d.ts +40 -0
- package/dist/skillInstaller.d.ts.map +1 -1
- package/dist/skillInstaller.js +108 -9
- package/dist/tableFilePreview.d.ts +14 -0
- package/dist/tableFilePreview.d.ts.map +1 -1
- package/dist/tableFilePreview.js +19 -8
- package/dist/tableFileReader.d.ts +26 -0
- package/dist/tableFileReader.d.ts.map +1 -0
- package/dist/tableFileReader.js +108 -0
- package/dist/tablesImport.d.ts +57 -0
- package/dist/tablesImport.d.ts.map +1 -0
- package/dist/tablesImport.js +263 -0
- package/dist/turnCache.d.ts +14 -1
- package/dist/turnCache.d.ts.map +1 -1
- package/dist/turnCache.js +25 -8
- package/package.json +6 -3
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generated_by": "packages/cli/scripts/generate-pack-verbs.mjs from apps/backend/src/services/v1/capabilityRegistry/catalog.snapshot.json; do not edit by hand",
|
|
3
|
+
"registry_hash": "a92deba405d5474a601c4781448cfead03ca6320d45744c0dcea4a723f9fee23",
|
|
4
|
+
"verbs": [
|
|
5
|
+
{
|
|
6
|
+
"command": "sequences analytics",
|
|
7
|
+
"positional": [
|
|
8
|
+
{
|
|
9
|
+
"name": "id",
|
|
10
|
+
"into": "sequence_id"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"capabilityId": "sequence.sequences.analytics_get"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"command": "sequences enrollments",
|
|
17
|
+
"positional": [
|
|
18
|
+
{
|
|
19
|
+
"name": "id",
|
|
20
|
+
"into": "sequence_id"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"capabilityId": "sequence.sequences.contacts_list"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"command": "sequences create-from-worksheet",
|
|
27
|
+
"capabilityId": "sequence.sequences.create_from_worksheet"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"command": "sequences enroll",
|
|
31
|
+
"positional": [
|
|
32
|
+
{
|
|
33
|
+
"name": "id",
|
|
34
|
+
"into": "sequence_id"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"capabilityId": "sequence.sequences.enroll_selection"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"command": "sequences launch",
|
|
41
|
+
"positional": [
|
|
42
|
+
{
|
|
43
|
+
"name": "id",
|
|
44
|
+
"into": "sequence_id"
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"capabilityId": "sequence.sequences.launch"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"command": "sequences pause",
|
|
51
|
+
"positional": [
|
|
52
|
+
{
|
|
53
|
+
"name": "id",
|
|
54
|
+
"into": "sequence_id"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"capabilityId": "sequence.sequences.pause"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"command": "sequences publish",
|
|
61
|
+
"positional": [
|
|
62
|
+
{
|
|
63
|
+
"name": "id",
|
|
64
|
+
"into": "sequence_id"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"capabilityId": "sequence.sequences.publish"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"command": "sequences resume",
|
|
71
|
+
"positional": [
|
|
72
|
+
{
|
|
73
|
+
"name": "id",
|
|
74
|
+
"into": "sequence_id"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"capabilityId": "sequence.sequences.resume"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"command": "sequences start",
|
|
81
|
+
"positional": [
|
|
82
|
+
{
|
|
83
|
+
"name": "id",
|
|
84
|
+
"into": "sequence_id"
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
"capabilityId": "sequence.sequences.start"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"command": "sequences stats",
|
|
91
|
+
"positional": [
|
|
92
|
+
{
|
|
93
|
+
"name": "id",
|
|
94
|
+
"into": "sequence_id"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"capabilityId": "sequence.sequences.step_counts_get"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"command": "sequences archive",
|
|
101
|
+
"positional": [
|
|
102
|
+
{
|
|
103
|
+
"name": "id",
|
|
104
|
+
"into": "automation_id"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"capabilityId": "workflow.automations.archive"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"command": "workflows archive",
|
|
111
|
+
"positional": [
|
|
112
|
+
{
|
|
113
|
+
"name": "id",
|
|
114
|
+
"into": "automation_id"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"capabilityId": "workflow.automations.archive"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"command": "sequences create",
|
|
121
|
+
"capabilityId": "workflow.automations.compose"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"command": "workflows create",
|
|
125
|
+
"capabilityId": "workflow.automations.compose"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"command": "sequences duplicate",
|
|
129
|
+
"positional": [
|
|
130
|
+
{
|
|
131
|
+
"name": "id",
|
|
132
|
+
"into": "automation_id"
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"capabilityId": "workflow.automations.duplicate"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"command": "workflows duplicate",
|
|
139
|
+
"positional": [
|
|
140
|
+
{
|
|
141
|
+
"name": "id",
|
|
142
|
+
"into": "automation_id"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"capabilityId": "workflow.automations.duplicate"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"command": "sequences export",
|
|
149
|
+
"positional": [
|
|
150
|
+
{
|
|
151
|
+
"name": "id",
|
|
152
|
+
"into": "automation_id"
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
"capabilityId": "workflow.automations.export"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"command": "workflows export",
|
|
159
|
+
"positional": [
|
|
160
|
+
{
|
|
161
|
+
"name": "id",
|
|
162
|
+
"into": "automation_id"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"capabilityId": "workflow.automations.export"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"command": "sequences field-options",
|
|
169
|
+
"positional": [
|
|
170
|
+
{
|
|
171
|
+
"name": "id",
|
|
172
|
+
"into": "automation_id",
|
|
173
|
+
"optional": true
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"capabilityId": "workflow.automations.field_options"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"command": "workflows field-options",
|
|
180
|
+
"capabilityId": "workflow.automations.field_options"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"command": "sequences get",
|
|
184
|
+
"positional": [
|
|
185
|
+
{
|
|
186
|
+
"name": "id",
|
|
187
|
+
"into": "automation_id"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"capabilityId": "workflow.automations.get"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"command": "workflows get",
|
|
194
|
+
"positional": [
|
|
195
|
+
{
|
|
196
|
+
"name": "id",
|
|
197
|
+
"into": "automation_id"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"capabilityId": "workflow.automations.get"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"command": "sequences import",
|
|
204
|
+
"capabilityId": "workflow.automations.import"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"command": "workflows import",
|
|
208
|
+
"capabilityId": "workflow.automations.import"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"command": "sequences init",
|
|
212
|
+
"local": "init",
|
|
213
|
+
"capabilityId": "workflow.automations.lint"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"command": "workflows init",
|
|
217
|
+
"local": "init",
|
|
218
|
+
"capabilityId": "workflow.automations.lint"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"command": "sequences lint",
|
|
222
|
+
"positional": [
|
|
223
|
+
{
|
|
224
|
+
"name": "id",
|
|
225
|
+
"into": "automation_id"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"capabilityId": "workflow.automations.lint"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"command": "workflows lint",
|
|
232
|
+
"positional": [
|
|
233
|
+
{
|
|
234
|
+
"name": "id",
|
|
235
|
+
"into": "automation_id"
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"capabilityId": "workflow.automations.lint"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"command": "sequences list",
|
|
242
|
+
"capabilityId": "workflow.automations.list"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"command": "workflows list",
|
|
246
|
+
"capabilityId": "workflow.automations.list"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"command": "sequences node-add",
|
|
250
|
+
"positional": [
|
|
251
|
+
{
|
|
252
|
+
"name": "id",
|
|
253
|
+
"into": "automation_id"
|
|
254
|
+
}
|
|
255
|
+
],
|
|
256
|
+
"capabilityId": "workflow.automations.node_add"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"command": "workflows node-add",
|
|
260
|
+
"positional": [
|
|
261
|
+
{
|
|
262
|
+
"name": "id",
|
|
263
|
+
"into": "automation_id"
|
|
264
|
+
}
|
|
265
|
+
],
|
|
266
|
+
"capabilityId": "workflow.automations.node_add"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"command": "sequences node-catalog",
|
|
270
|
+
"capabilityId": "workflow.automations.node_catalog"
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"command": "workflows node-catalog",
|
|
274
|
+
"capabilityId": "workflow.automations.node_catalog"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"command": "sequences node-inspect",
|
|
278
|
+
"positional": [
|
|
279
|
+
{
|
|
280
|
+
"name": "id",
|
|
281
|
+
"into": "automation_id",
|
|
282
|
+
"optional": true
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"capabilityId": "workflow.automations.node_inspect"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"command": "workflows node-inspect",
|
|
289
|
+
"capabilityId": "workflow.automations.node_inspect"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"command": "sequences node-move",
|
|
293
|
+
"positional": [
|
|
294
|
+
{
|
|
295
|
+
"name": "id",
|
|
296
|
+
"into": "automation_id"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"capabilityId": "workflow.automations.node_move"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"command": "workflows node-move",
|
|
303
|
+
"positional": [
|
|
304
|
+
{
|
|
305
|
+
"name": "id",
|
|
306
|
+
"into": "automation_id"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"capabilityId": "workflow.automations.node_move"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"command": "sequences node-patch",
|
|
313
|
+
"positional": [
|
|
314
|
+
{
|
|
315
|
+
"name": "id",
|
|
316
|
+
"into": "automation_id"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
"capabilityId": "workflow.automations.node_patch"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"command": "workflows node-patch",
|
|
323
|
+
"positional": [
|
|
324
|
+
{
|
|
325
|
+
"name": "id",
|
|
326
|
+
"into": "automation_id"
|
|
327
|
+
}
|
|
328
|
+
],
|
|
329
|
+
"capabilityId": "workflow.automations.node_patch"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"command": "sequences node-remove",
|
|
333
|
+
"positional": [
|
|
334
|
+
{
|
|
335
|
+
"name": "id",
|
|
336
|
+
"into": "automation_id"
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"capabilityId": "workflow.automations.node_remove"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"command": "workflows node-remove",
|
|
343
|
+
"positional": [
|
|
344
|
+
{
|
|
345
|
+
"name": "id",
|
|
346
|
+
"into": "automation_id"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"capabilityId": "workflow.automations.node_remove"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"command": "sequences preview",
|
|
353
|
+
"positional": [
|
|
354
|
+
{
|
|
355
|
+
"name": "id",
|
|
356
|
+
"into": "automation_id"
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
"capabilityId": "workflow.automations.preview"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"command": "workflows preview",
|
|
363
|
+
"positional": [
|
|
364
|
+
{
|
|
365
|
+
"name": "id",
|
|
366
|
+
"into": "automation_id"
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"capabilityId": "workflow.automations.preview"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"command": "sequences update",
|
|
373
|
+
"positional": [
|
|
374
|
+
{
|
|
375
|
+
"name": "id",
|
|
376
|
+
"into": "automation_id"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"capabilityId": "workflow.automations.update"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"command": "workflows update",
|
|
383
|
+
"positional": [
|
|
384
|
+
{
|
|
385
|
+
"name": "id",
|
|
386
|
+
"into": "automation_id"
|
|
387
|
+
}
|
|
388
|
+
],
|
|
389
|
+
"capabilityId": "workflow.automations.update"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
"command": "sequences variables",
|
|
393
|
+
"positional": [
|
|
394
|
+
{
|
|
395
|
+
"name": "id",
|
|
396
|
+
"into": "automation_id"
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"capabilityId": "workflow.automations.variables_list"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"command": "workflows variables",
|
|
403
|
+
"positional": [
|
|
404
|
+
{
|
|
405
|
+
"name": "id",
|
|
406
|
+
"into": "automation_id"
|
|
407
|
+
}
|
|
408
|
+
],
|
|
409
|
+
"capabilityId": "workflow.automations.variables_list"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"command": "workflows activate",
|
|
413
|
+
"positional": [
|
|
414
|
+
{
|
|
415
|
+
"name": "id",
|
|
416
|
+
"into": "workflow_id"
|
|
417
|
+
}
|
|
418
|
+
],
|
|
419
|
+
"capabilityId": "workflow.workflows.activate"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"command": "workflows deactivate",
|
|
423
|
+
"positional": [
|
|
424
|
+
{
|
|
425
|
+
"name": "id",
|
|
426
|
+
"into": "workflow_id"
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
"capabilityId": "workflow.workflows.deactivate"
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"command": "workflows publish",
|
|
433
|
+
"positional": [
|
|
434
|
+
{
|
|
435
|
+
"name": "id",
|
|
436
|
+
"into": "workflow_id"
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
"capabilityId": "workflow.workflows.draft_publish"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"command": "workflows draft-save",
|
|
443
|
+
"positional": [
|
|
444
|
+
{
|
|
445
|
+
"name": "id",
|
|
446
|
+
"into": "workflow_id"
|
|
447
|
+
}
|
|
448
|
+
],
|
|
449
|
+
"capabilityId": "workflow.workflows.draft_save"
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
"command": "workflows enroll",
|
|
453
|
+
"positional": [
|
|
454
|
+
{
|
|
455
|
+
"name": "id",
|
|
456
|
+
"into": "workflow_id"
|
|
457
|
+
}
|
|
458
|
+
],
|
|
459
|
+
"capabilityId": "workflow.workflows.enroll_selection"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"command": "workflows retry",
|
|
463
|
+
"positional": [
|
|
464
|
+
{
|
|
465
|
+
"name": "id",
|
|
466
|
+
"into": "workflow_id"
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
"capabilityId": "workflow.workflows.run_retry"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
"command": "workflows run",
|
|
473
|
+
"positional": [
|
|
474
|
+
{
|
|
475
|
+
"name": "id",
|
|
476
|
+
"into": "workflow_id"
|
|
477
|
+
}
|
|
478
|
+
],
|
|
479
|
+
"capabilityId": "workflow.workflows.run_trace_get"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"command": "workflows runs",
|
|
483
|
+
"positional": [
|
|
484
|
+
{
|
|
485
|
+
"name": "id",
|
|
486
|
+
"into": "workflow_id"
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
"capabilityId": "workflow.workflows.runs_list"
|
|
490
|
+
}
|
|
491
|
+
]
|
|
492
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runContract.generated.d.ts","sourceRoot":"","sources":["../../src/generated/runContract.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,SAAS,4CAA6C,CAAC;AACpE,eAAO,MAAM,kBAAkB,QAA0B,CAAC;AAC1D,eAAO,MAAM,0BAA0B,MAAM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IDEMPOTENCY_KEY_MAX_LENGTH = exports.QUOTE_HASH_PATTERN = exports.RUN_MODES = void 0;
|
|
4
|
+
// Generated by packages/cli/scripts/generate-run-contract.mjs from packages/types/src/agentSurface.ts. Do not edit.
|
|
5
|
+
exports.RUN_MODES = ['smoke_test', 'dry_run', 'live'];
|
|
6
|
+
exports.QUOTE_HASH_PATTERN = /^sha256:[a-f0-9]{64}$/;
|
|
7
|
+
exports.IDEMPOTENCY_KEY_MAX_LENGTH = 255;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** A key-sorted JSON string, so two spellings of one input fingerprint alike. */
|
|
2
|
+
export declare function stableJson(value: unknown): string;
|
|
3
|
+
export interface IdempotencyIdentity {
|
|
4
|
+
/** What the key is for: a capability id, or a control such as runs.cancel. */
|
|
5
|
+
scope: string;
|
|
6
|
+
/** Workspace the command acts in; the same body in another workspace is another command. */
|
|
7
|
+
workspace?: string | null;
|
|
8
|
+
/** The request body that will be sent (params, mode, max_credits, quote_hash, approved ...). */
|
|
9
|
+
body: unknown;
|
|
10
|
+
}
|
|
11
|
+
export declare function pendingIdempotencyPath(credentialsPath: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Deterministic idempotency key for one logical command.
|
|
14
|
+
*
|
|
15
|
+
* A random key per invocation made a re-run after a timeout a brand new
|
|
16
|
+
* operation: the server could not replay the first attempt, so a write whose
|
|
17
|
+
* response was lost ran twice. The key is now a digest of the capability, the
|
|
18
|
+
* canonical request body and the workspace, so running the same command again
|
|
19
|
+
* presents the same key and the server replays. A key the caller names with
|
|
20
|
+
* --idempotency-key is used as given and never reaches this function.
|
|
21
|
+
*
|
|
22
|
+
* Because the whole body is hashed, a changed input, ceiling, mode, quote or
|
|
23
|
+
* approval flag is a different command with a different key. That is the same
|
|
24
|
+
* rule the server applies when it refuses a reused key with a different body
|
|
25
|
+
* (idempotency_key_reuse), so a deliberate change can never collide with an
|
|
26
|
+
* earlier attempt.
|
|
27
|
+
*/
|
|
28
|
+
export declare function idempotencyDigest(identity: IdempotencyIdentity): string;
|
|
29
|
+
/**
|
|
30
|
+
* Request digest, not a durable command key. A terminal attempt removes its
|
|
31
|
+
* entry; only an interrupted or transient attempt is resumed with this key.
|
|
32
|
+
*/
|
|
33
|
+
export declare function deterministicIdempotencyKey(identity: IdempotencyIdentity): string;
|
|
34
|
+
/** Gets a fresh attempt key, or resumes only a pending attempt for this digest. */
|
|
35
|
+
export declare function pendingIdempotencyKey(path: string, identity: IdempotencyIdentity): Promise<string>;
|
|
36
|
+
/** A success or definitive refusal finishes an attempt; a transient outcome keeps it resumable. */
|
|
37
|
+
export declare function finishIdempotencyAttempt(path: string, identity: IdempotencyIdentity): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=idempotency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idempotency.d.ts","sourceRoot":"","sources":["../src/idempotency.ts"],"names":[],"mappings":"AAIA,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOjD;AASD,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,4FAA4F;IAC5F,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gGAAgG;IAChG,IAAI,EAAE,OAAO,CAAC;CACf;AAED,wBAAgB,sBAAsB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAavE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,mBAAmB,GAAG,MAAM,CAEjF;AAqBD,mFAAmF;AACnF,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CASxG;AAED,mGAAmG;AACnG,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMzG"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stableJson = stableJson;
|
|
4
|
+
exports.pendingIdempotencyPath = pendingIdempotencyPath;
|
|
5
|
+
exports.idempotencyDigest = idempotencyDigest;
|
|
6
|
+
exports.deterministicIdempotencyKey = deterministicIdempotencyKey;
|
|
7
|
+
exports.pendingIdempotencyKey = pendingIdempotencyKey;
|
|
8
|
+
exports.finishIdempotencyAttempt = finishIdempotencyAttempt;
|
|
9
|
+
const node_crypto_1 = require("node:crypto");
|
|
10
|
+
const promises_1 = require("node:fs/promises");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
|
+
/** A key-sorted JSON string, so two spellings of one input fingerprint alike. */
|
|
13
|
+
function stableJson(value) {
|
|
14
|
+
if (Array.isArray(value))
|
|
15
|
+
return `[${value.map(stableJson).join(',')}]`;
|
|
16
|
+
if (value && typeof value === 'object') {
|
|
17
|
+
const record = value;
|
|
18
|
+
return `{${Object.keys(record).sort().filter((key) => record[key] !== undefined).map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`).join(',')}}`;
|
|
19
|
+
}
|
|
20
|
+
return JSON.stringify(value) ?? 'null';
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Keys that say how one HTTP attempt is made, not what the command does. They
|
|
24
|
+
* change between a command and its re-run (a fresh tool_turn_token from a new
|
|
25
|
+
* tools get), so they must not decide the idempotency key.
|
|
26
|
+
*/
|
|
27
|
+
const TRANSPORT_ONLY_BODY_KEYS = new Set(['tool_turn_token', 'idempotency_key']);
|
|
28
|
+
function pendingIdempotencyPath(credentialsPath) {
|
|
29
|
+
return (0, node_path_1.join)((0, node_path_1.dirname)(credentialsPath), 'idempotency-attempts.json');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Deterministic idempotency key for one logical command.
|
|
33
|
+
*
|
|
34
|
+
* A random key per invocation made a re-run after a timeout a brand new
|
|
35
|
+
* operation: the server could not replay the first attempt, so a write whose
|
|
36
|
+
* response was lost ran twice. The key is now a digest of the capability, the
|
|
37
|
+
* canonical request body and the workspace, so running the same command again
|
|
38
|
+
* presents the same key and the server replays. A key the caller names with
|
|
39
|
+
* --idempotency-key is used as given and never reaches this function.
|
|
40
|
+
*
|
|
41
|
+
* Because the whole body is hashed, a changed input, ceiling, mode, quote or
|
|
42
|
+
* approval flag is a different command with a different key. That is the same
|
|
43
|
+
* rule the server applies when it refuses a reused key with a different body
|
|
44
|
+
* (idempotency_key_reuse), so a deliberate change can never collide with an
|
|
45
|
+
* earlier attempt.
|
|
46
|
+
*/
|
|
47
|
+
function idempotencyDigest(identity) {
|
|
48
|
+
const body = identity.body && typeof identity.body === 'object' && !Array.isArray(identity.body)
|
|
49
|
+
? Object.fromEntries(Object.entries(identity.body)
|
|
50
|
+
.filter(([key]) => !TRANSPORT_ONLY_BODY_KEYS.has(key)))
|
|
51
|
+
: identity.body;
|
|
52
|
+
return (0, node_crypto_1.createHash)('sha256')
|
|
53
|
+
.update(stableJson({
|
|
54
|
+
scope: identity.scope,
|
|
55
|
+
workspace: identity.workspace ?? null,
|
|
56
|
+
body,
|
|
57
|
+
}))
|
|
58
|
+
.digest('hex')
|
|
59
|
+
.slice(0, 40);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Request digest, not a durable command key. A terminal attempt removes its
|
|
63
|
+
* entry; only an interrupted or transient attempt is resumed with this key.
|
|
64
|
+
*/
|
|
65
|
+
function deterministicIdempotencyKey(identity) {
|
|
66
|
+
return `dscli-${idempotencyDigest(identity)}`;
|
|
67
|
+
}
|
|
68
|
+
async function loadPending(path) {
|
|
69
|
+
try {
|
|
70
|
+
const value = JSON.parse(await (0, promises_1.readFile)(path, 'utf8'));
|
|
71
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
72
|
+
return {};
|
|
73
|
+
return Object.fromEntries(Object.entries(value)
|
|
74
|
+
.filter((entry) => typeof entry[1] === 'string' && entry[1].length > 0));
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
if (error.code === 'ENOENT')
|
|
78
|
+
return {};
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async function savePending(path, attempts) {
|
|
83
|
+
await (0, promises_1.mkdir)((0, node_path_1.dirname)(path), { recursive: true, mode: 0o700 });
|
|
84
|
+
await (0, promises_1.writeFile)(path, JSON.stringify(attempts), { mode: 0o600 });
|
|
85
|
+
}
|
|
86
|
+
/** Gets a fresh attempt key, or resumes only a pending attempt for this digest. */
|
|
87
|
+
async function pendingIdempotencyKey(path, identity) {
|
|
88
|
+
const attempts = await loadPending(path);
|
|
89
|
+
const digest = idempotencyDigest(identity);
|
|
90
|
+
const existing = attempts[digest];
|
|
91
|
+
if (existing)
|
|
92
|
+
return existing;
|
|
93
|
+
const key = `dscli-${(0, node_crypto_1.randomBytes)(20).toString('hex')}`;
|
|
94
|
+
attempts[digest] = key;
|
|
95
|
+
await savePending(path, attempts);
|
|
96
|
+
return key;
|
|
97
|
+
}
|
|
98
|
+
/** A success or definitive refusal finishes an attempt; a transient outcome keeps it resumable. */
|
|
99
|
+
async function finishIdempotencyAttempt(path, identity) {
|
|
100
|
+
const attempts = await loadPending(path);
|
|
101
|
+
const digest = idempotencyDigest(identity);
|
|
102
|
+
if (!(digest in attempts))
|
|
103
|
+
return;
|
|
104
|
+
delete attempts[digest];
|
|
105
|
+
await savePending(path, attempts);
|
|
106
|
+
}
|