@serene-pub/contracts 0.6.0-pr-4 → 0.6.0-pr-6
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.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/inlets.d.ts +295 -50
- package/dist/inlets.js +468 -55
- package/dist/oracles.d.ts +440 -19
- package/dist/oracles.js +425 -42
- package/dist/outlets.d.ts +583 -44
- package/dist/outlets.js +641 -60
- package/dist/queries.d.ts +323 -80
- package/dist/queries.js +330 -90
- package/dist/tasks.d.ts +1425 -179
- package/dist/tasks.js +1169 -148
- package/package.json +3 -3
package/dist/oracles.js
CHANGED
|
@@ -41,7 +41,17 @@ const streamingParam = () => ({
|
|
|
41
41
|
description: "Automatic keeps the connection's own Stream setting; Off sends one request and waits, which is cheaper for background steps.",
|
|
42
42
|
});
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* The **loadout** a model call runs on: pair, sampling and workflow by
|
|
45
|
+
* one id. Additive and optional — the `connection` and `sampling` slots
|
|
46
|
+
* beside it stay as per-value overrides, and resolution is: the node's
|
|
47
|
+
* explicit slot → its loadout (following merges) → the transform's default
|
|
48
|
+
* loadout when that one is unfilled. One constant, so every model-calling
|
|
49
|
+
* oracle declares the same slot.
|
|
50
|
+
* @ruling DESIGN-image-generation §11, §13
|
|
51
|
+
*/
|
|
52
|
+
const LOADOUT_SLOT = { kind: 'loadout', quick: true };
|
|
53
|
+
/**
|
|
54
|
+
* **The model decides who speaks**: the oracle on
|
|
45
55
|
* the turn-order spec's optional model path (`decide.model.advise`). Same
|
|
46
56
|
* ports as a strategy — candidates and the visible history in, prepared turn
|
|
47
57
|
* entries out on `main` and `order` — so the junction's result port reads
|
|
@@ -68,6 +78,7 @@ export const turnAdvise = pin(describeOracleDefinition({
|
|
|
68
78
|
timeoutMs: 60000,
|
|
69
79
|
usage: 'response.usage',
|
|
70
80
|
slots: {
|
|
81
|
+
loadout: LOADOUT_SLOT,
|
|
71
82
|
connection: {
|
|
72
83
|
kind: 'connection',
|
|
73
84
|
quick: true,
|
|
@@ -97,7 +108,7 @@ export const turnAdvise = pin(describeOracleDefinition({
|
|
|
97
108
|
}));
|
|
98
109
|
/**
|
|
99
110
|
* Run the tool the model asked for, and hand the answer back as text it can
|
|
100
|
-
* read on the next pass
|
|
111
|
+
* read on the next pass.
|
|
101
112
|
*
|
|
102
113
|
* ## Why this is a Provider and not a Task
|
|
103
114
|
*
|
|
@@ -131,7 +142,7 @@ export const runTool = pin(describeOracleDefinition({
|
|
|
131
142
|
id: 'core:oracle/run-tool@1',
|
|
132
143
|
i18n: { name: { en: 'Run tool' } },
|
|
133
144
|
effects: 'external',
|
|
134
|
-
/** The call was the model's and the tool list the install's: approve or refuse
|
|
145
|
+
/** The call was the model's and the tool list the install's: approve or refuse. */
|
|
135
146
|
review: { fields: [] },
|
|
136
147
|
timeoutMs: 30000,
|
|
137
148
|
ports: {
|
|
@@ -164,7 +175,7 @@ export const embedText = pin(describeOracleDefinition({
|
|
|
164
175
|
id: 'core:oracle/embed-text@1',
|
|
165
176
|
shape: S.embeddings,
|
|
166
177
|
effects: 'external',
|
|
167
|
-
/** Nothing to edit: an embedding of a text somebody else wrote
|
|
178
|
+
/** Nothing to edit: an embedding of a text somebody else wrote. */
|
|
168
179
|
review: { fields: [] },
|
|
169
180
|
timeoutMs: 5000,
|
|
170
181
|
/**
|
|
@@ -212,8 +223,8 @@ export const embedText = pin(describeOracleDefinition({
|
|
|
212
223
|
kind: 'parameters',
|
|
213
224
|
schema: {
|
|
214
225
|
/**
|
|
215
|
-
* `shared`: one switch for every embed step of a
|
|
216
|
-
*
|
|
226
|
+
* `shared`: one switch for every embed step of a
|
|
227
|
+
* spec. `respond` puts it on the semantic mechanism's embed
|
|
217
228
|
* and the entity-vector mechanism's embed reads it through
|
|
218
229
|
* `slot.params({ node })` — an install with no embedding
|
|
219
230
|
* model switches both off in one place, which is the only
|
|
@@ -259,19 +270,19 @@ export const embedText = pin(describeOracleDefinition({
|
|
|
259
270
|
},
|
|
260
271
|
}));
|
|
261
272
|
/**
|
|
262
|
-
* An MCP tool call
|
|
263
|
-
* connection. The snapshot path
|
|
273
|
+
* An MCP tool call — the generic Provider for a tool on any MCP
|
|
274
|
+
* connection. The snapshot path projects each advertised tool as its
|
|
264
275
|
* own registry row under the connection's namespace, typed off the tool's
|
|
265
276
|
* declared input schema; this generic type is the escape hatch beneath them —
|
|
266
277
|
* pin it, choose the connection, name the tool in params.
|
|
267
278
|
*
|
|
268
279
|
* `effects: 'external'` unconditionally: MCP annotations (`readOnlyHint` and
|
|
269
280
|
* friends) are advisory by specification and are never trusted for gating
|
|
270
|
-
*
|
|
281
|
+
* The admin's per-tool classification lives on the snapshot rows;
|
|
271
282
|
* this generic type gates always, because through it any tool is reachable.
|
|
272
283
|
*
|
|
273
284
|
* The result carries the request and response verbatim in its output — which
|
|
274
|
-
* is the receipt, which is the pitch
|
|
285
|
+
* is the receipt, which is the pitch: no other MCP client can answer
|
|
275
286
|
* "what did this tool actually do, and did I approve it" from a row.
|
|
276
287
|
* @experimental
|
|
277
288
|
*/
|
|
@@ -285,9 +296,9 @@ export const mcpTool = pin(describeOracleDefinition({
|
|
|
285
296
|
},
|
|
286
297
|
shape: S.mcp,
|
|
287
298
|
effects: 'external',
|
|
288
|
-
/** Declared, not bound —
|
|
299
|
+
/** Declared, not bound — no handler exists for it yet. */
|
|
289
300
|
provisional: true,
|
|
290
|
-
/** The arguments are the model's invocation: approve or refuse it, never rewrite it
|
|
301
|
+
/** The arguments are the model's invocation: approve or refuse it, never rewrite it. */
|
|
291
302
|
review: { fields: [] },
|
|
292
303
|
timeoutMs: 60000,
|
|
293
304
|
slots: {
|
|
@@ -338,10 +349,10 @@ export const mcpTool = pin(describeOracleDefinition({
|
|
|
338
349
|
},
|
|
339
350
|
}));
|
|
340
351
|
/**
|
|
341
|
-
* An MCP resource read
|
|
342
|
-
* Query may not reach the network
|
|
343
|
-
* process boundary must be recorded verbatim so replay never re-infers
|
|
344
|
-
*
|
|
352
|
+
* An MCP resource read — a Provider, deliberately not a Query. A
|
|
353
|
+
* Query may not reach the network, and everything crossing the
|
|
354
|
+
* process boundary must be recorded verbatim so replay never re-infers;
|
|
355
|
+
* a resource is external state that can change between runs, and
|
|
345
356
|
* modelling it as a Query would quietly break both rules.
|
|
346
357
|
* @experimental
|
|
347
358
|
*/
|
|
@@ -355,9 +366,9 @@ export const mcpResource = pin(describeOracleDefinition({
|
|
|
355
366
|
},
|
|
356
367
|
shape: S.mcp,
|
|
357
368
|
effects: 'external',
|
|
358
|
-
/** Declared, not bound —
|
|
369
|
+
/** Declared, not bound — no handler exists for it yet. */
|
|
359
370
|
provisional: true,
|
|
360
|
-
/** The uri is the invocation: approve or refuse
|
|
371
|
+
/** The uri is the invocation: approve or refuse. */
|
|
361
372
|
review: { fields: [] },
|
|
362
373
|
timeoutMs: 60000,
|
|
363
374
|
slots: {
|
|
@@ -401,12 +412,13 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
401
412
|
i18n: { name: { en: 'Generate reply' } },
|
|
402
413
|
shape: S.textGen,
|
|
403
414
|
effects: 'external',
|
|
404
|
-
/** The payload is the compiled prompt; a prompt rewritten at the gate is one the receipt cannot explain — approve or refuse
|
|
415
|
+
/** The payload is the compiled prompt; a prompt rewritten at the gate is one the receipt cannot explain — approve or refuse. */
|
|
405
416
|
review: { fields: [] },
|
|
406
417
|
timeoutMs: 120000,
|
|
407
418
|
timeoutKind: 'idle',
|
|
408
419
|
usage: 'response.usage',
|
|
409
420
|
slots: {
|
|
421
|
+
loadout: LOADOUT_SLOT,
|
|
410
422
|
connection: {
|
|
411
423
|
kind: 'connection',
|
|
412
424
|
quick: true,
|
|
@@ -437,10 +449,25 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
437
449
|
shape: S.textGen,
|
|
438
450
|
description: 'The sampling settings — temperature and friends — used for this request.',
|
|
439
451
|
},
|
|
452
|
+
/**
|
|
453
|
+
* 🚧 **Speech sampling** (O7, evolved in place 2026-10-21): the
|
|
454
|
+
* second sampling slot a call takes when its `outputs` ask for
|
|
455
|
+
* audio — the TTS vocabulary (voice, speed, …) beside the text one
|
|
456
|
+
* above, one sampling per kind written. Read only when audio is
|
|
457
|
+
* asked for; unset, it is the Narration loadout's (`text->audio`
|
|
458
|
+
* default) sampling. ⚠ Not `sampling`: that one says how the reply
|
|
459
|
+
* is WRITTEN, this one how it is SPOKEN.
|
|
460
|
+
* @ruling O7
|
|
461
|
+
*/
|
|
462
|
+
speechSampling: {
|
|
463
|
+
kind: 'sampling',
|
|
464
|
+
shape: S.tts,
|
|
465
|
+
description: 'How a spoken reply sounds — the voice and its speed. Read only when this step asks for audio.',
|
|
466
|
+
},
|
|
440
467
|
/**
|
|
441
468
|
* ⚠ No `prompts` slot, and there was one — `system` and
|
|
442
469
|
* `postHistory`, "the written instructions sent with every request
|
|
443
|
-
* from this step" (culled 2026-09-16
|
|
470
|
+
* from this step" (culled 2026-09-16). No handler read it:
|
|
444
471
|
* the instructions reach the model INSIDE the assembled context,
|
|
445
472
|
* through `core:task/assemble@2`'s own `prompts` slot, and this
|
|
446
473
|
* node sends what it is handed on `context`. Every shipped spec
|
|
@@ -468,6 +495,25 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
468
495
|
description: 'Sequences that end the reply the moment the model writes one. One per line.',
|
|
469
496
|
},
|
|
470
497
|
streaming: streamingParam(),
|
|
498
|
+
/**
|
|
499
|
+
* 🚧 The **requested outputs** (O6, evolved in place
|
|
500
|
+
* 2026-10-20 — no @2 before 0.7): the kinds this call asks
|
|
501
|
+
* the model to write, in order. `['text']` — today's reply
|
|
502
|
+
* — unless stated. Asking for `audio` beside text makes the
|
|
503
|
+
* connection's requirement `text->text+audio`
|
|
504
|
+
* (`requirementForOutputs`): the bind check and fit derive
|
|
505
|
+
* it from here, and refuse in words where no reachable model
|
|
506
|
+
* writes audio. Open by kind (O1).
|
|
507
|
+
* @ruling O6
|
|
508
|
+
*/
|
|
509
|
+
outputs: {
|
|
510
|
+
type: 'string[]',
|
|
511
|
+
label: { en: 'Outputs' },
|
|
512
|
+
description: {
|
|
513
|
+
en: 'What the model is asked to write, in order — text, and audio for a spoken reply. Text unless set.',
|
|
514
|
+
},
|
|
515
|
+
default: ['text'],
|
|
516
|
+
},
|
|
471
517
|
},
|
|
472
518
|
},
|
|
473
519
|
},
|
|
@@ -486,19 +532,21 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
486
532
|
* resolved at bind time.
|
|
487
533
|
*/
|
|
488
534
|
media: {
|
|
489
|
-
|
|
490
|
-
|
|
535
|
+
// `audio` (O4, 2026-10-21): a voice note a pair that hears is sent.
|
|
536
|
+
accepts: ['image', 'document', 'audio'],
|
|
537
|
+
// `audio` (O6, 2026-10-20): a spoken reply's audio part.
|
|
538
|
+
emits: ['image', 'audio'],
|
|
491
539
|
},
|
|
492
540
|
ports: {
|
|
493
541
|
in: {
|
|
494
542
|
context: S.assembled,
|
|
495
543
|
/**
|
|
496
|
-
* Whose reply is being generated — the stop-string exclusion
|
|
497
|
-
*
|
|
544
|
+
* Whose reply is being generated — the stop-string exclusion:
|
|
545
|
+
* the speaking character's own name must not stop
|
|
498
546
|
* their own reply. The host already preferred a payload value
|
|
499
547
|
* over the run scope's; this port is what lets a spec supply
|
|
500
548
|
* one, so the exclusion follows the next-speaker node's output
|
|
501
|
-
*
|
|
549
|
+
* instead of the pre-run guess.
|
|
502
550
|
*/
|
|
503
551
|
currentCharacterId: S.rowIds,
|
|
504
552
|
/**
|
|
@@ -539,7 +587,7 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
539
587
|
},
|
|
540
588
|
}));
|
|
541
589
|
/**
|
|
542
|
-
* Generate, with the tools on the wire
|
|
590
|
+
* Generate, with the tools on the wire — the native door.
|
|
543
591
|
*
|
|
544
592
|
* ## Why this is a second type rather than two ports on `generate-text`
|
|
545
593
|
*
|
|
@@ -574,12 +622,13 @@ export const generateWithTools = pin(describeOracleDefinition({
|
|
|
574
622
|
i18n: { name: { en: 'Generate with tools' } },
|
|
575
623
|
shape: S.textGen,
|
|
576
624
|
effects: 'external',
|
|
577
|
-
/** The compiled prompt and the tool list: approve or refuse, as `generate-text
|
|
625
|
+
/** The compiled prompt and the tool list: approve or refuse, as `generate-text`. */
|
|
578
626
|
review: { fields: [] },
|
|
579
627
|
timeoutMs: 120000,
|
|
580
628
|
timeoutKind: 'idle',
|
|
581
629
|
usage: 'response.usage',
|
|
582
630
|
slots: {
|
|
631
|
+
loadout: LOADOUT_SLOT,
|
|
583
632
|
connection: {
|
|
584
633
|
kind: 'connection',
|
|
585
634
|
quick: true,
|
|
@@ -684,7 +733,7 @@ export const generateJson = pin(describeOracleDefinition({
|
|
|
684
733
|
i18n: { name: { en: 'Generate JSON' } },
|
|
685
734
|
shape: S.textGen,
|
|
686
735
|
effects: 'external',
|
|
687
|
-
/** The compiled prompt and the schema: approve or refuse, as `generate-text
|
|
736
|
+
/** The compiled prompt and the schema: approve or refuse, as `generate-text`. */
|
|
688
737
|
review: { fields: [] },
|
|
689
738
|
timeoutMs: 120000,
|
|
690
739
|
timeoutKind: 'idle',
|
|
@@ -701,6 +750,7 @@ export const generateJson = pin(describeOracleDefinition({
|
|
|
701
750
|
*/
|
|
702
751
|
optional: true,
|
|
703
752
|
slots: {
|
|
753
|
+
loadout: LOADOUT_SLOT,
|
|
704
754
|
connection: {
|
|
705
755
|
kind: 'connection',
|
|
706
756
|
quick: true,
|
|
@@ -750,6 +800,22 @@ export const generateJson = pin(describeOracleDefinition({
|
|
|
750
800
|
description: 'Sequences that end the reply the moment the model writes one. One per line.',
|
|
751
801
|
},
|
|
752
802
|
streaming: streamingParam(),
|
|
803
|
+
/**
|
|
804
|
+
* 🚧 An empty answer read as an unreadable one (the Dungeon
|
|
805
|
+
* Crawler 100-turn walk, B7): `json` null and `parseError`
|
|
806
|
+
* saying the model returned nothing, and the step goes on —
|
|
807
|
+
* so a check placed after it can ask once more and then go on
|
|
808
|
+
* without the answer. Off (the default), an empty answer halts
|
|
809
|
+
* the run, as it always has. `@1` evolves in place.
|
|
810
|
+
*/
|
|
811
|
+
emptyIsUnreadable: {
|
|
812
|
+
type: 'boolean',
|
|
813
|
+
default: false,
|
|
814
|
+
label: { en: 'Go on after an empty answer' },
|
|
815
|
+
description: {
|
|
816
|
+
en: 'Read an empty answer as one that could not be read, and carry on, instead of stopping the run.',
|
|
817
|
+
},
|
|
818
|
+
},
|
|
753
819
|
},
|
|
754
820
|
},
|
|
755
821
|
},
|
|
@@ -788,12 +854,13 @@ export const speak = pin(describeOracleDefinition({
|
|
|
788
854
|
i18n: { name: { en: 'Speak' } },
|
|
789
855
|
shape: S.tts,
|
|
790
856
|
effects: 'external',
|
|
791
|
-
/** Declared, not bound —
|
|
857
|
+
/** Declared, not bound — no handler exists for it yet. */
|
|
792
858
|
provisional: true,
|
|
793
|
-
/** The words to be spoken may be corrected before the call
|
|
859
|
+
/** The words to be spoken may be corrected before the call. */
|
|
794
860
|
review: { fields: ['text'] },
|
|
795
861
|
timeoutMs: 60000,
|
|
796
862
|
slots: {
|
|
863
|
+
loadout: LOADOUT_SLOT,
|
|
797
864
|
connection: {
|
|
798
865
|
kind: 'connection',
|
|
799
866
|
quick: true,
|
|
@@ -814,6 +881,89 @@ export const speak = pin(describeOracleDefinition({
|
|
|
814
881
|
},
|
|
815
882
|
ports: { in: { text: S.text }, out: { main: S.audio, audio: S.audio } },
|
|
816
883
|
}));
|
|
884
|
+
/**
|
|
885
|
+
* 🚧 **Transcribe audio** (O9, 2026-10-21) — the explicit step that turns a
|
|
886
|
+
* sound the reply cannot hear into the words it says, BEFORE placement.
|
|
887
|
+
*
|
|
888
|
+
* Reads the transcript's files by message (`core:query/history-attachments@1`)
|
|
889
|
+
* and what the reply's call HEARS — `hears`, the `reads` the context budget
|
|
890
|
+
* publishes off the same pair (`ConnectionReadsV1`). Each audio file within
|
|
891
|
+
* `mediaLookback` messages of the end that the call cannot hear and that has
|
|
892
|
+
* no transcript yet is sent to this step's own model (`audio->text`, the
|
|
893
|
+
* Transcription loadout); the words are cached on the file, so a file is
|
|
894
|
+
* heard once, and handed on as `transcript` (and `text`, when the person gave
|
|
895
|
+
* no description). Placement then names the file with its words:
|
|
896
|
+
* `[audio: note.mp3 — "…"]`.
|
|
897
|
+
*
|
|
898
|
+
* Never silent, never a refusal of the reply: a call that hears audio itself,
|
|
899
|
+
* a transcript with no audio, and a cached transcript send nothing; with no
|
|
900
|
+
* model set up to transcribe, the files pass through untouched and `notes`
|
|
901
|
+
* says so on the receipt. `attachments` is the same record, transcripts
|
|
902
|
+
* filled in — wire it into `place-attachments@1` in place of the query's.
|
|
903
|
+
* ⚠ Not `speak@1` — that one SPEAKS; this one HEARS.
|
|
904
|
+
* @experimental
|
|
905
|
+
* @ruling O9
|
|
906
|
+
*/
|
|
907
|
+
export const transcribeAudio = pin(describeOracleDefinition({
|
|
908
|
+
id: 'core:oracle/transcribe-audio@1',
|
|
909
|
+
i18n: { name: { en: 'Transcribe audio' } },
|
|
910
|
+
shape: S.transcription,
|
|
911
|
+
effects: 'external',
|
|
912
|
+
/** It prepares the prompt; a preview stops at the call that sends it. */
|
|
913
|
+
previewRunsThrough: true,
|
|
914
|
+
/** The request is the file itself; there is nothing to correct before it is heard. */
|
|
915
|
+
review: { fields: [] },
|
|
916
|
+
timeoutMs: 120000,
|
|
917
|
+
slots: {
|
|
918
|
+
loadout: LOADOUT_SLOT,
|
|
919
|
+
connection: {
|
|
920
|
+
kind: 'connection',
|
|
921
|
+
quick: true,
|
|
922
|
+
shape: S.transcription,
|
|
923
|
+
requires: [tf({ in: [IoKinds.audio], out: [IoKinds.text] })],
|
|
924
|
+
description: 'Which model hears the audio the reply cannot.',
|
|
925
|
+
},
|
|
926
|
+
params: {
|
|
927
|
+
kind: 'parameters',
|
|
928
|
+
facet: 'weights',
|
|
929
|
+
schema: {
|
|
930
|
+
mediaLookback: {
|
|
931
|
+
type: 'integer',
|
|
932
|
+
min: 0,
|
|
933
|
+
default: 10,
|
|
934
|
+
label: { en: 'Media lookback (messages)' },
|
|
935
|
+
description: {
|
|
936
|
+
en: 'Audio in the last this-many messages is transcribed when the reply cannot hear it; older audio is sent as its name. Match the placement step.',
|
|
937
|
+
},
|
|
938
|
+
},
|
|
939
|
+
language: {
|
|
940
|
+
type: 'string',
|
|
941
|
+
label: { en: 'Language' },
|
|
942
|
+
description: {
|
|
943
|
+
en: 'The language spoken, as a code such as "en" or "fr". Empty lets the model detect it.',
|
|
944
|
+
},
|
|
945
|
+
},
|
|
946
|
+
},
|
|
947
|
+
},
|
|
948
|
+
},
|
|
949
|
+
ports: {
|
|
950
|
+
in: {
|
|
951
|
+
/** The processed lines, for which messages are within the lookback. */
|
|
952
|
+
messages: S.messages,
|
|
953
|
+
/** The files by message, from `core:query/history-attachments@1`. */
|
|
954
|
+
attachments: S.mediaByMessage,
|
|
955
|
+
/** What the reply's call reads — `context-budget@1`'s `reads`. */
|
|
956
|
+
hears: S.json,
|
|
957
|
+
},
|
|
958
|
+
out: {
|
|
959
|
+
main: S.mediaByMessage,
|
|
960
|
+
/** The same files, transcripts filled in. */
|
|
961
|
+
attachments: S.mediaByMessage,
|
|
962
|
+
/** Sentences for the receipt: what was transcribed, and what was not and why. */
|
|
963
|
+
notes: S.json,
|
|
964
|
+
},
|
|
965
|
+
},
|
|
966
|
+
}));
|
|
817
967
|
/**
|
|
818
968
|
* Render an image.
|
|
819
969
|
*
|
|
@@ -848,6 +998,30 @@ export const speak = pin(describeOracleDefinition({
|
|
|
848
998
|
* `init` is declared now rather than added later: img2img changes nothing else
|
|
849
999
|
* about this contract, and retrofitting a port onto a published type costs a
|
|
850
1000
|
* version bump for every spec pinning it.
|
|
1001
|
+
*
|
|
1002
|
+
* ## Widened in place (2026-10-12)
|
|
1003
|
+
*
|
|
1004
|
+
* Additive, so still `@1` — every new port is optional and every new param
|
|
1005
|
+
* has a default that reproduces the old behaviour; the descriptor hash moves.
|
|
1006
|
+
*
|
|
1007
|
+
* - `references` — images the output should RESEMBLE (a likeness). Not
|
|
1008
|
+
* `init` (the starting canvas) and not `mask` (where to paint): three
|
|
1009
|
+
* different wire fields on every backend that has them.
|
|
1010
|
+
* - `series` — the pictures wanted, each `{ key, vars }`. The prompt rows
|
|
1011
|
+
* render once per item with `vars` in scope; every media item out carries
|
|
1012
|
+
* its `key`. How many CALLS that is, is the host's packing (loop, batch,
|
|
1013
|
+
* keyed graph) from the pair's drawing sheet — never the spec's.
|
|
1014
|
+
* - `orientation` swaps the longer edge of the sampling's size; `free`
|
|
1015
|
+
* takes it as-is.
|
|
1016
|
+
* - `cutOut` asks for a transparent background: native where the pair
|
|
1017
|
+
* draws one, else the media is flagged for the cut-out task
|
|
1018
|
+
* (`native-or-task`), or the bind refuses (`native-only`).
|
|
1019
|
+
* - `references: required` refuses a pair that takes no reference image;
|
|
1020
|
+
* `preferred` (default) runs anyway, reports `references` as ignored, and
|
|
1021
|
+
* says so on the action's form before the run.
|
|
1022
|
+
*
|
|
1023
|
+
* `requires` stays `[text->image]`: `requires` is a static list, so the gate
|
|
1024
|
+
* for reference images is the drawing sheet, read at bind, not a transform.
|
|
851
1025
|
* @experimental
|
|
852
1026
|
*/
|
|
853
1027
|
export const generateImage = pin(describeOracleDefinition({
|
|
@@ -855,13 +1029,14 @@ export const generateImage = pin(describeOracleDefinition({
|
|
|
855
1029
|
i18n: { name: { en: 'Generate image' } },
|
|
856
1030
|
shape: S.imageGen,
|
|
857
1031
|
effects: 'external',
|
|
858
|
-
/** The prompt and the negative may be edited; `init` names an asset and may not
|
|
1032
|
+
/** The prompt and the negative may be edited; `init` names an asset and may not. */
|
|
859
1033
|
review: { fields: ['prompt', 'negative'] },
|
|
860
1034
|
// Idle rather than wall: a render is minutes on modest hardware, and a
|
|
861
1035
|
// backend still reporting progress is working, not hung.
|
|
862
1036
|
timeoutMs: 600000,
|
|
863
1037
|
timeoutKind: 'idle',
|
|
864
1038
|
slots: {
|
|
1039
|
+
loadout: LOADOUT_SLOT,
|
|
865
1040
|
connection: {
|
|
866
1041
|
kind: 'connection',
|
|
867
1042
|
quick: true,
|
|
@@ -880,6 +1055,16 @@ export const generateImage = pin(describeOracleDefinition({
|
|
|
880
1055
|
shape: S.imageGen,
|
|
881
1056
|
description: 'Steps, CFG, size, seed — the settings every image backend shares.',
|
|
882
1057
|
},
|
|
1058
|
+
/**
|
|
1059
|
+
* 🚧 The graph a template-payload pair draws with (a ComfyUI
|
|
1060
|
+
* workflow). Optional: flat dialects
|
|
1061
|
+
* ignore it, and the host's bind guard requires it only when the
|
|
1062
|
+
* resolved pair's drawing sheet says `payload: 'template'`.
|
|
1063
|
+
*/
|
|
1064
|
+
workflow: {
|
|
1065
|
+
kind: 'workflow',
|
|
1066
|
+
description: 'Which ComfyUI workflow this step draws with, when its image server runs workflows.',
|
|
1067
|
+
},
|
|
883
1068
|
prompts: {
|
|
884
1069
|
kind: 'prompts',
|
|
885
1070
|
quick: true,
|
|
@@ -901,7 +1086,110 @@ export const generateImage = pin(describeOracleDefinition({
|
|
|
901
1086
|
*/
|
|
902
1087
|
params: {
|
|
903
1088
|
kind: 'parameters',
|
|
904
|
-
schema: {
|
|
1089
|
+
schema: {
|
|
1090
|
+
streaming: streamingParam(),
|
|
1091
|
+
orientation: {
|
|
1092
|
+
type: 'enum',
|
|
1093
|
+
of: ['free', 'square', 'portrait', 'landscape'],
|
|
1094
|
+
members: [
|
|
1095
|
+
{
|
|
1096
|
+
key: 'free',
|
|
1097
|
+
label: { en: 'As set' },
|
|
1098
|
+
description: { en: "Takes the sampling's width and height as they are." },
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
key: 'square',
|
|
1102
|
+
label: { en: 'Square' },
|
|
1103
|
+
description: { en: 'Both edges become the shorter of the two.' },
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
key: 'portrait',
|
|
1107
|
+
label: { en: 'Portrait' },
|
|
1108
|
+
description: { en: 'Taller than wide: the longer edge is the height.' },
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
key: 'landscape',
|
|
1112
|
+
label: { en: 'Landscape' },
|
|
1113
|
+
description: { en: 'Wider than tall: the longer edge is the width.' },
|
|
1114
|
+
},
|
|
1115
|
+
],
|
|
1116
|
+
default: 'free',
|
|
1117
|
+
description: "Which way up the picture is drawn. As set takes the sampling's size unchanged.",
|
|
1118
|
+
},
|
|
1119
|
+
cutOut: {
|
|
1120
|
+
type: 'enum',
|
|
1121
|
+
of: ['off', 'native-or-task', 'native-only'],
|
|
1122
|
+
members: [
|
|
1123
|
+
{
|
|
1124
|
+
key: 'off',
|
|
1125
|
+
label: { en: 'Off' },
|
|
1126
|
+
description: { en: 'Keeps the background the model draws.' },
|
|
1127
|
+
},
|
|
1128
|
+
{
|
|
1129
|
+
key: 'native-or-task',
|
|
1130
|
+
label: { en: 'Transparent when possible' },
|
|
1131
|
+
description: {
|
|
1132
|
+
en: 'Asks the model for a transparent background, or cuts one out afterwards when it cannot.',
|
|
1133
|
+
},
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
key: 'native-only',
|
|
1137
|
+
label: { en: 'Transparent from the model' },
|
|
1138
|
+
description: { en: 'Only runs on a model that draws a transparent background itself.' },
|
|
1139
|
+
},
|
|
1140
|
+
],
|
|
1141
|
+
default: 'off',
|
|
1142
|
+
description: 'Whether the picture needs a transparent background, and where it may come from.',
|
|
1143
|
+
},
|
|
1144
|
+
references: {
|
|
1145
|
+
type: 'enum',
|
|
1146
|
+
of: ['preferred', 'required'],
|
|
1147
|
+
members: [
|
|
1148
|
+
{
|
|
1149
|
+
key: 'preferred',
|
|
1150
|
+
label: { en: 'Preferred' },
|
|
1151
|
+
description: {
|
|
1152
|
+
en: "Runs on a model that can't take a reference image, from the prompt alone, and says so first.",
|
|
1153
|
+
},
|
|
1154
|
+
},
|
|
1155
|
+
{
|
|
1156
|
+
key: 'required',
|
|
1157
|
+
label: { en: 'Required' },
|
|
1158
|
+
description: { en: 'Only runs on a model that takes reference images.' },
|
|
1159
|
+
},
|
|
1160
|
+
],
|
|
1161
|
+
default: 'preferred',
|
|
1162
|
+
description: 'What happens when the model cannot take the reference images wired to this step.',
|
|
1163
|
+
},
|
|
1164
|
+
/**
|
|
1165
|
+
* 🚧 One seed for the whole step:
|
|
1166
|
+
* `per-run` draws a seed once when the sampling's
|
|
1167
|
+
* seed is random and sends it with every call, so a
|
|
1168
|
+
* series drawn on an SD-class model coheres. A sampling
|
|
1169
|
+
* that fixes its own seed keeps it. Models that ignore
|
|
1170
|
+
* seeds ignore this too.
|
|
1171
|
+
*/
|
|
1172
|
+
seed: {
|
|
1173
|
+
type: 'enum',
|
|
1174
|
+
of: ['as-set', 'per-run'],
|
|
1175
|
+
members: [
|
|
1176
|
+
{
|
|
1177
|
+
key: 'as-set',
|
|
1178
|
+
label: { en: 'As set' },
|
|
1179
|
+
description: { en: "Uses the sampling's seed: random stays random for every picture." },
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
key: 'per-run',
|
|
1183
|
+
label: { en: 'Same for every picture' },
|
|
1184
|
+
description: {
|
|
1185
|
+
en: 'Picks one seed per run and draws every picture with it, so a set looks alike.',
|
|
1186
|
+
},
|
|
1187
|
+
},
|
|
1188
|
+
],
|
|
1189
|
+
default: 'as-set',
|
|
1190
|
+
description: 'Whether every picture this step draws shares one seed.',
|
|
1191
|
+
},
|
|
1192
|
+
},
|
|
905
1193
|
},
|
|
906
1194
|
},
|
|
907
1195
|
media: { emits: ['image', 'video'] },
|
|
@@ -909,10 +1197,21 @@ export const generateImage = pin(describeOracleDefinition({
|
|
|
909
1197
|
in: {
|
|
910
1198
|
prompt: S.text,
|
|
911
1199
|
negative: S.text,
|
|
912
|
-
/**
|
|
1200
|
+
/** The starting canvas, for an edit (img2img). Not a reference. */
|
|
913
1201
|
init: S.media,
|
|
1202
|
+
/** Where to paint, for inpainting. Absent edits the whole frame. */
|
|
1203
|
+
mask: S.image,
|
|
1204
|
+
/** Images the output should resemble — a likeness. Not `init`. */
|
|
1205
|
+
references: S.mediaList,
|
|
1206
|
+
/** The pictures wanted, each `{ key, vars }` (`ImageSeriesItemV1`). */
|
|
1207
|
+
series: S.imageSeries,
|
|
914
1208
|
},
|
|
915
1209
|
out: {
|
|
1210
|
+
/**
|
|
1211
|
+
* Each item is a `MediaRef` plus `key` — the series item it was
|
|
1212
|
+
* drawn for (`"1"` without a series). Several items may share a
|
|
1213
|
+
* key (variants); an item with no key is surplus the host kept.
|
|
1214
|
+
*/
|
|
916
1215
|
main: S.mediaList,
|
|
917
1216
|
media: S.mediaList,
|
|
918
1217
|
image: S.image,
|
|
@@ -929,7 +1228,7 @@ export const renderImage = pin(describeOracleDefinition({
|
|
|
929
1228
|
id: 'chariot.comfy:render-image@1',
|
|
930
1229
|
shape: S.imageGen,
|
|
931
1230
|
effects: 'external',
|
|
932
|
-
/** A sample plugin oracle: its payload is a compiled prompt — approve or refuse
|
|
1231
|
+
/** A sample plugin oracle: its payload is a compiled prompt — approve or refuse. */
|
|
933
1232
|
review: { fields: [] },
|
|
934
1233
|
timeoutMs: 300000,
|
|
935
1234
|
slots: {
|
|
@@ -1014,7 +1313,7 @@ export const pickSprite = pin(describeOracleDefinition({
|
|
|
1014
1313
|
id: 'core:oracle/pick-sprite@1',
|
|
1015
1314
|
i18n: { name: { en: 'Closest sprite' } },
|
|
1016
1315
|
effects: 'external',
|
|
1017
|
-
/** Nothing to edit: a choice among the card's own sprites
|
|
1316
|
+
/** Nothing to edit: a choice among the card's own sprites. */
|
|
1018
1317
|
review: { fields: [] },
|
|
1019
1318
|
timeoutMs: 5000,
|
|
1020
1319
|
slots: {
|
|
@@ -1101,21 +1400,23 @@ export const pickSprite = pin(describeOracleDefinition({
|
|
|
1101
1400
|
/** Phase 1 — one batch, drafted without sight of any other. @internal */
|
|
1102
1401
|
export const summarizeBatch = pin(describeOracleDefinition({
|
|
1103
1402
|
id: 'core:oracle/summarize-batch@1',
|
|
1403
|
+
/** Runs best on a low-temperature, short-answer preset — a suggestion, never a gate. */
|
|
1404
|
+
prefers: { sampling: 'sampling-extraction' },
|
|
1104
1405
|
i18n: { name: { en: 'Draft a batch' } },
|
|
1105
1406
|
shape: S.textGen,
|
|
1106
1407
|
effects: 'external',
|
|
1107
|
-
/** A drafting call over a batch: approve or refuse
|
|
1408
|
+
/** A drafting call over a batch: approve or refuse. */
|
|
1108
1409
|
review: { fields: [] },
|
|
1109
1410
|
timeoutMs: 120000,
|
|
1110
1411
|
timeoutKind: 'idle',
|
|
1111
1412
|
usage: 'response.usage',
|
|
1112
1413
|
/**
|
|
1113
|
-
* The first interior point
|
|
1414
|
+
* The first interior point, and core dogfooding it:
|
|
1114
1415
|
* every intermediate draft passes the user's chain before synthesis
|
|
1115
1416
|
* reads it — slop killed in the material summaries are built *from*,
|
|
1116
1417
|
* not only in final replies. Invoked by the binding via
|
|
1117
1418
|
* `ctx.scripts.applyText('each-draft', …)`; recorded per application
|
|
1118
|
-
* as `appliedBy: 'binding'`. Declares what it accepts
|
|
1419
|
+
* as `appliedBy: 'binding'`. Declares what it accepts: a draft
|
|
1119
1420
|
* is text, so text transforms — said here rather than assumed by the
|
|
1120
1421
|
* broker, which is the difference between a point a plugin can shape
|
|
1121
1422
|
* and a literal in the executor.
|
|
@@ -1131,6 +1432,7 @@ export const summarizeBatch = pin(describeOracleDefinition({
|
|
|
1131
1432
|
},
|
|
1132
1433
|
],
|
|
1133
1434
|
slots: {
|
|
1435
|
+
loadout: LOADOUT_SLOT,
|
|
1134
1436
|
connection: {
|
|
1135
1437
|
kind: 'connection',
|
|
1136
1438
|
quick: true,
|
|
@@ -1201,15 +1503,18 @@ export const summarizeBatch = pin(describeOracleDefinition({
|
|
|
1201
1503
|
/** Phase 2 — the ordered drafts merged into one past-tense narrative. @internal */
|
|
1202
1504
|
export const summarizeSynth = pin(describeOracleDefinition({
|
|
1203
1505
|
id: 'core:oracle/summarize-synth@1',
|
|
1506
|
+
/** Runs best on a low-temperature, short-answer preset — a suggestion, never a gate. */
|
|
1507
|
+
prefers: { sampling: 'sampling-extraction' },
|
|
1204
1508
|
i18n: { name: { en: 'Synthesize the drafts' } },
|
|
1205
1509
|
shape: S.textGen,
|
|
1206
1510
|
effects: 'external',
|
|
1207
|
-
/** The merge call: approve or refuse
|
|
1511
|
+
/** The merge call: approve or refuse. */
|
|
1208
1512
|
review: { fields: [] },
|
|
1209
1513
|
timeoutMs: 120000,
|
|
1210
1514
|
timeoutKind: 'idle',
|
|
1211
1515
|
usage: 'response.usage',
|
|
1212
1516
|
slots: {
|
|
1517
|
+
loadout: LOADOUT_SLOT,
|
|
1213
1518
|
connection: {
|
|
1214
1519
|
kind: 'connection',
|
|
1215
1520
|
quick: true,
|
|
@@ -1240,14 +1545,17 @@ export const summarizeSynth = pin(describeOracleDefinition({
|
|
|
1240
1545
|
/** What the entry gets called. Its own step because it has its own prompt. @internal */
|
|
1241
1546
|
export const nameEntry = pin(describeOracleDefinition({
|
|
1242
1547
|
id: 'core:oracle/name-entry@1',
|
|
1548
|
+
/** Runs best on a low-temperature, short-answer preset — a suggestion, never a gate. */
|
|
1549
|
+
prefers: { sampling: 'sampling-extraction' },
|
|
1243
1550
|
i18n: { name: { en: 'Name the entry' } },
|
|
1244
1551
|
shape: S.textGen,
|
|
1245
1552
|
effects: 'external',
|
|
1246
|
-
/** Approve or refuse; the name it produces is reviewed at the entry's write
|
|
1553
|
+
/** Approve or refuse; the name it produces is reviewed at the entry's write. */
|
|
1247
1554
|
review: { fields: [] },
|
|
1248
1555
|
timeoutMs: 60000,
|
|
1249
1556
|
usage: 'response.usage',
|
|
1250
1557
|
slots: {
|
|
1558
|
+
loadout: LOADOUT_SLOT,
|
|
1251
1559
|
connection: {
|
|
1252
1560
|
kind: 'connection',
|
|
1253
1561
|
quick: true,
|
|
@@ -1281,14 +1589,17 @@ export const nameEntry = pin(describeOracleDefinition({
|
|
|
1281
1589
|
*/
|
|
1282
1590
|
export const extractCast = pin(describeOracleDefinition({
|
|
1283
1591
|
id: 'core:oracle/extract-cast@1',
|
|
1592
|
+
/** Runs best on a low-temperature, short-answer preset — a suggestion, never a gate. */
|
|
1593
|
+
prefers: { sampling: 'sampling-extraction' },
|
|
1284
1594
|
i18n: { name: { en: 'Extract the cast' } },
|
|
1285
1595
|
shape: S.textGen,
|
|
1286
1596
|
effects: 'external',
|
|
1287
|
-
/** Approve or refuse
|
|
1597
|
+
/** Approve or refuse. */
|
|
1288
1598
|
review: { fields: [] },
|
|
1289
1599
|
timeoutMs: 60000,
|
|
1290
1600
|
usage: 'response.usage',
|
|
1291
1601
|
slots: {
|
|
1602
|
+
loadout: LOADOUT_SLOT,
|
|
1292
1603
|
connection: {
|
|
1293
1604
|
kind: 'connection',
|
|
1294
1605
|
quick: true,
|
|
@@ -1348,12 +1659,13 @@ const graphStep = (id, label, field, extra = {}) => pin(describeOracleDefinition
|
|
|
1348
1659
|
i18n: { name: { en: label } },
|
|
1349
1660
|
shape: S.textGen,
|
|
1350
1661
|
effects: 'external',
|
|
1351
|
-
/** Each graph step sends a compiled prompt: approve or refuse
|
|
1662
|
+
/** Each graph step sends a compiled prompt: approve or refuse. */
|
|
1352
1663
|
review: { fields: [] },
|
|
1353
1664
|
timeoutMs: extra.timeoutMs ?? 120000,
|
|
1354
1665
|
timeoutKind: 'idle',
|
|
1355
1666
|
usage: 'response.usage',
|
|
1356
1667
|
slots: {
|
|
1668
|
+
loadout: LOADOUT_SLOT,
|
|
1357
1669
|
connection: {
|
|
1358
1670
|
kind: 'connection',
|
|
1359
1671
|
quick: true,
|
|
@@ -1383,4 +1695,75 @@ export const graphPerspective = graphStep('core:oracle/graph-perspective@1', 'Pe
|
|
|
1383
1695
|
export const graphNodeDescription = graphStep('core:oracle/graph-node-description@1', 'Describe new nodes', 'nodeDescription');
|
|
1384
1696
|
/** Did any present character reach a new lifecycle state this scene? @internal */
|
|
1385
1697
|
export const graphStateDetection = graphStep('core:oracle/graph-state-detection@1', 'Detect state changes', 'stateDetection');
|
|
1698
|
+
/**
|
|
1699
|
+
* 🚧 **Describe image** — a model that reads pictures is shown one or more
|
|
1700
|
+
* images and asked one written question about them; its answer is the text
|
|
1701
|
+
* out (*Describe from image*, 2026-10-12).
|
|
1702
|
+
*
|
|
1703
|
+
* Not `generate-text`: that node sends an assembled TURN (a transcript, a
|
|
1704
|
+
* speaker, a reply being continued) and its connection requires only
|
|
1705
|
+
* `text->text`, so it resolves to the instance's chat default. This node
|
|
1706
|
+
* sends no transcript — one instruction plus the images — and its connection
|
|
1707
|
+
* REQUIRES `text+image->text`, so an unset slot resolves to the default of
|
|
1708
|
+
* that job (the model that reads pictures), never to the chat model.
|
|
1709
|
+
*
|
|
1710
|
+
* Not a caption either: `caption` is `generate-image`'s out-port (the text a
|
|
1711
|
+
* picture is posted with). This node's answer is whatever the instruction
|
|
1712
|
+
* asks for — a tag list of a person's look, for the likeness helper.
|
|
1713
|
+
*
|
|
1714
|
+
* The instruction is the `prompts` slot's `instruction` field (a prompt
|
|
1715
|
+
* row), so an admin rewrites the question in Admin › Pipelines.
|
|
1716
|
+
* @experimental
|
|
1717
|
+
*/
|
|
1718
|
+
export const describeImage = pin(describeOracleDefinition({
|
|
1719
|
+
id: 'core:oracle/describe-image@1',
|
|
1720
|
+
i18n: {
|
|
1721
|
+
name: { en: 'Describe image' },
|
|
1722
|
+
description: { en: 'Shows a model that reads pictures an image and asks it one question about it.' },
|
|
1723
|
+
},
|
|
1724
|
+
shape: S.textGen,
|
|
1725
|
+
effects: 'external',
|
|
1726
|
+
/** The instruction is config and the images are references: approve or refuse. */
|
|
1727
|
+
review: { fields: [] },
|
|
1728
|
+
timeoutMs: 120000,
|
|
1729
|
+
timeoutKind: 'idle',
|
|
1730
|
+
usage: 'response.usage',
|
|
1731
|
+
slots: {
|
|
1732
|
+
loadout: LOADOUT_SLOT,
|
|
1733
|
+
connection: {
|
|
1734
|
+
kind: 'connection',
|
|
1735
|
+
quick: true,
|
|
1736
|
+
shape: S.textGen,
|
|
1737
|
+
/** A model that reads images — the job default this resolves to when unset. */
|
|
1738
|
+
requires: [tf({ in: [IoKinds.text, IoKinds.image], out: [IoKinds.text] })],
|
|
1739
|
+
description: 'Which model reads the picture. It must be one that can see images.',
|
|
1740
|
+
},
|
|
1741
|
+
sampling: {
|
|
1742
|
+
kind: 'sampling',
|
|
1743
|
+
quick: true,
|
|
1744
|
+
shape: S.textGen,
|
|
1745
|
+
description: 'The sampling settings used for this request.',
|
|
1746
|
+
},
|
|
1747
|
+
prompts: {
|
|
1748
|
+
kind: 'prompts',
|
|
1749
|
+
quick: true,
|
|
1750
|
+
facet: 'prompts',
|
|
1751
|
+
description: 'The question the model is asked about the picture.',
|
|
1752
|
+
fields: {
|
|
1753
|
+
instruction: { type: 'text' },
|
|
1754
|
+
},
|
|
1755
|
+
},
|
|
1756
|
+
},
|
|
1757
|
+
media: { accepts: ['image'] },
|
|
1758
|
+
ports: {
|
|
1759
|
+
in: {
|
|
1760
|
+
/** The pictures to read, in order. Empty refuses: there is nothing to describe. */
|
|
1761
|
+
images: S.mediaList,
|
|
1762
|
+
},
|
|
1763
|
+
out: {
|
|
1764
|
+
main: S.text,
|
|
1765
|
+
text: S.text,
|
|
1766
|
+
},
|
|
1767
|
+
},
|
|
1768
|
+
}));
|
|
1386
1769
|
//# sourceMappingURL=oracles.js.map
|