@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/queries.d.ts CHANGED
@@ -1352,12 +1352,233 @@ export declare const castPresences: import("@serene-pub/sdk").Pinned<import("@se
1352
1352
  main: string;
1353
1353
  /** The story date the session reads at, or null for the head. */
1354
1354
  at: string;
1355
+ /**
1356
+ * 🚧 `{ bindingId: number; where: string }[]` — where each cast member is at `atHour`, read
1357
+ * from the first `schedule` field on an entry they hold; a member with none is left out.
1358
+ */
1359
+ placements: string;
1355
1360
  }, {
1356
1361
  scope: string;
1362
+ /**
1363
+ * 🚧 The hour to place the cast at (M0, SHAPES L3): a clock target. Unwired,
1364
+ * the clock's present hour, today.
1365
+ */
1366
+ atHour: string;
1357
1367
  }, "core:query/cast-presences@1"> & {
1358
1368
  kind: 'query';
1359
1369
  slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1360
1370
  }>;
1371
+ /**
1372
+ * 🚧 **Minutes a round is worth** — the session's round worth, as a whole
1373
+ * number and as a clock step.
1374
+ *
1375
+ * It reads the session's `roundWorth` genre field from the settings document
1376
+ * (the cascade applied: the session's value, else its preset's, else the
1377
+ * genre's, else the field's default). `minutes` is a whole number ≥ 0; `step`
1378
+ * is `{ by: minutes, unit: 'minutes' }`, exactly what `core:task/clock-step@1`'s
1379
+ * `step` in-port takes; `main` is `{ minutes, step }`. All of it is 0 when the
1380
+ * genre places no `roundWorth` field (it has not opted in) or the session sets
1381
+ * 0 (off).
1382
+ *
1383
+ * It never reads or moves the clock and does not say whether one is set: gate
1384
+ * on `core:query/cast-presences@1`'s `at` for that.
1385
+ *
1386
+ * ⚠ Not the Dungeon Crawler Planner's round minutes (the time one round took,
1387
+ * judged), and not `core:task/clock-step@1`.
1388
+ * @experimental
1389
+ */
1390
+ export declare const roundWorth: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1391
+ /** `{ minutes, step }`. */
1392
+ main: string;
1393
+ /** The round worth as a whole number of minutes, ≥ 0. */
1394
+ minutes: string;
1395
+ /** `{ by: minutes, unit: 'minutes' }`: what `clock-step@1`'s `step` in-port takes. */
1396
+ step: string;
1397
+ }, {
1398
+ scope: string;
1399
+ }, "core:query/round-worth@1"> & {
1400
+ kind: 'query';
1401
+ slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1402
+ }>;
1403
+ /**
1404
+ * 🚧 One scene boundary the scenes routine found: the line it begins at, the boundary trigger that fired there, and its words. @experimental
1405
+ */
1406
+ export interface SceneBoundary {
1407
+ /** The message id the new scene begins at. */
1408
+ at: number;
1409
+ /** The boundary trigger that fired there: a core trigger key (`dayCrossed`, `placeChanged`, `timeAction`, `opening`, …) or a genre's declared one. */
1410
+ trigger: string;
1411
+ /** What the boundary trigger says, as the chip and the divider say it ("the day changed"). */
1412
+ reason: string;
1413
+ }
1414
+ /**
1415
+ * 🚧 **Where scenes begin** — the scenes routine's code-only look back over
1416
+ * the session's `main` channel (every name here is provisional).
1417
+ *
1418
+ * It walks the channel's standing lines up to the newest line that is at least
1419
+ * `depth` rounds old (a round as the turn order counts it), evaluates the
1420
+ * session's enabled boundary triggers line by line, and returns
1421
+ * `SceneBoundary[]` in line order on `main`. **A query writes nothing.**
1422
+ *
1423
+ * Where the walk starts is derived, never stored: after the latest of the
1424
+ * channel's latest scene boundary, its latest decided or offered scene cue, and
1425
+ * a branch's last copied line. `routine` is the routine inlet's `routine` port
1426
+ * (the firing); its cadence's `n` bounds how far back a session with none of
1427
+ * those looks. `depth` keeps a line that is swiped, retaken or taken back from
1428
+ * ever being read.
1429
+ *
1430
+ * ⚠ Not the judged scene check (the sweep's model question) and not
1431
+ * `core:outlet/propose-scene-cue@1` (which places).
1432
+ * @experimental
1433
+ */
1434
+ export declare const sceneBoundaries: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1435
+ main: string;
1436
+ }, {
1437
+ scope: string;
1438
+ routine: string;
1439
+ }, "core:query/scene-boundaries@1"> & {
1440
+ kind: 'query';
1441
+ slots?: {
1442
+ readonly params: {
1443
+ readonly kind: "parameters";
1444
+ readonly facet: "behavior";
1445
+ readonly schema: {
1446
+ readonly depth: {
1447
+ readonly type: "integer";
1448
+ readonly default: 2;
1449
+ readonly min: 1;
1450
+ readonly max: 50;
1451
+ readonly label: {
1452
+ readonly en: "Rounds it waits";
1453
+ };
1454
+ readonly description: {
1455
+ readonly en: "Only lines at least this many rounds old are read, so a line that is swiped, retaken or taken back is never read.";
1456
+ };
1457
+ };
1458
+ };
1459
+ };
1460
+ } | undefined;
1461
+ }>;
1462
+ /**
1463
+ * 🚧 **The scene due a summary** — the scene summaries routine's code-only look
1464
+ * at the session's `main` channel (every name here is provisional).
1465
+ *
1466
+ * `main` is **the oldest** finished scene on `main` that is due a summary, as
1467
+ * its scene id (a number), or `null` when none is due. Due: it closed at least
1468
+ * `depth` rounds ago (a round as the turn order counts it), it is not
1469
+ * summarized, and nobody has decided about it — a summary a person saved, a
1470
+ * review a person discarded, a failed run, a run going or a review waiting are
1471
+ * never taken; the session's **Summaries** is not *Never*; and no turns are
1472
+ * taken back. At most one scene per run. **A query writes nothing.**
1473
+ *
1474
+ * ⚠ Not *Summarize all* (the app's `scenesToSummarize`: every unsummarized
1475
+ * scene, a person's press) and not `core:outlet/summarize-finished-scene@1`
1476
+ * (which starts the summary).
1477
+ * @experimental
1478
+ */
1479
+ export declare const sceneSummaryDue: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1480
+ main: string;
1481
+ }, {
1482
+ scope: string;
1483
+ }, "core:query/scene-summary-due@1"> & {
1484
+ kind: 'query';
1485
+ slots?: {
1486
+ readonly params: {
1487
+ readonly kind: "parameters";
1488
+ readonly facet: "behavior";
1489
+ readonly schema: {
1490
+ readonly depth: {
1491
+ readonly type: "integer";
1492
+ readonly default: 6;
1493
+ readonly min: 1;
1494
+ readonly max: 50;
1495
+ readonly label: {
1496
+ readonly en: "Rounds after it ends";
1497
+ };
1498
+ readonly description: {
1499
+ readonly en: "A scene is summarized once it ended at least this many rounds ago, so its lines have stopped changing.";
1500
+ };
1501
+ };
1502
+ };
1503
+ };
1504
+ } | undefined;
1505
+ }>;
1506
+ /**
1507
+ * 🚧 **Earlier scenes** — the summaries of this session's finished scenes, for
1508
+ * the block *Earlier in the story* (every name here is provisional).
1509
+ *
1510
+ * `main` is `{ maxTokens: number | null, scenes: Array<{ sceneId: number,
1511
+ * name: string, summary: string, firstLineId: number }> }`: the session's
1512
+ * closed `main`-channel scenes with a usable summary (`summaryStatus =
1513
+ * 'done'`, a person's or the routine's) that are not compiled into a history
1514
+ * entry, in story order (oldest first, by where each scene starts: its opening
1515
+ * line, else its smallest selected line), at most the newest 200. `name` is
1516
+ * the scene's name as shown; `firstLineId` is its first line's message id.
1517
+ * `maxTokens` is `floor(share × budget.total)`, or `null` when `budget` is
1518
+ * unwired (then the block is not capped).
1519
+ *
1520
+ * It returns data, never rendered text: `core:task/assemble@2` decides which
1521
+ * scenes show (only those whose first line is older than the first line the
1522
+ * prompt keeps) and fits them to `maxTokens`.
1523
+ *
1524
+ * ⚠ Not `core:query/scene-summary-due@1` (the routine's look, one scene), not
1525
+ * `core:spec/scene-summaries` (the routine that writes the summaries) and not
1526
+ * `core:query/session-history@1`. **A query writes nothing.**
1527
+ * @experimental
1528
+ */
1529
+ export declare const earlierScenes: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1530
+ main: string;
1531
+ }, {
1532
+ scope: string;
1533
+ budget: string;
1534
+ }, "core:query/earlier-scenes@1"> & {
1535
+ kind: 'query';
1536
+ slots?: {
1537
+ readonly params: {
1538
+ readonly kind: "parameters";
1539
+ readonly facet: "weights";
1540
+ readonly schema: {
1541
+ readonly share: {
1542
+ readonly type: "number";
1543
+ readonly min: 0;
1544
+ readonly max: 1;
1545
+ readonly default: 0.15;
1546
+ readonly label: {
1547
+ readonly en: "Share — earlier scenes";
1548
+ };
1549
+ readonly description: {
1550
+ readonly en: "How much of the context window the summaries of earlier scenes may take. When they do not fit, the oldest are left out first.";
1551
+ };
1552
+ };
1553
+ };
1554
+ };
1555
+ } | undefined;
1556
+ }>;
1557
+ /**
1558
+ * 🚧 **One cast member**, as the scope session reads them — their line, their
1559
+ * clock, the session's own notes over the book.
1560
+ *
1561
+ * `member` is `seated-member:<castMemberId>`, `player-seat:<seatId>` (that
1562
+ * seat's cast member), or a cast member id (a number) of the session's
1563
+ * lorebook or its own. Anything else, a seat with no cast member, or a member
1564
+ * the session doesn't read is refused with a sentence.
1565
+ *
1566
+ * `main` is `CastMemberV1` (`@serene-pub/sdk`): the member, the card version
1567
+ * they follow, which fields they follow, and the character profile as the
1568
+ * session reads it.
1569
+ * @experimental
1570
+ */
1571
+ export declare const castMember: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1572
+ /** `CastMemberV1`. */
1573
+ main: string;
1574
+ }, {
1575
+ scope: string;
1576
+ /** `seated-member:<id>`, `player-seat:<id>`, or a cast member id. */
1577
+ member: string;
1578
+ }, "core:query/cast-member@1"> & {
1579
+ kind: 'query';
1580
+ slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
1581
+ }>;
1361
1582
  /** @experimental */
1362
1583
  export declare const vectorSearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
1363
1584
  main: string;
@@ -2516,6 +2737,14 @@ export declare const turnPlan: import("@serene-pub/sdk").Pinned<import("@serene-
2516
2737
  */
2517
2738
  export declare const sessionAnnex: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
2518
2739
  main: string;
2740
+ /**
2741
+ * 🚧 The owner's **annex document version** (M2a a8): a count the
2742
+ * host moves with every write of that document, 0 before the
2743
+ * first. Wire it into `set-session-annex`'s `base` to make the
2744
+ * write a compare-and-set. Absent for `view: 'template'` (many
2745
+ * owners, no one version).
2746
+ */
2747
+ version: string;
2519
2748
  }, {
2520
2749
  scope: string;
2521
2750
  /**
@@ -2565,6 +2794,59 @@ export declare const sessionAnnex: import("@serene-pub/sdk").Pinned<import("@ser
2565
2794
  };
2566
2795
  } | undefined;
2567
2796
  }>;
2797
+ /**
2798
+ * 🚧 The **lorebook annex** (M0, SHAPES L9): read one owner's document
2799
+ * out of the annex of the book the session reads — the session annex's model
2800
+ * at book scope, for world-level engine state that is neither an attribute nor
2801
+ * prose. Like `session-annex@1`, the owner defaults to the running spec's own
2802
+ * namespace, and reading another's takes `sharedAnnex`.
2803
+ *
2804
+ * ⚠ Not an entry, and not a save: typed world facts stay attributes, and a
2805
+ * session is the save.
2806
+ * @experimental
2807
+ */
2808
+ export declare const lorebookAnnex: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
2809
+ main: string;
2810
+ /**
2811
+ * 🚧 (M2b) The owner's annex document version on the book a
2812
+ * `set-lorebook-annex` from this run would write (0 before the first
2813
+ * write) — wire it into that step's `base` for a compare-and-set.
2814
+ * Absent when the run has no book to write.
2815
+ */
2816
+ version: string;
2817
+ }, {
2818
+ scope: string;
2819
+ }, "core:query/lorebook-annex@1"> & {
2820
+ kind: 'query';
2821
+ slots?: {
2822
+ readonly params: {
2823
+ readonly kind: "parameters";
2824
+ readonly facet: "behavior";
2825
+ readonly schema: {
2826
+ readonly owner: {
2827
+ readonly type: "string";
2828
+ readonly default: "";
2829
+ readonly label: {
2830
+ readonly en: "Owner";
2831
+ };
2832
+ readonly description: {
2833
+ readonly en: "Whose document to read. Blank means this pipeline's own.";
2834
+ };
2835
+ };
2836
+ readonly sharedAnnex: {
2837
+ readonly type: "boolean";
2838
+ readonly default: false;
2839
+ readonly label: {
2840
+ readonly en: "Read another owner";
2841
+ };
2842
+ readonly description: {
2843
+ readonly en: "Allow reading a document this pipeline does not own. Off refuses, with a note on the receipt.";
2844
+ };
2845
+ };
2846
+ };
2847
+ };
2848
+ } | undefined;
2849
+ }>;
2568
2850
  /**
2569
2851
  * The messages a summary is drawn from — both pins on one export, the way a
2570
2852
  * pinned constructor carries its version at the call site (04 §4b):
@@ -2855,6 +3137,14 @@ export declare const graphScenes: import("@serene-pub/sdk").Pinned<import("@sere
2855
3137
  * declaration default, with absence meaning **inherit** rather than zero, and
2856
3138
  * derived slots computed rather than read.
2857
3139
  *
3140
+ * 🚧 Each `cast.byId` entry carries `ref` (the seat's participant reference,
3141
+ * as the host fills it), `castMemberId` (the seat's cast member) and `cardId`
3142
+ * (the member's active card on the timeline; null when card-less). A reader
3143
+ * looks an entry up by `ref` or `castMemberId` (or takes the owner's `key` off
3144
+ * `session-state@1`'s owners), never by building or parsing the key: it is an
3145
+ * opaque owner key — `player_seat:<id>`, 🚧 `seated_member:<id>` from the
3146
+ * flip, ⏳ the card id before it.
3147
+ *
2858
3148
  * A Query, and a plain one: what it is is a read. There is no as-of parameter
2859
3149
  * — this is the `current` view, and the temporal registry that would give the
2860
3150
  * other one is not built (see docs/stats-and-states.md).
@@ -2974,7 +3264,8 @@ export declare const lorebookState: import("@serene-pub/sdk").Pinned<import("@se
2974
3264
  /**
2975
3265
  * One owner: `"world"`, `{ kind: 'cast_member', id }` or
2976
3266
  * `{ kind: 'location', id }` (the session kinds `session`,
2977
- * `session_cast`, `session_location` are translated). Optional.
3267
+ * 🚧 `seated_member`, ⏳ `session_cast`, `session_location` are
3268
+ * translated). Optional.
2978
3269
  */
2979
3270
  owner: string;
2980
3271
  /** 🚧 `'main'`, `'mostRecent'`, `'session'` or a branch id of this book. Optional. */
@@ -3558,4 +3849,141 @@ export declare const likenessImages: import("@serene-pub/sdk").Pinned<import("@s
3558
3849
  kind: 'query';
3559
3850
  slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
3560
3851
  }>;
3852
+ /**
3853
+ * 🚧 **One message as a line to speak**: its words, whose line it is and the
3854
+ * inflection it was recorded with — what `core:task/cue-lines@1` takes, read
3855
+ * off ONE stored row by id. The manual *Read aloud* / *Say it as…* verbs'
3856
+ * read (`core:spec/speak-message`): the history read's rows are opaque
3857
+ * (`messages@1`), so nothing else can hand cue-lines a stored line's speaker
3858
+ * or inflection.
3859
+ *
3860
+ * - `text` — the row's words; **empty** when the row is not this session's,
3861
+ * is hidden, or is still being written (the history read's rule), so a
3862
+ * spec junctions on it and nothing is spoken.
3863
+ * - `speaker` — the participant reference the row was voiced by: an envoy's
3864
+ * `envoy:<slug>`, a persona's or character's `character:<id>`; absent for
3865
+ * narration and for a person's own line with no persona.
3866
+ * - `inflection` — the line's recorded inflection: the label of the sprite
3867
+ * shown on its active swipe (a sprite pick is an inflection). Absent when
3868
+ * no sprite was shown.
3869
+ *
3870
+ * `say` overrides the recorded inflection with what a person asked for (the
3871
+ * *Say it as…* press's collected text): a word the host's marker table knows
3872
+ * (`sighs`, `angrily`, `joy`) becomes that label; any other words are kept as
3873
+ * the label as written, which a prose-taking model reads as direction and a
3874
+ * tag-taking model drops. Blank `say` keeps the recorded one.
3875
+ *
3876
+ * No writes, no model: a read.
3877
+ * @experimental
3878
+ */
3879
+ export declare const messageLine: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
3880
+ main: string;
3881
+ /** The row's words; empty when the row is hidden, still written, or not this session's. */
3882
+ text: string;
3883
+ /** Whose line it is; absent for narration. */
3884
+ speaker: string;
3885
+ /** How it is spoken: `say` when given, else the recorded sprite label; absent when neither. */
3886
+ inflection: string;
3887
+ }, {
3888
+ scope: string;
3889
+ /** The row — the inlet's `messageId`, the message a press on a message's ⋮ was made on. */
3890
+ messageId: string;
3891
+ /** How it should sound, in a person's words; blank keeps the recorded inflection. */
3892
+ say: string;
3893
+ }, "core:query/message-line@1"> & {
3894
+ kind: 'query';
3895
+ slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
3896
+ }>;
3897
+ /**
3898
+ * The largest file `core:query/plugin-storage@1` will read: 4 MiB. A bigger
3899
+ * file is refused with a sentence naming both sizes. (M2a)
3900
+ * @experimental
3901
+ */
3902
+ export declare const PLUGIN_STORAGE_QUERY_MAX_BYTES: number;
3903
+ /**
3904
+ * 🚧 (M2a) **A file from the running plugin's own storage** — read-only, size
3905
+ * capped, one file per read. Say a plugin's genre has a create pipeline that
3906
+ * loads a custom world the person imported: the world sits in the plugin's
3907
+ * storage, and this reads it into the run.
3908
+ *
3909
+ * Why a query and not a task: tasks are pure (F11) — the same inputs give the
3910
+ * same output — and a file on disk is state outside the graph, so it enters
3911
+ * the way every other outside state does, through a query.
3912
+ *
3913
+ * Whose storage: only the plugin that owns the running pipeline. A core or
3914
+ * person-authored pipeline is refused ("plugin-storage reads only a plugin's
3915
+ * own pipeline's storage"). `scope: 'pub'` reads the plugin's shared files and
3916
+ * needs its `storage` grant in force; `scope: 'me'` reads the acting person's
3917
+ * own folder and needs `storage-per-user` in force and a person on the run.
3918
+ * The path is relative, with no `..`, and stays inside the folder. No write,
3919
+ * no listing. A missing file answers `found: false`, not a halt.
3920
+ * @experimental
3921
+ */
3922
+ export declare const pluginStorage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
3923
+ /** The parsed JSON, or the text; null when the file is missing. */
3924
+ main: string;
3925
+ /** Whether the file was there. */
3926
+ found: string;
3927
+ }, {
3928
+ /** The file, relative to the folder: `worlds/atlas.json`. */
3929
+ path: string;
3930
+ }, "core:query/plugin-storage@1"> & {
3931
+ kind: 'query';
3932
+ slots?: {
3933
+ readonly params: {
3934
+ readonly kind: "parameters";
3935
+ readonly facet: "behavior";
3936
+ readonly schema: {
3937
+ readonly scope: {
3938
+ readonly type: "enum";
3939
+ readonly default: "pub";
3940
+ readonly label: {
3941
+ readonly en: "Whose files";
3942
+ };
3943
+ readonly members: readonly [{
3944
+ readonly key: "pub";
3945
+ readonly label: {
3946
+ readonly en: "The plugin";
3947
+ };
3948
+ readonly description: {
3949
+ readonly en: "The plugin's shared files.";
3950
+ };
3951
+ }, {
3952
+ readonly key: "me";
3953
+ readonly label: {
3954
+ readonly en: "The person";
3955
+ };
3956
+ readonly description: {
3957
+ readonly en: "The acting person's own files for this plugin.";
3958
+ };
3959
+ }];
3960
+ };
3961
+ readonly as: {
3962
+ readonly type: "enum";
3963
+ readonly default: "json";
3964
+ readonly label: {
3965
+ readonly en: "Read as";
3966
+ };
3967
+ readonly members: readonly [{
3968
+ readonly key: "json";
3969
+ readonly label: {
3970
+ readonly en: "JSON";
3971
+ };
3972
+ readonly description: {
3973
+ readonly en: "Parse the file and give the value.";
3974
+ };
3975
+ }, {
3976
+ readonly key: "text";
3977
+ readonly label: {
3978
+ readonly en: "Text";
3979
+ };
3980
+ readonly description: {
3981
+ readonly en: "Give the file as text.";
3982
+ };
3983
+ }];
3984
+ };
3985
+ };
3986
+ };
3987
+ } | undefined;
3988
+ }>;
3561
3989
  //# sourceMappingURL=queries.d.ts.map