patchwork-os 0.2.0-alpha.22 → 0.2.0-alpha.24

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.
@@ -0,0 +1,139 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://patchwork.sh/schema/dry-run-plan.v1.json",
4
+ "title": "Patchwork Recipe Dry-Run Plan",
5
+ "description": "Stable machine-readable output of `patchwork recipe run --dry-run`. Pin consumers on schemaVersion.",
6
+ "type": "object",
7
+ "required": [
8
+ "schemaVersion",
9
+ "recipe",
10
+ "mode",
11
+ "triggerType",
12
+ "generatedAt",
13
+ "steps"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": {
17
+ "type": "number",
18
+ "const": 1
19
+ },
20
+ "recipe": {
21
+ "type": "string"
22
+ },
23
+ "mode": {
24
+ "type": "string",
25
+ "const": "dry-run"
26
+ },
27
+ "triggerType": {
28
+ "type": "string"
29
+ },
30
+ "generatedAt": {
31
+ "type": "string",
32
+ "description": "ISO-8601 timestamp when plan was generated"
33
+ },
34
+ "stepSelection": {
35
+ "type": "object",
36
+ "properties": {
37
+ "query": {
38
+ "type": "string"
39
+ },
40
+ "matchedBy": {
41
+ "type": "string"
42
+ },
43
+ "matchedValue": {
44
+ "type": "string"
45
+ }
46
+ }
47
+ },
48
+ "steps": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "object",
52
+ "required": [
53
+ "id",
54
+ "type"
55
+ ],
56
+ "properties": {
57
+ "id": {
58
+ "type": "string"
59
+ },
60
+ "type": {
61
+ "type": "string",
62
+ "enum": [
63
+ "tool",
64
+ "agent",
65
+ "recipe"
66
+ ]
67
+ },
68
+ "tool": {
69
+ "type": "string"
70
+ },
71
+ "namespace": {
72
+ "type": "string"
73
+ },
74
+ "into": {
75
+ "type": "string"
76
+ },
77
+ "optional": {
78
+ "type": "boolean"
79
+ },
80
+ "prompt": {
81
+ "type": "string"
82
+ },
83
+ "params": {
84
+ "type": "object",
85
+ "additionalProperties": true
86
+ },
87
+ "dependencies": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ }
92
+ },
93
+ "condition": {
94
+ "type": "string"
95
+ },
96
+ "risk": {
97
+ "type": "string",
98
+ "enum": [
99
+ "low",
100
+ "medium",
101
+ "high"
102
+ ]
103
+ },
104
+ "isWrite": {
105
+ "type": "boolean"
106
+ },
107
+ "isConnector": {
108
+ "type": "boolean"
109
+ },
110
+ "resolved": {
111
+ "type": "boolean",
112
+ "description": "True if the tool id is known to the registry at plan time"
113
+ }
114
+ }
115
+ }
116
+ },
117
+ "parallelGroups": {
118
+ "type": "array",
119
+ "items": {
120
+ "type": "array",
121
+ "items": {
122
+ "type": "string"
123
+ }
124
+ }
125
+ },
126
+ "maxDepth": {
127
+ "type": "number"
128
+ },
129
+ "connectorNamespaces": {
130
+ "type": "array",
131
+ "items": {
132
+ "type": "string"
133
+ }
134
+ },
135
+ "hasWriteSteps": {
136
+ "type": "boolean"
137
+ }
138
+ }
139
+ }
@@ -0,0 +1,404 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://patchwork.sh/schema/recipe.v1.json",
4
+ "title": "Patchwork Recipe",
5
+ "description": "YAML recipe schema for Patchwork automation",
6
+ "x-taplo": {
7
+ "file-patterns": [
8
+ "*.patchwork.yaml",
9
+ "*.patchwork.yml"
10
+ ]
11
+ },
12
+ "type": "object",
13
+ "required": [
14
+ "name",
15
+ "trigger",
16
+ "steps"
17
+ ],
18
+ "properties": {
19
+ "name": {
20
+ "type": "string",
21
+ "description": "Recipe name (kebab-case recommended)",
22
+ "pattern": "^[a-z0-9-]+$"
23
+ },
24
+ "description": {
25
+ "type": "string",
26
+ "description": "Human-readable description of what this recipe does"
27
+ },
28
+ "maxConcurrency": {
29
+ "type": "number",
30
+ "description": "Maximum number of chained steps that may execute in parallel"
31
+ },
32
+ "maxDepth": {
33
+ "type": "number",
34
+ "description": "Maximum nested recipe depth for chained recipes"
35
+ },
36
+ "version": {
37
+ "type": "string",
38
+ "description": "Semantic version",
39
+ "default": "1.0.0"
40
+ },
41
+ "apiVersion": {
42
+ "type": "string",
43
+ "description": "Patchwork API version",
44
+ "enum": [
45
+ "patchwork.sh/v1"
46
+ ],
47
+ "default": "patchwork.sh/v1"
48
+ },
49
+ "trigger": {
50
+ "type": "object",
51
+ "description": "When to run this recipe",
52
+ "required": [
53
+ "type"
54
+ ],
55
+ "properties": {
56
+ "type": {
57
+ "type": "string",
58
+ "enum": [
59
+ "manual",
60
+ "cron",
61
+ "webhook",
62
+ "file_watch",
63
+ "git_hook",
64
+ "on_file_save",
65
+ "on_test_run",
66
+ "chained"
67
+ ],
68
+ "description": "Trigger type"
69
+ },
70
+ "at": {
71
+ "type": "string",
72
+ "description": "Cron expression (for cron trigger)"
73
+ },
74
+ "glob": {
75
+ "type": "string",
76
+ "description": "File glob pattern (for file_watch trigger)"
77
+ },
78
+ "on": {
79
+ "type": "string",
80
+ "enum": [
81
+ "post-commit",
82
+ "pre-push",
83
+ "post-merge"
84
+ ],
85
+ "description": "Git hook event (for git_hook trigger)"
86
+ },
87
+ "filter": {
88
+ "type": "string",
89
+ "description": "File filter pattern (for file_watch trigger)"
90
+ },
91
+ "eventSource": {
92
+ "type": "string",
93
+ "description": "Webhook/event source name after legacy trigger normalization"
94
+ },
95
+ "eventFilter": {
96
+ "oneOf": [
97
+ {
98
+ "type": "string"
99
+ },
100
+ {
101
+ "type": "object"
102
+ }
103
+ ],
104
+ "description": "Webhook/event filter after legacy trigger normalization"
105
+ },
106
+ "eventLeadTimeHours": {
107
+ "type": "number",
108
+ "description": "Lead time in hours after legacy trigger normalization"
109
+ },
110
+ "eventLeadTimeMinutes": {
111
+ "type": "number",
112
+ "description": "Lead time in minutes after legacy trigger normalization"
113
+ },
114
+ "legacyType": {
115
+ "type": "string",
116
+ "enum": [
117
+ "event"
118
+ ],
119
+ "description": "Original trigger type preserved during legacy normalization"
120
+ }
121
+ }
122
+ },
123
+ "context": {
124
+ "type": "array",
125
+ "description": "Context blocks to load before running steps",
126
+ "items": {
127
+ "type": "object",
128
+ "required": [
129
+ "type"
130
+ ],
131
+ "properties": {
132
+ "type": {
133
+ "type": "string",
134
+ "enum": [
135
+ "file",
136
+ "env"
137
+ ]
138
+ },
139
+ "path": {
140
+ "type": "string"
141
+ },
142
+ "keys": {
143
+ "type": "array",
144
+ "items": {
145
+ "type": "string"
146
+ }
147
+ }
148
+ }
149
+ }
150
+ },
151
+ "steps": {
152
+ "type": "array",
153
+ "description": "Sequence of steps to execute",
154
+ "items": {
155
+ "oneOf": [
156
+ {
157
+ "type": "object",
158
+ "required": [
159
+ "agent"
160
+ ],
161
+ "properties": {
162
+ "id": {
163
+ "type": "string",
164
+ "description": "Unique chained step identifier used for outputs and dependencies"
165
+ },
166
+ "awaits": {
167
+ "type": "array",
168
+ "description": "Step IDs that must complete before this step runs",
169
+ "items": {
170
+ "type": "string"
171
+ }
172
+ },
173
+ "when": {
174
+ "type": "string",
175
+ "description": "Template condition that controls whether this step runs"
176
+ },
177
+ "optional": {
178
+ "type": "boolean",
179
+ "description": "Whether step failure should be tolerated"
180
+ },
181
+ "risk": {
182
+ "type": "string",
183
+ "enum": [
184
+ "low",
185
+ "medium",
186
+ "high"
187
+ ],
188
+ "description": "Risk level for this step"
189
+ },
190
+ "transform": {
191
+ "type": "string",
192
+ "description": "Template rendered after tool execution. Use $result to reference the tool output. Supports all template expressions."
193
+ },
194
+ "agent": {
195
+ "type": "object",
196
+ "required": [
197
+ "prompt"
198
+ ],
199
+ "description": "Agent step configuration",
200
+ "properties": {
201
+ "prompt": {
202
+ "type": "string",
203
+ "description": "Prompt to send to the AI (supports {{templates}})"
204
+ },
205
+ "model": {
206
+ "type": "string",
207
+ "description": "Model to use for the agent step"
208
+ },
209
+ "driver": {
210
+ "type": "string",
211
+ "enum": [
212
+ "claude",
213
+ "claude-code",
214
+ "api",
215
+ "openai",
216
+ "grok",
217
+ "gemini",
218
+ "anthropic"
219
+ ],
220
+ "description": "Driver for agent execution"
221
+ },
222
+ "into": {
223
+ "type": "string",
224
+ "description": "Variable name to store output in context"
225
+ }
226
+ }
227
+ }
228
+ }
229
+ },
230
+ {
231
+ "type": "object",
232
+ "required": [
233
+ "tool"
234
+ ],
235
+ "properties": {
236
+ "id": {
237
+ "type": "string",
238
+ "description": "Unique chained step identifier used for outputs and dependencies"
239
+ },
240
+ "awaits": {
241
+ "type": "array",
242
+ "description": "Step IDs that must complete before this step runs",
243
+ "items": {
244
+ "type": "string"
245
+ }
246
+ },
247
+ "when": {
248
+ "type": "string",
249
+ "description": "Template condition that controls whether this step runs"
250
+ },
251
+ "optional": {
252
+ "type": "boolean",
253
+ "description": "Whether step failure should be tolerated"
254
+ },
255
+ "risk": {
256
+ "type": "string",
257
+ "enum": [
258
+ "low",
259
+ "medium",
260
+ "high"
261
+ ],
262
+ "description": "Risk level for this step"
263
+ },
264
+ "transform": {
265
+ "type": "string",
266
+ "description": "Template rendered after tool execution. Use $result to reference the tool output. Supports all template expressions."
267
+ },
268
+ "tool": {
269
+ "type": "string",
270
+ "not": {
271
+ "enum": []
272
+ }
273
+ },
274
+ "into": {
275
+ "type": "string"
276
+ }
277
+ }
278
+ },
279
+ {
280
+ "type": "object",
281
+ "required": [
282
+ "recipe"
283
+ ],
284
+ "properties": {
285
+ "id": {
286
+ "type": "string",
287
+ "description": "Unique chained step identifier used for outputs and dependencies"
288
+ },
289
+ "awaits": {
290
+ "type": "array",
291
+ "description": "Step IDs that must complete before this step runs",
292
+ "items": {
293
+ "type": "string"
294
+ }
295
+ },
296
+ "when": {
297
+ "type": "string",
298
+ "description": "Template condition that controls whether this step runs"
299
+ },
300
+ "optional": {
301
+ "type": "boolean",
302
+ "description": "Whether step failure should be tolerated"
303
+ },
304
+ "risk": {
305
+ "type": "string",
306
+ "enum": [
307
+ "low",
308
+ "medium",
309
+ "high"
310
+ ],
311
+ "description": "Risk level for this step"
312
+ },
313
+ "transform": {
314
+ "type": "string",
315
+ "description": "Template rendered after tool execution. Use $result to reference the tool output. Supports all template expressions."
316
+ },
317
+ "recipe": {
318
+ "type": "string",
319
+ "description": "Nested recipe name or path"
320
+ },
321
+ "vars": {
322
+ "type": "object",
323
+ "description": "Template variables passed into a nested recipe step",
324
+ "additionalProperties": {
325
+ "type": "string"
326
+ }
327
+ },
328
+ "output": {
329
+ "type": "string",
330
+ "description": "Output key for the nested recipe result"
331
+ }
332
+ }
333
+ }
334
+ ]
335
+ }
336
+ },
337
+ "expect": {
338
+ "type": "object",
339
+ "description": "Optional assertions for mocked recipe tests",
340
+ "properties": {
341
+ "stepsRun": {
342
+ "type": "number",
343
+ "description": "Expected number of executed steps"
344
+ },
345
+ "outputs": {
346
+ "type": "array",
347
+ "description": "Expected output paths or keys recorded by the run",
348
+ "items": {
349
+ "type": "string"
350
+ }
351
+ },
352
+ "errorMessage": {
353
+ "type": [
354
+ "string",
355
+ "null"
356
+ ],
357
+ "description": "Expected final error message, or null for a clean run"
358
+ },
359
+ "context": {
360
+ "type": "object",
361
+ "description": "Expected context key/value pairs after the run",
362
+ "additionalProperties": {
363
+ "type": "string"
364
+ }
365
+ }
366
+ }
367
+ },
368
+ "output": {
369
+ "type": "object",
370
+ "description": "Output file configuration",
371
+ "properties": {
372
+ "path": {
373
+ "type": "string",
374
+ "description": "Path to write final output"
375
+ }
376
+ }
377
+ },
378
+ "on_error": {
379
+ "type": "object",
380
+ "description": "Error handling policy",
381
+ "properties": {
382
+ "retry": {
383
+ "type": "number",
384
+ "description": "Number of retries",
385
+ "default": 0
386
+ },
387
+ "fallback": {
388
+ "type": "string",
389
+ "enum": [
390
+ "log_only",
391
+ "abort",
392
+ "deliver_original"
393
+ ],
394
+ "description": "Fallback action on error"
395
+ },
396
+ "notify": {
397
+ "type": "boolean",
398
+ "description": "Whether to notify on error",
399
+ "default": true
400
+ }
401
+ }
402
+ }
403
+ }
404
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchwork-os",
3
- "version": "0.2.0-alpha.22",
3
+ "version": "0.2.0-alpha.24",
4
4
  "description": "Patchwork OS — proactive, multi-model AI teammate built on the Claude IDE Bridge. One agent, any model, works while you're away.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -78,7 +78,7 @@
78
78
  "lint:fix": "biome check --write .",
79
79
  "typecheck": "tsc --noEmit",
80
80
  "postinstall": "node scripts/postinstall.mjs || true",
81
- "prepublishOnly": "npm run build && node dist/index.js --help | grep -q issuer-url",
81
+ "prepublishOnly": "npm run build && node dist/index.js --help | grep -q issuer-url && node scripts/publish-schemas.mjs",
82
82
  "smoke": "node smoke-test-v2.mjs",
83
83
  "remote": "bash scripts/start-remote.sh",
84
84
  "vps": "bash scripts/start-vps.sh",