@nylorun/core 0.27.0-beta → 0.28.0-beta

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 (43) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +3 -1
  3. package/dist/contracts.d.ts +153 -1
  4. package/dist/contracts.js +62 -7
  5. package/dist/define.d.ts +2 -1
  6. package/dist/define.js +2 -1
  7. package/dist/definition/cron.d.ts +15 -0
  8. package/dist/definition/cron.js +155 -0
  9. package/dist/definition/sections.d.ts +11 -0
  10. package/dist/definition/sections.js +29 -20
  11. package/dist/folder/compile.d.ts +43 -5
  12. package/dist/folder/compile.js +499 -88
  13. package/dist/folder/context.d.ts +97 -0
  14. package/dist/folder/context.js +79 -0
  15. package/dist/folder/decompile.d.ts +18 -0
  16. package/dist/folder/decompile.js +660 -0
  17. package/dist/folder/fix.d.ts +22 -0
  18. package/dist/folder/fix.js +191 -0
  19. package/dist/folder/flow.d.ts +42 -0
  20. package/dist/folder/flow.js +215 -0
  21. package/dist/folder/frontmatter.d.ts +5 -2
  22. package/dist/folder/frontmatter.js +8 -4
  23. package/dist/folder/index.d.ts +7 -2
  24. package/dist/folder/index.js +6 -1
  25. package/dist/folder/json-schema.d.ts +15 -0
  26. package/dist/folder/json-schema.js +212 -0
  27. package/dist/folder/nested.d.ts +24 -0
  28. package/dist/folder/nested.js +378 -0
  29. package/dist/folder/plugins.d.ts +23 -0
  30. package/dist/folder/plugins.js +155 -0
  31. package/dist/folder/schemas.d.ts +8 -0
  32. package/dist/folder/schemas.js +238 -0
  33. package/dist/folder/suggest.d.ts +13 -0
  34. package/dist/folder/suggest.js +63 -0
  35. package/dist/schemas/agent-folder/agent-md.schema.json +143 -0
  36. package/dist/schemas/agent-folder/flow.schema.json +466 -0
  37. package/dist/schemas/agent-folder/mcp.schema.json +59 -0
  38. package/dist/schemas/agent-folder/runtime.schema.json +447 -0
  39. package/dist/schemas/agent-folder/tool.schema.json +77 -0
  40. package/dist/schemas/agent-folder/trigger-md.schema.json +65 -0
  41. package/dist/utils/runtime-limits.d.ts +8 -0
  42. package/dist/utils/runtime-limits.js +19 -0
  43. package/package.json +8 -2
@@ -0,0 +1,466 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/flow.json",
4
+ "title": "Nylorun agent folder: flow.json",
5
+ "description": "A flow's node tree (workflow manifest v3's), naming agents of the flow root's agents/ by id and tools beside the file by name",
6
+ "oneOf": [
7
+ {
8
+ "type": "object",
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string",
12
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
13
+ },
14
+ "agent": {
15
+ "type": "string",
16
+ "minLength": 1,
17
+ "description": "An agent of the flow root's agents/, by its id"
18
+ },
19
+ "id": {
20
+ "type": "string",
21
+ "minLength": 1,
22
+ "description": "The node's id, which names its step in a run"
23
+ }
24
+ },
25
+ "required": [
26
+ "agent"
27
+ ],
28
+ "additionalProperties": false
29
+ },
30
+ {
31
+ "type": "object",
32
+ "properties": {
33
+ "$schema": {
34
+ "type": "string",
35
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
36
+ },
37
+ "tool": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "description": "A tool of tools/ beside this flow.json, by its name (tools/<name>.json)"
41
+ },
42
+ "id": {
43
+ "type": "string",
44
+ "minLength": 1,
45
+ "description": "The node's id, which names its step in a run"
46
+ }
47
+ },
48
+ "required": [
49
+ "tool"
50
+ ],
51
+ "additionalProperties": false
52
+ },
53
+ {
54
+ "type": "object",
55
+ "properties": {
56
+ "$schema": {
57
+ "type": "string",
58
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
59
+ },
60
+ "chain": {
61
+ "type": "array",
62
+ "items": {
63
+ "$ref": "#/$defs/Node"
64
+ },
65
+ "minItems": 1,
66
+ "description": "Nodes run in order, each given the one before's output"
67
+ },
68
+ "id": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "description": "The node's id, which names its step in a run"
72
+ }
73
+ },
74
+ "required": [
75
+ "chain"
76
+ ],
77
+ "additionalProperties": false
78
+ },
79
+ {
80
+ "type": "object",
81
+ "properties": {
82
+ "$schema": {
83
+ "type": "string",
84
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
85
+ },
86
+ "switch": {
87
+ "type": "object",
88
+ "properties": {
89
+ "cases": {
90
+ "type": "object",
91
+ "additionalProperties": {
92
+ "$ref": "#/$defs/Node"
93
+ },
94
+ "description": "The node each route runs, by route"
95
+ },
96
+ "default": {
97
+ "$ref": "#/$defs/Node",
98
+ "description": "The node that runs when no route matches"
99
+ }
100
+ },
101
+ "required": [
102
+ "cases"
103
+ ],
104
+ "additionalProperties": false,
105
+ "description": "Runs the node of the route the input names"
106
+ },
107
+ "id": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "description": "The node's id, which names its step in a run"
111
+ }
112
+ },
113
+ "required": [
114
+ "switch"
115
+ ],
116
+ "additionalProperties": false
117
+ },
118
+ {
119
+ "type": "object",
120
+ "properties": {
121
+ "$schema": {
122
+ "type": "string",
123
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
124
+ },
125
+ "parallel": {
126
+ "type": "object",
127
+ "additionalProperties": {
128
+ "$ref": "#/$defs/Node"
129
+ },
130
+ "minProperties": 1,
131
+ "description": "Runs each branch's node at once, by branch name"
132
+ },
133
+ "id": {
134
+ "type": "string",
135
+ "minLength": 1,
136
+ "description": "The node's id, which names its step in a run"
137
+ }
138
+ },
139
+ "required": [
140
+ "parallel"
141
+ ],
142
+ "additionalProperties": false
143
+ },
144
+ {
145
+ "type": "object",
146
+ "properties": {
147
+ "$schema": {
148
+ "type": "string",
149
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
150
+ },
151
+ "map": {
152
+ "type": "object",
153
+ "properties": {
154
+ "each": {
155
+ "$ref": "#/$defs/Node"
156
+ }
157
+ },
158
+ "required": [
159
+ "each"
160
+ ],
161
+ "additionalProperties": false,
162
+ "description": "Runs the node once per item of its input"
163
+ },
164
+ "id": {
165
+ "type": "string",
166
+ "minLength": 1,
167
+ "description": "The node's id, which names its step in a run"
168
+ }
169
+ },
170
+ "required": [
171
+ "map"
172
+ ],
173
+ "additionalProperties": false
174
+ },
175
+ {
176
+ "type": "object",
177
+ "properties": {
178
+ "$schema": {
179
+ "type": "string",
180
+ "description": "This file's JSON Schema, for editors; the compiler leaves it out of the manifest"
181
+ },
182
+ "loop": {
183
+ "type": "object",
184
+ "properties": {
185
+ "run": {
186
+ "$ref": "#/$defs/Node",
187
+ "description": "The node each attempt runs"
188
+ },
189
+ "verify": {
190
+ "$ref": "#/$defs/Verifier"
191
+ },
192
+ "max": {
193
+ "type": "integer",
194
+ "minimum": 1,
195
+ "description": "The most attempts the loop makes"
196
+ }
197
+ },
198
+ "required": [
199
+ "run",
200
+ "verify",
201
+ "max"
202
+ ],
203
+ "additionalProperties": false,
204
+ "description": "Runs a node until verify passes it, up to max attempts"
205
+ },
206
+ "id": {
207
+ "type": "string",
208
+ "minLength": 1,
209
+ "description": "The node's id, which names its step in a run"
210
+ }
211
+ },
212
+ "required": [
213
+ "loop"
214
+ ],
215
+ "additionalProperties": false
216
+ }
217
+ ],
218
+ "$defs": {
219
+ "Node": {
220
+ "oneOf": [
221
+ {
222
+ "$ref": "#/$defs/AgentNode"
223
+ },
224
+ {
225
+ "$ref": "#/$defs/ToolNode"
226
+ },
227
+ {
228
+ "$ref": "#/$defs/ChainNode"
229
+ },
230
+ {
231
+ "$ref": "#/$defs/SwitchNode"
232
+ },
233
+ {
234
+ "$ref": "#/$defs/ParallelNode"
235
+ },
236
+ {
237
+ "$ref": "#/$defs/MapNode"
238
+ },
239
+ {
240
+ "$ref": "#/$defs/LoopNode"
241
+ }
242
+ ],
243
+ "description": "A node: exactly one of agent, tool, chain, switch, parallel, map, loop, and an optional id"
244
+ },
245
+ "AgentNode": {
246
+ "type": "object",
247
+ "properties": {
248
+ "agent": {
249
+ "type": "string",
250
+ "minLength": 1,
251
+ "description": "An agent of the flow root's agents/, by its id"
252
+ },
253
+ "id": {
254
+ "type": "string",
255
+ "minLength": 1,
256
+ "description": "The node's id, which names its step in a run"
257
+ }
258
+ },
259
+ "required": [
260
+ "agent"
261
+ ],
262
+ "additionalProperties": false
263
+ },
264
+ "ToolNode": {
265
+ "type": "object",
266
+ "properties": {
267
+ "tool": {
268
+ "type": "string",
269
+ "minLength": 1,
270
+ "description": "A tool of tools/ beside this flow.json, by its name (tools/<name>.json)"
271
+ },
272
+ "id": {
273
+ "type": "string",
274
+ "minLength": 1,
275
+ "description": "The node's id, which names its step in a run"
276
+ }
277
+ },
278
+ "required": [
279
+ "tool"
280
+ ],
281
+ "additionalProperties": false
282
+ },
283
+ "ChainNode": {
284
+ "type": "object",
285
+ "properties": {
286
+ "chain": {
287
+ "type": "array",
288
+ "items": {
289
+ "$ref": "#/$defs/Node"
290
+ },
291
+ "minItems": 1,
292
+ "description": "Nodes run in order, each given the one before's output"
293
+ },
294
+ "id": {
295
+ "type": "string",
296
+ "minLength": 1,
297
+ "description": "The node's id, which names its step in a run"
298
+ }
299
+ },
300
+ "required": [
301
+ "chain"
302
+ ],
303
+ "additionalProperties": false
304
+ },
305
+ "SwitchNode": {
306
+ "type": "object",
307
+ "properties": {
308
+ "switch": {
309
+ "type": "object",
310
+ "properties": {
311
+ "cases": {
312
+ "type": "object",
313
+ "additionalProperties": {
314
+ "$ref": "#/$defs/Node"
315
+ },
316
+ "description": "The node each route runs, by route"
317
+ },
318
+ "default": {
319
+ "$ref": "#/$defs/Node",
320
+ "description": "The node that runs when no route matches"
321
+ }
322
+ },
323
+ "required": [
324
+ "cases"
325
+ ],
326
+ "additionalProperties": false,
327
+ "description": "Runs the node of the route the input names"
328
+ },
329
+ "id": {
330
+ "type": "string",
331
+ "minLength": 1,
332
+ "description": "The node's id, which names its step in a run"
333
+ }
334
+ },
335
+ "required": [
336
+ "switch"
337
+ ],
338
+ "additionalProperties": false
339
+ },
340
+ "ParallelNode": {
341
+ "type": "object",
342
+ "properties": {
343
+ "parallel": {
344
+ "type": "object",
345
+ "additionalProperties": {
346
+ "$ref": "#/$defs/Node"
347
+ },
348
+ "minProperties": 1,
349
+ "description": "Runs each branch's node at once, by branch name"
350
+ },
351
+ "id": {
352
+ "type": "string",
353
+ "minLength": 1,
354
+ "description": "The node's id, which names its step in a run"
355
+ }
356
+ },
357
+ "required": [
358
+ "parallel"
359
+ ],
360
+ "additionalProperties": false
361
+ },
362
+ "MapNode": {
363
+ "type": "object",
364
+ "properties": {
365
+ "map": {
366
+ "type": "object",
367
+ "properties": {
368
+ "each": {
369
+ "$ref": "#/$defs/Node"
370
+ }
371
+ },
372
+ "required": [
373
+ "each"
374
+ ],
375
+ "additionalProperties": false,
376
+ "description": "Runs the node once per item of its input"
377
+ },
378
+ "id": {
379
+ "type": "string",
380
+ "minLength": 1,
381
+ "description": "The node's id, which names its step in a run"
382
+ }
383
+ },
384
+ "required": [
385
+ "map"
386
+ ],
387
+ "additionalProperties": false
388
+ },
389
+ "LoopNode": {
390
+ "type": "object",
391
+ "properties": {
392
+ "loop": {
393
+ "type": "object",
394
+ "properties": {
395
+ "run": {
396
+ "$ref": "#/$defs/Node",
397
+ "description": "The node each attempt runs"
398
+ },
399
+ "verify": {
400
+ "$ref": "#/$defs/Verifier"
401
+ },
402
+ "max": {
403
+ "type": "integer",
404
+ "minimum": 1,
405
+ "description": "The most attempts the loop makes"
406
+ }
407
+ },
408
+ "required": [
409
+ "run",
410
+ "verify",
411
+ "max"
412
+ ],
413
+ "additionalProperties": false,
414
+ "description": "Runs a node until verify passes it, up to max attempts"
415
+ },
416
+ "id": {
417
+ "type": "string",
418
+ "minLength": 1,
419
+ "description": "The node's id, which names its step in a run"
420
+ }
421
+ },
422
+ "required": [
423
+ "loop"
424
+ ],
425
+ "additionalProperties": false
426
+ },
427
+ "Verifier": {
428
+ "oneOf": [
429
+ {
430
+ "type": "object",
431
+ "properties": {
432
+ "agent": {
433
+ "type": "string",
434
+ "minLength": 1,
435
+ "description": "An agent of the flow root's agents/, by its id, that judges each attempt"
436
+ },
437
+ "id": {
438
+ "type": "string",
439
+ "minLength": 1,
440
+ "description": "The node's id, which names its step in a run"
441
+ }
442
+ },
443
+ "required": [
444
+ "agent"
445
+ ],
446
+ "additionalProperties": false
447
+ },
448
+ {
449
+ "type": "object",
450
+ "properties": {
451
+ "tool": {
452
+ "type": "string",
453
+ "minLength": 1,
454
+ "description": "A tool of tools/ beside this flow.json, by its name, that judges each attempt"
455
+ }
456
+ },
457
+ "required": [
458
+ "tool"
459
+ ],
460
+ "additionalProperties": false
461
+ }
462
+ ],
463
+ "description": "What judges each attempt: an agent, or an HTTP tool"
464
+ }
465
+ }
466
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://docs.nylorun.com/schemas/agent-folder/v1/mcp.json",
4
+ "title": "Nylorun agent folder: mcp.json",
5
+ "description": "An agent folder's MCP servers, in Agent Plugins syntax",
6
+ "type": "object",
7
+ "properties": {
8
+ "$schema": {
9
+ "type": "string",
10
+ "description": "This file's JSON Schema, for editors: ours, or Agent Plugins' MCP schema"
11
+ },
12
+ "mcpServers": {
13
+ "type": "object",
14
+ "propertyNames": {
15
+ "pattern": "^[A-Za-z0-9_-]{1,64}$"
16
+ },
17
+ "additionalProperties": {
18
+ "$ref": "#/$defs/McpServer"
19
+ },
20
+ "description": "The MCP servers, by name"
21
+ }
22
+ },
23
+ "required": [
24
+ "mcpServers"
25
+ ],
26
+ "additionalProperties": false,
27
+ "$defs": {
28
+ "McpServer": {
29
+ "type": "object",
30
+ "properties": {
31
+ "type": {
32
+ "enum": [
33
+ "streamable-http",
34
+ "sse"
35
+ ],
36
+ "description": "The server's transport: the Runtime runs remote servers only"
37
+ },
38
+ "url": {
39
+ "type": "string",
40
+ "minLength": 1,
41
+ "pattern": "^(?!.*\\$\\{)",
42
+ "description": "The server's URL; a credential goes in a header, never here"
43
+ },
44
+ "headers": {
45
+ "type": "object",
46
+ "additionalProperties": {
47
+ "type": "string"
48
+ },
49
+ "description": "Headers sent to the server. \"Bearer ${NAME}\" in Authorization, or \"${NAME}\" alone in another header, names the secret slot the server authenticates with"
50
+ }
51
+ },
52
+ "required": [
53
+ "type",
54
+ "url"
55
+ ],
56
+ "additionalProperties": false
57
+ }
58
+ }
59
+ }