@farmslot/protocol 0.9.0 → 0.11.0

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +27 -2
  2. package/README.md +12 -4
  3. package/dist/agents/roles.js +2 -2
  4. package/dist/agents/roles.js.map +1 -1
  5. package/dist/contracts/agents.d.ts +7 -0
  6. package/dist/contracts/agents.d.ts.map +1 -1
  7. package/dist/contracts/backlog.d.ts +11 -0
  8. package/dist/contracts/backlog.d.ts.map +1 -1
  9. package/dist/contracts/backlog.js.map +1 -1
  10. package/dist/contracts/bug-input.d.ts +8 -0
  11. package/dist/contracts/bug-input.d.ts.map +1 -1
  12. package/dist/contracts/bug-input.js +14 -2
  13. package/dist/contracts/bug-input.js.map +1 -1
  14. package/dist/contracts/bug-score.d.ts +73 -0
  15. package/dist/contracts/bug-score.d.ts.map +1 -0
  16. package/dist/contracts/bug-score.js +208 -0
  17. package/dist/contracts/bug-score.js.map +1 -0
  18. package/dist/contracts/dispatch.d.ts +5 -1
  19. package/dist/contracts/dispatch.d.ts.map +1 -1
  20. package/dist/contracts/index.d.ts +1 -0
  21. package/dist/contracts/index.d.ts.map +1 -1
  22. package/dist/contracts/index.js +1 -0
  23. package/dist/contracts/index.js.map +1 -1
  24. package/dist/contracts/recipes.js +1 -1
  25. package/dist/contracts/recipes.js.map +1 -1
  26. package/dist/contracts/reviews.d.ts +2 -1
  27. package/dist/contracts/reviews.d.ts.map +1 -1
  28. package/dist/contracts/reviews.js.map +1 -1
  29. package/dist/contracts/runs.d.ts +51 -3
  30. package/dist/contracts/runs.d.ts.map +1 -1
  31. package/dist/contracts/runs.js +42 -2
  32. package/dist/contracts/runs.js.map +1 -1
  33. package/dist/contracts/slots.d.ts +11 -0
  34. package/dist/contracts/slots.d.ts.map +1 -1
  35. package/dist/contracts/slots.js +11 -0
  36. package/dist/contracts/slots.js.map +1 -1
  37. package/dist/contracts/work-graph.d.ts +1 -1
  38. package/dist/contracts/work-graph.d.ts.map +1 -1
  39. package/dist/integrations/github-ref.js +1 -1
  40. package/dist/integrations/github-ref.js.map +1 -1
  41. package/dist/recipe/artifact.d.ts.map +1 -1
  42. package/dist/recipe/artifact.js +153 -20
  43. package/dist/recipe/artifact.js.map +1 -1
  44. package/dist/recipe/common.d.ts +30 -36
  45. package/dist/recipe/common.d.ts.map +1 -1
  46. package/dist/recipe/common.js +0 -3
  47. package/dist/recipe/common.js.map +1 -1
  48. package/dist/recipe/digest.d.ts +5 -0
  49. package/dist/recipe/digest.d.ts.map +1 -0
  50. package/dist/recipe/digest.js +25 -0
  51. package/dist/recipe/digest.js.map +1 -0
  52. package/dist/recipe/document.d.ts +4 -20
  53. package/dist/recipe/document.d.ts.map +1 -1
  54. package/dist/recipe/document.js +160 -123
  55. package/dist/recipe/document.js.map +1 -1
  56. package/dist/recipe/index.d.ts +6 -3
  57. package/dist/recipe/index.d.ts.map +1 -1
  58. package/dist/recipe/index.js +6 -3
  59. package/dist/recipe/index.js.map +1 -1
  60. package/dist/recipe/manifest.d.ts +0 -1
  61. package/dist/recipe/manifest.d.ts.map +1 -1
  62. package/dist/recipe/manifest.js +82 -45
  63. package/dist/recipe/manifest.js.map +1 -1
  64. package/dist/recipe/params.d.ts +9 -0
  65. package/dist/recipe/params.d.ts.map +1 -0
  66. package/dist/recipe/params.js +261 -0
  67. package/dist/recipe/params.js.map +1 -0
  68. package/dist/recipe/trust.d.ts +47 -0
  69. package/dist/recipe/trust.d.ts.map +1 -0
  70. package/dist/recipe/trust.js +63 -0
  71. package/dist/recipe/trust.js.map +1 -0
  72. package/dist/recipe/workflow.d.ts +13 -27
  73. package/dist/recipe/workflow.d.ts.map +1 -1
  74. package/dist/recipe/workflow.js +201 -497
  75. package/dist/recipe/workflow.js.map +1 -1
  76. package/dist/rpc/dispatch.d.ts +9 -1
  77. package/dist/rpc/dispatch.d.ts.map +1 -1
  78. package/dist/rpc/registry.d.ts +5 -0
  79. package/dist/rpc/registry.d.ts.map +1 -1
  80. package/dist/rpc/registry.js +5 -0
  81. package/dist/rpc/registry.js.map +1 -1
  82. package/dist/rpc/run.d.ts +11 -1
  83. package/dist/rpc/run.d.ts.map +1 -1
  84. package/dist/rpc/slot.d.ts +53 -1
  85. package/dist/rpc/slot.d.ts.map +1 -1
  86. package/dist/rpc/slot.js +5 -0
  87. package/dist/rpc/slot.js.map +1 -1
  88. package/dist/rpc/tmux.d.ts +1 -1
  89. package/dist/rpc/tmux.d.ts.map +1 -1
  90. package/dist/runs/family-iteration-ledger.js +2 -2
  91. package/dist/runs/family-iteration-ledger.js.map +1 -1
  92. package/dist/runs/run-mode.d.ts +1 -1
  93. package/dist/runs/run-mode.js +2 -2
  94. package/dist/runs/run-mode.js.map +1 -1
  95. package/dist/transport/events.d.ts +2 -0
  96. package/dist/transport/events.d.ts.map +1 -1
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.d.ts.map +1 -1
  99. package/dist/version.js +1 -1
  100. package/dist/version.js.map +1 -1
  101. package/package.json +1 -1
  102. package/schemas/recipe-v1.schema.json +119 -197
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,WAAW,CAAC"}
package/dist/version.js CHANGED
@@ -3,5 +3,5 @@
3
3
  // fleet can be upgraded deliberately; optional method/event fields remain
4
4
  // backward-compatible unless a caller requires a new node capability.
5
5
  // Format: semver-ish, increment when methods/events/frame format changes.
6
- export const PROTOCOL_VERSION = '0.9.0';
6
+ export const PROTOCOL_VERSION = '0.10.0';
7
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,6EAA6E;AAC7E,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,6EAA6E;AAC7E,0EAA0E;AAC1E,sEAAsE;AACtE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farmslot/protocol",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,33 +3,21 @@
3
3
  "$id": "https://farmslot.io/schemas/recipe-v1.schema.json",
4
4
  "title": "Farmslot Recipe Protocol v1",
5
5
  "type": "object",
6
- "required": ["schema_version", "validate"],
6
+ "required": ["$schema", "description", "workflow"],
7
7
  "properties": {
8
8
  "$schema": {
9
9
  "const": "https://farmslot.io/schemas/recipe-v1.schema.json"
10
10
  },
11
- "schema_version": {
12
- "const": 1
13
- },
14
11
  "title": {
15
- "type": "string"
12
+ "type": "string",
13
+ "minLength": 1
16
14
  },
17
15
  "description": {
18
- "type": "string"
19
- },
20
- "inputs": {
21
- "type": "object"
16
+ "type": "string",
17
+ "minLength": 1
22
18
  },
23
- "uses": {
24
- "type": "array",
25
- "items": {
26
- "type": "string",
27
- "minLength": 1
28
- }
29
- },
30
- "flows": {
31
- "type": "object",
32
- "description": "Inline flow definitions keyed by flow id, resolvable by call.ref."
19
+ "paramsSchema": {
20
+ "$ref": "#/$defs/paramsSchema"
33
21
  },
34
22
  "proofTargets": {
35
23
  "type": "array",
@@ -37,170 +25,97 @@
37
25
  "type": "object",
38
26
  "required": ["id", "claim"],
39
27
  "properties": {
40
- "id": {
41
- "type": "string",
42
- "minLength": 1
43
- },
44
- "claim": {
45
- "type": "string",
46
- "minLength": 1
47
- }
28
+ "id": { "type": "string", "minLength": 1 },
29
+ "claim": { "type": "string", "minLength": 1 }
48
30
  },
49
- "additionalProperties": true
31
+ "additionalProperties": false
50
32
  }
51
33
  },
52
- "startState": {
53
- "$ref": "#/$defs/actionNode"
54
- },
55
- "fail_on_unexpected": {
56
- "type": "object"
57
- },
58
- "validate": {
59
- "type": "object",
60
- "required": ["workflow"],
61
- "properties": {
62
- "workflow": {
63
- "$ref": "#/$defs/workflow"
64
- }
65
- },
66
- "additionalProperties": true
34
+ "workflow": {
35
+ "$ref": "#/$defs/workflow"
67
36
  }
68
37
  },
69
- "additionalProperties": true,
38
+ "additionalProperties": false,
70
39
  "$defs": {
71
- "workflow": {
40
+ "paramsSchema": {
72
41
  "type": "object",
73
- "required": ["entry", "nodes"],
42
+ "required": ["type", "additionalProperties"],
74
43
  "properties": {
75
- "pre_conditions": {
76
- "type": "array"
77
- },
78
- "setup": {
79
- "type": "array",
80
- "items": {
81
- "$ref": "#/$defs/actionNode"
82
- }
83
- },
84
- "entry": {
85
- "type": "string",
86
- "minLength": 1
87
- },
88
- "nodes": {
89
- "type": "object",
90
- "minProperties": 1,
91
- "additionalProperties": {
92
- "$ref": "#/$defs/workflowNode"
93
- }
94
- },
95
- "teardown": {
44
+ "type": { "const": "object" },
45
+ "additionalProperties": { "const": false },
46
+ "required": {
96
47
  "type": "array",
97
- "items": {
98
- "$ref": "#/$defs/actionNode"
99
- }
48
+ "items": { "type": "string", "minLength": 1 },
49
+ "uniqueItems": true
100
50
  },
101
- "playback": {
51
+ "properties": {
102
52
  "type": "object",
103
- "properties": {
104
- "mode": {
105
- "enum": ["off", "auto", "step"]
106
- },
107
- "slow_ms": {
108
- "type": "number",
109
- "minimum": 100,
110
- "maximum": 60000
111
- }
112
- },
113
- "additionalProperties": true
53
+ "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
54
+ "additionalProperties": { "$ref": "#/$defs/paramSchema" }
114
55
  }
115
56
  },
116
- "additionalProperties": true
57
+ "additionalProperties": false
117
58
  },
118
- "workflowNode": {
59
+ "paramSchema": {
119
60
  "type": "object",
120
- "required": ["action"],
61
+ "required": ["type"],
121
62
  "properties": {
122
- "action": {
123
- "type": "string",
124
- "minLength": 1
125
- },
126
- "intent": {
127
- "type": "string",
128
- "minLength": 1
129
- },
130
- "next": {
131
- "type": "string",
132
- "minLength": 1
133
- },
134
- "default": {
135
- "type": "string",
136
- "minLength": 1
137
- },
138
- "cases": {
63
+ "type": {
139
64
  "oneOf": [
65
+ { "enum": ["string", "number", "integer", "boolean", "object", "array"] },
140
66
  {
141
67
  "type": "array",
142
- "items": {
143
- "type": "object",
144
- "properties": {
145
- "next": {
146
- "type": "string",
147
- "minLength": 1
148
- }
149
- },
150
- "additionalProperties": true
151
- }
152
- },
153
- {
154
- "type": "object",
155
- "additionalProperties": {
156
- "type": "string",
157
- "minLength": 1
158
- }
68
+ "items": { "enum": ["string", "number", "integer", "boolean", "object", "array"] },
69
+ "minItems": 1,
70
+ "uniqueItems": true
159
71
  }
160
72
  ]
161
73
  },
162
- "status": {
163
- "enum": ["pass", "fail", "unknown"]
164
- },
165
- "phase": {
166
- "enum": ["setup", "start_state", "proof", "assert", "teardown"]
167
- },
168
- "proofTarget": {
169
- "type": "string",
170
- "minLength": 1
171
- },
172
- "record": {
173
- "enum": ["none", "trace_only", "proof_window", "failure_only"]
174
- },
175
- "observe": {
176
- "$ref": "#/$defs/observePolicy"
74
+ "description": { "type": "string" },
75
+ "default": true,
76
+ "enum": { "type": "array", "minItems": 1, "uniqueItems": true },
77
+ "additionalProperties": { "type": "boolean" },
78
+ "required": {
79
+ "type": "array",
80
+ "items": { "type": "string", "minLength": 1 },
81
+ "uniqueItems": true
177
82
  },
178
- "expect_observations": {
179
- "$ref": "#/$defs/observationExpectation"
83
+ "properties": {
84
+ "type": "object",
85
+ "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
86
+ "additionalProperties": { "$ref": "#/$defs/paramSchema" }
180
87
  },
181
- "settle": {
182
- "type": "boolean"
183
- }
88
+ "items": { "$ref": "#/$defs/paramSchema" }
184
89
  },
185
- "allOf": [
90
+ "additionalProperties": false
91
+ },
92
+ "proofLinks": {
93
+ "type": "array",
94
+ "items": { "type": "string", "minLength": 1 },
95
+ "uniqueItems": true
96
+ },
97
+ "transition": {
98
+ "oneOf": [
186
99
  {
187
- "if": {
188
- "properties": {
189
- "action": {
190
- "const": "end"
191
- }
192
- },
193
- "required": ["action"]
100
+ "required": ["next"],
101
+ "properties": {
102
+ "next": { "type": "string", "minLength": 1 }
194
103
  },
195
- "then": {
196
- "required": ["status"]
104
+ "not": { "anyOf": [{ "required": ["cases"] }, { "required": ["default"] }] }
105
+ },
106
+ {
107
+ "required": ["cases", "default"],
108
+ "properties": {
109
+ "cases": {
110
+ "type": "object",
111
+ "minProperties": 1,
112
+ "additionalProperties": { "type": "string", "minLength": 1 }
113
+ },
114
+ "default": { "type": "string", "minLength": 1 }
197
115
  },
198
- "else": {
199
- "required": ["intent"]
200
- }
116
+ "not": { "required": ["next"] }
201
117
  }
202
- ],
203
- "additionalProperties": true
118
+ ]
204
119
  },
205
120
  "actionNode": {
206
121
  "type": "object",
@@ -208,58 +123,65 @@
208
123
  "properties": {
209
124
  "action": {
210
125
  "type": "string",
211
- "minLength": 1
212
- },
213
- "intent": {
214
- "type": "string",
215
- "minLength": 1
216
- },
217
- "phase": {
218
- "enum": ["setup", "start_state", "proof", "assert", "teardown"]
219
- },
220
- "proofTarget": {
221
- "type": "string",
222
- "minLength": 1
223
- },
224
- "record": {
225
- "enum": ["none", "trace_only", "proof_window", "failure_only"]
126
+ "minLength": 1,
127
+ "not": { "enum": ["call", "end"] }
226
128
  },
227
- "observe": {
228
- "$ref": "#/$defs/observePolicy"
229
- },
230
- "expect_observations": {
231
- "$ref": "#/$defs/observationExpectation"
129
+ "intent": { "type": "string", "minLength": 1 },
130
+ "next": { "type": "string", "minLength": 1 },
131
+ "cases": {
132
+ "type": "object",
133
+ "minProperties": 1,
134
+ "additionalProperties": { "type": "string", "minLength": 1 }
232
135
  },
233
- "settle": {
234
- "type": "boolean"
235
- }
136
+ "default": { "type": "string", "minLength": 1 },
137
+ "proves": { "$ref": "#/$defs/proofLinks" }
236
138
  },
139
+ "allOf": [{ "$ref": "#/$defs/transition" }],
237
140
  "additionalProperties": true
238
141
  },
239
- "observePolicy": {
142
+ "callNode": {
143
+ "type": "object",
144
+ "required": ["action", "intent", "ref", "next"],
145
+ "properties": {
146
+ "action": { "const": "call" },
147
+ "intent": { "type": "string", "minLength": 1 },
148
+ "ref": { "type": "string", "minLength": 1 },
149
+ "params": { "type": "object" },
150
+ "proves": { "$ref": "#/$defs/proofLinks" },
151
+ "next": { "type": "string", "minLength": 1 }
152
+ },
153
+ "additionalProperties": false
154
+ },
155
+ "endNode": {
156
+ "type": "object",
157
+ "required": ["action", "status"],
158
+ "properties": {
159
+ "action": { "const": "end" },
160
+ "status": { "enum": ["pass", "fail", "unknown"] }
161
+ },
162
+ "additionalProperties": false
163
+ },
164
+ "workflowNode": {
240
165
  "oneOf": [
241
- {
242
- "type": "boolean"
243
- },
244
- {
245
- "type": "array",
246
- "items": {
247
- "type": "string",
248
- "minLength": 1,
249
- "pattern": "\\S"
250
- },
251
- "uniqueItems": true
252
- }
166
+ { "$ref": "#/$defs/actionNode" },
167
+ { "$ref": "#/$defs/callNode" },
168
+ { "$ref": "#/$defs/endNode" }
253
169
  ]
254
170
  },
255
- "observationExpectation": {
256
- "type": "array",
257
- "items": {
258
- "type": "string",
259
- "minLength": 1,
260
- "pattern": "\\S"
171
+ "workflow": {
172
+ "type": "object",
173
+ "required": ["entry", "nodes"],
174
+ "properties": {
175
+ "entry": { "type": "string", "minLength": 1 },
176
+ "teardown": { "type": "string", "minLength": 1 },
177
+ "nodes": {
178
+ "type": "object",
179
+ "minProperties": 1,
180
+ "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
181
+ "additionalProperties": { "$ref": "#/$defs/workflowNode" }
182
+ }
261
183
  },
262
- "uniqueItems": true
184
+ "additionalProperties": false
263
185
  }
264
186
  }
265
187
  }