@serene-pub/contracts 0.6.0-pr-5 → 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/inlets.d.ts +183 -0
- package/dist/inlets.js +350 -2
- package/dist/oracles.d.ts +132 -0
- package/dist/oracles.js +137 -2
- package/dist/outlets.d.ts +389 -0
- package/dist/outlets.js +411 -6
- package/dist/queries.d.ts +70 -1
- package/dist/queries.js +82 -2
- package/dist/tasks.d.ts +509 -7
- package/dist/tasks.js +385 -7
- package/package.json +3 -3
package/dist/oracles.d.ts
CHANGED
|
@@ -340,6 +340,21 @@ export declare const generateText: import("@serene-pub/sdk").Pinned<import("@ser
|
|
|
340
340
|
readonly shape: string;
|
|
341
341
|
readonly description: "The sampling settings — temperature and friends — used for this request.";
|
|
342
342
|
};
|
|
343
|
+
/**
|
|
344
|
+
* 🚧 **Speech sampling** (O7, evolved in place 2026-10-21): the
|
|
345
|
+
* second sampling slot a call takes when its `outputs` ask for
|
|
346
|
+
* audio — the TTS vocabulary (voice, speed, …) beside the text one
|
|
347
|
+
* above, one sampling per kind written. Read only when audio is
|
|
348
|
+
* asked for; unset, it is the Narration loadout's (`text->audio`
|
|
349
|
+
* default) sampling. ⚠ Not `sampling`: that one says how the reply
|
|
350
|
+
* is WRITTEN, this one how it is SPOKEN.
|
|
351
|
+
* @ruling O7
|
|
352
|
+
*/
|
|
353
|
+
readonly speechSampling: {
|
|
354
|
+
readonly kind: "sampling";
|
|
355
|
+
readonly shape: string;
|
|
356
|
+
readonly description: "How a spoken reply sounds — the voice and its speed. Read only when this step asks for audio.";
|
|
357
|
+
};
|
|
343
358
|
/**
|
|
344
359
|
* ⚠ No `prompts` slot, and there was one — `system` and
|
|
345
360
|
* `postHistory`, "the written instructions sent with every request
|
|
@@ -371,6 +386,27 @@ export declare const generateText: import("@serene-pub/sdk").Pinned<import("@ser
|
|
|
371
386
|
readonly description: "Sequences that end the reply the moment the model writes one. One per line.";
|
|
372
387
|
};
|
|
373
388
|
readonly streaming: FieldDecl<import("@serene-pub/sdk").FieldType, readonly string[]>;
|
|
389
|
+
/**
|
|
390
|
+
* 🚧 The **requested outputs** (O6, evolved in place
|
|
391
|
+
* 2026-10-20 — no @2 before 0.7): the kinds this call asks
|
|
392
|
+
* the model to write, in order. `['text']` — today's reply
|
|
393
|
+
* — unless stated. Asking for `audio` beside text makes the
|
|
394
|
+
* connection's requirement `text->text+audio`
|
|
395
|
+
* (`requirementForOutputs`): the bind check and fit derive
|
|
396
|
+
* it from here, and refuse in words where no reachable model
|
|
397
|
+
* writes audio. Open by kind (O1).
|
|
398
|
+
* @ruling O6
|
|
399
|
+
*/
|
|
400
|
+
readonly outputs: {
|
|
401
|
+
readonly type: "string[]";
|
|
402
|
+
readonly label: {
|
|
403
|
+
readonly en: "Outputs";
|
|
404
|
+
};
|
|
405
|
+
readonly description: {
|
|
406
|
+
readonly en: "What the model is asked to write, in order — text, and audio for a spoken reply. Text unless set.";
|
|
407
|
+
};
|
|
408
|
+
readonly default: readonly ["text"];
|
|
409
|
+
};
|
|
374
410
|
};
|
|
375
411
|
};
|
|
376
412
|
} | undefined;
|
|
@@ -593,6 +629,24 @@ export declare const generateJson: import("@serene-pub/sdk").Pinned<import("@ser
|
|
|
593
629
|
readonly description: "Sequences that end the reply the moment the model writes one. One per line.";
|
|
594
630
|
};
|
|
595
631
|
readonly streaming: FieldDecl<import("@serene-pub/sdk").FieldType, readonly string[]>;
|
|
632
|
+
/**
|
|
633
|
+
* 🚧 An empty answer read as an unreadable one (the Dungeon
|
|
634
|
+
* Crawler 100-turn walk, B7): `json` null and `parseError`
|
|
635
|
+
* saying the model returned nothing, and the step goes on —
|
|
636
|
+
* so a check placed after it can ask once more and then go on
|
|
637
|
+
* without the answer. Off (the default), an empty answer halts
|
|
638
|
+
* the run, as it always has. `@1` evolves in place.
|
|
639
|
+
*/
|
|
640
|
+
readonly emptyIsUnreadable: {
|
|
641
|
+
readonly type: "boolean";
|
|
642
|
+
readonly default: false;
|
|
643
|
+
readonly label: {
|
|
644
|
+
readonly en: "Go on after an empty answer";
|
|
645
|
+
};
|
|
646
|
+
readonly description: {
|
|
647
|
+
readonly en: "Read an empty answer as one that could not be read, and carry on, instead of stopping the run.";
|
|
648
|
+
};
|
|
649
|
+
};
|
|
596
650
|
};
|
|
597
651
|
};
|
|
598
652
|
} | undefined;
|
|
@@ -638,6 +692,84 @@ export declare const speak: import("@serene-pub/sdk").Pinned<import("@serene-pub
|
|
|
638
692
|
};
|
|
639
693
|
} | undefined;
|
|
640
694
|
}>;
|
|
695
|
+
/**
|
|
696
|
+
* 🚧 **Transcribe audio** (O9, 2026-10-21) — the explicit step that turns a
|
|
697
|
+
* sound the reply cannot hear into the words it says, BEFORE placement.
|
|
698
|
+
*
|
|
699
|
+
* Reads the transcript's files by message (`core:query/history-attachments@1`)
|
|
700
|
+
* and what the reply's call HEARS — `hears`, the `reads` the context budget
|
|
701
|
+
* publishes off the same pair (`ConnectionReadsV1`). Each audio file within
|
|
702
|
+
* `mediaLookback` messages of the end that the call cannot hear and that has
|
|
703
|
+
* no transcript yet is sent to this step's own model (`audio->text`, the
|
|
704
|
+
* Transcription loadout); the words are cached on the file, so a file is
|
|
705
|
+
* heard once, and handed on as `transcript` (and `text`, when the person gave
|
|
706
|
+
* no description). Placement then names the file with its words:
|
|
707
|
+
* `[audio: note.mp3 — "…"]`.
|
|
708
|
+
*
|
|
709
|
+
* Never silent, never a refusal of the reply: a call that hears audio itself,
|
|
710
|
+
* a transcript with no audio, and a cached transcript send nothing; with no
|
|
711
|
+
* model set up to transcribe, the files pass through untouched and `notes`
|
|
712
|
+
* says so on the receipt. `attachments` is the same record, transcripts
|
|
713
|
+
* filled in — wire it into `place-attachments@1` in place of the query's.
|
|
714
|
+
* ⚠ Not `speak@1` — that one SPEAKS; this one HEARS.
|
|
715
|
+
* @experimental
|
|
716
|
+
* @ruling O9
|
|
717
|
+
*/
|
|
718
|
+
export declare const transcribeAudio: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
719
|
+
main: string;
|
|
720
|
+
/** The same files, transcripts filled in. */
|
|
721
|
+
attachments: string;
|
|
722
|
+
/** Sentences for the receipt: what was transcribed, and what was not and why. */
|
|
723
|
+
notes: string;
|
|
724
|
+
}, {
|
|
725
|
+
/** The processed lines, for which messages are within the lookback. */
|
|
726
|
+
messages: string;
|
|
727
|
+
/** The files by message, from `core:query/history-attachments@1`. */
|
|
728
|
+
attachments: string;
|
|
729
|
+
/** What the reply's call reads — `context-budget@1`'s `reads`. */
|
|
730
|
+
hears: string;
|
|
731
|
+
}, "core:oracle/transcribe-audio@1"> & {
|
|
732
|
+
kind: 'oracle';
|
|
733
|
+
slots?: {
|
|
734
|
+
readonly loadout: {
|
|
735
|
+
readonly kind: 'loadout';
|
|
736
|
+
readonly quick: true;
|
|
737
|
+
};
|
|
738
|
+
readonly connection: {
|
|
739
|
+
readonly kind: "connection";
|
|
740
|
+
readonly quick: true;
|
|
741
|
+
readonly shape: string;
|
|
742
|
+
readonly requires: readonly ["audio->text"];
|
|
743
|
+
readonly description: "Which model hears the audio the reply cannot.";
|
|
744
|
+
};
|
|
745
|
+
readonly params: {
|
|
746
|
+
readonly kind: "parameters";
|
|
747
|
+
readonly facet: "weights";
|
|
748
|
+
readonly schema: {
|
|
749
|
+
readonly mediaLookback: {
|
|
750
|
+
readonly type: "integer";
|
|
751
|
+
readonly min: 0;
|
|
752
|
+
readonly default: 10;
|
|
753
|
+
readonly label: {
|
|
754
|
+
readonly en: "Media lookback (messages)";
|
|
755
|
+
};
|
|
756
|
+
readonly description: {
|
|
757
|
+
readonly 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.";
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
readonly language: {
|
|
761
|
+
readonly type: "string";
|
|
762
|
+
readonly label: {
|
|
763
|
+
readonly en: "Language";
|
|
764
|
+
};
|
|
765
|
+
readonly description: {
|
|
766
|
+
readonly en: "The language spoken, as a code such as \"en\" or \"fr\". Empty lets the model detect it.";
|
|
767
|
+
};
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
} | undefined;
|
|
772
|
+
}>;
|
|
641
773
|
/**
|
|
642
774
|
* Render an image.
|
|
643
775
|
*
|
package/dist/oracles.js
CHANGED
|
@@ -449,6 +449,21 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
449
449
|
shape: S.textGen,
|
|
450
450
|
description: 'The sampling settings — temperature and friends — used for this request.',
|
|
451
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
|
+
},
|
|
452
467
|
/**
|
|
453
468
|
* ⚠ No `prompts` slot, and there was one — `system` and
|
|
454
469
|
* `postHistory`, "the written instructions sent with every request
|
|
@@ -480,6 +495,25 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
480
495
|
description: 'Sequences that end the reply the moment the model writes one. One per line.',
|
|
481
496
|
},
|
|
482
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
|
+
},
|
|
483
517
|
},
|
|
484
518
|
},
|
|
485
519
|
},
|
|
@@ -498,8 +532,10 @@ export const generateText = pin(describeOracleDefinition({
|
|
|
498
532
|
* resolved at bind time.
|
|
499
533
|
*/
|
|
500
534
|
media: {
|
|
501
|
-
|
|
502
|
-
|
|
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'],
|
|
503
539
|
},
|
|
504
540
|
ports: {
|
|
505
541
|
in: {
|
|
@@ -764,6 +800,22 @@ export const generateJson = pin(describeOracleDefinition({
|
|
|
764
800
|
description: 'Sequences that end the reply the moment the model writes one. One per line.',
|
|
765
801
|
},
|
|
766
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
|
+
},
|
|
767
819
|
},
|
|
768
820
|
},
|
|
769
821
|
},
|
|
@@ -829,6 +881,89 @@ export const speak = pin(describeOracleDefinition({
|
|
|
829
881
|
},
|
|
830
882
|
ports: { in: { text: S.text }, out: { main: S.audio, audio: S.audio } },
|
|
831
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
|
+
}));
|
|
832
967
|
/**
|
|
833
968
|
* Render an image.
|
|
834
969
|
*
|