@serene-pub/contracts 0.6.0-pr-6 β†’ 0.6.0-pr-8

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/tasks.d.ts CHANGED
@@ -1480,6 +1480,15 @@ export declare const assemble: import("@serene-pub/sdk").Pinned<import("@serene-
1480
1480
  * records.
1481
1481
  */
1482
1482
  decisions: string;
1483
+ /**
1484
+ * 🚧 Optional: the summaries of earlier scenes, fed only by
1485
+ * `core:query/earlier-scenes@1`'s `main`. Unwired, the block is
1486
+ * empty and the prompt is what it was. The binding renders into
1487
+ * `earlierScenes` only the scenes whose first line is older than
1488
+ * the first line the prompt keeps, newest first under
1489
+ * `maxTokens`, and its transcript fit counts the block.
1490
+ */
1491
+ earlierScenes: string;
1483
1492
  /**
1484
1493
  * The finished chat lines, from `core:task/process-messages@1`.
1485
1494
  *
@@ -1571,6 +1580,11 @@ export declare const assemble: import("@serene-pub/sdk").Pinned<import("@serene-
1571
1580
  readonly optional: true;
1572
1581
  readonly description: 'History entries that fit the budget, laid out.';
1573
1582
  };
1583
+ readonly earlierScenes: {
1584
+ readonly type: 'string';
1585
+ readonly optional: true;
1586
+ readonly description: 'The summaries of earlier scenes whose lines are no longer in the prompt, laid out.';
1587
+ };
1574
1588
  readonly currentDate: {
1575
1589
  readonly type: 'string';
1576
1590
  readonly optional: true;
@@ -1727,6 +1741,7 @@ export declare const assemble: import("@serene-pub/sdk").Pinned<import("@serene-
1727
1741
  readonly worldLore: "core:var/world-lore@1";
1728
1742
  readonly characterLore: "core:var/character-lore@1";
1729
1743
  readonly history: "core:var/history@1";
1744
+ readonly earlierScenes: "core:var/earlier-scenes@1";
1730
1745
  readonly currentDate: "core:var/current-date@1";
1731
1746
  };
1732
1747
  /**
@@ -3319,7 +3334,8 @@ export declare const turnNarrator: import("@serene-pub/sdk").Pinned<import("@ser
3319
3334
  * genre's narrate action; a plain narrator reply when unset), unless a
3320
3335
  * narration already landed since the person's line.
3321
3336
  *
3322
- * `modes` is `{ 'side-cast': …, 'narrator-interjections': … }` β€” `full` or
3337
+ * `modes` is `{ 'side-cast': …, 'narrator-interjections': … }` (plus `narrator-every`,
3338
+ * 1–3: the narrator's cadence in rounds; absent = every round) β€” `full` or
3323
3339
  * `off` each, the genre's voices settings as the turn-order spec reads them
3324
3340
  * (`core:script/unprompted-modes`, 2026-10-20; was the retired background
3325
3341
  * tasks' modes); a key absent or `off` adds nothing, so the order passes
@@ -3407,7 +3423,7 @@ export declare const turnPool: import("@serene-pub/sdk").Pinned<import("@serene-
3407
3423
  readonly en: "All";
3408
3424
  };
3409
3425
  readonly description: {
3410
- readonly en: "Ones switched off in the cast too.";
3426
+ readonly en: "The same as Active today, kept so presets that name it still load. A benched character never takes a turn.";
3411
3427
  };
3412
3428
  }, {
3413
3429
  readonly key: "none";
@@ -3420,7 +3436,7 @@ export declare const turnPool: import("@serene-pub/sdk").Pinned<import("@serene-
3420
3436
  readonly en: "Characters";
3421
3437
  };
3422
3438
  readonly description: {
3423
- readonly en: "Which of the session's characters may take a turn. 'All' admits ones switched off in the cast; a removed character never is.";
3439
+ readonly en: "Which of the session's characters may take a turn. A benched or removed character never does, whichever is picked; 'All' is the same as 'Active'.";
3424
3440
  };
3425
3441
  };
3426
3442
  readonly personas: {
@@ -5213,12 +5229,12 @@ export declare const picturePlacement: import("@serene-pub/sdk").Pinned<import("
5213
5229
  * and whether it moves at all (2026-10-13, PROPOSAL-live-scenes Β§6).
5214
5230
  *
5215
5231
  * Two uses, one shape. *Time passes…* hands it the press's collected
5216
- * `step` (`input.clockStep`), which wins. Chat's reply hands it nothing and
5217
- * reads its own parameters β€” **By** (0, the default, is off) and **Unit** β€”
5218
- * exposed as the session setting *Each reply advances the clock by …*. Either
5219
- * way the step publishes `moves` (true when `by` is a whole number other than
5220
- * zero), and the *Advance story clock* outlet sits behind a junction on it,
5221
- * so a step of nothing is never written and never refused. Pure: no read, no
5232
+ * `step` (`input.clockStep`), which wins. The round tick and the Lair's
5233
+ * keeper hand it the round worth's `step` (`core:query/round-worth@1`). Its
5234
+ * own **By** (0, the default, is off) and **Unit** answer when nothing is
5235
+ * handed. Either way the step publishes `moves` (true when `by` is a whole
5236
+ * number other than zero), and the *Advance story clock* outlet sits behind a
5237
+ * junction on it, so a step of nothing is never written and never refused. Pure: no read, no
5222
5238
  * model, never the clock itself.
5223
5239
  * @experimental
5224
5240
  */
@@ -5234,9 +5250,10 @@ export declare const clockStep: import("@serene-pub/sdk").Pinned<import("@serene
5234
5250
  /** A collected step, `{ by, unit }` β€” wins over the parameters when it reads. */
5235
5251
  step: string;
5236
5252
  /**
5237
- * When truthy, the clock does not move (`moves` false). Chat's
5238
- * reply wires the row it re-drives (`input.messageId`), so a
5239
- * regenerate, a swipe or an extend never ticks the clock twice.
5253
+ * When truthy, the clock does not move (`moves` false). Nothing in
5254
+ * core wires it since 2026-11-11; a pipeline that re-drives a row
5255
+ * wires it (`input.messageId`) so a regenerate never moves the
5256
+ * clock twice.
5240
5257
  */
5241
5258
  unless: string;
5242
5259
  }, "core:task/clock-step@1"> & {
@@ -5639,7 +5656,7 @@ export declare const reckoningDuties: import("@serene-pub/sdk").Pinned<import("@
5639
5656
  * JSON call every few turns that looks back over the story and files what is
5640
5657
  * worth keeping. Each duty is a switch; the routine's mode decides whether
5641
5658
  * what it files is written (`full`) or held for review (`review`). Publishes
5642
- * `modes` keyed `summary`, `lore`, `cast`, `relationships`, `world-state`,
5659
+ * `modes` keyed `lore`, `cast`, `relationships`, `world-state`,
5643
5660
  * `scenes`, `goals`, `goal-reached`, `scene-moved-on` β€” the keys the sweep's scripts and
5644
5661
  * junctions read β€” and `any`. Duties that write a lorebook read Off in a
5645
5662
  * session with none. *Mark goals reached* (`goal-reached`) is read by the
@@ -5668,17 +5685,6 @@ export declare const sweepDuties: import("@serene-pub/sdk").Pinned<import("@sere
5668
5685
  readonly kind: "parameters";
5669
5686
  readonly facet: "behavior";
5670
5687
  readonly schema: {
5671
- summary: {
5672
- type: 'boolean';
5673
- default: boolean;
5674
- reach: 'owner';
5675
- label: {
5676
- en: string;
5677
- };
5678
- description: {
5679
- en: string;
5680
- };
5681
- };
5682
5688
  lore: {
5683
5689
  type: 'boolean';
5684
5690
  default: boolean;
@@ -5787,4 +5793,231 @@ export type JudgedSceneCheck = {
5787
5793
  readonly due: false;
5788
5794
  readonly why: string;
5789
5795
  };
5796
+ /**
5797
+ * 🚧 **Cue a line** β€” turn a line's text into the script it is spoken from
5798
+ * (`Cue[]`, PLAN-speech-connections-and-timbre Β§11.1). Pure and deterministic:
5799
+ * regex and locale tables, the same text giving the same cues, no model.
5800
+ *
5801
+ * - a quote opens **dialogue** (`quoteStyles`); `*…*` / `_…_` are **action**
5802
+ * (`asterisks`); `(…)` is an **aside**; the rest is **narration**;
5803
+ * - `Name:` at the start of a run, where the name is one of `cast`, switches
5804
+ * the cue's `speaker` (multi-voice lines);
5805
+ * - inline expression markers the model wrote β€” `[angry]`, `<laugh>`,
5806
+ * `*sighs*`, `(((word)))` β€” are lifted off the text into `markers`, never
5807
+ * spoken; a marker the shipped marker table knows sets that cue's
5808
+ * inflection, else the line's `inflection` label does (Β§11.2);
5809
+ * - `voices` maps each kind to a voice; code blocks are dropped.
5810
+ *
5811
+ * `inflection` takes a sprite pick as it is (`sprite-pick@1` is assignable to
5812
+ * `inflection@1`): the sprite a line was given is the inflection it is spoken with.
5813
+ * @experimental
5814
+ */
5815
+ export declare const cueLines: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
5816
+ main: string;
5817
+ cues: string;
5818
+ }, {
5819
+ /** The line's text, as written. */
5820
+ text: string;
5821
+ /** Whose line it is β€” the voice `speaker` cues take. */
5822
+ speaker: string;
5823
+ /** The line's recorded inflection β€” a sprite pick wires in as it is. */
5824
+ inflection: string;
5825
+ /** `string[]` β€” the cast's names, which `Name:` may switch to. */
5826
+ cast: string;
5827
+ }, "core:task/cue-lines@1"> & {
5828
+ kind: 'task';
5829
+ slots?: {
5830
+ readonly params: {
5831
+ readonly kind: "parameters";
5832
+ readonly facet: "behavior";
5833
+ readonly schema: {
5834
+ readonly quoteStyles: {
5835
+ readonly type: "list";
5836
+ readonly item: {
5837
+ readonly type: "string";
5838
+ };
5839
+ readonly default: readonly string[];
5840
+ readonly label: {
5841
+ readonly en: "Quote marks";
5842
+ };
5843
+ readonly description: {
5844
+ readonly en: "The marks that open and close dialogue β€” each entry is the opening mark then the closing one.";
5845
+ };
5846
+ };
5847
+ readonly asterisks: {
5848
+ readonly type: "enum";
5849
+ readonly of: readonly ["action", "emphasis", "ignore"];
5850
+ readonly default: "action";
5851
+ readonly members: readonly [{
5852
+ readonly key: "action";
5853
+ readonly label: {
5854
+ readonly en: "Action";
5855
+ };
5856
+ readonly description: {
5857
+ readonly en: "*waves* is something done, read in the narrator's voice.";
5858
+ };
5859
+ }, {
5860
+ readonly key: "emphasis";
5861
+ readonly label: {
5862
+ readonly en: "Emphasis";
5863
+ };
5864
+ readonly description: {
5865
+ readonly en: "*really* is a stressed word, read in the line's own voice.";
5866
+ };
5867
+ }, {
5868
+ readonly key: "ignore";
5869
+ readonly label: {
5870
+ readonly en: "Ignore";
5871
+ };
5872
+ readonly description: {
5873
+ readonly en: "Asterisks are dropped and the words read as they stand.";
5874
+ };
5875
+ }];
5876
+ readonly label: {
5877
+ readonly en: "Text between asterisks";
5878
+ };
5879
+ };
5880
+ readonly voices: {
5881
+ readonly type: "object";
5882
+ readonly label: {
5883
+ readonly en: "Who speaks what";
5884
+ };
5885
+ readonly description: {
5886
+ readonly en: "Which voice reads dialogue, narration, actions and asides.";
5887
+ };
5888
+ readonly default: Readonly<Record<"action" | "aside" | "dialogue" | "narration", "narrator" | "silent" | "speaker">>;
5889
+ readonly fields: {
5890
+ readonly dialogue: {
5891
+ readonly type: "enum";
5892
+ readonly of: readonly ["speaker", "narrator", "silent"];
5893
+ readonly default: "narrator" | "silent" | "speaker";
5894
+ readonly members: readonly [{
5895
+ readonly key: 'speaker';
5896
+ readonly label: {
5897
+ readonly en: "The speaker's voice";
5898
+ };
5899
+ }, {
5900
+ readonly key: 'narrator';
5901
+ readonly label: {
5902
+ readonly en: "The narrator's voice";
5903
+ };
5904
+ }, {
5905
+ readonly key: 'silent';
5906
+ readonly label: {
5907
+ readonly en: 'Not spoken';
5908
+ };
5909
+ }];
5910
+ readonly label: {
5911
+ readonly en: "Dialogue";
5912
+ };
5913
+ };
5914
+ readonly narration: {
5915
+ readonly type: "enum";
5916
+ readonly of: readonly ["speaker", "narrator", "silent"];
5917
+ readonly default: "narrator" | "silent" | "speaker";
5918
+ readonly members: readonly [{
5919
+ readonly key: 'speaker';
5920
+ readonly label: {
5921
+ readonly en: "The speaker's voice";
5922
+ };
5923
+ }, {
5924
+ readonly key: 'narrator';
5925
+ readonly label: {
5926
+ readonly en: "The narrator's voice";
5927
+ };
5928
+ }, {
5929
+ readonly key: 'silent';
5930
+ readonly label: {
5931
+ readonly en: 'Not spoken';
5932
+ };
5933
+ }];
5934
+ readonly label: {
5935
+ readonly en: "Narration";
5936
+ };
5937
+ };
5938
+ readonly action: {
5939
+ readonly type: "enum";
5940
+ readonly of: readonly ["speaker", "narrator", "silent"];
5941
+ readonly default: "narrator" | "silent" | "speaker";
5942
+ readonly members: readonly [{
5943
+ readonly key: 'speaker';
5944
+ readonly label: {
5945
+ readonly en: "The speaker's voice";
5946
+ };
5947
+ }, {
5948
+ readonly key: 'narrator';
5949
+ readonly label: {
5950
+ readonly en: "The narrator's voice";
5951
+ };
5952
+ }, {
5953
+ readonly key: 'silent';
5954
+ readonly label: {
5955
+ readonly en: 'Not spoken';
5956
+ };
5957
+ }];
5958
+ readonly label: {
5959
+ readonly en: "Actions";
5960
+ };
5961
+ };
5962
+ readonly aside: {
5963
+ readonly type: "enum";
5964
+ readonly of: readonly ["speaker", "narrator", "silent"];
5965
+ readonly default: "narrator" | "silent" | "speaker";
5966
+ readonly members: readonly [{
5967
+ readonly key: 'speaker';
5968
+ readonly label: {
5969
+ readonly en: "The speaker's voice";
5970
+ };
5971
+ }, {
5972
+ readonly key: 'narrator';
5973
+ readonly label: {
5974
+ readonly en: "The narrator's voice";
5975
+ };
5976
+ }, {
5977
+ readonly key: 'silent';
5978
+ readonly label: {
5979
+ readonly en: 'Not spoken';
5980
+ };
5981
+ }];
5982
+ readonly label: {
5983
+ readonly en: "Asides";
5984
+ };
5985
+ };
5986
+ };
5987
+ };
5988
+ readonly language: {
5989
+ readonly type: "string";
5990
+ readonly default: "";
5991
+ readonly label: {
5992
+ readonly en: "Language";
5993
+ };
5994
+ readonly description: {
5995
+ readonly en: "ISO 639-1 code whose quote and number rules apply. Blank reads the line's own script.";
5996
+ };
5997
+ };
5998
+ };
5999
+ };
6000
+ } | undefined;
6001
+ }>;
6002
+ /**
6003
+ * 🚧 **Read a drafted card or book** (M2c path B, owner ruling 2026-10-31): a reply that drafts a character card or
6004
+ * a lorebook ends with one hidden block β€” `<!--draft:character {…}-->` or `<!--draft:lorebook {…}-->`, an HTML
6005
+ * comment the message renderer never shows, even while the reply streams. This step takes every such block out of
6006
+ * the reply (`text`, what is saved) and reads the last one: `make` is `'character'`, `'lorebook'` or `''`, and
6007
+ * `draft` its JSON, for `create-character@1` / `create-lorebook@1` behind a junction on `make`. One model call per
6008
+ * turn β€” the reply's own β€” and no tool loop. Also turns a plain `See: /docs/<path>` line into a markdown link. Pure (the SDK's `readLibraryDraft`). ⚠ Not `parse-json@1` (a whole reply
6009
+ * read as JSON) and not `parse-tool-call@1`.
6010
+ * @experimental
6011
+ */
6012
+ export declare const readLibraryDraft: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
6013
+ main: string;
6014
+ text: string;
6015
+ make: string;
6016
+ draft: string;
6017
+ }, {
6018
+ text: string;
6019
+ }, "core:task/read-library-draft@1"> & {
6020
+ kind: 'task';
6021
+ slots?: Record<string, SlotDecl> | undefined;
6022
+ }>;
5790
6023
  //# sourceMappingURL=tasks.d.ts.map
package/dist/tasks.js CHANGED
@@ -8,6 +8,7 @@ import { S, tf, IoKinds } from '@serene-pub/sdk';
8
8
  import { handlebars, liquid } from '@serene-pub/sdk';
9
9
  import { describeTaskDefinition, pin } from '@serene-pub/sdk';
10
10
  import { PROMPT_BLOCKS_DECL } from '@serene-pub/sdk';
11
+ import { ASTERISK_READINGS, CUE_VOICES, DEFAULT_CUE_VOICES, DEFAULT_QUOTE_STYLES } from '@serene-pub/sdk';
11
12
  // ── Tasks ───────────────────────────────────────────────────────────────────
12
13
  /** @public */
13
14
  export const contextBudget = pin(describeTaskDefinition({
@@ -1154,6 +1155,11 @@ const ASSEMBLE_TEMPLATE_SCOPE = {
1154
1155
  description: 'Lore bound to a cast member that fit the budget, laid out β€” only what this speaker may see.',
1155
1156
  },
1156
1157
  history: { type: 'string', optional: true, description: 'History entries that fit the budget, laid out.' },
1158
+ earlierScenes: {
1159
+ type: 'string',
1160
+ optional: true,
1161
+ description: 'The summaries of earlier scenes whose lines are no longer in the prompt, laid out.',
1162
+ },
1157
1163
  currentDate: { type: 'string', optional: true, description: 'The story’s current date, laid out.' },
1158
1164
  sessionMessages: {
1159
1165
  type: 'list',
@@ -1284,6 +1290,7 @@ export const assemble = pin(describeTaskDefinition({
1284
1290
  worldLore: 'core:var/world-lore@1',
1285
1291
  characterLore: 'core:var/character-lore@1',
1286
1292
  history: 'core:var/history@1',
1293
+ earlierScenes: 'core:var/earlier-scenes@1',
1287
1294
  currentDate: 'core:var/current-date@1',
1288
1295
  },
1289
1296
  /**
@@ -1434,6 +1441,15 @@ export const assemble = pin(describeTaskDefinition({
1434
1441
  * records.
1435
1442
  */
1436
1443
  decisions: S.decisions,
1444
+ /**
1445
+ * 🚧 Optional: the summaries of earlier scenes, fed only by
1446
+ * `core:query/earlier-scenes@1`'s `main`. Unwired, the block is
1447
+ * empty and the prompt is what it was. The binding renders into
1448
+ * `earlierScenes` only the scenes whose first line is older than
1449
+ * the first line the prompt keeps, newest first under
1450
+ * `maxTokens`, and its transcript fit counts the block.
1451
+ */
1452
+ earlierScenes: S.json,
1437
1453
  /**
1438
1454
  * The finished chat lines, from `core:task/process-messages@1`.
1439
1455
  *
@@ -2785,7 +2801,8 @@ export const turnNarrator = pin(turnStrategy('core:task/turn-narrator@1', 'Narra
2785
2801
  * genre's narrate action; a plain narrator reply when unset), unless a
2786
2802
  * narration already landed since the person's line.
2787
2803
  *
2788
- * `modes` is `{ 'side-cast': …, 'narrator-interjections': … }` β€” `full` or
2804
+ * `modes` is `{ 'side-cast': …, 'narrator-interjections': … }` (plus `narrator-every`,
2805
+ * 1–3: the narrator's cadence in rounds; absent = every round) β€” `full` or
2789
2806
  * `off` each, the genre's voices settings as the turn-order spec reads them
2790
2807
  * (`core:script/unprompted-modes`, 2026-10-20; was the retired background
2791
2808
  * tasks' modes); a key absent or `off` adds nothing, so the order passes
@@ -2864,14 +2881,16 @@ export const turnPool = pin(describeTaskDefinition({
2864
2881
  {
2865
2882
  key: 'all',
2866
2883
  label: { en: 'All' },
2867
- description: { en: 'Ones switched off in the cast too.' },
2884
+ description: {
2885
+ en: 'The same as Active today, kept so presets that name it still load. A benched character never takes a turn.',
2886
+ },
2868
2887
  },
2869
2888
  { key: 'none', label: { en: 'None' } },
2870
2889
  ],
2871
2890
  default: 'active',
2872
2891
  label: { en: 'Characters' },
2873
2892
  description: {
2874
- en: "Which of the session's characters may take a turn. 'All' admits ones switched off in the cast; a removed character never is.",
2893
+ en: "Which of the session's characters may take a turn. A benched or removed character never does, whichever is picked; 'All' is the same as 'Active'.",
2875
2894
  },
2876
2895
  },
2877
2896
  personas: {
@@ -4618,12 +4637,12 @@ export const picturePlacement = pin(describeTaskDefinition({
4618
4637
  * and whether it moves at all (2026-10-13, PROPOSAL-live-scenes Β§6).
4619
4638
  *
4620
4639
  * Two uses, one shape. *Time passes…* hands it the press's collected
4621
- * `step` (`input.clockStep`), which wins. Chat's reply hands it nothing and
4622
- * reads its own parameters β€” **By** (0, the default, is off) and **Unit** β€”
4623
- * exposed as the session setting *Each reply advances the clock by …*. Either
4624
- * way the step publishes `moves` (true when `by` is a whole number other than
4625
- * zero), and the *Advance story clock* outlet sits behind a junction on it,
4626
- * so a step of nothing is never written and never refused. Pure: no read, no
4640
+ * `step` (`input.clockStep`), which wins. The round tick and the Lair's
4641
+ * keeper hand it the round worth's `step` (`core:query/round-worth@1`). Its
4642
+ * own **By** (0, the default, is off) and **Unit** answer when nothing is
4643
+ * handed. Either way the step publishes `moves` (true when `by` is a whole
4644
+ * number other than zero), and the *Advance story clock* outlet sits behind a
4645
+ * junction on it, so a step of nothing is never written and never refused. Pure: no read, no
4627
4646
  * model, never the clock itself.
4628
4647
  * @experimental
4629
4648
  */
@@ -4667,9 +4686,10 @@ export const clockStep = pin(describeTaskDefinition({
4667
4686
  /** A collected step, `{ by, unit }` β€” wins over the parameters when it reads. */
4668
4687
  step: S.json,
4669
4688
  /**
4670
- * When truthy, the clock does not move (`moves` false). Chat's
4671
- * reply wires the row it re-drives (`input.messageId`), so a
4672
- * regenerate, a swipe or an extend never ticks the clock twice.
4689
+ * When truthy, the clock does not move (`moves` false). Nothing in
4690
+ * core wires it since 2026-11-11; a pipeline that re-drives a row
4691
+ * wires it (`input.messageId`) so a regenerate never moves the
4692
+ * clock twice.
4673
4693
  */
4674
4694
  unless: S.json,
4675
4695
  },
@@ -4987,7 +5007,7 @@ export const reckoningDuties = pin(describeTaskDefinition({
4987
5007
  * JSON call every few turns that looks back over the story and files what is
4988
5008
  * worth keeping. Each duty is a switch; the routine's mode decides whether
4989
5009
  * what it files is written (`full`) or held for review (`review`). Publishes
4990
- * `modes` keyed `summary`, `lore`, `cast`, `relationships`, `world-state`,
5010
+ * `modes` keyed `lore`, `cast`, `relationships`, `world-state`,
4991
5011
  * `scenes`, `goals`, `goal-reached`, `scene-moved-on` β€” the keys the sweep's scripts and
4992
5012
  * junctions read β€” and `any`. Duties that write a lorebook read Off in a
4993
5013
  * session with none. *Mark goals reached* (`goal-reached`) is read by the
@@ -4999,7 +5019,7 @@ export const sweepDuties = pin(describeTaskDefinition({
4999
5019
  i18n: {
5000
5020
  name: { en: 'Look back over the story' },
5001
5021
  description: {
5002
- en: 'Switches for what is filed every few turns: a summary, lore, people, how they stand, the world, places, goals. How it lands is the routine’s mode.',
5022
+ en: 'Switches for what is filed every few turns: lore, people, how they stand, the world, places, goals. How it lands is the routine’s mode.',
5003
5023
  },
5004
5024
  },
5005
5025
  timeoutMs: 500,
@@ -5008,7 +5028,6 @@ export const sweepDuties = pin(describeTaskDefinition({
5008
5028
  kind: 'parameters',
5009
5029
  facet: 'behavior',
5010
5030
  schema: {
5011
- summary: duty('Summarize the story', 'Files a summary of what happened in the lorebook’s history.', true),
5012
5031
  lore: duty('Add to the lore', 'Files new facts the story established as lorebook entries.', true),
5013
5032
  cast: duty('Note new people', 'Files the people the story introduced as lorebook entries.', true),
5014
5033
  relationships: duty('Track relationships', 'Proposes how the characters now stand with each other, for you to look over.', false),
@@ -5029,4 +5048,145 @@ export const sweepDuties = pin(describeTaskDefinition({
5029
5048
  },
5030
5049
  },
5031
5050
  }));
5051
+ // ── 🚧 Speech (PLAN-speech-build S3, 2026-10-28) ────────────────────────────
5052
+ /** The three voices a cue may take, as the picker shows them. */
5053
+ const CUE_VOICE_MEMBERS = [
5054
+ { key: 'speaker', label: { en: "The speaker's voice" } },
5055
+ { key: 'narrator', label: { en: "The narrator's voice" } },
5056
+ { key: 'silent', label: { en: 'Not spoken' } },
5057
+ ];
5058
+ /**
5059
+ * 🚧 **Cue a line** β€” turn a line's text into the script it is spoken from
5060
+ * (`Cue[]`, PLAN-speech-connections-and-timbre Β§11.1). Pure and deterministic:
5061
+ * regex and locale tables, the same text giving the same cues, no model.
5062
+ *
5063
+ * - a quote opens **dialogue** (`quoteStyles`); `*…*` / `_…_` are **action**
5064
+ * (`asterisks`); `(…)` is an **aside**; the rest is **narration**;
5065
+ * - `Name:` at the start of a run, where the name is one of `cast`, switches
5066
+ * the cue's `speaker` (multi-voice lines);
5067
+ * - inline expression markers the model wrote β€” `[angry]`, `<laugh>`,
5068
+ * `*sighs*`, `(((word)))` β€” are lifted off the text into `markers`, never
5069
+ * spoken; a marker the shipped marker table knows sets that cue's
5070
+ * inflection, else the line's `inflection` label does (Β§11.2);
5071
+ * - `voices` maps each kind to a voice; code blocks are dropped.
5072
+ *
5073
+ * `inflection` takes a sprite pick as it is (`sprite-pick@1` is assignable to
5074
+ * `inflection@1`): the sprite a line was given is the inflection it is spoken with.
5075
+ * @experimental
5076
+ */
5077
+ export const cueLines = pin(describeTaskDefinition({
5078
+ id: 'core:task/cue-lines@1',
5079
+ i18n: { name: { en: 'Cue a line' } },
5080
+ effects: 'none',
5081
+ timeoutMs: 1000,
5082
+ slots: {
5083
+ params: {
5084
+ kind: 'parameters',
5085
+ facet: 'behavior',
5086
+ schema: {
5087
+ quoteStyles: {
5088
+ type: 'list',
5089
+ item: { type: 'string' },
5090
+ default: DEFAULT_QUOTE_STYLES,
5091
+ label: { en: 'Quote marks' },
5092
+ description: {
5093
+ en: 'The marks that open and close dialogue β€” each entry is the opening mark then the closing one.',
5094
+ },
5095
+ },
5096
+ asterisks: {
5097
+ type: 'enum',
5098
+ of: ASTERISK_READINGS,
5099
+ default: 'action',
5100
+ members: [
5101
+ { key: 'action', label: { en: 'Action' }, description: { en: '*waves* is something done, read in the narrator\'s voice.' } },
5102
+ { key: 'emphasis', label: { en: 'Emphasis' }, description: { en: '*really* is a stressed word, read in the line\'s own voice.' } },
5103
+ { key: 'ignore', label: { en: 'Ignore' }, description: { en: 'Asterisks are dropped and the words read as they stand.' } },
5104
+ ],
5105
+ label: { en: 'Text between asterisks' },
5106
+ },
5107
+ voices: {
5108
+ type: 'object',
5109
+ label: { en: 'Who speaks what' },
5110
+ description: {
5111
+ en: 'Which voice reads dialogue, narration, actions and asides.',
5112
+ },
5113
+ default: DEFAULT_CUE_VOICES,
5114
+ fields: {
5115
+ dialogue: {
5116
+ type: 'enum',
5117
+ of: CUE_VOICES,
5118
+ default: DEFAULT_CUE_VOICES.dialogue,
5119
+ members: CUE_VOICE_MEMBERS,
5120
+ label: { en: 'Dialogue' },
5121
+ },
5122
+ narration: {
5123
+ type: 'enum',
5124
+ of: CUE_VOICES,
5125
+ default: DEFAULT_CUE_VOICES.narration,
5126
+ members: CUE_VOICE_MEMBERS,
5127
+ label: { en: 'Narration' },
5128
+ },
5129
+ action: {
5130
+ type: 'enum',
5131
+ of: CUE_VOICES,
5132
+ default: DEFAULT_CUE_VOICES.action,
5133
+ members: CUE_VOICE_MEMBERS,
5134
+ label: { en: 'Actions' },
5135
+ },
5136
+ aside: {
5137
+ type: 'enum',
5138
+ of: CUE_VOICES,
5139
+ default: DEFAULT_CUE_VOICES.aside,
5140
+ members: CUE_VOICE_MEMBERS,
5141
+ label: { en: 'Asides' },
5142
+ },
5143
+ },
5144
+ },
5145
+ language: {
5146
+ type: 'string',
5147
+ default: '',
5148
+ label: { en: 'Language' },
5149
+ description: {
5150
+ en: "ISO 639-1 code whose quote and number rules apply. Blank reads the line's own script.",
5151
+ },
5152
+ },
5153
+ },
5154
+ },
5155
+ },
5156
+ ports: {
5157
+ in: {
5158
+ /** The line's text, as written. */
5159
+ text: S.text,
5160
+ /** Whose line it is β€” the voice `speaker` cues take. */
5161
+ speaker: S.participantRef,
5162
+ /** The line's recorded inflection β€” a sprite pick wires in as it is. */
5163
+ inflection: S.inflection,
5164
+ /** `string[]` β€” the cast's names, which `Name:` may switch to. */
5165
+ cast: S.json,
5166
+ },
5167
+ out: {
5168
+ main: S.cues,
5169
+ cues: S.cues,
5170
+ },
5171
+ },
5172
+ }));
5173
+ /**
5174
+ * 🚧 **Read a drafted card or book** (M2c path B, owner ruling 2026-10-31): a reply that drafts a character card or
5175
+ * a lorebook ends with one hidden block β€” `<!--draft:character {…}-->` or `<!--draft:lorebook {…}-->`, an HTML
5176
+ * comment the message renderer never shows, even while the reply streams. This step takes every such block out of
5177
+ * the reply (`text`, what is saved) and reads the last one: `make` is `'character'`, `'lorebook'` or `''`, and
5178
+ * `draft` its JSON, for `create-character@1` / `create-lorebook@1` behind a junction on `make`. One model call per
5179
+ * turn β€” the reply's own β€” and no tool loop. Also turns a plain `See: /docs/<path>` line into a markdown link. Pure (the SDK's `readLibraryDraft`). ⚠ Not `parse-json@1` (a whole reply
5180
+ * read as JSON) and not `parse-tool-call@1`.
5181
+ * @experimental
5182
+ */
5183
+ export const readLibraryDraft = pin(describeTaskDefinition({
5184
+ id: 'core:task/read-library-draft@1',
5185
+ i18n: { name: { en: 'Read a drafted card or book' } },
5186
+ timeoutMs: 500,
5187
+ ports: {
5188
+ in: { text: S.text },
5189
+ out: { main: S.json, text: S.text, make: S.text, draft: S.json },
5190
+ },
5191
+ }));
5032
5192
  //# sourceMappingURL=tasks.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serene-pub/contracts",
3
- "version": "0.6.0-pr-6",
3
+ "version": "0.6.0-pr-8",
4
4
  "description": "Generated, frozen type declarations for one Serene Pub release: @serene-pub/contracts@0.6.x compiles against Serene Pub 0.6.x.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/SerenePub/serene-pub-sdk/tree/main/contracts#readme",
@@ -40,13 +40,13 @@
40
40
  "./package.json": "./package.json"
41
41
  },
42
42
  "peerDependencies": {
43
- "@serene-pub/sdk": "^0.6.0-pr-6"
43
+ "@serene-pub/sdk": "^0.6.0-pr-8"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsc -p tsconfig.build.json"
47
47
  },
48
48
  "devDependencies": {
49
- "@serene-pub/sdk": "0.6.0-pr-6"
49
+ "@serene-pub/sdk": "0.6.0-pr-8"
50
50
  },
51
51
  "publishConfig": {
52
52
  "access": "public",