@serene-pub/contracts 0.6.0-pr-5 → 0.6.0-pr-7
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 +317 -4
- package/dist/oracles.js +235 -10
- package/dist/outlets.d.ts +618 -2
- package/dist/outlets.js +667 -11
- package/dist/queries.d.ts +278 -1
- package/dist/queries.js +301 -4
- package/dist/tasks.d.ts +736 -7
- package/dist/tasks.js +527 -7
- package/package.json +3 -3
package/dist/queries.js
CHANGED
|
@@ -147,6 +147,21 @@ export const sessionHistory = pin(describeQueryDefinition({
|
|
|
147
147
|
en: "On every channel but 'main', read only what was said there: people's lines and the replies to them — never a greeting or a turn's notes.",
|
|
148
148
|
},
|
|
149
149
|
},
|
|
150
|
+
/**
|
|
151
|
+
* 🚧 **Table lines** (2026-10-15): the rows written as the
|
|
152
|
+
* table's own (`create-message@1`'s `tableLine` — a Dungeon
|
|
153
|
+
* Crawler roll line). On by default, so every spec reads
|
|
154
|
+
* what it always read; a spec whose brief already carries
|
|
155
|
+
* what those lines say turns them off, and says so here.
|
|
156
|
+
*/
|
|
157
|
+
tableLines: {
|
|
158
|
+
type: 'boolean',
|
|
159
|
+
default: true,
|
|
160
|
+
label: { en: 'Read the table lines' },
|
|
161
|
+
description: {
|
|
162
|
+
en: "Include the table's own lines — roll lines and the like — in what this history reads. Off: only what was said.",
|
|
163
|
+
},
|
|
164
|
+
},
|
|
150
165
|
/**
|
|
151
166
|
* The transcript's intent, on the node that produces the
|
|
152
167
|
* transcript (built 2026-09-16 — see
|
|
@@ -264,6 +279,20 @@ export const sessionHistory = pin(describeQueryDefinition({
|
|
|
264
279
|
* carries the id, never the text, so the row is read here.
|
|
265
280
|
*/
|
|
266
281
|
messageId: S.rowIds,
|
|
282
|
+
/**
|
|
283
|
+
* 🚧 **One channel lane, chosen at run time** (2026-10-15):
|
|
284
|
+
* wired — `$.input.channel`, the channel lane the turn was
|
|
285
|
+
* fired on — the read is exactly that channel lane, in place
|
|
286
|
+
* of the `channel` parameter. A bare slug here is its lane 1,
|
|
287
|
+
* never the whole channel: the run names the channel lane a
|
|
288
|
+
* row is on, and a channel lane is one conversation (`parley` is the owner's lane with the
|
|
289
|
+
* Planner, `parley:2` another player's — reading the slug
|
|
290
|
+
* would hand one player's private talk to another's reply).
|
|
291
|
+
* `limit`, `budget`, `unplayedOnly` and `talkOnly` apply as
|
|
292
|
+
* they would to the parameter. Unwired, the parameter is read.
|
|
293
|
+
* The Dungeon Crawler's Planner reads its player's lane so.
|
|
294
|
+
*/
|
|
295
|
+
channelLane: S.text,
|
|
267
296
|
},
|
|
268
297
|
out: {
|
|
269
298
|
/**
|
|
@@ -1115,12 +1144,24 @@ export const castPresences = pin(describeQueryDefinition({
|
|
|
1115
1144
|
/** A session with no book, or a book that dates nobody, reads nothing — a normal state. */
|
|
1116
1145
|
optional: true,
|
|
1117
1146
|
ports: {
|
|
1118
|
-
in: {
|
|
1147
|
+
in: {
|
|
1148
|
+
scope: S.sessionScope,
|
|
1149
|
+
/**
|
|
1150
|
+
* 🚧 The hour to place the cast at (M0, SHAPES L3): a clock target. Unwired,
|
|
1151
|
+
* the clock's present hour, today.
|
|
1152
|
+
*/
|
|
1153
|
+
atHour: S.clockTarget,
|
|
1154
|
+
},
|
|
1119
1155
|
out: {
|
|
1120
1156
|
/** `{ bindingId, from, until, position }[]`, on the session's line. */
|
|
1121
1157
|
main: S.json,
|
|
1122
1158
|
/** The story date the session reads at, or null for the head. */
|
|
1123
1159
|
at: S.json,
|
|
1160
|
+
/**
|
|
1161
|
+
* 🚧 `{ bindingId: number; where: string }[]` — where each cast member is at `atHour`, read
|
|
1162
|
+
* from the first `schedule` field on an entry they hold; a member with none is left out.
|
|
1163
|
+
*/
|
|
1164
|
+
placements: S.json,
|
|
1124
1165
|
},
|
|
1125
1166
|
},
|
|
1126
1167
|
}));
|
|
@@ -2140,7 +2181,21 @@ export const availableTools = pin(describeQueryDefinition({
|
|
|
2140
2181
|
},
|
|
2141
2182
|
},
|
|
2142
2183
|
},
|
|
2143
|
-
ports: {
|
|
2184
|
+
ports: {
|
|
2185
|
+
in: {
|
|
2186
|
+
scope: S.sessionScope,
|
|
2187
|
+
/**
|
|
2188
|
+
* 🚧 Which **kinds** of tool to offer (2026-10-19, the Chat
|
|
2189
|
+
* genre's `tools` field): `web`, `lore`, `lorebook-write`,
|
|
2190
|
+
* `image`, `clock`, `calculator`, `history` — the host maps
|
|
2191
|
+
* each kind onto the tools that serve it. Unwired, every tool
|
|
2192
|
+
* the session has (as before); an empty list, none. Added in
|
|
2193
|
+
* place (`@1` evolves until 0.7).
|
|
2194
|
+
*/
|
|
2195
|
+
kinds: S.json,
|
|
2196
|
+
},
|
|
2197
|
+
out: { main: S.json, tools: S.json },
|
|
2198
|
+
},
|
|
2144
2199
|
}));
|
|
2145
2200
|
// ── Consumers ───────────────────────────────────────────────────────────────
|
|
2146
2201
|
/**
|
|
@@ -2321,7 +2376,70 @@ export const sessionAnnex = pin(describeQueryDefinition({
|
|
|
2321
2376
|
/** Whose prompt, for `view: 'ai'` — a `character:` or `envoy:` reference. */
|
|
2322
2377
|
speaker: S.participantRef,
|
|
2323
2378
|
},
|
|
2324
|
-
out: {
|
|
2379
|
+
out: {
|
|
2380
|
+
main: S.json,
|
|
2381
|
+
/**
|
|
2382
|
+
* 🚧 The owner's **annex document version** (M2a a8): a count the
|
|
2383
|
+
* host moves with every write of that document, 0 before the
|
|
2384
|
+
* first. Wire it into `set-session-annex`'s `base` to make the
|
|
2385
|
+
* write a compare-and-set. Absent for `view: 'template'` (many
|
|
2386
|
+
* owners, no one version).
|
|
2387
|
+
*/
|
|
2388
|
+
version: S.json,
|
|
2389
|
+
},
|
|
2390
|
+
},
|
|
2391
|
+
}));
|
|
2392
|
+
/**
|
|
2393
|
+
* 🚧 The **lorebook annex** (M0, SHAPES L9): read one owner's document
|
|
2394
|
+
* out of the annex of the book the session reads — the session annex's model
|
|
2395
|
+
* at book scope, for world-level engine state that is neither an attribute nor
|
|
2396
|
+
* prose. Like `session-annex@1`, the owner defaults to the running spec's own
|
|
2397
|
+
* namespace, and reading another's takes `sharedAnnex`.
|
|
2398
|
+
*
|
|
2399
|
+
* âš Not an entry, and not a save: typed world facts stay attributes, and a
|
|
2400
|
+
* session is the save.
|
|
2401
|
+
* @experimental
|
|
2402
|
+
*/
|
|
2403
|
+
export const lorebookAnnex = pin(describeQueryDefinition({
|
|
2404
|
+
id: 'core:query/lorebook-annex@1',
|
|
2405
|
+
i18n: { name: { en: 'Lorebook annex' } },
|
|
2406
|
+
timeoutMs: 1000,
|
|
2407
|
+
slots: {
|
|
2408
|
+
params: {
|
|
2409
|
+
kind: 'parameters',
|
|
2410
|
+
facet: 'behavior',
|
|
2411
|
+
schema: {
|
|
2412
|
+
owner: {
|
|
2413
|
+
type: 'string',
|
|
2414
|
+
default: '',
|
|
2415
|
+
label: { en: 'Owner' },
|
|
2416
|
+
description: {
|
|
2417
|
+
en: "Whose document to read. Blank means this pipeline's own.",
|
|
2418
|
+
},
|
|
2419
|
+
},
|
|
2420
|
+
sharedAnnex: {
|
|
2421
|
+
type: 'boolean',
|
|
2422
|
+
default: false,
|
|
2423
|
+
label: { en: 'Read another owner' },
|
|
2424
|
+
description: {
|
|
2425
|
+
en: "Allow reading a document this pipeline does not own. Off refuses, with a note on the receipt.",
|
|
2426
|
+
},
|
|
2427
|
+
},
|
|
2428
|
+
},
|
|
2429
|
+
},
|
|
2430
|
+
},
|
|
2431
|
+
ports: {
|
|
2432
|
+
in: { scope: S.sessionScope },
|
|
2433
|
+
out: {
|
|
2434
|
+
main: S.json,
|
|
2435
|
+
/**
|
|
2436
|
+
* 🚧 (M2b) The owner's annex document version on the book a
|
|
2437
|
+
* `set-lorebook-annex` from this run would write (0 before the first
|
|
2438
|
+
* write) — wire it into that step's `base` for a compare-and-set.
|
|
2439
|
+
* Absent when the run has no book to write.
|
|
2440
|
+
*/
|
|
2441
|
+
version: S.json,
|
|
2442
|
+
},
|
|
2325
2443
|
},
|
|
2326
2444
|
}));
|
|
2327
2445
|
// ── Summarization ───────────────────────────────────────────────────────────
|
|
@@ -2618,8 +2736,12 @@ export const graphScenes = pin(describeQueryDefinition({
|
|
|
2618
2736
|
* The session's stats and states, resolved — an inventory is one, the
|
|
2619
2737
|
* `inventory` list stat (phase 3b retired possessions as edges).
|
|
2620
2738
|
*
|
|
2621
|
-
* `{ world, cast, slots, who, version }` — the same object `stateFor(sessionId)`
|
|
2739
|
+
* `{ world, cast, slots, configs, who, version }` — the same object `stateFor(sessionId)`
|
|
2622
2740
|
* returns and the shape `state` on `core:task/build-template-context@1` takes.
|
|
2741
|
+
* 🚧 `configs` is each owner's **stat configuration** in force — `world`
|
|
2742
|
+
* and every `cast.byId` key, then the slot id: `configs['player_seat:4']
|
|
2743
|
+
* ['core:slot/hp@1'].max` is that seat's full health, the bar's own number
|
|
2744
|
+
* (`core:outlet/set-stat-config@1` writes it).
|
|
2623
2745
|
* Every value is already resolved down session → lorebook → card →
|
|
2624
2746
|
* declaration default, with absence meaning **inherit** rather than zero, and
|
|
2625
2747
|
* derived slots computed rather than read.
|
|
@@ -2779,6 +2901,39 @@ export const lorebookState = pin(describeQueryDefinition({
|
|
|
2779
2901
|
out: { main: S.json, state: S.json },
|
|
2780
2902
|
},
|
|
2781
2903
|
}));
|
|
2904
|
+
/**
|
|
2905
|
+
* 🚧 **A person's channel lane** (owner ruling 2026-10-17): on a channel the
|
|
2906
|
+
* genre declares `lanes: 'personal'`, the lane that is this person's —
|
|
2907
|
+
* allocated by core on first ask, filed in the session's lane register,
|
|
2908
|
+
* and sent by the host to that person and the session's owner alone. The
|
|
2909
|
+
* same ask twice is the same lane; a shared channel is refused (its lanes
|
|
2910
|
+
* are the genre's to allocate). Replaces a genre's own user→lane map and
|
|
2911
|
+
* client-side hiding.
|
|
2912
|
+
* @experimental
|
|
2913
|
+
*/
|
|
2914
|
+
export const channelLane = pin(describeQueryDefinition({
|
|
2915
|
+
id: 'core:query/channel-lane@1',
|
|
2916
|
+
i18n: {
|
|
2917
|
+
name: { en: 'A person’s channel lane' },
|
|
2918
|
+
description: { en: 'Finds, or opens, the lane one person has on a channel of personal lanes.' },
|
|
2919
|
+
},
|
|
2920
|
+
timeoutMs: 2000,
|
|
2921
|
+
ports: {
|
|
2922
|
+
in: {
|
|
2923
|
+
scope: S.sessionScope,
|
|
2924
|
+
/** The channel's slug, declared with personal lanes. */
|
|
2925
|
+
channel: S.text,
|
|
2926
|
+
/** Whose lane: `user:<id>` — a participant reference as text (wired from a script's words; the host parses it). */
|
|
2927
|
+
person: S.json,
|
|
2928
|
+
},
|
|
2929
|
+
out: {
|
|
2930
|
+
/** The canonical channel string of the lane: `parley` for lane 1, `parley:2` after. */
|
|
2931
|
+
lane: S.text,
|
|
2932
|
+
/** Whether this ask opened the lane. */
|
|
2933
|
+
opened: S.json,
|
|
2934
|
+
},
|
|
2935
|
+
},
|
|
2936
|
+
}));
|
|
2782
2937
|
/**
|
|
2783
2938
|
* 🚧 The **stat trail**: one stat's values over time, for one owner — the
|
|
2784
2939
|
* world, a cast member or a place (owner-confirmed 2026-09-27: "stats over
|
|
@@ -3332,4 +3487,146 @@ export const likenessImages = pin(describeQueryDefinition({
|
|
|
3332
3487
|
out: { main: S.mediaList, references: S.mediaList },
|
|
3333
3488
|
},
|
|
3334
3489
|
}));
|
|
3490
|
+
// ── 🚧 core:query/message-line@1 (speech lane D follow-up, ★1, 2026-10-28) ──
|
|
3491
|
+
/**
|
|
3492
|
+
* 🚧 **One message as a line to speak**: its words, whose line it is and the
|
|
3493
|
+
* inflection it was recorded with — what `core:task/cue-lines@1` takes, read
|
|
3494
|
+
* off ONE stored row by id. The manual *Read aloud* / *Say it as…* verbs'
|
|
3495
|
+
* read (`core:spec/speak-message`): the history read's rows are opaque
|
|
3496
|
+
* (`messages@1`), so nothing else can hand cue-lines a stored line's speaker
|
|
3497
|
+
* or inflection.
|
|
3498
|
+
*
|
|
3499
|
+
* - `text` — the row's words; **empty** when the row is not this session's,
|
|
3500
|
+
* is hidden, or is still being written (the history read's rule), so a
|
|
3501
|
+
* spec junctions on it and nothing is spoken.
|
|
3502
|
+
* - `speaker` — the participant reference the row was voiced by: an envoy's
|
|
3503
|
+
* `envoy:<slug>`, a persona's or character's `character:<id>`; absent for
|
|
3504
|
+
* narration and for a person's own line with no persona.
|
|
3505
|
+
* - `inflection` — the line's recorded inflection: the label of the sprite
|
|
3506
|
+
* shown on its active swipe (a sprite pick is an inflection). Absent when
|
|
3507
|
+
* no sprite was shown.
|
|
3508
|
+
*
|
|
3509
|
+
* `say` overrides the recorded inflection with what a person asked for (the
|
|
3510
|
+
* *Say it as…* press's collected text): a word the host's marker table knows
|
|
3511
|
+
* (`sighs`, `angrily`, `joy`) becomes that label; any other words are kept as
|
|
3512
|
+
* the label as written, which a prose-taking model reads as direction and a
|
|
3513
|
+
* tag-taking model drops. Blank `say` keeps the recorded one.
|
|
3514
|
+
*
|
|
3515
|
+
* No writes, no model: a read.
|
|
3516
|
+
* @experimental
|
|
3517
|
+
*/
|
|
3518
|
+
export const messageLine = pin(describeQueryDefinition({
|
|
3519
|
+
id: 'core:query/message-line@1',
|
|
3520
|
+
i18n: {
|
|
3521
|
+
name: { en: 'Message line' },
|
|
3522
|
+
description: {
|
|
3523
|
+
en: "One message's words, who said it, and how it was said — for reading it aloud.",
|
|
3524
|
+
},
|
|
3525
|
+
},
|
|
3526
|
+
timeoutMs: 2000,
|
|
3527
|
+
ports: {
|
|
3528
|
+
in: {
|
|
3529
|
+
scope: S.sessionScope,
|
|
3530
|
+
/** The row — the inlet's `messageId`, the message a press on a message's ⋮ was made on. */
|
|
3531
|
+
messageId: S.rowIds,
|
|
3532
|
+
/** How it should sound, in a person's words; blank keeps the recorded inflection. */
|
|
3533
|
+
say: S.text,
|
|
3534
|
+
},
|
|
3535
|
+
out: {
|
|
3536
|
+
main: S.text,
|
|
3537
|
+
/** The row's words; empty when the row is hidden, still written, or not this session's. */
|
|
3538
|
+
text: S.text,
|
|
3539
|
+
/** Whose line it is; absent for narration. */
|
|
3540
|
+
speaker: S.participantRef,
|
|
3541
|
+
/** How it is spoken: `say` when given, else the recorded sprite label; absent when neither. */
|
|
3542
|
+
inflection: S.inflection,
|
|
3543
|
+
},
|
|
3544
|
+
},
|
|
3545
|
+
}));
|
|
3546
|
+
/**
|
|
3547
|
+
* The largest file `core:query/plugin-storage@1` will read: 4 MiB. A bigger
|
|
3548
|
+
* file is refused with a sentence naming both sizes. (M2a)
|
|
3549
|
+
* @experimental
|
|
3550
|
+
*/
|
|
3551
|
+
export const PLUGIN_STORAGE_QUERY_MAX_BYTES = 4 * 1024 * 1024;
|
|
3552
|
+
/**
|
|
3553
|
+
* 🚧 (M2a) **A file from the running plugin's own storage** — read-only, size
|
|
3554
|
+
* capped, one file per read. Say a plugin's genre has a create pipeline that
|
|
3555
|
+
* loads a custom world the person imported: the world sits in the plugin's
|
|
3556
|
+
* storage, and this reads it into the run.
|
|
3557
|
+
*
|
|
3558
|
+
* Why a query and not a task: tasks are pure (F11) — the same inputs give the
|
|
3559
|
+
* same output — and a file on disk is state outside the graph, so it enters
|
|
3560
|
+
* the way every other outside state does, through a query.
|
|
3561
|
+
*
|
|
3562
|
+
* Whose storage: only the plugin that owns the running pipeline. A core or
|
|
3563
|
+
* person-authored pipeline is refused ("plugin-storage reads only a plugin's
|
|
3564
|
+
* own pipeline's storage"). `scope: 'pub'` reads the plugin's shared files and
|
|
3565
|
+
* needs its `storage` grant in force; `scope: 'me'` reads the acting person's
|
|
3566
|
+
* own folder and needs `storage-per-user` in force and a person on the run.
|
|
3567
|
+
* The path is relative, with no `..`, and stays inside the folder. No write,
|
|
3568
|
+
* no listing. A missing file answers `found: false`, not a halt.
|
|
3569
|
+
* @experimental
|
|
3570
|
+
*/
|
|
3571
|
+
export const pluginStorage = pin(describeQueryDefinition({
|
|
3572
|
+
id: 'core:query/plugin-storage@1',
|
|
3573
|
+
i18n: { name: { en: 'Plugin storage' } },
|
|
3574
|
+
timeoutMs: 2000,
|
|
3575
|
+
slots: {
|
|
3576
|
+
params: {
|
|
3577
|
+
kind: 'parameters',
|
|
3578
|
+
facet: 'behavior',
|
|
3579
|
+
schema: {
|
|
3580
|
+
scope: {
|
|
3581
|
+
type: 'enum',
|
|
3582
|
+
default: 'pub',
|
|
3583
|
+
label: { en: 'Whose files' },
|
|
3584
|
+
members: [
|
|
3585
|
+
{
|
|
3586
|
+
key: 'pub',
|
|
3587
|
+
label: { en: 'The plugin' },
|
|
3588
|
+
description: { en: "The plugin's shared files." },
|
|
3589
|
+
},
|
|
3590
|
+
{
|
|
3591
|
+
key: 'me',
|
|
3592
|
+
label: { en: 'The person' },
|
|
3593
|
+
description: {
|
|
3594
|
+
en: "The acting person's own files for this plugin.",
|
|
3595
|
+
},
|
|
3596
|
+
},
|
|
3597
|
+
],
|
|
3598
|
+
},
|
|
3599
|
+
as: {
|
|
3600
|
+
type: 'enum',
|
|
3601
|
+
default: 'json',
|
|
3602
|
+
label: { en: 'Read as' },
|
|
3603
|
+
members: [
|
|
3604
|
+
{
|
|
3605
|
+
key: 'json',
|
|
3606
|
+
label: { en: 'JSON' },
|
|
3607
|
+
description: { en: 'Parse the file and give the value.' },
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
key: 'text',
|
|
3611
|
+
label: { en: 'Text' },
|
|
3612
|
+
description: { en: 'Give the file as text.' },
|
|
3613
|
+
},
|
|
3614
|
+
],
|
|
3615
|
+
},
|
|
3616
|
+
},
|
|
3617
|
+
},
|
|
3618
|
+
},
|
|
3619
|
+
ports: {
|
|
3620
|
+
in: {
|
|
3621
|
+
/** The file, relative to the folder: `worlds/atlas.json`. */
|
|
3622
|
+
path: S.text,
|
|
3623
|
+
},
|
|
3624
|
+
out: {
|
|
3625
|
+
/** The parsed JSON, or the text; null when the file is missing. */
|
|
3626
|
+
main: S.json,
|
|
3627
|
+
/** Whether the file was there. */
|
|
3628
|
+
found: S.json,
|
|
3629
|
+
},
|
|
3630
|
+
},
|
|
3631
|
+
}));
|
|
3335
3632
|
//# sourceMappingURL=queries.js.map
|