@noetic-tools/core 0.3.0 → 1.1.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.
@@ -0,0 +1,523 @@
1
+ {
2
+ "$id": "https://noetic.tools/schema/noetic-workflow.schema.json",
3
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
4
+ "type": "object",
5
+ "properties": {
6
+ "version": {
7
+ "type": "number",
8
+ "const": 1
9
+ },
10
+ "root": {
11
+ "$ref": "#/$defs/WorkflowNode"
12
+ }
13
+ },
14
+ "required": [
15
+ "version",
16
+ "root"
17
+ ],
18
+ "additionalProperties": false,
19
+ "title": "WorkflowDocument",
20
+ "description": "A portable, JSON-safe representation of a Noetic step tree.",
21
+ "$defs": {
22
+ "WorkflowNode": {
23
+ "oneOf": [
24
+ {
25
+ "type": "object",
26
+ "properties": {
27
+ "kind": {
28
+ "type": "string",
29
+ "const": "llm"
30
+ },
31
+ "id": {
32
+ "type": "string",
33
+ "minLength": 1
34
+ },
35
+ "model": {
36
+ "type": "string"
37
+ },
38
+ "instructions": {
39
+ "type": "string"
40
+ },
41
+ "tools": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "string"
45
+ }
46
+ },
47
+ "params": {
48
+ "type": "object",
49
+ "properties": {
50
+ "temperature": {
51
+ "type": "number",
52
+ "minimum": 0
53
+ },
54
+ "topP": {
55
+ "type": "number",
56
+ "minimum": 0,
57
+ "maximum": 1
58
+ },
59
+ "maxTokens": {
60
+ "type": "integer",
61
+ "exclusiveMinimum": 0,
62
+ "maximum": 9007199254740991
63
+ },
64
+ "stopSequences": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "string"
68
+ }
69
+ }
70
+ },
71
+ "additionalProperties": false
72
+ }
73
+ },
74
+ "required": [
75
+ "kind",
76
+ "id",
77
+ "instructions"
78
+ ],
79
+ "additionalProperties": false
80
+ },
81
+ {
82
+ "type": "object",
83
+ "properties": {
84
+ "kind": {
85
+ "type": "string",
86
+ "const": "tool"
87
+ },
88
+ "id": {
89
+ "type": "string",
90
+ "minLength": 1
91
+ },
92
+ "toolName": {
93
+ "type": "string",
94
+ "minLength": 1
95
+ },
96
+ "args": {
97
+ "type": "object",
98
+ "propertyNames": {
99
+ "type": "string"
100
+ },
101
+ "additionalProperties": {}
102
+ }
103
+ },
104
+ "required": [
105
+ "kind",
106
+ "id",
107
+ "toolName"
108
+ ],
109
+ "additionalProperties": false
110
+ },
111
+ {
112
+ "type": "object",
113
+ "properties": {
114
+ "kind": {
115
+ "type": "string",
116
+ "const": "branch"
117
+ },
118
+ "id": {
119
+ "type": "string",
120
+ "minLength": 1
121
+ },
122
+ "routes": {
123
+ "minItems": 1,
124
+ "type": "array",
125
+ "items": {
126
+ "type": "object",
127
+ "properties": {
128
+ "match": {
129
+ "type": "string",
130
+ "minLength": 1
131
+ },
132
+ "target": {
133
+ "$ref": "#/$defs/WorkflowNode"
134
+ }
135
+ },
136
+ "required": [
137
+ "match",
138
+ "target"
139
+ ],
140
+ "additionalProperties": false
141
+ }
142
+ },
143
+ "default": {
144
+ "$ref": "#/$defs/WorkflowNode"
145
+ }
146
+ },
147
+ "required": [
148
+ "kind",
149
+ "id",
150
+ "routes"
151
+ ],
152
+ "additionalProperties": false
153
+ },
154
+ {
155
+ "type": "object",
156
+ "properties": {
157
+ "kind": {
158
+ "type": "string",
159
+ "const": "fork"
160
+ },
161
+ "id": {
162
+ "type": "string",
163
+ "minLength": 1
164
+ },
165
+ "mode": {
166
+ "type": "string",
167
+ "enum": [
168
+ "race",
169
+ "all",
170
+ "settle"
171
+ ]
172
+ },
173
+ "paths": {
174
+ "minItems": 1,
175
+ "type": "array",
176
+ "items": {
177
+ "$ref": "#/$defs/WorkflowNode"
178
+ }
179
+ },
180
+ "merge": {
181
+ "type": "string",
182
+ "enum": [
183
+ "last",
184
+ "first",
185
+ "concat"
186
+ ]
187
+ },
188
+ "concurrency": {
189
+ "type": "integer",
190
+ "exclusiveMinimum": 0,
191
+ "maximum": 9007199254740991
192
+ }
193
+ },
194
+ "required": [
195
+ "kind",
196
+ "id",
197
+ "mode",
198
+ "paths"
199
+ ],
200
+ "additionalProperties": false
201
+ },
202
+ {
203
+ "type": "object",
204
+ "properties": {
205
+ "kind": {
206
+ "type": "string",
207
+ "const": "spawn"
208
+ },
209
+ "id": {
210
+ "type": "string",
211
+ "minLength": 1
212
+ },
213
+ "child": {
214
+ "$ref": "#/$defs/WorkflowNode"
215
+ },
216
+ "timeout": {
217
+ "type": "number",
218
+ "exclusiveMinimum": 0
219
+ }
220
+ },
221
+ "required": [
222
+ "kind",
223
+ "id",
224
+ "child"
225
+ ],
226
+ "additionalProperties": false
227
+ },
228
+ {
229
+ "type": "object",
230
+ "properties": {
231
+ "kind": {
232
+ "type": "string",
233
+ "const": "provide"
234
+ },
235
+ "id": {
236
+ "type": "string",
237
+ "minLength": 1
238
+ },
239
+ "child": {
240
+ "$ref": "#/$defs/WorkflowNode"
241
+ },
242
+ "layers": {
243
+ "minItems": 1,
244
+ "type": "array",
245
+ "items": {
246
+ "type": "string",
247
+ "minLength": 1
248
+ }
249
+ }
250
+ },
251
+ "required": [
252
+ "kind",
253
+ "id",
254
+ "child",
255
+ "layers"
256
+ ],
257
+ "additionalProperties": false
258
+ },
259
+ {
260
+ "type": "object",
261
+ "properties": {
262
+ "kind": {
263
+ "type": "string",
264
+ "const": "loop"
265
+ },
266
+ "id": {
267
+ "type": "string",
268
+ "minLength": 1
269
+ },
270
+ "body": {
271
+ "$ref": "#/$defs/WorkflowNode"
272
+ },
273
+ "until": {
274
+ "$ref": "#/$defs/UntilPredicate"
275
+ },
276
+ "maxIterations": {
277
+ "type": "integer",
278
+ "exclusiveMinimum": 0,
279
+ "maximum": 9007199254740991
280
+ }
281
+ },
282
+ "required": [
283
+ "kind",
284
+ "id",
285
+ "body",
286
+ "until"
287
+ ],
288
+ "additionalProperties": false
289
+ },
290
+ {
291
+ "type": "object",
292
+ "properties": {
293
+ "kind": {
294
+ "type": "string",
295
+ "const": "sequence"
296
+ },
297
+ "id": {
298
+ "type": "string",
299
+ "minLength": 1
300
+ },
301
+ "steps": {
302
+ "minItems": 1,
303
+ "type": "array",
304
+ "items": {
305
+ "$ref": "#/$defs/WorkflowNode"
306
+ }
307
+ }
308
+ },
309
+ "required": [
310
+ "kind",
311
+ "id",
312
+ "steps"
313
+ ],
314
+ "additionalProperties": false
315
+ },
316
+ {
317
+ "type": "object",
318
+ "properties": {
319
+ "kind": {
320
+ "type": "string",
321
+ "const": "every"
322
+ },
323
+ "id": {
324
+ "type": "string",
325
+ "minLength": 1
326
+ },
327
+ "step": {
328
+ "$ref": "#/$defs/WorkflowNode"
329
+ },
330
+ "ms": {
331
+ "type": "number",
332
+ "minimum": 0
333
+ },
334
+ "onError": {
335
+ "type": "string",
336
+ "enum": [
337
+ "continue",
338
+ "fail"
339
+ ]
340
+ }
341
+ },
342
+ "required": [
343
+ "kind",
344
+ "id",
345
+ "step",
346
+ "ms"
347
+ ],
348
+ "additionalProperties": false
349
+ }
350
+ ],
351
+ "title": "WorkflowNode"
352
+ },
353
+ "UntilPredicate": {
354
+ "anyOf": [
355
+ {
356
+ "type": "object",
357
+ "properties": {
358
+ "kind": {
359
+ "type": "string",
360
+ "const": "maxSteps"
361
+ },
362
+ "n": {
363
+ "type": "integer",
364
+ "exclusiveMinimum": 0,
365
+ "maximum": 9007199254740991
366
+ }
367
+ },
368
+ "required": [
369
+ "kind",
370
+ "n"
371
+ ],
372
+ "additionalProperties": false
373
+ },
374
+ {
375
+ "type": "object",
376
+ "properties": {
377
+ "kind": {
378
+ "type": "string",
379
+ "const": "maxCost"
380
+ },
381
+ "usd": {
382
+ "type": "number",
383
+ "exclusiveMinimum": 0
384
+ }
385
+ },
386
+ "required": [
387
+ "kind",
388
+ "usd"
389
+ ],
390
+ "additionalProperties": false
391
+ },
392
+ {
393
+ "type": "object",
394
+ "properties": {
395
+ "kind": {
396
+ "type": "string",
397
+ "const": "maxDuration"
398
+ },
399
+ "ms": {
400
+ "type": "number",
401
+ "exclusiveMinimum": 0
402
+ }
403
+ },
404
+ "required": [
405
+ "kind",
406
+ "ms"
407
+ ],
408
+ "additionalProperties": false
409
+ },
410
+ {
411
+ "type": "object",
412
+ "properties": {
413
+ "kind": {
414
+ "type": "string",
415
+ "const": "noToolCalls"
416
+ }
417
+ },
418
+ "required": [
419
+ "kind"
420
+ ],
421
+ "additionalProperties": false
422
+ },
423
+ {
424
+ "type": "object",
425
+ "properties": {
426
+ "kind": {
427
+ "type": "string",
428
+ "const": "outputContains"
429
+ },
430
+ "marker": {
431
+ "type": "string",
432
+ "minLength": 1
433
+ }
434
+ },
435
+ "required": [
436
+ "kind",
437
+ "marker"
438
+ ],
439
+ "additionalProperties": false
440
+ },
441
+ {
442
+ "type": "object",
443
+ "properties": {
444
+ "kind": {
445
+ "type": "string",
446
+ "const": "outputEquals"
447
+ },
448
+ "sentinel": {
449
+ "type": "string",
450
+ "minLength": 1
451
+ }
452
+ },
453
+ "required": [
454
+ "kind",
455
+ "sentinel"
456
+ ],
457
+ "additionalProperties": false
458
+ },
459
+ {
460
+ "type": "object",
461
+ "properties": {
462
+ "kind": {
463
+ "type": "string",
464
+ "const": "converged"
465
+ },
466
+ "threshold": {
467
+ "type": "number",
468
+ "minimum": 0,
469
+ "maximum": 1
470
+ }
471
+ },
472
+ "required": [
473
+ "kind"
474
+ ],
475
+ "additionalProperties": false
476
+ },
477
+ {
478
+ "type": "object",
479
+ "properties": {
480
+ "kind": {
481
+ "type": "string",
482
+ "const": "any"
483
+ },
484
+ "predicates": {
485
+ "minItems": 1,
486
+ "type": "array",
487
+ "items": {
488
+ "$ref": "#/$defs/UntilPredicate"
489
+ }
490
+ }
491
+ },
492
+ "required": [
493
+ "kind",
494
+ "predicates"
495
+ ],
496
+ "additionalProperties": false
497
+ },
498
+ {
499
+ "type": "object",
500
+ "properties": {
501
+ "kind": {
502
+ "type": "string",
503
+ "const": "all"
504
+ },
505
+ "predicates": {
506
+ "minItems": 1,
507
+ "type": "array",
508
+ "items": {
509
+ "$ref": "#/$defs/UntilPredicate"
510
+ }
511
+ }
512
+ },
513
+ "required": [
514
+ "kind",
515
+ "predicates"
516
+ ],
517
+ "additionalProperties": false
518
+ }
519
+ ],
520
+ "title": "UntilPredicate"
521
+ }
522
+ }
523
+ }