@farmslot/protocol 0.11.1 → 0.12.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.
@@ -2,37 +2,52 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://farmslot.io/schemas/recipe-v1.schema.json",
4
4
  "title": "Farmslot Recipe Protocol v1",
5
+ "description": "A parameterized, composable workflow that executes actions or other recipes and records explicit proof claims.",
5
6
  "type": "object",
6
- "required": ["$schema", "description", "workflow"],
7
+ "required": ["$schema", "workflow"],
7
8
  "properties": {
8
9
  "$schema": {
9
- "const": "https://farmslot.io/schemas/recipe-v1.schema.json"
10
+ "const": "https://farmslot.io/schemas/recipe-v1.schema.json",
11
+ "description": "Canonical Recipe Protocol v1 schema URL used by editors and validators."
10
12
  },
11
13
  "title": {
12
14
  "type": "string",
13
- "minLength": 1
15
+ "minLength": 1,
16
+ "description": "Short human-readable recipe name."
14
17
  },
15
18
  "description": {
16
19
  "type": "string",
17
- "minLength": 1
20
+ "minLength": 1,
21
+ "description": "What the recipe does and the outcome it is designed to prove."
18
22
  },
19
23
  "paramsSchema": {
20
- "$ref": "#/$defs/paramsSchema"
24
+ "$ref": "#/$defs/paramsSchema",
25
+ "description": "Optional JSON Schema for caller-supplied recipe parameters."
21
26
  },
22
27
  "proofTargets": {
23
28
  "type": "array",
29
+ "description": "Claims this recipe can prove; workflow nodes link to them through proves.",
24
30
  "items": {
25
31
  "type": "object",
26
32
  "required": ["id", "claim"],
27
33
  "properties": {
28
- "id": { "type": "string", "minLength": 1 },
29
- "claim": { "type": "string", "minLength": 1 }
34
+ "id": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "description": "Stable identifier referenced by workflow node proves entries."
38
+ },
39
+ "claim": {
40
+ "type": "string",
41
+ "minLength": 1,
42
+ "description": "Human-readable statement that successful linked nodes establish."
43
+ }
30
44
  },
31
45
  "additionalProperties": false
32
46
  }
33
47
  },
34
48
  "workflow": {
35
- "$ref": "#/$defs/workflow"
49
+ "$ref": "#/$defs/workflow",
50
+ "description": "Executable graph containing the entry node, optional teardown node, and named nodes."
36
51
  }
37
52
  },
38
53
  "additionalProperties": false,
@@ -41,15 +56,23 @@
41
56
  "type": "object",
42
57
  "required": ["type", "additionalProperties"],
43
58
  "properties": {
44
- "type": { "const": "object" },
45
- "additionalProperties": { "const": false },
59
+ "type": {
60
+ "const": "object",
61
+ "description": "Recipe parameters are always supplied as one object."
62
+ },
63
+ "additionalProperties": {
64
+ "const": false,
65
+ "description": "Reject caller parameters that the recipe does not declare."
66
+ },
46
67
  "required": {
47
68
  "type": "array",
69
+ "description": "Parameter names callers must provide when no default satisfies them.",
48
70
  "items": { "type": "string", "minLength": 1 },
49
71
  "uniqueItems": true
50
72
  },
51
73
  "properties": {
52
74
  "type": "object",
75
+ "description": "Named parameter definitions available to callers and call nodes.",
53
76
  "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
54
77
  "additionalProperties": { "$ref": "#/$defs/paramSchema" }
55
78
  }
@@ -61,6 +84,7 @@
61
84
  "required": ["type"],
62
85
  "properties": {
63
86
  "type": {
87
+ "description": "Allowed JSON value type or types for this parameter.",
64
88
  "oneOf": [
65
89
  { "enum": ["string", "number", "integer", "boolean", "object", "array"] },
66
90
  {
@@ -71,21 +95,39 @@
71
95
  }
72
96
  ]
73
97
  },
74
- "description": { "type": "string" },
75
- "default": true,
76
- "enum": { "type": "array", "minItems": 1, "uniqueItems": true },
77
- "additionalProperties": { "type": "boolean" },
98
+ "description": {
99
+ "type": "string",
100
+ "description": "Human-readable parameter help shown by recipe discovery and editors."
101
+ },
102
+ "default": {
103
+ "description": "Value used when the caller omits this parameter."
104
+ },
105
+ "enum": {
106
+ "type": "array",
107
+ "minItems": 1,
108
+ "uniqueItems": true,
109
+ "description": "Exact values accepted for this parameter."
110
+ },
111
+ "additionalProperties": {
112
+ "type": "boolean",
113
+ "description": "Whether an object parameter may contain undeclared keys."
114
+ },
78
115
  "required": {
79
116
  "type": "array",
117
+ "description": "Required keys within an object parameter.",
80
118
  "items": { "type": "string", "minLength": 1 },
81
119
  "uniqueItems": true
82
120
  },
83
121
  "properties": {
84
122
  "type": "object",
123
+ "description": "Named child schemas for an object parameter.",
85
124
  "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
86
125
  "additionalProperties": { "$ref": "#/$defs/paramSchema" }
87
126
  },
88
- "items": { "$ref": "#/$defs/paramSchema" }
127
+ "items": {
128
+ "$ref": "#/$defs/paramSchema",
129
+ "description": "Schema applied to each item of an array parameter."
130
+ }
89
131
  },
90
132
  "additionalProperties": false
91
133
  },
@@ -99,7 +141,11 @@
99
141
  {
100
142
  "required": ["next"],
101
143
  "properties": {
102
- "next": { "type": "string", "minLength": 1 }
144
+ "next": {
145
+ "type": "string",
146
+ "minLength": 1,
147
+ "description": "Node id to execute after this node succeeds."
148
+ }
103
149
  },
104
150
  "not": { "anyOf": [{ "required": ["cases"] }, { "required": ["default"] }] }
105
151
  },
@@ -109,9 +155,14 @@
109
155
  "cases": {
110
156
  "type": "object",
111
157
  "minProperties": 1,
112
- "additionalProperties": { "type": "string", "minLength": 1 }
158
+ "additionalProperties": { "type": "string", "minLength": 1 },
159
+ "description": "Maps an action result case to the next node id."
113
160
  },
114
- "default": { "type": "string", "minLength": 1 }
161
+ "default": {
162
+ "type": "string",
163
+ "minLength": 1,
164
+ "description": "Node id used when no declared result case matches."
165
+ }
115
166
  },
116
167
  "not": { "required": ["next"] }
117
168
  }
@@ -124,17 +175,34 @@
124
175
  "action": {
125
176
  "type": "string",
126
177
  "minLength": 1,
127
- "not": { "enum": ["call", "end"] }
178
+ "not": { "enum": ["call", "end"] },
179
+ "description": "Registered action name to execute; action-specific fields are declared by its manifest."
180
+ },
181
+ "intent": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "description": "Concise human-facing reason for performing this step."
185
+ },
186
+ "next": {
187
+ "type": "string",
188
+ "minLength": 1,
189
+ "description": "Node id to execute after this node succeeds."
128
190
  },
129
- "intent": { "type": "string", "minLength": 1 },
130
- "next": { "type": "string", "minLength": 1 },
131
191
  "cases": {
132
192
  "type": "object",
133
193
  "minProperties": 1,
134
- "additionalProperties": { "type": "string", "minLength": 1 }
194
+ "additionalProperties": { "type": "string", "minLength": 1 },
195
+ "description": "Maps an action result case to the next node id."
135
196
  },
136
- "default": { "type": "string", "minLength": 1 },
137
- "proves": { "$ref": "#/$defs/proofLinks" }
197
+ "default": {
198
+ "type": "string",
199
+ "minLength": 1,
200
+ "description": "Node id used when no declared result case matches."
201
+ },
202
+ "proves": {
203
+ "$ref": "#/$defs/proofLinks",
204
+ "description": "Proof target ids established by successful execution of this node."
205
+ }
138
206
  },
139
207
  "allOf": [{ "$ref": "#/$defs/transition" }],
140
208
  "additionalProperties": true
@@ -143,12 +211,34 @@
143
211
  "type": "object",
144
212
  "required": ["action", "intent", "ref", "next"],
145
213
  "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 }
214
+ "action": {
215
+ "const": "call",
216
+ "description": "Selects recipe composition instead of an action adapter."
217
+ },
218
+ "intent": {
219
+ "type": "string",
220
+ "minLength": 1,
221
+ "description": "Concise human-facing reason for invoking the referenced recipe."
222
+ },
223
+ "ref": {
224
+ "type": "string",
225
+ "minLength": 1,
226
+ "not": { "pattern": "\\{\\{(?:params|outputs)\\.[A-Za-z0-9_.-]+\\}\\}" },
227
+ "description": "Static recipe id resolved from configured recipe libraries."
228
+ },
229
+ "params": {
230
+ "type": "object",
231
+ "description": "Parameters passed to the referenced recipe; values may use supported parameter templates."
232
+ },
233
+ "proves": {
234
+ "$ref": "#/$defs/proofLinks",
235
+ "description": "Proof target ids established by successful completion of the called recipe."
236
+ },
237
+ "next": {
238
+ "type": "string",
239
+ "minLength": 1,
240
+ "description": "Node id to execute after the called recipe succeeds."
241
+ }
152
242
  },
153
243
  "additionalProperties": false
154
244
  },
@@ -156,8 +246,14 @@
156
246
  "type": "object",
157
247
  "required": ["action", "status"],
158
248
  "properties": {
159
- "action": { "const": "end" },
160
- "status": { "enum": ["pass", "fail", "unknown"] }
249
+ "action": {
250
+ "const": "end",
251
+ "description": "Terminates the current recipe."
252
+ },
253
+ "status": {
254
+ "enum": ["pass", "fail", "unknown"],
255
+ "description": "Terminal recipe verdict returned by this path."
256
+ }
161
257
  },
162
258
  "additionalProperties": false
163
259
  },
@@ -172,13 +268,22 @@
172
268
  "type": "object",
173
269
  "required": ["entry", "nodes"],
174
270
  "properties": {
175
- "entry": { "type": "string", "minLength": 1 },
176
- "teardown": { "type": "string", "minLength": 1 },
271
+ "entry": {
272
+ "type": "string",
273
+ "minLength": 1,
274
+ "description": "Node id where normal recipe execution starts."
275
+ },
276
+ "teardown": {
277
+ "type": "string",
278
+ "minLength": 1,
279
+ "description": "Optional node id executed once after the main graph exits to restore deterministic state."
280
+ },
177
281
  "nodes": {
178
282
  "type": "object",
179
283
  "minProperties": 1,
180
284
  "propertyNames": { "pattern": "^[A-Za-z0-9_-]+$" },
181
- "additionalProperties": { "$ref": "#/$defs/workflowNode" }
285
+ "additionalProperties": { "$ref": "#/$defs/workflowNode" },
286
+ "description": "Named action, recipe-call, and terminal nodes in the executable graph."
182
287
  }
183
288
  },
184
289
  "additionalProperties": false