@serene-pub/contracts 0.6.0-pr-2 → 0.6.0-pr-5
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 +12 -10591
- package/dist/index.js +12 -10236
- package/dist/inlets.d.ts +628 -0
- package/dist/inlets.js +744 -0
- package/dist/oracles.d.ts +1535 -0
- package/dist/oracles.js +1634 -0
- package/dist/outlets.d.ts +1140 -0
- package/dist/outlets.js +1261 -0
- package/dist/queries.d.ts +3492 -0
- package/dist/queries.js +3335 -0
- package/dist/tasks.d.ts +5288 -0
- package/dist/tasks.js +4654 -0
- package/package.json +9 -4
|
@@ -0,0 +1,1140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core's **outlet** node definitions — writes, attaches, emits: where a run leaves
|
|
3
|
+
* into the world.
|
|
4
|
+
*
|
|
5
|
+
* One file per node kind, with the helpers only that kind uses; `index.ts`
|
|
6
|
+
* re-exports them all.
|
|
7
|
+
*/
|
|
8
|
+
import type { WriteResult } from '@serene-pub/sdk';
|
|
9
|
+
/**
|
|
10
|
+
* An author defaulting review ON for their own consumer — and unable to forbid it.
|
|
11
|
+
*
|
|
12
|
+
* Bound 2026-09-17: the host's commit for it existed and no
|
|
13
|
+
* binding reached it. `target` is the row the part lands on — the same port
|
|
14
|
+
* `update-message` takes, fed from an earlier write in the document (the reply's
|
|
15
|
+
* placeholder) or from the inlet's `messageId`. An update whose target is
|
|
16
|
+
* an earlier write is the same row, so placing this after `create-message` is
|
|
17
|
+
* one live row, not two. The host reads the id off `target`, or off the
|
|
18
|
+
* media reference's own `messageId` where a caller outside the graph set one.
|
|
19
|
+
* @experimental
|
|
20
|
+
*/
|
|
21
|
+
export declare const attachImage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
22
|
+
main: string;
|
|
23
|
+
}, {
|
|
24
|
+
target: string;
|
|
25
|
+
image: string;
|
|
26
|
+
}, "core:outlet/attach-image@1"> & {
|
|
27
|
+
kind: 'outlet';
|
|
28
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* The create pipeline's write: seed the collected greetings as
|
|
32
|
+
* the session's first messages — one assistant message per entry, the full
|
|
33
|
+
* list as its swipe history, redirected to the genre's declared greeting
|
|
34
|
+
* channel when that is not `main`.
|
|
35
|
+
* @experimental
|
|
36
|
+
*/
|
|
37
|
+
export declare const seedGreetings: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
38
|
+
main: string;
|
|
39
|
+
messageIds: string;
|
|
40
|
+
}, {
|
|
41
|
+
greetings: string;
|
|
42
|
+
/**
|
|
43
|
+
* The channel the greetings land on — the genre's
|
|
44
|
+
* declared greeting channel, written by the create specs as a
|
|
45
|
+
* literal (`createChat.ts`, `adventure.ts`). Absent is `main`.
|
|
46
|
+
* Declared 2026-09-16: the host read it off the
|
|
47
|
+
* payload while no declaration supplied it.
|
|
48
|
+
*/
|
|
49
|
+
channel: string;
|
|
50
|
+
}, "core:outlet/seed-greetings@1"> & {
|
|
51
|
+
kind: 'outlet';
|
|
52
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Write a message — complete, or as the run's **placeholder**.
|
|
56
|
+
*
|
|
57
|
+
* A pipeline that wants a message creates it itself. The reply specs put this
|
|
58
|
+
* node straight after the inlet with `generating: true`: the row it inserts is
|
|
59
|
+
* empty and generating, it is the run's live row (`liveRow` — an oracle's
|
|
60
|
+
* stream lands in it, and Stop finalises it), and the spec's last node is an
|
|
61
|
+
* `update-message` that fills it. That create → update pair on one row inside
|
|
62
|
+
* one run is the run's **one live row**. Without `generating` (or a
|
|
63
|
+
* claimed `row`) the message is complete, and an ordinary write — a pipeline
|
|
64
|
+
* may write as many as it likes, just never a second on the live row's
|
|
65
|
+
* channel. `message-created` fires on the create, which is now genuinely the
|
|
66
|
+
* moment the row exists.
|
|
67
|
+
*
|
|
68
|
+
* `reviewDefault: 'off'` — review of a reply, when an admin enables it, lands
|
|
69
|
+
* on the *update* of the primary row and never on this create by default:
|
|
70
|
+
* a placeholder is a write, and an admin who gates this node gets
|
|
71
|
+
* a run that shows nothing until approved, which is honest and rarely wanted.
|
|
72
|
+
* Turning it on is still the admin's to do.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare const createMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
76
|
+
main: string;
|
|
77
|
+
messageId: string;
|
|
78
|
+
}, {
|
|
79
|
+
text: string;
|
|
80
|
+
/**
|
|
81
|
+
* Media to post WITH the message, as references.
|
|
82
|
+
*
|
|
83
|
+
* Posting an image as a NEW message is one write, not a create
|
|
84
|
+
* followed by an `attach-image`: the answer is the same one
|
|
85
|
+
* streaming got — one node with a settled output, not two nodes
|
|
86
|
+
* and a hope. The write that creates the message is the write
|
|
87
|
+
* that attaches its images.
|
|
88
|
+
*/
|
|
89
|
+
media: string;
|
|
90
|
+
/**
|
|
91
|
+
* Who is speaking, as a cast row — the inlet's `characterId`.
|
|
92
|
+
* Null or absent means nobody in particular: narration, or a
|
|
93
|
+
* message no character voices.
|
|
94
|
+
*/
|
|
95
|
+
characterId: string;
|
|
96
|
+
/**
|
|
97
|
+
* The participant voicing this message when they are **not** a
|
|
98
|
+
* cast row — the side-character fact `{ name, characterId, known }`
|
|
99
|
+
* off `side-character-turn@1`'s `sideCharacter` port. Stored
|
|
100
|
+
* beside the message under `metadata.sideCharacter` (was
|
|
101
|
+
* `metadata.speaker` until 2026-09-16 — that key is the
|
|
102
|
+
* participant reference now, on the row as on the inlet),
|
|
103
|
+
* where the run and the receipt read it from; it never writes a
|
|
104
|
+
* cast row and never enters the rotation.
|
|
105
|
+
*
|
|
106
|
+
* Was `speaker` until 2026-09-16 — the inlet's port of that
|
|
107
|
+
* name is a participant reference now.
|
|
108
|
+
*/
|
|
109
|
+
sideCharacter: string;
|
|
110
|
+
/**
|
|
111
|
+
* Who is speaking, as a **participant reference**
|
|
112
|
+
* (2026-09-16) — `character:<id>` or `envoy:<slug>`, the
|
|
113
|
+
* inlet's `speaker`. Stored beside the message as
|
|
114
|
+
* `metadata.speaker`; it is the only identity an envoy's turn
|
|
115
|
+
* carries, since an envoy has no row for `characterId` to name.
|
|
116
|
+
* Optional: a spec that wires only `characterId` writes the row
|
|
117
|
+
* it always wrote.
|
|
118
|
+
*/
|
|
119
|
+
speaker: string;
|
|
120
|
+
/**
|
|
121
|
+
* Create the row as a **placeholder**: empty, generating, and the
|
|
122
|
+
* run's live row — filled by a later `update-message`, or
|
|
123
|
+
* finalised by core if the run stops first.
|
|
124
|
+
*
|
|
125
|
+
* A port, not a parameter, and the call site is what decides:
|
|
126
|
+
* the reply specs write `generating: true` as a literal into the
|
|
127
|
+
* node's config, in the same map as `text`, and `resolveInput`
|
|
128
|
+
* passes it through untouched — so the binding reads it exactly
|
|
129
|
+
* the way it reads a port (see `summarize-batch`'s `loreType`
|
|
130
|
+
* for the same reasoning at length). A `params` field would put
|
|
131
|
+
* a structural fact of the document in the panel as a knob.
|
|
132
|
+
*/
|
|
133
|
+
generating: string;
|
|
134
|
+
/**
|
|
135
|
+
* The message is **narration** — not a character's turn. Shown
|
|
136
|
+
* under the narrator's name, never counted by the rotation. A
|
|
137
|
+
* literal, on the same terms as `generating`. The name is the
|
|
138
|
+
* session's narrator name, or the `speaker`'s where one was
|
|
139
|
+
* named; the host resolves it at the write, which is where the
|
|
140
|
+
* row is.
|
|
141
|
+
*/
|
|
142
|
+
narration: string;
|
|
143
|
+
/**
|
|
144
|
+
* Instructions this message was asked for — a narrator's focus
|
|
145
|
+
* note. Stored beside the message and shown with it; never its
|
|
146
|
+
* text. Wired from the inlet's `text` on the narrate specs, which
|
|
147
|
+
* is what a narrator turn's triggering text is.
|
|
148
|
+
*/
|
|
149
|
+
instructions: string;
|
|
150
|
+
/**
|
|
151
|
+
* The channel the row lands on. Absent is `main`, so a
|
|
152
|
+
* pipeline that has never heard of channels writes where it
|
|
153
|
+
* always did; a channel the session's genre never declared is
|
|
154
|
+
* refused at the write. Declared 2026-09-16 for
|
|
155
|
+
* the same reason `seed-greetings` declares its own.
|
|
156
|
+
*/
|
|
157
|
+
channel: string;
|
|
158
|
+
/**
|
|
159
|
+
* An existing message row to take as the placeholder instead of
|
|
160
|
+
* inserting one — the inlet's `messageId` on a regenerate, swipe
|
|
161
|
+
* or extend. The row is reset to generating and becomes the
|
|
162
|
+
* run's live row; its text and swipe history stay as the verb
|
|
163
|
+
* left them. Absent on a fresh turn, which inserts.
|
|
164
|
+
*/
|
|
165
|
+
row: string;
|
|
166
|
+
/**
|
|
167
|
+
* Message **blocks** to post with the row
|
|
168
|
+
* (2026-09-17): a list of `MessageBlock` — text,
|
|
169
|
+
* tables, meters, and the two interactive kinds, `choices` and
|
|
170
|
+
* `form`, which are **forms** when they carry an `addressee`.
|
|
171
|
+
* The host validates the tree (`checkMessageBlocks`), refuses
|
|
172
|
+
* a block naming a function this spec declares no action for
|
|
173
|
+
* or one whose action is `world` (the effects line), stamps
|
|
174
|
+
* each form with the writing spec's action identity and an
|
|
175
|
+
* id, stores them as a `core:blocks` part, and — for a form
|
|
176
|
+
* whose addressee the run's pinned portrayals say the AI
|
|
177
|
+
* portrays — records `core:event/form-addressed@1` for the
|
|
178
|
+
* genre's answer pipeline once this run's receipt is saved.
|
|
179
|
+
* Absent on nearly every message.
|
|
180
|
+
*/
|
|
181
|
+
blocks: string;
|
|
182
|
+
/**
|
|
183
|
+
* **Folded sections** to show collapsed beside the text — a
|
|
184
|
+
* narrator's Plan, a step's notes (`FoldedSectionV1[]`: each
|
|
185
|
+
* `{ kind, label, content }` or `{ kind, label, items }`; at
|
|
186
|
+
* most `MAX_FOLDED_SECTIONS`). Stored with the row as
|
|
187
|
+
* `core:section` parts above the body; never the text, and
|
|
188
|
+
* never read into the prompt transcript. A malformed section
|
|
189
|
+
* is refused by position. Absent on nearly every message.
|
|
190
|
+
*/
|
|
191
|
+
sections: string;
|
|
192
|
+
/**
|
|
193
|
+
* 🚧 The **turn plan** this row carries (Lair character turns,
|
|
194
|
+
* owner ruling 2026-09-30): `{ plan, locationPassage? }`, where
|
|
195
|
+
* `plan` is a planner's document whose `speakers` (side-character
|
|
196
|
+
* facts — `{ name, intent }` or `{ characterId }`) name who takes
|
|
197
|
+
* a **character turn** next, in order, and `locationPassage` is
|
|
198
|
+
* prose that describes the room they are heading into. The host
|
|
199
|
+
* resolves each speaker to a seated cast member and stores the
|
|
200
|
+
* whole as `metadata.turnPlan` (`{ turns, plan, locationPassage? }`,
|
|
201
|
+
* `turns` the participant references in order). A turn-order
|
|
202
|
+
* strategy reads the **standing plan** off the history and
|
|
203
|
+
* prepares one entry per turn not yet taken (`via: 'plan'`); each
|
|
204
|
+
* character turn reads it back through `core:query/turn-plan@1`.
|
|
205
|
+
* Absent, or with no `plan`, the row plans nothing — which is
|
|
206
|
+
* every row but a planner's.
|
|
207
|
+
*/
|
|
208
|
+
turnPlan: string;
|
|
209
|
+
}, "core:outlet/create-message@1"> & {
|
|
210
|
+
kind: 'outlet';
|
|
211
|
+
slots?: {
|
|
212
|
+
/**
|
|
213
|
+
* The write hook: one chain rewrites the final output, the
|
|
214
|
+
* other decides where a streamed reply stops. Stop is a verdict —
|
|
215
|
+
* min-reduction across every attached script, and the connection's
|
|
216
|
+
* own guards join the same union at dispatch, which is why
|
|
217
|
+
* order never needs ruling. `speakerName` and `castNames` are
|
|
218
|
+
* extras: readable, never writable, by construction.
|
|
219
|
+
*/
|
|
220
|
+
readonly scripts: {
|
|
221
|
+
readonly kind: "scripts";
|
|
222
|
+
readonly accepts: ["core:script:text/transform@1", "core:script:text/stop@1"];
|
|
223
|
+
readonly port: "text";
|
|
224
|
+
readonly phase: "before";
|
|
225
|
+
readonly extras: ["speakerName", "castNames"];
|
|
226
|
+
readonly description: "Scripts over the reply as it is saved — clean up the text, or stop a streaming reply early.";
|
|
227
|
+
};
|
|
228
|
+
} | undefined;
|
|
229
|
+
}>;
|
|
230
|
+
/**
|
|
231
|
+
* Update an existing message — finish a placeholder, or edit a settled row.
|
|
232
|
+
*
|
|
233
|
+
* `target` takes `row-ids@1`, and a `write-result@1` from earlier in the same
|
|
234
|
+
* run is assignable to it: the reply specs wire `$.placeholder.messageId`
|
|
235
|
+
* here, which is the create → update pair that makes the pipeline own its row.
|
|
236
|
+
* The other case is unchanged — the id comes from outside the run because the
|
|
237
|
+
* user clicked a message, so it is on the inlet.
|
|
238
|
+
*
|
|
239
|
+
* Which of the two this is, the row decides: a target still **generating** — a
|
|
240
|
+
* placeholder this run created — is finished (the text lands, the generating
|
|
241
|
+
* state ends, the reasoning trace and the swipe slot are written); a settled
|
|
242
|
+
* target is edited and marked so. That is the row's own state, not a flag a
|
|
243
|
+
* spec could get wrong.
|
|
244
|
+
*
|
|
245
|
+
* Where review lands on a reply: when an admin turns review on
|
|
246
|
+
* for a reply's message writes, it is THIS node that parks — the placeholder
|
|
247
|
+
* ships `reviewDefault: 'off'` and declares no default here either, so nothing
|
|
248
|
+
* gates by default and a reviewer who asks for one sees the content, not an
|
|
249
|
+
* empty row. The executor's own rule (`resolvePosition`) is "the setting, else
|
|
250
|
+
* the author's default, else off", and this node leaves the default unset.
|
|
251
|
+
* @experimental
|
|
252
|
+
*/
|
|
253
|
+
export declare const updateMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
254
|
+
main: string;
|
|
255
|
+
messageId: string;
|
|
256
|
+
}, {
|
|
257
|
+
target: string;
|
|
258
|
+
text: string;
|
|
259
|
+
/**
|
|
260
|
+
* The reasoning trace the oracle separated from its text, when
|
|
261
|
+
* the model produced one. Stored beside the message as the
|
|
262
|
+
* reasoning fold reads it; absent means none. Shown folded,
|
|
263
|
+
* and never re-sent to the model: the prompt transcript reads
|
|
264
|
+
* a row's text alone (decided 2026-09-27).
|
|
265
|
+
*/
|
|
266
|
+
reasoning: string;
|
|
267
|
+
/**
|
|
268
|
+
* Blocks to append to the row — the same list, the same
|
|
269
|
+
* checks and the same stamping as `create-message`'s
|
|
270
|
+
* `blocks`; appended as a `core:blocks` part after the text
|
|
271
|
+
* lands, so a reply can end with a question put to the cast.
|
|
272
|
+
*/
|
|
273
|
+
blocks: string;
|
|
274
|
+
/**
|
|
275
|
+
* **Folded sections** for the reply — the same list and the
|
|
276
|
+
* same checks as `create-message`'s `sections`. Finishing a
|
|
277
|
+
* reply, they are the shown alternative's sections, whole: a
|
|
278
|
+
* regenerate replaces what the slot held, and a finish with
|
|
279
|
+
* none clears it, while every other alternative keeps its own.
|
|
280
|
+
* Editing a settled row, they replace the shown alternative's
|
|
281
|
+
* only when given. Like `reasoning`, never re-sent to the model.
|
|
282
|
+
*/
|
|
283
|
+
sections: string;
|
|
284
|
+
}, "core:outlet/update-message@1"> & {
|
|
285
|
+
kind: 'outlet';
|
|
286
|
+
slots?: {
|
|
287
|
+
/** The same write hook as `create-message` — see it for the terms. */
|
|
288
|
+
readonly scripts: {
|
|
289
|
+
readonly kind: "scripts";
|
|
290
|
+
readonly accepts: ["core:script:text/transform@1", "core:script:text/stop@1"];
|
|
291
|
+
readonly port: "text";
|
|
292
|
+
readonly phase: "before";
|
|
293
|
+
readonly extras: ["speakerName", "castNames"];
|
|
294
|
+
readonly description: "Scripts over the reply as it is saved — clean up the text, or stop a streaming reply early.";
|
|
295
|
+
};
|
|
296
|
+
} | undefined;
|
|
297
|
+
}>;
|
|
298
|
+
/**
|
|
299
|
+
* Delete a message. Publishes `lost` — the content, role, speaker, channel
|
|
300
|
+
* and metadata the row held — beside the write result, so a listener (a
|
|
301
|
+
* plugin cleaning its rows, the next reply's inlet) knows what went.
|
|
302
|
+
* @experimental
|
|
303
|
+
*/
|
|
304
|
+
export declare const deleteMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
305
|
+
main: string;
|
|
306
|
+
messageId: string;
|
|
307
|
+
lost: string;
|
|
308
|
+
}, {
|
|
309
|
+
target: string;
|
|
310
|
+
}, "core:outlet/delete-message@1"> & {
|
|
311
|
+
kind: 'outlet';
|
|
312
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
313
|
+
}>;
|
|
314
|
+
/**
|
|
315
|
+
* Write the session's turn order — the ONE
|
|
316
|
+
* write path for `sessions.metadata.turnOrder`, and the only outlet that
|
|
317
|
+
* writes `metadata` at all.
|
|
318
|
+
*
|
|
319
|
+
* Before writing it drops what cannot be fired, each with a receipt note:
|
|
320
|
+
* an entry whose `ref` is not among `candidates` (a script or a plugin
|
|
321
|
+
* strategy cannot seat somebody the pool did not admit), and an entry on a
|
|
322
|
+
* channel the session does not have. Then `writeTurnOrder`, which refuses
|
|
323
|
+
* an order answering an older event than the one already stored and says
|
|
324
|
+
* `stale` on the receipt rather than failing.
|
|
325
|
+
*
|
|
326
|
+
* `causesEvent` is how `turn-order-changed` reaches the auto-advance
|
|
327
|
+
* listener and the `sessions:turnOrder` push; the `cause` wired in here is
|
|
328
|
+
* the one that rides along, so the listener can tell a person's send from a
|
|
329
|
+
* migration's backfill.
|
|
330
|
+
* @experimental
|
|
331
|
+
*/
|
|
332
|
+
export declare const setTurnOrder: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
333
|
+
main: string;
|
|
334
|
+
/** The document as written, or the stored one when this was stale. */
|
|
335
|
+
turnOrder: string;
|
|
336
|
+
}, {
|
|
337
|
+
order: string;
|
|
338
|
+
candidates: string;
|
|
339
|
+
/** The instant the answered event happened — the staleness key. */
|
|
340
|
+
basedOnAt: string;
|
|
341
|
+
/** The event id this order answers. */
|
|
342
|
+
event: string;
|
|
343
|
+
/** The inlet's cause, carried into `turn-order-changed`. */
|
|
344
|
+
cause: string;
|
|
345
|
+
}, "core:outlet/set-turn-order@1"> & {
|
|
346
|
+
kind: 'outlet';
|
|
347
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
348
|
+
}>;
|
|
349
|
+
/**
|
|
350
|
+
* Write one owner's document into the session's annex.
|
|
351
|
+
*
|
|
352
|
+
* Merged into what is there by default — a spec that keeps one key does not
|
|
353
|
+
* have to carry the rest — and written under
|
|
354
|
+
* `pg_advisory_xact_lock(hashtext('annex'), sessionId)` through `jsonb_set`,
|
|
355
|
+
* so two specs writing two owners' documents at once cannot lose each
|
|
356
|
+
* other's. Causes `core:event/annex-changed@1` (a later
|
|
357
|
+
* ruling, reversing the original "no causesEvent"): a package's state is the annex, and a
|
|
358
|
+
* genre that wants its turn order to answer that state binds the event in
|
|
359
|
+
* the open, where the event map draws it — not through a back door.
|
|
360
|
+
* @experimental
|
|
361
|
+
*/
|
|
362
|
+
export declare const setSessionAnnex: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
363
|
+
main: string;
|
|
364
|
+
annex: string;
|
|
365
|
+
}, {
|
|
366
|
+
value: string;
|
|
367
|
+
}, "core:outlet/set-session-annex@1"> & {
|
|
368
|
+
kind: 'outlet';
|
|
369
|
+
slots?: {
|
|
370
|
+
readonly params: {
|
|
371
|
+
readonly kind: "parameters";
|
|
372
|
+
readonly facet: "behavior";
|
|
373
|
+
readonly schema: {
|
|
374
|
+
readonly owner: {
|
|
375
|
+
readonly type: "string";
|
|
376
|
+
readonly default: "";
|
|
377
|
+
readonly label: {
|
|
378
|
+
readonly en: "Owner";
|
|
379
|
+
};
|
|
380
|
+
readonly description: {
|
|
381
|
+
readonly en: "Whose document to write. Blank means this pipeline's own.";
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
readonly merge: {
|
|
385
|
+
readonly type: "boolean";
|
|
386
|
+
readonly default: true;
|
|
387
|
+
readonly label: {
|
|
388
|
+
readonly en: "Merge";
|
|
389
|
+
};
|
|
390
|
+
readonly description: {
|
|
391
|
+
readonly en: "Keep the keys already there and write over the ones given. Off replaces the whole document.";
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
readonly sharedAnnex: {
|
|
395
|
+
readonly type: "boolean";
|
|
396
|
+
readonly default: false;
|
|
397
|
+
readonly label: {
|
|
398
|
+
readonly en: "Write another owner";
|
|
399
|
+
};
|
|
400
|
+
readonly description: {
|
|
401
|
+
readonly en: "Allow writing a document this pipeline does not own. Off refuses, with a note on the receipt.";
|
|
402
|
+
};
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
} | undefined;
|
|
407
|
+
}>;
|
|
408
|
+
/**
|
|
409
|
+
* Set one **annex field** (2026-09-26): the write behind every
|
|
410
|
+
* `annexField()` a package declares — core's one pipeline for them all,
|
|
411
|
+
* `core:spec/set-annex-field`.
|
|
412
|
+
*
|
|
413
|
+
* `payload` is `{ field, value }`: `field` the field's action identity
|
|
414
|
+
* (`<owner>:annex#<key>`), which the host's door put there after judging the
|
|
415
|
+
* press — who pressed, the plugin switch, the shape. The host reads the
|
|
416
|
+
* declaration again here rather than trusting the payload: an undeclared
|
|
417
|
+
* key, a value its shape refuses, a secret, or a declared audience that is
|
|
418
|
+
* not one is refused, and the run halts on it. What is written goes through
|
|
419
|
+
* the same annex write as `set-session-annex` — the lock, one audience per
|
|
420
|
+
* key, `annex-changed`, every viewer's view re-sent — into
|
|
421
|
+
* `annex[<owner>][<key>]`, under the audience the declaration names.
|
|
422
|
+
* @experimental
|
|
423
|
+
*/
|
|
424
|
+
export declare const setAnnexField: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
425
|
+
main: string;
|
|
426
|
+
annex: string;
|
|
427
|
+
}, {
|
|
428
|
+
payload: string;
|
|
429
|
+
}, "core:outlet/set-annex-field@1"> & {
|
|
430
|
+
kind: 'outlet';
|
|
431
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
432
|
+
}>;
|
|
433
|
+
/**
|
|
434
|
+
* Record an event your package declared: something happened, and
|
|
435
|
+
* pipelines bound to it — plugin listeners, and widgets when the event is
|
|
436
|
+
* delivered to the session — hear it.
|
|
437
|
+
*
|
|
438
|
+
* `event` is the declaration value (`defineSessionEvent(…)`), written into
|
|
439
|
+
* the document as its id; it is never wired, so what a pipeline records is
|
|
440
|
+
* known before it runs. `payload` must carry the event's declared shape. The
|
|
441
|
+
* write is the `session_changes` row, and the event it causes is the one it
|
|
442
|
+
* names — so a recorded event is, like every event, the consequence of a
|
|
443
|
+
* write. It is never the live row; a run may record several.
|
|
444
|
+
*
|
|
445
|
+
* Who may record it is the declaring package's to say
|
|
446
|
+
* (`defineExtension({ events: [{ event, genre, recordedBy }] })`): the host
|
|
447
|
+
* refuses a recording from a pipeline outside that scope.
|
|
448
|
+
* @experimental
|
|
449
|
+
*/
|
|
450
|
+
export declare const recordEvent: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
451
|
+
main: string;
|
|
452
|
+
}, {
|
|
453
|
+
/** The declared event's id — a literal, never wired. */
|
|
454
|
+
event: string;
|
|
455
|
+
payload: string;
|
|
456
|
+
}, "core:outlet/record-event@1"> & {
|
|
457
|
+
kind: 'outlet';
|
|
458
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
459
|
+
}>;
|
|
460
|
+
/**
|
|
461
|
+
* Hide a message from the prompt, or show it again — a **ghost**. The row
|
|
462
|
+
* stays; `hidden` says which way it went.
|
|
463
|
+
* @experimental
|
|
464
|
+
*/
|
|
465
|
+
export declare const hideMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
466
|
+
main: string;
|
|
467
|
+
messageId: string;
|
|
468
|
+
hidden: string;
|
|
469
|
+
}, {
|
|
470
|
+
target: string;
|
|
471
|
+
hidden: string;
|
|
472
|
+
}, "core:outlet/hide-message@1"> & {
|
|
473
|
+
kind: 'outlet';
|
|
474
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
475
|
+
}>;
|
|
476
|
+
/**
|
|
477
|
+
* A person's rewrite of a **settled** row: the text replaces, the selected
|
|
478
|
+
* alternative follows it, the embedding is cleared for re-indexing, and the
|
|
479
|
+
* row is marked edited. Publishes `previous` — the content it replaced.
|
|
480
|
+
*
|
|
481
|
+
* Distinct from `update-message@1`, which finishes a *generating* row with
|
|
482
|
+
* what a pipeline produced. A floor: every genre has it.
|
|
483
|
+
* @experimental
|
|
484
|
+
*/
|
|
485
|
+
export declare const editMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
486
|
+
main: string;
|
|
487
|
+
messageId: string;
|
|
488
|
+
previous: string;
|
|
489
|
+
}, {
|
|
490
|
+
target: string;
|
|
491
|
+
text: string;
|
|
492
|
+
}, "core:outlet/edit-message@1"> & {
|
|
493
|
+
kind: 'outlet';
|
|
494
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
495
|
+
}>;
|
|
496
|
+
/**
|
|
497
|
+
* Move between a message's alternatives, or record a new one. `index`
|
|
498
|
+
* selects an alternative the row already holds; `text` records a new one and
|
|
499
|
+
* selects it — the reply road then fills an empty one it opened this way.
|
|
500
|
+
* Publishes `swipeIndex`, the alternative now showing, and `previous` — the
|
|
501
|
+
* content and index that were.
|
|
502
|
+
* @experimental
|
|
503
|
+
*/
|
|
504
|
+
export declare const swipeMessage: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
505
|
+
main: string;
|
|
506
|
+
messageId: string;
|
|
507
|
+
swipeIndex: string;
|
|
508
|
+
previous: string;
|
|
509
|
+
}, {
|
|
510
|
+
target: string;
|
|
511
|
+
index: string;
|
|
512
|
+
text: string;
|
|
513
|
+
}, "core:outlet/swipe-message@1"> & {
|
|
514
|
+
kind: 'outlet';
|
|
515
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
516
|
+
}>;
|
|
517
|
+
/**
|
|
518
|
+
* Branch a session at a message: a new session with the same cast, guests
|
|
519
|
+
* and tags and a copy of the history up to and including `fromMessage`, each
|
|
520
|
+
* copy keeping its channel. Publishes the new `sessionId`. A floor.
|
|
521
|
+
* @experimental
|
|
522
|
+
*/
|
|
523
|
+
export declare const branchSession: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
524
|
+
main: string;
|
|
525
|
+
sessionId: string;
|
|
526
|
+
}, {
|
|
527
|
+
fromMessage: string;
|
|
528
|
+
title: string;
|
|
529
|
+
}, "core:outlet/branch-session@1"> & {
|
|
530
|
+
kind: 'outlet';
|
|
531
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
532
|
+
}>;
|
|
533
|
+
/**
|
|
534
|
+
* 🚧 Set the session's **backdrop**: `sessions.backdropMediaId`, the picture
|
|
535
|
+
* the Backdrop widget shows behind or beside the Stage — session state, a
|
|
536
|
+
* role pointer like a card's avatar, never a message part.
|
|
537
|
+
*
|
|
538
|
+
* `media` is a media list (what `core:oracle/generate-image@1` publishes);
|
|
539
|
+
* the host takes the FIRST image in it, keyed or not, and refuses a file
|
|
540
|
+
* that belongs to neither this session nor the user the run acts as (the
|
|
541
|
+
* rule `create-message`'s media keeps). A list with no image in it writes
|
|
542
|
+
* nothing, causes no event and publishes a null `mediaId` — it never
|
|
543
|
+
* clears: a person clears a backdrop, a pipeline replaces it. Runs in the
|
|
544
|
+
* session scope the run was started in.
|
|
545
|
+
*
|
|
546
|
+
* Causes `core:event/backdrop-set@1` when the pointer moved. Publishes the
|
|
547
|
+
* write result on `main` and the file id now set on `mediaId` (null when
|
|
548
|
+
* nothing was written).
|
|
549
|
+
*
|
|
550
|
+
* ⚠ Not the app background (`user_settings.background_media_id`), not a
|
|
551
|
+
* message attachment, and not the retired *scene image* pins.
|
|
552
|
+
* @experimental
|
|
553
|
+
*/
|
|
554
|
+
export declare const setBackdrop: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
555
|
+
main: string;
|
|
556
|
+
mediaId: string;
|
|
557
|
+
}, {
|
|
558
|
+
media: string;
|
|
559
|
+
}, "core:outlet/set-backdrop@1"> & {
|
|
560
|
+
kind: 'outlet';
|
|
561
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
562
|
+
}>;
|
|
563
|
+
/**
|
|
564
|
+
* Record a line's **shown sprite**. Writes it on the line's ACTIVE swipe
|
|
565
|
+
* (`metadata.swipes.spriteHistory[currentIdx]`, mirrored to
|
|
566
|
+
* `metadata.sprite`), so each swipe keeps its own face.
|
|
567
|
+
*
|
|
568
|
+
* Who chose it is `source`, written by the spec as a literal: `picker` after
|
|
569
|
+
* a reply, `person` in `core:spec/show-sprite` (a person's pick from the
|
|
570
|
+
* message menu). A picker never overwrites a person's pick. A picker's null
|
|
571
|
+
* pick writes nothing — the line keeps what it shows; a person's null clears
|
|
572
|
+
* the line's sprite.
|
|
573
|
+
* @experimental
|
|
574
|
+
*/
|
|
575
|
+
export declare const showSprite: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
576
|
+
main: string;
|
|
577
|
+
messageId: string;
|
|
578
|
+
/** What the line now shows, or null. */
|
|
579
|
+
sprite: string;
|
|
580
|
+
/**
|
|
581
|
+
* True when nothing was written — a picker meeting a person's
|
|
582
|
+
* pick, a picker's null pick, or the sprite the line already
|
|
583
|
+
* shows.
|
|
584
|
+
*/
|
|
585
|
+
kept: string;
|
|
586
|
+
}, {
|
|
587
|
+
target: string;
|
|
588
|
+
/** A `sprite-pick@1` — a picker's, or a person's; null for none. */
|
|
589
|
+
pick: string;
|
|
590
|
+
/**
|
|
591
|
+
* Who chose the pick: `'picker'` or `'person'`.
|
|
592
|
+
*
|
|
593
|
+
* ## A port, not a parameter, and the call site is what decides
|
|
594
|
+
*
|
|
595
|
+
* A literal in the node's config, on `create-message`'s
|
|
596
|
+
* `generating` terms: the reply specs write `source: 'picker'`
|
|
597
|
+
* and `core:spec/show-sprite` writes `source: 'person'`. A
|
|
598
|
+
* `params` field would put a structural fact of the document
|
|
599
|
+
* in the panel as a knob. It was the host's to decide from the
|
|
600
|
+
* running spec's id until 2026-10-05; the document says it now.
|
|
601
|
+
*
|
|
602
|
+
* ⚠ Stated, not trusted: a host accepts `'person'` only from
|
|
603
|
+
* core's own `core:spec/show-sprite`, run for a person whose
|
|
604
|
+
* pick it checked against the item rule, as for an edit.
|
|
605
|
+
*/
|
|
606
|
+
source: string;
|
|
607
|
+
}, "core:outlet/show-sprite@1"> & {
|
|
608
|
+
kind: 'outlet';
|
|
609
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
610
|
+
}>;
|
|
611
|
+
/**
|
|
612
|
+
* 🚧 File pictures as a card's **sprites** — the end of the Sprite set fill.
|
|
613
|
+
*
|
|
614
|
+
* For every item of `media` that carries a series `key`: a `sprites` row in
|
|
615
|
+
* the set named `setName` (the card's default set when the name is blank or
|
|
616
|
+
* gone), under the sprite label that key was drawn for, with
|
|
617
|
+
* `source: 'generated'` and the picture as its file. The label comes from
|
|
618
|
+
* `series` (each item's `vars.label`); with no series the key is the label.
|
|
619
|
+
*
|
|
620
|
+
* - An **empty sprite** waiting under the label is filled first.
|
|
621
|
+
* - Otherwise the picture is added beside what is there — a **variant** —
|
|
622
|
+
* so a second picture under one key, or a run that redraws a label, never
|
|
623
|
+
* replaces a sprite.
|
|
624
|
+
* - An item with **no key** (surplus the host kept) is ignored.
|
|
625
|
+
* - A key in `series` that brought no picture is reported on `missing`.
|
|
626
|
+
*
|
|
627
|
+
* The picture becomes the card's file (provenance: `files.character_id`), so
|
|
628
|
+
* it carries the card's visibility and stays out of the card's gallery like
|
|
629
|
+
* every sprite. Refused unless the run's person owns the card or is an admin.
|
|
630
|
+
*
|
|
631
|
+
* Causes `core:event/sprites-attached@1` when at least one row was written.
|
|
632
|
+
* About a card, not a session: it writes no session row.
|
|
633
|
+
* @experimental
|
|
634
|
+
*/
|
|
635
|
+
export declare const attachSprite: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
636
|
+
main: string;
|
|
637
|
+
/** `[{ label, spriteId }]`, one per row written, in media order. */
|
|
638
|
+
attached: string;
|
|
639
|
+
/** Sprite labels the series asked for that came back with no picture. */
|
|
640
|
+
missing: string;
|
|
641
|
+
}, {
|
|
642
|
+
media: string;
|
|
643
|
+
characterId: string;
|
|
644
|
+
setName: string;
|
|
645
|
+
/** The series the pictures were drawn for — the key → sprite label map. */
|
|
646
|
+
series: string;
|
|
647
|
+
}, "core:outlet/attach-sprite@1"> & {
|
|
648
|
+
kind: 'outlet';
|
|
649
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
650
|
+
}>;
|
|
651
|
+
/**
|
|
652
|
+
* 🚧 **Offer** pictures to a card — put them in the card's **gallery** for a
|
|
653
|
+
* person to pick from (the end of Portrait).
|
|
654
|
+
*
|
|
655
|
+
* Each image in `media` becomes a picture of the card's gallery, after the
|
|
656
|
+
* pictures already there, in media order. Nothing is chosen for the person:
|
|
657
|
+
* the avatar and the likeness image are left as they are. *Use as avatar*
|
|
658
|
+
* and *Use as likeness image* on the gallery tile are the person's, later.
|
|
659
|
+
*
|
|
660
|
+
* - An item that is not an image is skipped.
|
|
661
|
+
* - A picture must be the run person's own file or already the card's — a
|
|
662
|
+
* media reference is an address anyone could type, and the gallery would
|
|
663
|
+
* re-publish whatever it names under the card's visibility.
|
|
664
|
+
* - A picture that is already one of the card's files stays where it is.
|
|
665
|
+
*
|
|
666
|
+
* `offered` is `[{ mediaId, key }]`, one per picture placed, with the series
|
|
667
|
+
* key it was drawn for (`null` for surplus the host kept unkeyed). Refused
|
|
668
|
+
* unless the run's person owns the card or is an admin.
|
|
669
|
+
*
|
|
670
|
+
* Causes `core:event/media-offered@1` when at least one picture was placed.
|
|
671
|
+
* About a card, not a session: it writes no session row.
|
|
672
|
+
* @experimental
|
|
673
|
+
*/
|
|
674
|
+
export declare const offerMedia: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
675
|
+
main: string;
|
|
676
|
+
/** `[{ mediaId, key }]`, one per picture placed, in media order. */
|
|
677
|
+
offered: string;
|
|
678
|
+
}, {
|
|
679
|
+
media: string;
|
|
680
|
+
characterId: string;
|
|
681
|
+
}, "core:outlet/offer-media@1"> & {
|
|
682
|
+
kind: 'outlet';
|
|
683
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
684
|
+
}>;
|
|
685
|
+
/**
|
|
686
|
+
* Move a session's **story clock** — the session's own story now — by `by` of
|
|
687
|
+
* `unit`, through its lorebook's calendar (`advanceStoryTime`): carried by a
|
|
688
|
+
* declared calendar, and by the smallest-part rule in a free-form book.
|
|
689
|
+
* What "advance a minute per reply" places.
|
|
690
|
+
*
|
|
691
|
+
* Moves the session's clock only, never the book's or its line's present. A
|
|
692
|
+
* session with no clock of its own starts from its line's present. Refused
|
|
693
|
+
* with a sentence — the run halts, unless the spec says `onRefusal: 'skip'`
|
|
694
|
+
* — when the session has no lorebook, when there is no present to start
|
|
695
|
+
* from, and when the result does not land in the book's calendar; never
|
|
696
|
+
* clamped, never a silent no-op.
|
|
697
|
+
*
|
|
698
|
+
* `by` and `unit` in-ports, when wired, win over the parameters. To advance
|
|
699
|
+
* once per reply, place it in a spec bound to the reply's event, which runs
|
|
700
|
+
* after the reply is saved. (No ordering-only in-port: an unread port is a
|
|
701
|
+
* declared control no run consults — `declaredReads`.)
|
|
702
|
+
*
|
|
703
|
+
* 🚧 Every move it makes is written to the session's state ledger, anchored
|
|
704
|
+
* where the world's changes are (live scenes §15 G5, 2026-10-13): the person
|
|
705
|
+
* reads it under the message ("Time passes: 3 hours (… → …)"), and a delete,
|
|
706
|
+
* swipe or regenerate of that message takes it back as it takes values back.
|
|
707
|
+
* Why the clock moved is the spec's to say (`cause`), never inferred from
|
|
708
|
+
* the run's inlet.
|
|
709
|
+
* @experimental
|
|
710
|
+
*/
|
|
711
|
+
export declare const advanceStoryClock: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
712
|
+
main: string;
|
|
713
|
+
/** The session's story clock as it now stands: `{ year, month?, day?, hour?, minute? }`. */
|
|
714
|
+
clock: string;
|
|
715
|
+
/**
|
|
716
|
+
* 🚧 Why the clock did not move, under `onRefusal: 'skip'` —
|
|
717
|
+
* the sentence the person reads; empty when it moved.
|
|
718
|
+
*/
|
|
719
|
+
skipped: string;
|
|
720
|
+
/** It spelled through the book's calendar. */
|
|
721
|
+
label: string;
|
|
722
|
+
}, {
|
|
723
|
+
/** A whole number; wins over the `by` parameter when wired. */
|
|
724
|
+
by: string;
|
|
725
|
+
/** One of the units; wins over the `unit` parameter when wired. */
|
|
726
|
+
unit: string;
|
|
727
|
+
/**
|
|
728
|
+
* 🚧 **Why the clock moves** (live scenes §15 G4, 2026-10-13),
|
|
729
|
+
* a literal: `'action'` — a person's press (*Time passes…*);
|
|
730
|
+
* `'keeper'` — the state-keeper's move under Trust the
|
|
731
|
+
* narrator; `'tick'` — a reply's fixed tick. An action's and
|
|
732
|
+
* the keeper's move are **time actions** the boundary watcher
|
|
733
|
+
* may begin a new scene at; a tick never is. Unwired reads as
|
|
734
|
+
* `'action'`.
|
|
735
|
+
*
|
|
736
|
+
* ## A port, not a parameter, and the call site is what decides
|
|
737
|
+
*
|
|
738
|
+
* As `show-sprite@1`'s `source`: a literal in the node's
|
|
739
|
+
* config, because why a step moves the clock is a structural
|
|
740
|
+
* fact of the document, not a knob for the panel. It was the
|
|
741
|
+
* host's to infer from the run's inlet until 2026-10-13, and a
|
|
742
|
+
* keeper's move on a reply turn was then never a time action.
|
|
743
|
+
* It also decides what a swipe or a regenerate takes back: a
|
|
744
|
+
* tick stands (the re-driven reply never ticks again), every
|
|
745
|
+
* other move goes with the reply.
|
|
746
|
+
*/
|
|
747
|
+
cause: string;
|
|
748
|
+
/**
|
|
749
|
+
* 🚧 **What a refusal does** (live scenes §15 G7), a literal:
|
|
750
|
+
* `'halt'` (unwired) stops the run with the sentence;
|
|
751
|
+
* `'skip'` moves nothing, puts the sentence on `skipped` and
|
|
752
|
+
* on the session's state ledger, and lets the run finish — for
|
|
753
|
+
* a step that runs after other changes already landed, which
|
|
754
|
+
* a halt would leave looking like a failed turn. Every core
|
|
755
|
+
* spec's skips: Adventure's keeper steps and its *Time
|
|
756
|
+
* passes…*, Chat's reply tick, and Chat's and the Lair's *Time
|
|
757
|
+
* passes…* (live scenes §15 G12).
|
|
758
|
+
*/
|
|
759
|
+
onRefusal: string;
|
|
760
|
+
}, "core:outlet/advance-story-clock@1"> & {
|
|
761
|
+
kind: 'outlet';
|
|
762
|
+
slots?: {
|
|
763
|
+
readonly params: {
|
|
764
|
+
readonly kind: "parameters";
|
|
765
|
+
readonly facet: "behavior";
|
|
766
|
+
readonly schema: {
|
|
767
|
+
readonly by: {
|
|
768
|
+
readonly type: "integer";
|
|
769
|
+
readonly default: 1;
|
|
770
|
+
readonly label: {
|
|
771
|
+
readonly en: "By";
|
|
772
|
+
};
|
|
773
|
+
readonly description: {
|
|
774
|
+
readonly en: "How many units to move the clock. Negative goes back.";
|
|
775
|
+
};
|
|
776
|
+
};
|
|
777
|
+
readonly unit: {
|
|
778
|
+
readonly type: "enum";
|
|
779
|
+
readonly of: readonly ["minutes", "hours", "days", "months", "years"];
|
|
780
|
+
readonly members: readonly [{
|
|
781
|
+
readonly key: "minutes";
|
|
782
|
+
readonly label: {
|
|
783
|
+
readonly en: "Minutes";
|
|
784
|
+
};
|
|
785
|
+
}, {
|
|
786
|
+
readonly key: "hours";
|
|
787
|
+
readonly label: {
|
|
788
|
+
readonly en: "Hours";
|
|
789
|
+
};
|
|
790
|
+
}, {
|
|
791
|
+
readonly key: "days";
|
|
792
|
+
readonly label: {
|
|
793
|
+
readonly en: "Days";
|
|
794
|
+
};
|
|
795
|
+
}, {
|
|
796
|
+
readonly key: "months";
|
|
797
|
+
readonly label: {
|
|
798
|
+
readonly en: "Months";
|
|
799
|
+
};
|
|
800
|
+
}, {
|
|
801
|
+
readonly key: "years";
|
|
802
|
+
readonly label: {
|
|
803
|
+
readonly en: "Years";
|
|
804
|
+
};
|
|
805
|
+
}];
|
|
806
|
+
readonly default: "hours";
|
|
807
|
+
readonly label: {
|
|
808
|
+
readonly en: "Unit";
|
|
809
|
+
};
|
|
810
|
+
readonly description: {
|
|
811
|
+
readonly en: "What to count. In a free-form book only the part named moves: days never roll into a month.";
|
|
812
|
+
};
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
};
|
|
816
|
+
} | undefined;
|
|
817
|
+
}>;
|
|
818
|
+
/**
|
|
819
|
+
* Commit an oracle's answer to a form **exactly as a click would**.
|
|
820
|
+
*
|
|
821
|
+
* The host checks the answer against the form's schema, then fires the
|
|
822
|
+
* block's action through the same server path a press takes
|
|
823
|
+
* (`fireAction`): the run owner is the acting user, the actor portrays the
|
|
824
|
+
* addressee, the block's addressee is the audience, and the action's spec
|
|
825
|
+
* runs as a child of this run. It records `form-answered` in the session's
|
|
826
|
+
* changes with the answer and `answeredBy: 'oracle'`, so the next reply's
|
|
827
|
+
* inlet sees it. Refused outside a document on `core:inlet/form-addressed@1`
|
|
828
|
+
* (`validate()` and the host), refused when the addressee is not the AI's,
|
|
829
|
+
* and refused for a `world` action (the effects line — belt to the
|
|
830
|
+
* validator's braces). `reviewDefault: 'off'`; an admin may gate it, and the
|
|
831
|
+
* reviewer edits the `answer` alone.
|
|
832
|
+
* @experimental
|
|
833
|
+
*/
|
|
834
|
+
export declare const answerForm: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
835
|
+
main: string;
|
|
836
|
+
messageId: string;
|
|
837
|
+
/** The answer as committed: `{ choice }` or the values. */
|
|
838
|
+
answer: string;
|
|
839
|
+
/** The identity of the action the answer fires — `<spec slug>#<key>`. */
|
|
840
|
+
firedAction: string;
|
|
841
|
+
/** The child run's id, chosen at the commit so this receipt can name it. */
|
|
842
|
+
firedRunId: string;
|
|
843
|
+
}, {
|
|
844
|
+
/** The block, as the inlet published it. */
|
|
845
|
+
form: string;
|
|
846
|
+
/** The oracle's document — checked against `formAnswerSchema(form)`. */
|
|
847
|
+
answer: string;
|
|
848
|
+
messageId: string;
|
|
849
|
+
blockId: string;
|
|
850
|
+
addressee: string;
|
|
851
|
+
}, "core:outlet/answer-form@1"> & {
|
|
852
|
+
kind: 'outlet';
|
|
853
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
854
|
+
}>;
|
|
855
|
+
/** The audio twin of `attach-image` — same `target`, same commit, bound the same day. @experimental */
|
|
856
|
+
export declare const attachAudio: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
857
|
+
main: string;
|
|
858
|
+
}, {
|
|
859
|
+
target: string;
|
|
860
|
+
audio: string;
|
|
861
|
+
}, "core:outlet/attach-audio@1"> & {
|
|
862
|
+
kind: 'outlet';
|
|
863
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
864
|
+
}>;
|
|
865
|
+
/**
|
|
866
|
+
* Write the finished entry. Gate-eligible, so it publishes a write result.
|
|
867
|
+
*
|
|
868
|
+
* ## Which kind of entry — the pipeline's decision, at last (2026-09-17)
|
|
869
|
+
*
|
|
870
|
+
* The host's commit case has said since the four summarize namespaces were
|
|
871
|
+
* written that *which kind of entry comes from the pipeline that ran*. It did
|
|
872
|
+
* not: it wrote world lore whatever ran, because nothing on this declaration
|
|
873
|
+
* could say otherwise. `entryType` is that sentence made true — a declared
|
|
874
|
+
* entry type id (`core:entry/world-lore`, `core:entry/history`,
|
|
875
|
+
* `core:entry/location`), bare, the way `core:query/lorebook-entries@1` spells
|
|
876
|
+
* them; the version is the row's own column.
|
|
877
|
+
*
|
|
878
|
+
* A **param** and not an in-port, because the kind of thing a pipeline writes
|
|
879
|
+
* is a fact about the pipeline rather than about the turn — a summarizer
|
|
880
|
+
* writes history every time it runs, a room-builder writes locations every
|
|
881
|
+
* time — and a param is what a preset can set per session without the spec
|
|
882
|
+
* being rewired. An unknown id is refused at the commit with a sentence
|
|
883
|
+
* naming the declared types, never coerced to world lore: a typo that silently
|
|
884
|
+
* files rooms as world lore is the defect this replaces.
|
|
885
|
+
*
|
|
886
|
+
* Default world lore, the agnostic shape, so every spec written before this
|
|
887
|
+
* keeps doing exactly what it did.
|
|
888
|
+
*
|
|
889
|
+
* ## `links`, or a second write
|
|
890
|
+
*
|
|
891
|
+
* Linking a new entry takes one of two shapes, and both exist on purpose.
|
|
892
|
+
* (A pipeline may write many times — only the live row is limited to one — so
|
|
893
|
+
* `core:outlet/link-lore-entries@1` may also follow this outlet in the same
|
|
894
|
+
* run, each its own transaction.)
|
|
895
|
+
*
|
|
896
|
+
* - `links` — the links land in the **same transaction** as the row, keyed
|
|
897
|
+
* from the entry just written. A genre that builds a room with its exits
|
|
898
|
+
* does it in one run and one commit, and a link naming an entry that does
|
|
899
|
+
* not exist fails the row with it rather than writing half a room. This is
|
|
900
|
+
* the shape a builder wants.
|
|
901
|
+
* - `core:outlet/link-lore-entries@1` takes its `to` by **name**, so a later
|
|
902
|
+
* run can link what an earlier one created without holding an id. This is
|
|
903
|
+
* the shape a second turn wants.
|
|
904
|
+
*
|
|
905
|
+
* Each entry of `links` is a name or an entry id, or a `LoreLinkInput` —
|
|
906
|
+
* `{ to, linkType?, reverseLinkType?, name?, description? }` — for one that
|
|
907
|
+
* says more (2026-09-29). Absent on nearly every write, and an
|
|
908
|
+
* empty list is the same as none. A link the list states twice, or one the
|
|
909
|
+
* session already reads, is written once: see `linkLoreEntries` on idempotence.
|
|
910
|
+
* @internal
|
|
911
|
+
*/
|
|
912
|
+
export declare const createLoreEntry: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
913
|
+
main: string;
|
|
914
|
+
entryId: string;
|
|
915
|
+
}, {
|
|
916
|
+
name: string;
|
|
917
|
+
content: string;
|
|
918
|
+
/**
|
|
919
|
+
* Links to write from this entry in the same commit — see the
|
|
920
|
+
* note above on the live row. Names, entry ids, or `LoreLinkInput`s.
|
|
921
|
+
*/
|
|
922
|
+
links: string;
|
|
923
|
+
}, "core:outlet/create-lore-entry@1"> & {
|
|
924
|
+
kind: 'outlet';
|
|
925
|
+
slots?: {
|
|
926
|
+
readonly params: {
|
|
927
|
+
readonly kind: "parameters";
|
|
928
|
+
readonly schema: {
|
|
929
|
+
readonly entryType: {
|
|
930
|
+
readonly type: "string";
|
|
931
|
+
readonly default: "core:entry/world-lore";
|
|
932
|
+
readonly quick: true;
|
|
933
|
+
readonly label: {
|
|
934
|
+
readonly en: "Kind of entry";
|
|
935
|
+
};
|
|
936
|
+
readonly description: "Which kind of lorebook entry this pipeline writes — world lore, history, a location. Leave it as world lore for anything that is simply about the world.";
|
|
937
|
+
};
|
|
938
|
+
};
|
|
939
|
+
};
|
|
940
|
+
} | undefined;
|
|
941
|
+
}>;
|
|
942
|
+
/**
|
|
943
|
+
* Link two lore entries (2026-09-17).
|
|
944
|
+
*
|
|
945
|
+
* ## The gap it closes
|
|
946
|
+
*
|
|
947
|
+
* `create-lore-entry@1` takes a name and a body and nothing else, so a genre
|
|
948
|
+
* whose world has *shape* — a room with exits, a street that runs past a shop
|
|
949
|
+
* — had one place to put that shape: the prose. Lair shipped writing an
|
|
950
|
+
* `Exits:` line into the content and parsing it back out, which is a link with
|
|
951
|
+
* no foreign key, no cascade and no second reader. The rows have existed all
|
|
952
|
+
* along (an entry-ended `narrative_relationships` row, the same edge the
|
|
953
|
+
* lorebook's own graph draws); no pipeline could write one.
|
|
954
|
+
*
|
|
955
|
+
* ## Both ends, and the one scope
|
|
956
|
+
*
|
|
957
|
+
* `from` is an entry id — or, straight off `create-lore-entry@1`, its
|
|
958
|
+
* `entryId` write result, which is assignable to `row-ids@1`. `to`
|
|
959
|
+
* is an id **or a name**, resolved within the session's own lorebook, case
|
|
960
|
+
* and surrounding space ignored. A name is the half that makes the law below
|
|
961
|
+
* survivable, and it is also the half that can be wrong in two ways, so both
|
|
962
|
+
* are refused with a sentence: a name nothing answers to, and a name **two**
|
|
963
|
+
* entries answer to — the second never picks one, because picking would link
|
|
964
|
+
* the wrong room silently and a duplicate name is the author's to resolve.
|
|
965
|
+
*
|
|
966
|
+
* One lorebook, both ends. An edge whose ends live in two books belongs to
|
|
967
|
+
* neither and the row carries one `lorebook_id`, so a cross-book link is
|
|
968
|
+
* refused rather than repaired — the same rule the socket handlers hold, held
|
|
969
|
+
* again here because a pipeline does not come through them.
|
|
970
|
+
*
|
|
971
|
+
* ## After a create
|
|
972
|
+
*
|
|
973
|
+
* It may follow `core:outlet/create-lore-entry@1` in the same run (only the
|
|
974
|
+
* live row is limited to one), linking by name what that write created — which is why
|
|
975
|
+
* `to` takes one; a later run can do the same. Each write is its own
|
|
976
|
+
* transaction, so a failed link leaves the entry behind. When the entry and
|
|
977
|
+
* its links are one thought, `create-lore-entry`'s own `links` in-port writes
|
|
978
|
+
* the edges in the row's transaction instead — the shape a room-builder wants.
|
|
979
|
+
*
|
|
980
|
+
* ## What the link says (2026-09-29)
|
|
981
|
+
*
|
|
982
|
+
* The row is a **relationship**, and it carries the relationship's whole
|
|
983
|
+
* descriptor — the same four words the lorebook's own link form edits:
|
|
984
|
+
*
|
|
985
|
+
* - `linkType` — the relationship type, read from the `from` end ("leads
|
|
986
|
+
* north to"). Free text in the row and free text here: the app's list is a
|
|
987
|
+
* vocabulary of *suggestions*, and nothing reads a relationship type
|
|
988
|
+
* semantically. The default is `leads to`.
|
|
989
|
+
* - `reverseLinkType` — the wording read from the `to` end ("leads south
|
|
990
|
+
* to"). **Empty is one way**, and one way is the default: direction is
|
|
991
|
+
* something a spec says, never a guess the host makes from the forward
|
|
992
|
+
* words. A symmetric wording repeats itself (`connects to` / `connects to`).
|
|
993
|
+
* - `name` — the relationship's own name ("the rusted iron door", "the King's
|
|
994
|
+
* Road"), empty for an unnamed way. ⚠ Something you can stand in is a place
|
|
995
|
+
* of its own, not a named link.
|
|
996
|
+
* - `description` — its description. (It was the port `label`; one column,
|
|
997
|
+
* one word, no alias.)
|
|
998
|
+
*
|
|
999
|
+
* ## Idempotent
|
|
1000
|
+
*
|
|
1001
|
+
* One way is one row, **as the session reads** (the app's
|
|
1002
|
+
* `linksOnReadingThatWay`): a link the session already reads — on its own
|
|
1003
|
+
* line or one it inherits, undated or dated at or before its moment — with
|
|
1004
|
+
* the same name (case aside) that says **everything** this one would (the same
|
|
1005
|
+
* words read from the same end, both ways when both are asked, or its true
|
|
1006
|
+
* mirror drawn from the far end) is **the standing row**. The outlet returns
|
|
1007
|
+
* its id and writes nothing, so a re-run, a swipe or a second turn never stacks
|
|
1008
|
+
* a room's ways out; `fromEntryId` is the row's own `from`. The standing row is
|
|
1009
|
+
* never rewritten: a pipeline's repeat does not edit a link a person may have
|
|
1010
|
+
* drawn or worded. And because this run did not make the row, the host neither
|
|
1011
|
+
* records it as the run's (an undo of the run must not delete it) nor reports a
|
|
1012
|
+
* write (`written: false`, so no `core:event/lore-link-created@1`).
|
|
1013
|
+
*
|
|
1014
|
+
* Refused with a sentence instead: a link that says only PART of this one (a
|
|
1015
|
+
* one-way door where both ways is asked — a second row would say that part
|
|
1016
|
+
* twice), and one that says it all but no longer stands (resolved, broken,
|
|
1017
|
+
* secret) — nothing the session reads states it, and a pipeline does not
|
|
1018
|
+
* reopen or reveal it.
|
|
1019
|
+
* @internal
|
|
1020
|
+
*/
|
|
1021
|
+
export declare const linkLoreEntries: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1022
|
+
main: string;
|
|
1023
|
+
linkId: string;
|
|
1024
|
+
}, {
|
|
1025
|
+
/** The entry the link starts at — an id, or a write result. */
|
|
1026
|
+
from: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* The entry it ends at: an id, or a **name** resolved within
|
|
1029
|
+
* this session's lorebook. `json` because it is either — and
|
|
1030
|
+
* every shape is assignable into `json`, so an id port, a
|
|
1031
|
+
* write result and a text name all wire here.
|
|
1032
|
+
*/
|
|
1033
|
+
to: string;
|
|
1034
|
+
/** The relationship's own name — "the rusted iron door". Optional. */
|
|
1035
|
+
name: string;
|
|
1036
|
+
/** Its description. Optional. */
|
|
1037
|
+
description: string;
|
|
1038
|
+
}, "core:outlet/link-lore-entries@1"> & {
|
|
1039
|
+
kind: 'outlet';
|
|
1040
|
+
slots?: {
|
|
1041
|
+
readonly params: {
|
|
1042
|
+
readonly kind: "parameters";
|
|
1043
|
+
readonly schema: {
|
|
1044
|
+
readonly linkType: {
|
|
1045
|
+
readonly type: "string";
|
|
1046
|
+
readonly default: "leads to";
|
|
1047
|
+
readonly quick: true;
|
|
1048
|
+
readonly label: {
|
|
1049
|
+
readonly en: "Kind of link";
|
|
1050
|
+
};
|
|
1051
|
+
readonly description: "What the link says, read from the entry it starts at — “leads north to”, “connects to”, “is inside”, “keeper of”.";
|
|
1052
|
+
};
|
|
1053
|
+
readonly reverseLinkType: {
|
|
1054
|
+
readonly type: "string";
|
|
1055
|
+
readonly default: "";
|
|
1056
|
+
readonly label: {
|
|
1057
|
+
readonly en: "From there it…";
|
|
1058
|
+
};
|
|
1059
|
+
readonly description: "What the link says read from the other end — “leads south to”, “holds”. Leave it empty for a way that only goes one way.";
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1063
|
+
} | undefined;
|
|
1064
|
+
}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* One lore link a spec asks for — an element of
|
|
1067
|
+
* `core:outlet/create-lore-entry@1`'s `links` (2026-09-29).
|
|
1068
|
+
*
|
|
1069
|
+
* The same four words as `core:outlet/link-lore-entries@1`'s ports and
|
|
1070
|
+
* parameters, and as the `LoreLinkRow` a listing reads back: what you write is
|
|
1071
|
+
* what you read. A bare name, entry id or write result in `links` is the same
|
|
1072
|
+
* as `{ to }` with nothing else said.
|
|
1073
|
+
* @experimental
|
|
1074
|
+
*/
|
|
1075
|
+
export interface LoreLinkInput {
|
|
1076
|
+
/**
|
|
1077
|
+
* The entry the link ends at: an entry id, the name of an entry in the
|
|
1078
|
+
* session's lorebook (case and surrounding space ignored), or the write
|
|
1079
|
+
* result of the write that made it.
|
|
1080
|
+
*/
|
|
1081
|
+
to: number | string | WriteResult;
|
|
1082
|
+
/** The relationship type, read from the entry being saved. Absent is `leads to`. */
|
|
1083
|
+
linkType?: string;
|
|
1084
|
+
/** The wording read from `to`'s end. Absent or empty is one way. */
|
|
1085
|
+
reverseLinkType?: string;
|
|
1086
|
+
/** The relationship's own name — "the rusted iron door". Absent is unnamed. */
|
|
1087
|
+
name?: string;
|
|
1088
|
+
/** Its description. */
|
|
1089
|
+
description?: string;
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* One lore link on a `core:query/lorebook-entries@1` row, listed when the
|
|
1093
|
+
* spec asks for `withLinks` (2026-09-29).
|
|
1094
|
+
*
|
|
1095
|
+
* **Said from the listed entry**: `to` is the far end, whichever end of the
|
|
1096
|
+
* relationship the listed entry is. A relationship drawn from here reads by
|
|
1097
|
+
* its relationship type; one drawn to here reads by its reverse type, and one
|
|
1098
|
+
* drawn to here with no reverse type (one way, inbound) is not listed at all —
|
|
1099
|
+
* it is no way out of here. Only relationships between two entries, standing
|
|
1100
|
+
* (active, not secret) on the session's line at its moment, with both ends
|
|
1101
|
+
* live and the far end one the wired `speaker` may see — or, with no speaker
|
|
1102
|
+
* wired, one every voice may see.
|
|
1103
|
+
* @experimental
|
|
1104
|
+
*/
|
|
1105
|
+
export interface LoreLinkRow {
|
|
1106
|
+
/** The relationship's id. */
|
|
1107
|
+
id: number;
|
|
1108
|
+
/** The far end, named as the session's reading sees it (amendments applied). */
|
|
1109
|
+
to: {
|
|
1110
|
+
entryId: number;
|
|
1111
|
+
name: string;
|
|
1112
|
+
};
|
|
1113
|
+
/** The wording read from the listed entry — "leads north to". */
|
|
1114
|
+
linkType: string;
|
|
1115
|
+
/** The wording read from the far end back to here. Absent is one way. */
|
|
1116
|
+
reverseLinkType?: string;
|
|
1117
|
+
/** The relationship's own name. Absent is unnamed. */
|
|
1118
|
+
name?: string;
|
|
1119
|
+
/** Its description. Absent is none. */
|
|
1120
|
+
description?: string;
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* The proposal, held for review.
|
|
1124
|
+
*
|
|
1125
|
+
* `effects: 'write'` and therefore gate-eligible, which is the mechanism behind
|
|
1126
|
+
* the rule that a graph build **stops at the review screen** and never applies
|
|
1127
|
+
* itself. Under `async` review the proposal is exactly that — a proposal — and
|
|
1128
|
+
* `write-result@1` is the shape that refuses to be mistaken for row ids.
|
|
1129
|
+
* @internal
|
|
1130
|
+
*/
|
|
1131
|
+
export declare const graphProposal: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1132
|
+
main: string;
|
|
1133
|
+
proposalId: string;
|
|
1134
|
+
}, {
|
|
1135
|
+
proposal: string;
|
|
1136
|
+
}, "core:outlet/graph-proposal@1"> & {
|
|
1137
|
+
kind: 'outlet';
|
|
1138
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1139
|
+
}>;
|
|
1140
|
+
//# sourceMappingURL=outlets.d.ts.map
|