@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,3492 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core's **query** node definitions — reads.
|
|
3
|
+
*
|
|
4
|
+
* One file per node kind, with the helpers only that kind uses; `index.ts`
|
|
5
|
+
* re-exports them all.
|
|
6
|
+
*/
|
|
7
|
+
/** @public */
|
|
8
|
+
export declare const sessionHistory: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
9
|
+
/**
|
|
10
|
+
* Transcript rows, on both — `messages@1` (was
|
|
11
|
+
* `context-candidates@1` until 2026-09-17: the
|
|
12
|
+
* value had always been rows, for `process-messages` and
|
|
13
|
+
* `prose-transcript`, and the intent rides `band` alone).
|
|
14
|
+
* Neither is a candidates list (ruled the same day): a spec that
|
|
15
|
+
* wires either into a merge, a concat or `assemble`'s
|
|
16
|
+
* `candidates` gets a `validate()` warning naming `band` — the
|
|
17
|
+
* host drops rows handed as candidates rather than ranking them.
|
|
18
|
+
*/
|
|
19
|
+
main: string;
|
|
20
|
+
messages: string;
|
|
21
|
+
/**
|
|
22
|
+
* The conversation's **band intent**, alone — a candidates
|
|
23
|
+
* list holding one element and no items (`BandIntent`), for a
|
|
24
|
+
* spec to concatenate in with the lore so the ranker reserves
|
|
25
|
+
* the transcript's slice. Its own port because `main` and
|
|
26
|
+
* `messages` carry transcript rows for `process-messages`, and
|
|
27
|
+
* an intent element ahead of them would be read as a message.
|
|
28
|
+
* Opens with a band-intent element (and holds nothing else)
|
|
29
|
+
* — readers call `splitCandidates()`.
|
|
30
|
+
*/
|
|
31
|
+
band: string;
|
|
32
|
+
}, {
|
|
33
|
+
scope: string;
|
|
34
|
+
/**
|
|
35
|
+
* **The window this read is sized by** (history window,
|
|
36
|
+
* 2026-10-03) — `$.contextBudget.available`, the same value
|
|
37
|
+
* the prompt's `assemble` is handed. Wired, the read is the
|
|
38
|
+
* newest rows until a deliberately generous estimate
|
|
39
|
+
* (characters ÷ 4, nothing for names or scaffolding) reaches
|
|
40
|
+
* **twice** the budget's `total`, or every row — never more
|
|
41
|
+
* than 2000 — and `limit` is not read. Fitting those rows to
|
|
42
|
+
* the window stays `assemble`'s (its transcript fit, which
|
|
43
|
+
* cuts the oldest lines in a chunk and holds the cut across
|
|
44
|
+
* turns): reading twice what fits is what lets that held cut,
|
|
45
|
+
* not a row count, decide where the conversation starts.
|
|
46
|
+
* Unwired, the window is the newest `limit` rows, as it
|
|
47
|
+
* always was.
|
|
48
|
+
*
|
|
49
|
+
* Not read with `unplayedOnly` (the talk keeps its `limit`)
|
|
50
|
+
* or a wired `messageId` (one row). There was a `budget`
|
|
51
|
+
* in-port once (culled 2026-09-16): declared and read by
|
|
52
|
+
* nothing. This one has a reader.
|
|
53
|
+
*/
|
|
54
|
+
budget: string;
|
|
55
|
+
/**
|
|
56
|
+
* **One row, by id** (2026-09-28): wired —
|
|
57
|
+
* `$.input.messageId`, the message a press on a message's ⋮
|
|
58
|
+
* was made on — the read is exactly that row, whatever its
|
|
59
|
+
* channel, as a one-row transcript; `limit`, `budget`,
|
|
60
|
+
* `channel`, `unplayedOnly` and `talkOnly` do not apply. The row must be
|
|
61
|
+
* this session's, and a hidden or still-generating row reads
|
|
62
|
+
* as nothing, the same as in any window. Unwired, the window
|
|
63
|
+
* reads as it always did. For an action that acts on the row
|
|
64
|
+
* it was pressed on (the Lair's *File as a room*): the inlet
|
|
65
|
+
* carries the id, never the text, so the row is read here.
|
|
66
|
+
*/
|
|
67
|
+
messageId: string;
|
|
68
|
+
}, "core:query/session-history@1"> & {
|
|
69
|
+
kind: 'query';
|
|
70
|
+
slots?: {
|
|
71
|
+
/**
|
|
72
|
+
* ⚠ No `template` slot, and there was one.
|
|
73
|
+
*
|
|
74
|
+
* It declared "how each chat message is written into the context",
|
|
75
|
+
* and three things were true of it: no binding ever read it, no row
|
|
76
|
+
* was ever seeded for its pool, and so the panel rendered a picker
|
|
77
|
+
* with **nothing in it** on every pipeline that used this node. A
|
|
78
|
+
* control that cannot be given a value and would not be used if it
|
|
79
|
+
* could is worse than the absence of the feature.
|
|
80
|
+
*
|
|
81
|
+
* If per-message wording becomes configurable, it belongs on
|
|
82
|
+
* `core:task/process-messages@1`, which is what actually formats a
|
|
83
|
+
* line. This node fetches rows.
|
|
84
|
+
*/
|
|
85
|
+
readonly params: {
|
|
86
|
+
readonly kind: "parameters";
|
|
87
|
+
readonly facet: "weights";
|
|
88
|
+
readonly schema: {
|
|
89
|
+
/**
|
|
90
|
+
* ⚠ The default is **100 because 100 is what every install
|
|
91
|
+
* has been getting**, not because 100 was chosen.
|
|
92
|
+
*
|
|
93
|
+
* It read 40 here and nothing read it: the binding took
|
|
94
|
+
* `input.limit`, a key nothing supplies, and fell through to
|
|
95
|
+
* a literal 100 on every run. Wiring the control while
|
|
96
|
+
* leaving the declared number at 40 would have moved the
|
|
97
|
+
* transcript window from 100 to 40 on every install at
|
|
98
|
+
* defaults — a retrieval change smuggled in behind a typing
|
|
99
|
+
* fix. So the declaration is corrected to the effective
|
|
100
|
+
* value first; changing the number is a separate decision,
|
|
101
|
+
* made against the measure corpus.
|
|
102
|
+
*
|
|
103
|
+
* Exactly the ruling `topK` got (2026-09-07), for exactly
|
|
104
|
+
* the same defect.
|
|
105
|
+
*
|
|
106
|
+
* ⚠ **Not read when `budget` is wired** (history window,
|
|
107
|
+
* 2026-10-03): that read is sized by the context window,
|
|
108
|
+
* which belongs to the sampling config — a count
|
|
109
|
+
* of rows beside it is the same number entered twice, and
|
|
110
|
+
* the count is what moved the prompt's first line on every
|
|
111
|
+
* turn once a session passed it. Every shipped reply wires
|
|
112
|
+
* the budget; the asking steps (a form's answer, Adventure's
|
|
113
|
+
* Ask, the Lair's room drafting), the turn order and any
|
|
114
|
+
* spec that does not keep reading this.
|
|
115
|
+
*/
|
|
116
|
+
readonly limit: {
|
|
117
|
+
readonly type: "integer";
|
|
118
|
+
readonly default: 100;
|
|
119
|
+
readonly description: "How many recent messages are read. Not used where the read is sized by the context window — every shipped reply — which reads as much as the window could hold twice over and lets the prompt decide where the conversation starts.";
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* The channel this history reads. A session's
|
|
123
|
+
* lanes are the mode's declaration; a pipeline chooses
|
|
124
|
+
* which one builds its context — the map narrator reads
|
|
125
|
+
* `map`, the chat pipeline reads `main`, and a custom
|
|
126
|
+
* spec may do otherwise on purpose.
|
|
127
|
+
*/
|
|
128
|
+
readonly channel: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
readonly default: "main";
|
|
131
|
+
readonly description: "Which of the session's channels this history reads. The chat log is 'main'.";
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* **Only the unplayed talk** (2026-09-28):
|
|
135
|
+
* the rows of a side channel written since the story's
|
|
136
|
+
* newest generated line — the newest visible `main` row
|
|
137
|
+
* whose role is not `user`. Of those it keeps a person's own
|
|
138
|
+
* lines and the replies a run fired ON this channel wrote
|
|
139
|
+
* there (its inlet's `channel` is this one); a row a create
|
|
140
|
+
* run wrote (a greeting) or a story turn wrote (the Lair's
|
|
141
|
+
* beats row) is left out, read off the run artifacts, never
|
|
142
|
+
* a row's metadata. `limit` still caps it, newest kept.
|
|
143
|
+
*
|
|
144
|
+
* Refused with `channel: 'main'`: the story's own rows are
|
|
145
|
+
* the bound, never the talk.
|
|
146
|
+
*/
|
|
147
|
+
readonly unplayedOnly: {
|
|
148
|
+
readonly type: "boolean";
|
|
149
|
+
readonly default: false;
|
|
150
|
+
readonly label: {
|
|
151
|
+
readonly en: "Only since the last story line";
|
|
152
|
+
};
|
|
153
|
+
readonly description: {
|
|
154
|
+
readonly en: "Read only what was said on this channel since the story's newest generated line: people's lines and the replies to them. Cannot be used with the 'main' channel.";
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* **Side channels as talk** (2026-09-28): on every channel but
|
|
159
|
+
* `main`, keep only the talk — a person's own lines and the
|
|
160
|
+
* replies a run fired ON that channel wrote there — by the
|
|
161
|
+
* rule `unplayedOnly` uses, without its bound. A row a
|
|
162
|
+
* create run wrote (a greeting) or a story turn wrote (the
|
|
163
|
+
* Lair's Sanctum beats row) is left out, read off the run
|
|
164
|
+
* artifacts, never a row's metadata. `main` rows are kept
|
|
165
|
+
* whole. The window is the newest `limit` rows before the
|
|
166
|
+
* filter, so it may hand on fewer.
|
|
167
|
+
*
|
|
168
|
+
* The Lair's room check reads every channel with it
|
|
169
|
+
* (`exitProse`): a beats list naming a room is the
|
|
170
|
+
* Castellan's plan, not a description of the room.
|
|
171
|
+
*/
|
|
172
|
+
readonly talkOnly: {
|
|
173
|
+
readonly type: "boolean";
|
|
174
|
+
readonly default: false;
|
|
175
|
+
readonly label: {
|
|
176
|
+
readonly en: "Side channels: talk only";
|
|
177
|
+
};
|
|
178
|
+
readonly description: {
|
|
179
|
+
readonly 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.";
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The transcript's intent, on the node that produces the
|
|
184
|
+
* transcript (built 2026-09-16 — see
|
|
185
|
+
* `bandIntentFields`). `weight: 0.4` and `minInclude: 6`
|
|
186
|
+
* were here once, moved to the ranker's per-source map as
|
|
187
|
+
* `share.messages` and `minEntries.messages`, and are back
|
|
188
|
+
* on the source, where a source's intent belongs, at the numbers
|
|
189
|
+
* the map held: half the window is `MESSAGE_FILL_FRACTION`,
|
|
190
|
+
* and six is the minimum the map carried for the one band
|
|
191
|
+
* allowed a minimum (recent conversation; lore has none).
|
|
192
|
+
*
|
|
193
|
+
* ⚠ **No shipped spec ranks a message candidate** —
|
|
194
|
+
* `main` carries the transcript rows for
|
|
195
|
+
* `process-messages`, and `assemble` builds the transcript
|
|
196
|
+
* from those, never from ranked candidates. Two things
|
|
197
|
+
* keep it so: `entity-search`'s past lines publish on
|
|
198
|
+
* their own `recalledLines` band, and `vector-search`
|
|
199
|
+
* asks the index for lorebook entries only (the app's
|
|
200
|
+
* binding names them). Its intent
|
|
201
|
+
* still reaches the ranker, on the `band` out-port a spec
|
|
202
|
+
* concatenates in with the lore, and its `share` is what
|
|
203
|
+
* halves the pool the lore sources divide: the
|
|
204
|
+
* conversation's slice is reserved and whatever it does
|
|
205
|
+
* not spend is swept to the others, exactly as the map's
|
|
206
|
+
* `messages: 0.5` did. `maxEntries` and `minEntries` bind
|
|
207
|
+
* only when a spec does rank message candidates (a
|
|
208
|
+
* compression region, or a plugin source publishing on
|
|
209
|
+
* this band); they are declared at the map's values so
|
|
210
|
+
* that spec inherits what every install has stored, not
|
|
211
|
+
* so a person moving them today sees a prompt change —
|
|
212
|
+
* they will not.
|
|
213
|
+
*/
|
|
214
|
+
readonly share: {
|
|
215
|
+
readonly type: "number";
|
|
216
|
+
readonly min: 0;
|
|
217
|
+
readonly default: 0.5;
|
|
218
|
+
readonly quick: true;
|
|
219
|
+
readonly label: {
|
|
220
|
+
readonly en: "Share — conversation";
|
|
221
|
+
};
|
|
222
|
+
readonly description: {
|
|
223
|
+
readonly en: "How much of the context window the conversation may take, relative to every other source. What it does not spend is handed to the lore. Set to zero to give the whole window to the other sources.";
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
readonly maxEntries: {
|
|
227
|
+
readonly type: "integer";
|
|
228
|
+
readonly min: 0;
|
|
229
|
+
readonly default: 50;
|
|
230
|
+
readonly label: {
|
|
231
|
+
readonly en: "Most entries — conversation";
|
|
232
|
+
};
|
|
233
|
+
readonly description: {
|
|
234
|
+
readonly en: "A ceiling on how many retrieved messages may reach the prompt as ranked entries, whatever the share. The transcript itself is sized by the window, not by this.";
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
readonly minEntries: {
|
|
238
|
+
readonly type: "integer";
|
|
239
|
+
readonly min: 0;
|
|
240
|
+
readonly default: 6;
|
|
241
|
+
readonly label: {
|
|
242
|
+
readonly en: "Always keep at least";
|
|
243
|
+
};
|
|
244
|
+
readonly description: {
|
|
245
|
+
readonly en: "Recent messages kept as ranked entries whatever the shares say, so a lore-heavy chat stays readable. Dropped when there is no room. Lore has no minimum — it competes on score (R6).";
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* Read, at last (it was declared and read by nothing
|
|
250
|
+
* from the day it was written, allow-listed in the
|
|
251
|
+
* declared-reads guard until this landed). `normal` is no
|
|
252
|
+
* ordering at all; see `BAND_PRIORITIES` in the SDK for
|
|
253
|
+
* what the other three do to the ranker's sweep.
|
|
254
|
+
*/
|
|
255
|
+
readonly priority: {
|
|
256
|
+
readonly type: "enum";
|
|
257
|
+
readonly of: readonly ["low", "normal", "high", "always"];
|
|
258
|
+
readonly members: {
|
|
259
|
+
key: string;
|
|
260
|
+
label: {
|
|
261
|
+
en: string;
|
|
262
|
+
};
|
|
263
|
+
description: {
|
|
264
|
+
en: string;
|
|
265
|
+
};
|
|
266
|
+
}[];
|
|
267
|
+
readonly default: "normal";
|
|
268
|
+
readonly label: {
|
|
269
|
+
readonly en: "Priority — conversation";
|
|
270
|
+
};
|
|
271
|
+
readonly description: {
|
|
272
|
+
readonly en: "How strongly the conversation resists being trimmed once the shares are spent — 'always' keeps every message the window can hold.";
|
|
273
|
+
};
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
} | undefined;
|
|
278
|
+
}>;
|
|
279
|
+
/** @public */
|
|
280
|
+
export declare const lorebookTriggers: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
281
|
+
main: string;
|
|
282
|
+
hits: string;
|
|
283
|
+
/**
|
|
284
|
+
* The entries this scan **found and then excluded** — an
|
|
285
|
+
* entry's own selective logic said *not here* — as verdicts
|
|
286
|
+
* `{ source, id, reason }` (2026-10-02). A copy of one that
|
|
287
|
+
* another mechanism brings in (by meaning, by name) is the
|
|
288
|
+
* same entry the author ruled out, and
|
|
289
|
+
* `core:task/eligibility@1` marks it ineligible with this
|
|
290
|
+
* reason instead of letting it through by the side door.
|
|
291
|
+
*/
|
|
292
|
+
exclusions: string;
|
|
293
|
+
}, {
|
|
294
|
+
scope: string;
|
|
295
|
+
/**
|
|
296
|
+
* **Whose private lore this read is for** — a participant
|
|
297
|
+
* reference (`character:<id>`), additive, 2026-09-17.
|
|
298
|
+
*
|
|
299
|
+
* Character-lore visibility is decided at the host read against
|
|
300
|
+
* ONE subject, and until this port existed that subject was the
|
|
301
|
+
* run's scope — so every voice of a multi-agent turn was handed
|
|
302
|
+
* every character's private lore, because one gather ran once for
|
|
303
|
+
* all of them. Wired inside a repeating clause
|
|
304
|
+
* (`speaker: $.voices.item.context.speaker`) it names the speaker
|
|
305
|
+
* THIS iteration is writing as, and the host applies the same
|
|
306
|
+
* binding-visibility gate for that character instead of the
|
|
307
|
+
* scope's.
|
|
308
|
+
*
|
|
309
|
+
* Unwired, `null` or empty, the scope decides exactly as it
|
|
310
|
+
* always did (a scope of nobody is the omniscient narrator's
|
|
311
|
+
* read). Any other reference that names no character row — an
|
|
312
|
+
* envoy, a role, a row that does not exist — reads no private
|
|
313
|
+
* lore at all. A reference is never *widened* here: the port
|
|
314
|
+
* chooses whose secrets are readable, never whether the gate runs.
|
|
315
|
+
*/
|
|
316
|
+
speaker: string;
|
|
317
|
+
}, "core:query/lorebook-triggers@1"> & {
|
|
318
|
+
kind: 'query';
|
|
319
|
+
slots?: {
|
|
320
|
+
/**
|
|
321
|
+
* ⚠ No `template` slot, and there was one — a *source* template for
|
|
322
|
+
* "how one triggered entry is written into the context".
|
|
323
|
+
*
|
|
324
|
+
* Nothing read it and nothing seeded a row for it, so it rendered as
|
|
325
|
+
* an empty picker. A source template belongs on the node whose job
|
|
326
|
+
* is the rendering — a `render-entries` task, when one is bound
|
|
327
|
+
* (culled: declared, never bound); two declarations of one idea, one
|
|
328
|
+
* of them inert, is how they drift.
|
|
329
|
+
*/
|
|
330
|
+
readonly params: {
|
|
331
|
+
readonly kind: "parameters";
|
|
332
|
+
readonly facet: "weights";
|
|
333
|
+
readonly schema: {
|
|
334
|
+
/**
|
|
335
|
+
* 10, matching `DEFAULT_RETRIEVAL.scanDepth` — the value the
|
|
336
|
+
* scan actually ran on while this declaration said 3 and
|
|
337
|
+
* nothing read it.
|
|
338
|
+
*
|
|
339
|
+
* Round-sized on purpose. A group session with five
|
|
340
|
+
* characters takes five messages to come back round, so a
|
|
341
|
+
* depth of 3 cannot see the turn it belongs to: the window
|
|
342
|
+
* has already slid past where the round began. Scan depth
|
|
343
|
+
* has to be at least a round, and a round grows with the
|
|
344
|
+
* cast.
|
|
345
|
+
*/
|
|
346
|
+
readonly scanDepth: {
|
|
347
|
+
readonly type: "integer";
|
|
348
|
+
readonly default: 10;
|
|
349
|
+
readonly label: {
|
|
350
|
+
readonly en: "Messages scanned for keywords";
|
|
351
|
+
};
|
|
352
|
+
readonly description: "How many recent messages are scanned for lorebook keywords.";
|
|
353
|
+
};
|
|
354
|
+
/**
|
|
355
|
+
* On this type as well as on `loreSlots`, for the reason its
|
|
356
|
+
* three siblings below give: the narrator runs its lore
|
|
357
|
+
* through this type, and this number reaches the same
|
|
358
|
+
* `keywordQuery` from the same `retrievalParamsFrom` seam —
|
|
359
|
+
* so a control that exists on the reply pipeline and not on
|
|
360
|
+
* the narrator is a difference no user could discover a
|
|
361
|
+
* reason for.
|
|
362
|
+
*/
|
|
363
|
+
readonly guaranteedMessages: {
|
|
364
|
+
readonly type: 'integer';
|
|
365
|
+
readonly default: 10;
|
|
366
|
+
readonly min: 1;
|
|
367
|
+
readonly label: {
|
|
368
|
+
readonly en: 'Messages that count as "now"';
|
|
369
|
+
};
|
|
370
|
+
readonly description: 'How much of the recent conversation counts as the current moment when judging relevance — which characters are present, and which words the scene is actually using. Separate from how far back a keyword may fire from.';
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* The ceiling, spelled the way its three siblings spell it.
|
|
374
|
+
*
|
|
375
|
+
* ⚠ This was `recursionDepth`, and the one letter of
|
|
376
|
+
* difference is why it looked wired and was not:
|
|
377
|
+
* `retrievalParamsFrom` reads `maxRecursionDepth`, so the
|
|
378
|
+
* number this node stored was handed to nothing and the
|
|
379
|
+
* narrator ran on `DEFAULT_RETRIEVAL` whatever anybody
|
|
380
|
+
* typed. `narrate@1.10.0`'s own note says "Scan Depth and
|
|
381
|
+
* Max Recursion Depth rendered, validated and saved here
|
|
382
|
+
* without ever being read" — half of that was fixed by
|
|
383
|
+
* wiring the slot, and this is the other half, because the
|
|
384
|
+
* control it names was never called that here.
|
|
385
|
+
*
|
|
386
|
+
* Renamed rather than read under both spellings: two names
|
|
387
|
+
* for one ceiling is how the four lore types drift apart
|
|
388
|
+
* again, and `loreSlots` below has the older claim on the
|
|
389
|
+
* name. Migration 0195 carries the stored values across so
|
|
390
|
+
* a number somebody typed keeps its meaning — it simply
|
|
391
|
+
* starts working, which is the 0186 rule.
|
|
392
|
+
*
|
|
393
|
+
* Same default and same words as `loreSlots`': the narrator
|
|
394
|
+
* runs its lore through this type, and a ceiling that
|
|
395
|
+
* exists on the reply pipeline and not on the narrator is a
|
|
396
|
+
* difference no user could discover a reason for.
|
|
397
|
+
*/
|
|
398
|
+
readonly maxRecursionDepth: {
|
|
399
|
+
readonly type: "integer";
|
|
400
|
+
readonly default: 0;
|
|
401
|
+
readonly label: {
|
|
402
|
+
readonly en: "Follow keyword chains this deep";
|
|
403
|
+
};
|
|
404
|
+
readonly description: "A ceiling on how far entries may trigger further entries via keywords found in their text, however deep an individual entry asks to go. It never follows links between entries.";
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* ⚠ `caseSensitive`, `useRegex`, `weight` and `minInclude`
|
|
408
|
+
* were here, and are gone rather than wired. All four
|
|
409
|
+
* rendered, validated, stored a row and resolved through
|
|
410
|
+
* every scope layer while `retrievalParamsFrom` read none
|
|
411
|
+
* of them — plan bug 15, and the last of the dead-control
|
|
412
|
+
* clusters bug 12 found the first of.
|
|
413
|
+
*
|
|
414
|
+
* They divide cleanly in two, and neither half is a control
|
|
415
|
+
* this node should own:
|
|
416
|
+
*
|
|
417
|
+
* · `caseSensitive` and `useRegex` describe how an *entry*
|
|
418
|
+
* matches. `loreSlots` below already states the rule —
|
|
419
|
+
* the entry is what somebody is looking at when they
|
|
420
|
+
* want to change that — and the entry is where they
|
|
421
|
+
* live: `signals.ts` reads `entry.caseSensitive` and
|
|
422
|
+
* folds `entry.useRegex` into `entry.matchMode`, both
|
|
423
|
+
* columns with their own editor control. A node-level
|
|
424
|
+
* copy could only ever be a second answer to a question
|
|
425
|
+
* the row already answers.
|
|
426
|
+
* · `weight` and `minInclude` are the ranker's, and this
|
|
427
|
+
* is the same pair `core:query/session-history@1` lost
|
|
428
|
+
* for the same reason: they ask how one source fares
|
|
429
|
+
* against everything else, and a node that fetches rows
|
|
430
|
+
* cannot see everything else to answer it. They are
|
|
431
|
+
* `share` / `signal*` and `minEntries` on
|
|
432
|
+
* `core:task/rank-hybrid@1` now, beside their peers,
|
|
433
|
+
* where a share is normalised against the others rather
|
|
434
|
+
* than free to disagree with them.
|
|
435
|
+
*
|
|
436
|
+
* Deleting an address culls it: `reconcileConfigs` removes
|
|
437
|
+
* the stored value and writes a notice carrying what it
|
|
438
|
+
* was, which the admin workspace renders. That is the
|
|
439
|
+
* whole reason a cull is allowed to be the answer here —
|
|
440
|
+
* before the notices surface had a reader, "delete it" and
|
|
441
|
+
* "lose it silently" were the same act.
|
|
442
|
+
*/
|
|
443
|
+
readonly admitThreshold: {
|
|
444
|
+
readonly type: 'number';
|
|
445
|
+
readonly default: 0;
|
|
446
|
+
readonly min: 0;
|
|
447
|
+
readonly max: 1;
|
|
448
|
+
readonly quick: true;
|
|
449
|
+
readonly label: {
|
|
450
|
+
readonly en: 'Find without keywords';
|
|
451
|
+
};
|
|
452
|
+
readonly description: {
|
|
453
|
+
readonly en: 'How readily an entry is brought in on relevance alone when none of its keywords matched — the names the conversation is using, and the distinctive words it shares with the entry. 0 keeps keywords the only way in; try 0.3 to turn it on.';
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* The three lexical-quality controls, on this type as well
|
|
458
|
+
* as on `loreSlots` and for `admitThreshold`'s reason: the
|
|
459
|
+
* narrator runs its lore through this type, and a control
|
|
460
|
+
* that exists on the reply pipeline and not on the narrator
|
|
461
|
+
* is a difference no user could discover a reason for.
|
|
462
|
+
*/
|
|
463
|
+
readonly lexicalScoring: {
|
|
464
|
+
readonly type: 'enum';
|
|
465
|
+
readonly default: 'overlap';
|
|
466
|
+
readonly label: {
|
|
467
|
+
readonly en: 'Relevance balance';
|
|
468
|
+
};
|
|
469
|
+
readonly members: readonly [{
|
|
470
|
+
readonly key: 'overlap';
|
|
471
|
+
readonly label: {
|
|
472
|
+
readonly en: 'Raw overlap';
|
|
473
|
+
};
|
|
474
|
+
readonly description: {
|
|
475
|
+
readonly en: 'Every repeat of a word counts again, so a longer entry has more chances to score.';
|
|
476
|
+
};
|
|
477
|
+
}, {
|
|
478
|
+
readonly key: 'balanced';
|
|
479
|
+
readonly label: {
|
|
480
|
+
readonly en: 'Length-aware';
|
|
481
|
+
};
|
|
482
|
+
readonly description: {
|
|
483
|
+
readonly en: 'A repeated word stops adding as much, and an entry is judged against how long lorebook entries usually are. Better when entries differ a lot in length.';
|
|
484
|
+
};
|
|
485
|
+
}];
|
|
486
|
+
readonly description: {
|
|
487
|
+
readonly en: "How an entry's own wording is weighed when deciding how relevant it is to what is being said.";
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
readonly trigramFolding: {
|
|
491
|
+
readonly type: 'number';
|
|
492
|
+
readonly default: 0;
|
|
493
|
+
readonly min: 0;
|
|
494
|
+
readonly max: 1;
|
|
495
|
+
readonly label: {
|
|
496
|
+
readonly en: 'Match near-misses';
|
|
497
|
+
};
|
|
498
|
+
readonly description: {
|
|
499
|
+
readonly en: 'How much a keyword that is nearly present counts — a different ending, a typo, or a language that does not put spaces between words. 0 requires an exact match; try 0.5 to turn it on.';
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
readonly titleWeight: {
|
|
503
|
+
readonly type: 'number';
|
|
504
|
+
readonly default: 1;
|
|
505
|
+
readonly min: 0;
|
|
506
|
+
readonly max: 5;
|
|
507
|
+
readonly label: {
|
|
508
|
+
readonly en: 'Title counts extra';
|
|
509
|
+
};
|
|
510
|
+
readonly description: {
|
|
511
|
+
readonly en: "How much more a word in an entry's title counts than the same word among its keywords. 1 treats them alike.";
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
readonly characterLoreMaxEntries: {
|
|
515
|
+
type: 'integer';
|
|
516
|
+
min: number;
|
|
517
|
+
default?: number | undefined;
|
|
518
|
+
label: {
|
|
519
|
+
en: string;
|
|
520
|
+
};
|
|
521
|
+
description: {
|
|
522
|
+
en: string;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
readonly characterLorePriority: {
|
|
526
|
+
type: 'enum';
|
|
527
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
528
|
+
members: {
|
|
529
|
+
key: string;
|
|
530
|
+
label: {
|
|
531
|
+
en: string;
|
|
532
|
+
};
|
|
533
|
+
description: {
|
|
534
|
+
en: string;
|
|
535
|
+
};
|
|
536
|
+
}[];
|
|
537
|
+
default: 'normal';
|
|
538
|
+
label: {
|
|
539
|
+
en: string;
|
|
540
|
+
};
|
|
541
|
+
description: {
|
|
542
|
+
en: string;
|
|
543
|
+
};
|
|
544
|
+
};
|
|
545
|
+
readonly characterLoreShare: {
|
|
546
|
+
type: 'number';
|
|
547
|
+
min: number;
|
|
548
|
+
default: number;
|
|
549
|
+
quick: boolean;
|
|
550
|
+
label: {
|
|
551
|
+
en: string;
|
|
552
|
+
};
|
|
553
|
+
description: {
|
|
554
|
+
en: string;
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
readonly historyMaxEntries: {
|
|
558
|
+
type: 'integer';
|
|
559
|
+
min: number;
|
|
560
|
+
default?: number | undefined;
|
|
561
|
+
label: {
|
|
562
|
+
en: string;
|
|
563
|
+
};
|
|
564
|
+
description: {
|
|
565
|
+
en: string;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
readonly historyPriority: {
|
|
569
|
+
type: 'enum';
|
|
570
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
571
|
+
members: {
|
|
572
|
+
key: string;
|
|
573
|
+
label: {
|
|
574
|
+
en: string;
|
|
575
|
+
};
|
|
576
|
+
description: {
|
|
577
|
+
en: string;
|
|
578
|
+
};
|
|
579
|
+
}[];
|
|
580
|
+
default: 'normal';
|
|
581
|
+
label: {
|
|
582
|
+
en: string;
|
|
583
|
+
};
|
|
584
|
+
description: {
|
|
585
|
+
en: string;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
588
|
+
readonly historyShare: {
|
|
589
|
+
type: 'number';
|
|
590
|
+
min: number;
|
|
591
|
+
default: number;
|
|
592
|
+
quick: boolean;
|
|
593
|
+
label: {
|
|
594
|
+
en: string;
|
|
595
|
+
};
|
|
596
|
+
description: {
|
|
597
|
+
en: string;
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
readonly worldLoreMaxEntries: {
|
|
601
|
+
type: 'integer';
|
|
602
|
+
min: number;
|
|
603
|
+
default?: number | undefined;
|
|
604
|
+
label: {
|
|
605
|
+
en: string;
|
|
606
|
+
};
|
|
607
|
+
description: {
|
|
608
|
+
en: string;
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
readonly worldLorePriority: {
|
|
612
|
+
type: 'enum';
|
|
613
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
614
|
+
members: {
|
|
615
|
+
key: string;
|
|
616
|
+
label: {
|
|
617
|
+
en: string;
|
|
618
|
+
};
|
|
619
|
+
description: {
|
|
620
|
+
en: string;
|
|
621
|
+
};
|
|
622
|
+
}[];
|
|
623
|
+
default: 'normal';
|
|
624
|
+
label: {
|
|
625
|
+
en: string;
|
|
626
|
+
};
|
|
627
|
+
description: {
|
|
628
|
+
en: string;
|
|
629
|
+
};
|
|
630
|
+
};
|
|
631
|
+
readonly worldLoreShare: {
|
|
632
|
+
type: 'number';
|
|
633
|
+
min: number;
|
|
634
|
+
default: number;
|
|
635
|
+
quick: boolean;
|
|
636
|
+
label: {
|
|
637
|
+
en: string;
|
|
638
|
+
};
|
|
639
|
+
description: {
|
|
640
|
+
en: string;
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
} | undefined;
|
|
646
|
+
}>;
|
|
647
|
+
/** @experimental */
|
|
648
|
+
export declare const worldLore: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
649
|
+
main: string;
|
|
650
|
+
hits: string;
|
|
651
|
+
/**
|
|
652
|
+
* The entries this scan **found and then excluded** — an
|
|
653
|
+
* entry's own selective logic said *not here* — as verdicts
|
|
654
|
+
* `{ source, id, reason }` (2026-10-02). A copy of one that
|
|
655
|
+
* another mechanism brings in (by meaning, by name) is the
|
|
656
|
+
* same entry the author ruled out, and
|
|
657
|
+
* `core:task/eligibility@1` marks it ineligible with this
|
|
658
|
+
* reason instead of letting it through by the side door.
|
|
659
|
+
*/
|
|
660
|
+
exclusions: string;
|
|
661
|
+
}, {
|
|
662
|
+
scope: string;
|
|
663
|
+
}, "core:query/world-lore@1"> & {
|
|
664
|
+
kind: 'query';
|
|
665
|
+
slots?: {
|
|
666
|
+
params: {
|
|
667
|
+
kind: 'parameters';
|
|
668
|
+
facet: 'weights';
|
|
669
|
+
schema: {
|
|
670
|
+
share: {
|
|
671
|
+
type: 'number';
|
|
672
|
+
min: number;
|
|
673
|
+
default: number;
|
|
674
|
+
quick: boolean;
|
|
675
|
+
label: {
|
|
676
|
+
en: string;
|
|
677
|
+
};
|
|
678
|
+
description: {
|
|
679
|
+
en: string;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
maxEntries: {
|
|
683
|
+
type: 'integer';
|
|
684
|
+
min: number;
|
|
685
|
+
default?: number | undefined;
|
|
686
|
+
label: {
|
|
687
|
+
en: string;
|
|
688
|
+
};
|
|
689
|
+
description: {
|
|
690
|
+
en: string;
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
priority: {
|
|
694
|
+
type: 'enum';
|
|
695
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
696
|
+
members: {
|
|
697
|
+
key: string;
|
|
698
|
+
label: {
|
|
699
|
+
en: string;
|
|
700
|
+
};
|
|
701
|
+
description: {
|
|
702
|
+
en: string;
|
|
703
|
+
};
|
|
704
|
+
}[];
|
|
705
|
+
default: 'normal';
|
|
706
|
+
label: {
|
|
707
|
+
en: string;
|
|
708
|
+
};
|
|
709
|
+
description: {
|
|
710
|
+
en: string;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
713
|
+
/**
|
|
714
|
+
* 10, matching `DEFAULT_RETRIEVAL.scanDepth` — the value every scan
|
|
715
|
+
* has actually run on. This said 3 for as long as the three lore
|
|
716
|
+
* lanes shipped without a wired `params` slot, so the number was
|
|
717
|
+
* never handed to anything and the two could not be seen to
|
|
718
|
+
* disagree.
|
|
719
|
+
*
|
|
720
|
+
* Round-sized on purpose. A group session with five characters
|
|
721
|
+
* takes five messages to come back round, so a depth of 3 cannot
|
|
722
|
+
* see the turn it belongs to: the window has already slid past
|
|
723
|
+
* where the round began. Scan depth has to be at least a round,
|
|
724
|
+
* and a round grows with the cast.
|
|
725
|
+
*/
|
|
726
|
+
scanDepth: {
|
|
727
|
+
type: 'integer';
|
|
728
|
+
default: number;
|
|
729
|
+
quick: boolean;
|
|
730
|
+
shared: boolean;
|
|
731
|
+
label: {
|
|
732
|
+
en: string;
|
|
733
|
+
};
|
|
734
|
+
description: string;
|
|
735
|
+
};
|
|
736
|
+
/**
|
|
737
|
+
* Beside `scanDepth` because the pair is only legible together:
|
|
738
|
+
* one is how far back a key may fire from, the other is how much
|
|
739
|
+
* conversation counts as the present moment. See
|
|
740
|
+
* `GUARANTEED_MESSAGES`.
|
|
741
|
+
*/
|
|
742
|
+
guaranteedMessages: {
|
|
743
|
+
type: 'integer';
|
|
744
|
+
default: 10;
|
|
745
|
+
min: 1;
|
|
746
|
+
label: {
|
|
747
|
+
readonly en: 'Messages that count as "now"';
|
|
748
|
+
};
|
|
749
|
+
description: 'How much of the recent conversation counts as the current moment when judging relevance — which characters are present, and which words the scene is actually using. Separate from how far back a keyword may fire from.';
|
|
750
|
+
shared: boolean;
|
|
751
|
+
};
|
|
752
|
+
maxRecursionDepth: {
|
|
753
|
+
type: 'integer';
|
|
754
|
+
default: number;
|
|
755
|
+
shared: boolean;
|
|
756
|
+
label: {
|
|
757
|
+
en: string;
|
|
758
|
+
};
|
|
759
|
+
description: string;
|
|
760
|
+
};
|
|
761
|
+
/**
|
|
762
|
+
* Declared on all three lanes, held by one: since 2026-09-15 a spec
|
|
763
|
+
* names ONE owner for the seven knobs and the other lanes read the
|
|
764
|
+
* owner's slot, so this is one row governing world lore, character
|
|
765
|
+
* lore and history alike — not one row per lane. World lore
|
|
766
|
+
* without keys is the case it exists for; the other two sources
|
|
767
|
+
* take the same answer. A per-source answer is a weight, and
|
|
768
|
+
* weights live on the source (`bandIntentFields`), not here.
|
|
769
|
+
*/
|
|
770
|
+
admitThreshold: {
|
|
771
|
+
type: 'number';
|
|
772
|
+
default: 0;
|
|
773
|
+
min: 0;
|
|
774
|
+
max: 1;
|
|
775
|
+
quick: true;
|
|
776
|
+
label: {
|
|
777
|
+
readonly en: 'Find without keywords';
|
|
778
|
+
};
|
|
779
|
+
description: {
|
|
780
|
+
readonly en: 'How readily an entry is brought in on relevance alone when none of its keywords matched — the names the conversation is using, and the distinctive words it shares with the entry. 0 keeps keywords the only way in; try 0.3 to turn it on.';
|
|
781
|
+
};
|
|
782
|
+
shared: boolean;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* One row for the three lanes, like `admitThreshold`: the owner's
|
|
786
|
+
* value reaches world lore, where entry lengths differ most,
|
|
787
|
+
* character lore, already narrowed to whoever is speaking, and
|
|
788
|
+
* dated history — which has no title at all, so the value reaches
|
|
789
|
+
* it and moves nothing. That is the honest state rather than a
|
|
790
|
+
* fourth declaration.
|
|
791
|
+
*/
|
|
792
|
+
lexicalScoring: {
|
|
793
|
+
type: 'enum';
|
|
794
|
+
default: 'overlap';
|
|
795
|
+
label: {
|
|
796
|
+
readonly en: 'Relevance balance';
|
|
797
|
+
};
|
|
798
|
+
members: readonly [{
|
|
799
|
+
readonly key: 'overlap';
|
|
800
|
+
readonly label: {
|
|
801
|
+
readonly en: 'Raw overlap';
|
|
802
|
+
};
|
|
803
|
+
readonly description: {
|
|
804
|
+
readonly en: 'Every repeat of a word counts again, so a longer entry has more chances to score.';
|
|
805
|
+
};
|
|
806
|
+
}, {
|
|
807
|
+
readonly key: 'balanced';
|
|
808
|
+
readonly label: {
|
|
809
|
+
readonly en: 'Length-aware';
|
|
810
|
+
};
|
|
811
|
+
readonly description: {
|
|
812
|
+
readonly en: 'A repeated word stops adding as much, and an entry is judged against how long lorebook entries usually are. Better when entries differ a lot in length.';
|
|
813
|
+
};
|
|
814
|
+
}];
|
|
815
|
+
description: {
|
|
816
|
+
readonly en: "How an entry's own wording is weighed when deciding how relevant it is to what is being said.";
|
|
817
|
+
};
|
|
818
|
+
shared: boolean;
|
|
819
|
+
};
|
|
820
|
+
trigramFolding: {
|
|
821
|
+
type: 'number';
|
|
822
|
+
default: 0;
|
|
823
|
+
min: 0;
|
|
824
|
+
max: 1;
|
|
825
|
+
label: {
|
|
826
|
+
readonly en: 'Match near-misses';
|
|
827
|
+
};
|
|
828
|
+
description: {
|
|
829
|
+
readonly en: 'How much a keyword that is nearly present counts — a different ending, a typo, or a language that does not put spaces between words. 0 requires an exact match; try 0.5 to turn it on.';
|
|
830
|
+
};
|
|
831
|
+
shared: boolean;
|
|
832
|
+
};
|
|
833
|
+
titleWeight: {
|
|
834
|
+
type: 'number';
|
|
835
|
+
default: 1;
|
|
836
|
+
min: 0;
|
|
837
|
+
max: 5;
|
|
838
|
+
label: {
|
|
839
|
+
readonly en: 'Title counts extra';
|
|
840
|
+
};
|
|
841
|
+
description: {
|
|
842
|
+
readonly en: "How much more a word in an entry's title counts than the same word among its keywords. 1 treats them alike.";
|
|
843
|
+
};
|
|
844
|
+
shared: boolean;
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
} | undefined;
|
|
849
|
+
}>;
|
|
850
|
+
/** @experimental */
|
|
851
|
+
export declare const characterLore: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
852
|
+
main: string;
|
|
853
|
+
hits: string;
|
|
854
|
+
/**
|
|
855
|
+
* The entries this scan **found and then excluded** — an
|
|
856
|
+
* entry's own selective logic said *not here* — as verdicts
|
|
857
|
+
* `{ source, id, reason }` (2026-10-02). A copy of one that
|
|
858
|
+
* another mechanism brings in (by meaning, by name) is the
|
|
859
|
+
* same entry the author ruled out, and
|
|
860
|
+
* `core:task/eligibility@1` marks it ineligible with this
|
|
861
|
+
* reason instead of letting it through by the side door.
|
|
862
|
+
*/
|
|
863
|
+
exclusions: string;
|
|
864
|
+
}, {
|
|
865
|
+
scope: string;
|
|
866
|
+
/**
|
|
867
|
+
* **Whose private lore this read is for** — a participant
|
|
868
|
+
* reference (`character:<id>`), additive, 2026-09-17.
|
|
869
|
+
*
|
|
870
|
+
* Character-lore visibility is decided at the host read against
|
|
871
|
+
* ONE subject, and until this port existed that subject was the
|
|
872
|
+
* run's scope — so every voice of a multi-agent turn was handed
|
|
873
|
+
* every character's private lore, because one gather ran once for
|
|
874
|
+
* all of them. Wired inside a repeating clause
|
|
875
|
+
* (`speaker: $.voices.item.context.speaker`) it names the speaker
|
|
876
|
+
* THIS iteration is writing as, and the host applies the same
|
|
877
|
+
* binding-visibility gate for that character instead of the
|
|
878
|
+
* scope's.
|
|
879
|
+
*
|
|
880
|
+
* Unwired, `null` or empty, the scope decides exactly as it
|
|
881
|
+
* always did (a scope of nobody is the omniscient narrator's
|
|
882
|
+
* read). Any other reference that names no character row — an
|
|
883
|
+
* envoy, a role, a row that does not exist — reads no private
|
|
884
|
+
* lore at all. A reference is never *widened* here: the port
|
|
885
|
+
* chooses whose secrets are readable, never whether the gate runs.
|
|
886
|
+
*/
|
|
887
|
+
speaker: string;
|
|
888
|
+
}, "core:query/character-lore@1"> & {
|
|
889
|
+
kind: 'query';
|
|
890
|
+
slots?: {
|
|
891
|
+
params: {
|
|
892
|
+
kind: 'parameters';
|
|
893
|
+
facet: 'weights';
|
|
894
|
+
schema: {
|
|
895
|
+
share: {
|
|
896
|
+
type: 'number';
|
|
897
|
+
min: number;
|
|
898
|
+
default: number;
|
|
899
|
+
quick: boolean;
|
|
900
|
+
label: {
|
|
901
|
+
en: string;
|
|
902
|
+
};
|
|
903
|
+
description: {
|
|
904
|
+
en: string;
|
|
905
|
+
};
|
|
906
|
+
};
|
|
907
|
+
maxEntries: {
|
|
908
|
+
type: 'integer';
|
|
909
|
+
min: number;
|
|
910
|
+
default?: number | undefined;
|
|
911
|
+
label: {
|
|
912
|
+
en: string;
|
|
913
|
+
};
|
|
914
|
+
description: {
|
|
915
|
+
en: string;
|
|
916
|
+
};
|
|
917
|
+
};
|
|
918
|
+
priority: {
|
|
919
|
+
type: 'enum';
|
|
920
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
921
|
+
members: {
|
|
922
|
+
key: string;
|
|
923
|
+
label: {
|
|
924
|
+
en: string;
|
|
925
|
+
};
|
|
926
|
+
description: {
|
|
927
|
+
en: string;
|
|
928
|
+
};
|
|
929
|
+
}[];
|
|
930
|
+
default: 'normal';
|
|
931
|
+
label: {
|
|
932
|
+
en: string;
|
|
933
|
+
};
|
|
934
|
+
description: {
|
|
935
|
+
en: string;
|
|
936
|
+
};
|
|
937
|
+
};
|
|
938
|
+
/**
|
|
939
|
+
* 10, matching `DEFAULT_RETRIEVAL.scanDepth` — the value every scan
|
|
940
|
+
* has actually run on. This said 3 for as long as the three lore
|
|
941
|
+
* lanes shipped without a wired `params` slot, so the number was
|
|
942
|
+
* never handed to anything and the two could not be seen to
|
|
943
|
+
* disagree.
|
|
944
|
+
*
|
|
945
|
+
* Round-sized on purpose. A group session with five characters
|
|
946
|
+
* takes five messages to come back round, so a depth of 3 cannot
|
|
947
|
+
* see the turn it belongs to: the window has already slid past
|
|
948
|
+
* where the round began. Scan depth has to be at least a round,
|
|
949
|
+
* and a round grows with the cast.
|
|
950
|
+
*/
|
|
951
|
+
scanDepth: {
|
|
952
|
+
type: 'integer';
|
|
953
|
+
default: number;
|
|
954
|
+
quick: boolean;
|
|
955
|
+
shared: boolean;
|
|
956
|
+
label: {
|
|
957
|
+
en: string;
|
|
958
|
+
};
|
|
959
|
+
description: string;
|
|
960
|
+
};
|
|
961
|
+
/**
|
|
962
|
+
* Beside `scanDepth` because the pair is only legible together:
|
|
963
|
+
* one is how far back a key may fire from, the other is how much
|
|
964
|
+
* conversation counts as the present moment. See
|
|
965
|
+
* `GUARANTEED_MESSAGES`.
|
|
966
|
+
*/
|
|
967
|
+
guaranteedMessages: {
|
|
968
|
+
type: 'integer';
|
|
969
|
+
default: 10;
|
|
970
|
+
min: 1;
|
|
971
|
+
label: {
|
|
972
|
+
readonly en: 'Messages that count as "now"';
|
|
973
|
+
};
|
|
974
|
+
description: 'How much of the recent conversation counts as the current moment when judging relevance — which characters are present, and which words the scene is actually using. Separate from how far back a keyword may fire from.';
|
|
975
|
+
shared: boolean;
|
|
976
|
+
};
|
|
977
|
+
maxRecursionDepth: {
|
|
978
|
+
type: 'integer';
|
|
979
|
+
default: number;
|
|
980
|
+
shared: boolean;
|
|
981
|
+
label: {
|
|
982
|
+
en: string;
|
|
983
|
+
};
|
|
984
|
+
description: string;
|
|
985
|
+
};
|
|
986
|
+
/**
|
|
987
|
+
* Declared on all three lanes, held by one: since 2026-09-15 a spec
|
|
988
|
+
* names ONE owner for the seven knobs and the other lanes read the
|
|
989
|
+
* owner's slot, so this is one row governing world lore, character
|
|
990
|
+
* lore and history alike — not one row per lane. World lore
|
|
991
|
+
* without keys is the case it exists for; the other two sources
|
|
992
|
+
* take the same answer. A per-source answer is a weight, and
|
|
993
|
+
* weights live on the source (`bandIntentFields`), not here.
|
|
994
|
+
*/
|
|
995
|
+
admitThreshold: {
|
|
996
|
+
type: 'number';
|
|
997
|
+
default: 0;
|
|
998
|
+
min: 0;
|
|
999
|
+
max: 1;
|
|
1000
|
+
quick: true;
|
|
1001
|
+
label: {
|
|
1002
|
+
readonly en: 'Find without keywords';
|
|
1003
|
+
};
|
|
1004
|
+
description: {
|
|
1005
|
+
readonly en: 'How readily an entry is brought in on relevance alone when none of its keywords matched — the names the conversation is using, and the distinctive words it shares with the entry. 0 keeps keywords the only way in; try 0.3 to turn it on.';
|
|
1006
|
+
};
|
|
1007
|
+
shared: boolean;
|
|
1008
|
+
};
|
|
1009
|
+
/**
|
|
1010
|
+
* One row for the three lanes, like `admitThreshold`: the owner's
|
|
1011
|
+
* value reaches world lore, where entry lengths differ most,
|
|
1012
|
+
* character lore, already narrowed to whoever is speaking, and
|
|
1013
|
+
* dated history — which has no title at all, so the value reaches
|
|
1014
|
+
* it and moves nothing. That is the honest state rather than a
|
|
1015
|
+
* fourth declaration.
|
|
1016
|
+
*/
|
|
1017
|
+
lexicalScoring: {
|
|
1018
|
+
type: 'enum';
|
|
1019
|
+
default: 'overlap';
|
|
1020
|
+
label: {
|
|
1021
|
+
readonly en: 'Relevance balance';
|
|
1022
|
+
};
|
|
1023
|
+
members: readonly [{
|
|
1024
|
+
readonly key: 'overlap';
|
|
1025
|
+
readonly label: {
|
|
1026
|
+
readonly en: 'Raw overlap';
|
|
1027
|
+
};
|
|
1028
|
+
readonly description: {
|
|
1029
|
+
readonly en: 'Every repeat of a word counts again, so a longer entry has more chances to score.';
|
|
1030
|
+
};
|
|
1031
|
+
}, {
|
|
1032
|
+
readonly key: 'balanced';
|
|
1033
|
+
readonly label: {
|
|
1034
|
+
readonly en: 'Length-aware';
|
|
1035
|
+
};
|
|
1036
|
+
readonly description: {
|
|
1037
|
+
readonly en: 'A repeated word stops adding as much, and an entry is judged against how long lorebook entries usually are. Better when entries differ a lot in length.';
|
|
1038
|
+
};
|
|
1039
|
+
}];
|
|
1040
|
+
description: {
|
|
1041
|
+
readonly en: "How an entry's own wording is weighed when deciding how relevant it is to what is being said.";
|
|
1042
|
+
};
|
|
1043
|
+
shared: boolean;
|
|
1044
|
+
};
|
|
1045
|
+
trigramFolding: {
|
|
1046
|
+
type: 'number';
|
|
1047
|
+
default: 0;
|
|
1048
|
+
min: 0;
|
|
1049
|
+
max: 1;
|
|
1050
|
+
label: {
|
|
1051
|
+
readonly en: 'Match near-misses';
|
|
1052
|
+
};
|
|
1053
|
+
description: {
|
|
1054
|
+
readonly en: 'How much a keyword that is nearly present counts — a different ending, a typo, or a language that does not put spaces between words. 0 requires an exact match; try 0.5 to turn it on.';
|
|
1055
|
+
};
|
|
1056
|
+
shared: boolean;
|
|
1057
|
+
};
|
|
1058
|
+
titleWeight: {
|
|
1059
|
+
type: 'number';
|
|
1060
|
+
default: 1;
|
|
1061
|
+
min: 0;
|
|
1062
|
+
max: 5;
|
|
1063
|
+
label: {
|
|
1064
|
+
readonly en: 'Title counts extra';
|
|
1065
|
+
};
|
|
1066
|
+
description: {
|
|
1067
|
+
readonly en: "How much more a word in an entry's title counts than the same word among its keywords. 1 treats them alike.";
|
|
1068
|
+
};
|
|
1069
|
+
shared: boolean;
|
|
1070
|
+
};
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
} | undefined;
|
|
1074
|
+
}>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Dated summaries of earlier events.
|
|
1077
|
+
*
|
|
1078
|
+
* ⚠ **This lane did not exist between spec 1.8.0 and 1.10.0, and history was
|
|
1079
|
+
* silently absent from every prompt in that window.**
|
|
1080
|
+
*
|
|
1081
|
+
* `lorebook-triggers@1` returned all three sources through one port. Splitting
|
|
1082
|
+
* world and character lore into two nodes replaced it with two lanes that each
|
|
1083
|
+
* filter the shared scan to their own `source` — and nothing filtered for
|
|
1084
|
+
* `history`, so those candidates were built, scored, and then dropped on the
|
|
1085
|
+
* floor. Nothing failed: the ranker kept a `history` band, `assemble` kept
|
|
1086
|
+
* asking for history blocks, and both got nothing.
|
|
1087
|
+
*
|
|
1088
|
+
* The parity corpus stayed green throughout because its harness renders through
|
|
1089
|
+
* `lorebook-triggers@1` rather than the shipped document — the exact divergence
|
|
1090
|
+
* a comment in that file warns about. The corpus mirrors the three lanes now.
|
|
1091
|
+
*
|
|
1092
|
+
* Same retrieval as its two siblings: one scan, one filter.
|
|
1093
|
+
* @experimental
|
|
1094
|
+
*/
|
|
1095
|
+
export declare const historyEntries: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1096
|
+
main: string;
|
|
1097
|
+
hits: string;
|
|
1098
|
+
/**
|
|
1099
|
+
* The entries this scan **found and then excluded** — an
|
|
1100
|
+
* entry's own selective logic said *not here* — as verdicts
|
|
1101
|
+
* `{ source, id, reason }` (2026-10-02). A copy of one that
|
|
1102
|
+
* another mechanism brings in (by meaning, by name) is the
|
|
1103
|
+
* same entry the author ruled out, and
|
|
1104
|
+
* `core:task/eligibility@1` marks it ineligible with this
|
|
1105
|
+
* reason instead of letting it through by the side door.
|
|
1106
|
+
*/
|
|
1107
|
+
exclusions: string;
|
|
1108
|
+
}, {
|
|
1109
|
+
scope: string;
|
|
1110
|
+
}, "core:query/history-entries@1"> & {
|
|
1111
|
+
kind: 'query';
|
|
1112
|
+
slots?: {
|
|
1113
|
+
params: {
|
|
1114
|
+
kind: 'parameters';
|
|
1115
|
+
facet: 'weights';
|
|
1116
|
+
schema: {
|
|
1117
|
+
share: {
|
|
1118
|
+
type: 'number';
|
|
1119
|
+
min: number;
|
|
1120
|
+
default: number;
|
|
1121
|
+
quick: boolean;
|
|
1122
|
+
label: {
|
|
1123
|
+
en: string;
|
|
1124
|
+
};
|
|
1125
|
+
description: {
|
|
1126
|
+
en: string;
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1129
|
+
maxEntries: {
|
|
1130
|
+
type: 'integer';
|
|
1131
|
+
min: number;
|
|
1132
|
+
default?: number | undefined;
|
|
1133
|
+
label: {
|
|
1134
|
+
en: string;
|
|
1135
|
+
};
|
|
1136
|
+
description: {
|
|
1137
|
+
en: string;
|
|
1138
|
+
};
|
|
1139
|
+
};
|
|
1140
|
+
priority: {
|
|
1141
|
+
type: 'enum';
|
|
1142
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
1143
|
+
members: {
|
|
1144
|
+
key: string;
|
|
1145
|
+
label: {
|
|
1146
|
+
en: string;
|
|
1147
|
+
};
|
|
1148
|
+
description: {
|
|
1149
|
+
en: string;
|
|
1150
|
+
};
|
|
1151
|
+
}[];
|
|
1152
|
+
default: 'normal';
|
|
1153
|
+
label: {
|
|
1154
|
+
en: string;
|
|
1155
|
+
};
|
|
1156
|
+
description: {
|
|
1157
|
+
en: string;
|
|
1158
|
+
};
|
|
1159
|
+
};
|
|
1160
|
+
/**
|
|
1161
|
+
* 10, matching `DEFAULT_RETRIEVAL.scanDepth` — the value every scan
|
|
1162
|
+
* has actually run on. This said 3 for as long as the three lore
|
|
1163
|
+
* lanes shipped without a wired `params` slot, so the number was
|
|
1164
|
+
* never handed to anything and the two could not be seen to
|
|
1165
|
+
* disagree.
|
|
1166
|
+
*
|
|
1167
|
+
* Round-sized on purpose. A group session with five characters
|
|
1168
|
+
* takes five messages to come back round, so a depth of 3 cannot
|
|
1169
|
+
* see the turn it belongs to: the window has already slid past
|
|
1170
|
+
* where the round began. Scan depth has to be at least a round,
|
|
1171
|
+
* and a round grows with the cast.
|
|
1172
|
+
*/
|
|
1173
|
+
scanDepth: {
|
|
1174
|
+
type: 'integer';
|
|
1175
|
+
default: number;
|
|
1176
|
+
quick: boolean;
|
|
1177
|
+
shared: boolean;
|
|
1178
|
+
label: {
|
|
1179
|
+
en: string;
|
|
1180
|
+
};
|
|
1181
|
+
description: string;
|
|
1182
|
+
};
|
|
1183
|
+
/**
|
|
1184
|
+
* Beside `scanDepth` because the pair is only legible together:
|
|
1185
|
+
* one is how far back a key may fire from, the other is how much
|
|
1186
|
+
* conversation counts as the present moment. See
|
|
1187
|
+
* `GUARANTEED_MESSAGES`.
|
|
1188
|
+
*/
|
|
1189
|
+
guaranteedMessages: {
|
|
1190
|
+
type: 'integer';
|
|
1191
|
+
default: 10;
|
|
1192
|
+
min: 1;
|
|
1193
|
+
label: {
|
|
1194
|
+
readonly en: 'Messages that count as "now"';
|
|
1195
|
+
};
|
|
1196
|
+
description: 'How much of the recent conversation counts as the current moment when judging relevance — which characters are present, and which words the scene is actually using. Separate from how far back a keyword may fire from.';
|
|
1197
|
+
shared: boolean;
|
|
1198
|
+
};
|
|
1199
|
+
maxRecursionDepth: {
|
|
1200
|
+
type: 'integer';
|
|
1201
|
+
default: number;
|
|
1202
|
+
shared: boolean;
|
|
1203
|
+
label: {
|
|
1204
|
+
en: string;
|
|
1205
|
+
};
|
|
1206
|
+
description: string;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Declared on all three lanes, held by one: since 2026-09-15 a spec
|
|
1210
|
+
* names ONE owner for the seven knobs and the other lanes read the
|
|
1211
|
+
* owner's slot, so this is one row governing world lore, character
|
|
1212
|
+
* lore and history alike — not one row per lane. World lore
|
|
1213
|
+
* without keys is the case it exists for; the other two sources
|
|
1214
|
+
* take the same answer. A per-source answer is a weight, and
|
|
1215
|
+
* weights live on the source (`bandIntentFields`), not here.
|
|
1216
|
+
*/
|
|
1217
|
+
admitThreshold: {
|
|
1218
|
+
type: 'number';
|
|
1219
|
+
default: 0;
|
|
1220
|
+
min: 0;
|
|
1221
|
+
max: 1;
|
|
1222
|
+
quick: true;
|
|
1223
|
+
label: {
|
|
1224
|
+
readonly en: 'Find without keywords';
|
|
1225
|
+
};
|
|
1226
|
+
description: {
|
|
1227
|
+
readonly en: 'How readily an entry is brought in on relevance alone when none of its keywords matched — the names the conversation is using, and the distinctive words it shares with the entry. 0 keeps keywords the only way in; try 0.3 to turn it on.';
|
|
1228
|
+
};
|
|
1229
|
+
shared: boolean;
|
|
1230
|
+
};
|
|
1231
|
+
/**
|
|
1232
|
+
* One row for the three lanes, like `admitThreshold`: the owner's
|
|
1233
|
+
* value reaches world lore, where entry lengths differ most,
|
|
1234
|
+
* character lore, already narrowed to whoever is speaking, and
|
|
1235
|
+
* dated history — which has no title at all, so the value reaches
|
|
1236
|
+
* it and moves nothing. That is the honest state rather than a
|
|
1237
|
+
* fourth declaration.
|
|
1238
|
+
*/
|
|
1239
|
+
lexicalScoring: {
|
|
1240
|
+
type: 'enum';
|
|
1241
|
+
default: 'overlap';
|
|
1242
|
+
label: {
|
|
1243
|
+
readonly en: 'Relevance balance';
|
|
1244
|
+
};
|
|
1245
|
+
members: readonly [{
|
|
1246
|
+
readonly key: 'overlap';
|
|
1247
|
+
readonly label: {
|
|
1248
|
+
readonly en: 'Raw overlap';
|
|
1249
|
+
};
|
|
1250
|
+
readonly description: {
|
|
1251
|
+
readonly en: 'Every repeat of a word counts again, so a longer entry has more chances to score.';
|
|
1252
|
+
};
|
|
1253
|
+
}, {
|
|
1254
|
+
readonly key: 'balanced';
|
|
1255
|
+
readonly label: {
|
|
1256
|
+
readonly en: 'Length-aware';
|
|
1257
|
+
};
|
|
1258
|
+
readonly description: {
|
|
1259
|
+
readonly en: 'A repeated word stops adding as much, and an entry is judged against how long lorebook entries usually are. Better when entries differ a lot in length.';
|
|
1260
|
+
};
|
|
1261
|
+
}];
|
|
1262
|
+
description: {
|
|
1263
|
+
readonly en: "How an entry's own wording is weighed when deciding how relevant it is to what is being said.";
|
|
1264
|
+
};
|
|
1265
|
+
shared: boolean;
|
|
1266
|
+
};
|
|
1267
|
+
trigramFolding: {
|
|
1268
|
+
type: 'number';
|
|
1269
|
+
default: 0;
|
|
1270
|
+
min: 0;
|
|
1271
|
+
max: 1;
|
|
1272
|
+
label: {
|
|
1273
|
+
readonly en: 'Match near-misses';
|
|
1274
|
+
};
|
|
1275
|
+
description: {
|
|
1276
|
+
readonly en: 'How much a keyword that is nearly present counts — a different ending, a typo, or a language that does not put spaces between words. 0 requires an exact match; try 0.5 to turn it on.';
|
|
1277
|
+
};
|
|
1278
|
+
shared: boolean;
|
|
1279
|
+
};
|
|
1280
|
+
titleWeight: {
|
|
1281
|
+
type: 'number';
|
|
1282
|
+
default: 1;
|
|
1283
|
+
min: 0;
|
|
1284
|
+
max: 5;
|
|
1285
|
+
label: {
|
|
1286
|
+
readonly en: 'Title counts extra';
|
|
1287
|
+
};
|
|
1288
|
+
description: {
|
|
1289
|
+
readonly en: "How much more a word in an entry's title counts than the same word among its keywords. 1 treats them alike.";
|
|
1290
|
+
};
|
|
1291
|
+
shared: boolean;
|
|
1292
|
+
};
|
|
1293
|
+
};
|
|
1294
|
+
};
|
|
1295
|
+
} | undefined;
|
|
1296
|
+
}>;
|
|
1297
|
+
/**
|
|
1298
|
+
* **Who is in the world, and when** — the cast's presences, as the session's
|
|
1299
|
+
* reading sees them (built 2026-10-02).
|
|
1300
|
+
*
|
|
1301
|
+
* A presence says *this member, at this point of their own life, is here from
|
|
1302
|
+
* this date until that one* (`cast_presences`). The host reads the scope
|
|
1303
|
+
* session's book and resolves the line before returning: only presences on the
|
|
1304
|
+
* session's line (its own, and an ancestor's that begin at or before the fork
|
|
1305
|
+
* cut) — another line's spans never reach a node. `until` is exclusive: gone at
|
|
1306
|
+
* Y6 is present at Y5 and absent at Y6.
|
|
1307
|
+
*
|
|
1308
|
+
* `main` is the rows `{ bindingId, from, until, position }` (`from` / `until`
|
|
1309
|
+
* a story date `{ year, month?, day? }` or null); `at` is the moment the
|
|
1310
|
+
* session reads at — its story clock, or null for the head ("now", where every
|
|
1311
|
+
* presence with an `until` has ended). A member with **no** rows is always
|
|
1312
|
+
* present: declaring nothing means being here, as it always has.
|
|
1313
|
+
*
|
|
1314
|
+
* What it is for: `core:task/eligibility@1`'s presence rule, which gates the
|
|
1315
|
+
* lore of a member who is not in the world at `at`. A custom retrieval reads it
|
|
1316
|
+
* the same way.
|
|
1317
|
+
* @experimental
|
|
1318
|
+
*/
|
|
1319
|
+
export declare const castPresences: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1320
|
+
/** `{ bindingId, from, until, position }[]`, on the session's line. */
|
|
1321
|
+
main: string;
|
|
1322
|
+
/** The story date the session reads at, or null for the head. */
|
|
1323
|
+
at: string;
|
|
1324
|
+
}, {
|
|
1325
|
+
scope: string;
|
|
1326
|
+
}, "core:query/cast-presences@1"> & {
|
|
1327
|
+
kind: 'query';
|
|
1328
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1329
|
+
}>;
|
|
1330
|
+
/** @experimental */
|
|
1331
|
+
export declare const vectorSearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1332
|
+
main: string;
|
|
1333
|
+
hits: string;
|
|
1334
|
+
/** One ranked list per query vector, in the order they were given. */
|
|
1335
|
+
lists: string;
|
|
1336
|
+
/**
|
|
1337
|
+
* `cos(i, j)` over `hits`, by index. What MMR needs, without any
|
|
1338
|
+
* embedding leaving the host.
|
|
1339
|
+
*/
|
|
1340
|
+
similarity: string;
|
|
1341
|
+
}, {
|
|
1342
|
+
/**
|
|
1343
|
+
* Several query vectors, one ranked list each — a list, so
|
|
1344
|
+
* `json@1` (was `vector@1` until 2026-09-17):
|
|
1345
|
+
* what `embed-text@1`'s `vectors` publishes and what the
|
|
1346
|
+
* host's search reads.
|
|
1347
|
+
*/
|
|
1348
|
+
vectors: string;
|
|
1349
|
+
scope: string;
|
|
1350
|
+
/**
|
|
1351
|
+
* **Whose private lore this search may return** — a participant
|
|
1352
|
+
* reference, with `core:query/character-lore@1`'s exact
|
|
1353
|
+
* semantics (2026-10-02): unwired, `null` or empty, the
|
|
1354
|
+
* scope decides as it always did; a `character:<id>` reads
|
|
1355
|
+
* that character's own private lore and nobody else's; any
|
|
1356
|
+
* other reference reads none. The leak guard for a search
|
|
1357
|
+
* wired inside a repeating clause, where the run's scope is
|
|
1358
|
+
* not the voice being written.
|
|
1359
|
+
*/
|
|
1360
|
+
speaker: string;
|
|
1361
|
+
}, "core:query/vector-search@1"> & {
|
|
1362
|
+
kind: 'query';
|
|
1363
|
+
slots?: {
|
|
1364
|
+
readonly params: {
|
|
1365
|
+
readonly kind: "parameters";
|
|
1366
|
+
readonly facet: "weights";
|
|
1367
|
+
readonly schema: {
|
|
1368
|
+
/**
|
|
1369
|
+
* A **ceiling, not the mechanism's switch** (2026-09-29) — see
|
|
1370
|
+
* `query-windows.searchByMeaning`, which is. Non-zero so that
|
|
1371
|
+
* turning the mechanism on with one control does something:
|
|
1372
|
+
* a feature whose two controls both default to off is one
|
|
1373
|
+
* where turning the first one on appears to do nothing.
|
|
1374
|
+
*
|
|
1375
|
+
* It *was* the switch — 0, the shipped default, was off — and
|
|
1376
|
+
* that was the defect: this is the chain's last node, so the
|
|
1377
|
+
* probes had already been embedded by the time 0 said
|
|
1378
|
+
* nothing was wanted. Every turn with an embedding model
|
|
1379
|
+
* ready paid for an embed it threw away.
|
|
1380
|
+
*
|
|
1381
|
+
* A **cap on what this mechanism contributes**, not a cap on what
|
|
1382
|
+
* it looks at — `topK` is that, one field down. 0 still
|
|
1383
|
+
* contributes nothing, and the binding returns before its
|
|
1384
|
+
* reads for it, but it is not how the mechanism is turned off.
|
|
1385
|
+
*/
|
|
1386
|
+
readonly maxEntries: {
|
|
1387
|
+
readonly type: "integer";
|
|
1388
|
+
readonly default: 5;
|
|
1389
|
+
readonly min: 0;
|
|
1390
|
+
readonly label: {
|
|
1391
|
+
readonly en: "Entries found by meaning";
|
|
1392
|
+
};
|
|
1393
|
+
readonly description: "The most lorebook entries a search by meaning may bring in on one turn. The switch is Search by meaning, on the retrieval queries step. A pipeline that ranks this arm separately reads its per-query lists instead, which this does not cut.";
|
|
1394
|
+
};
|
|
1395
|
+
/**
|
|
1396
|
+
* ⚠ **40, and it was 12.** The number never reached the
|
|
1397
|
+
* host: the binding read `input?.topK` — an *in-port* name
|
|
1398
|
+
* this node does not declare — and fell through to a
|
|
1399
|
+
* literal `?? 40` on every run since the mechanism was
|
|
1400
|
+
* written. So 40 is the value every install has actually
|
|
1401
|
+
* been searching at, and 12 is a number that was rendered,
|
|
1402
|
+
* validated, saved and resolved through the whole scope
|
|
1403
|
+
* chain without ever being handed to anything.
|
|
1404
|
+
*
|
|
1405
|
+
* Defaulted to the effective behaviour rather than to the
|
|
1406
|
+
* declared one on purpose. Wiring a control is not a licence
|
|
1407
|
+
* to re-tune every install that never touched it: the fix is
|
|
1408
|
+
* that the number now *means* something, and it means what
|
|
1409
|
+
* it has been doing.
|
|
1410
|
+
*
|
|
1411
|
+
* A cap on what each query *looks at*, which is a different
|
|
1412
|
+
* question from `maxEntries` one field up — that one caps
|
|
1413
|
+
* what the mechanism *contributes*. Raising this widens the
|
|
1414
|
+
* pool the ranker's other signals get to score; raising
|
|
1415
|
+
* `maxEntries` lets more of it through. Neither decides
|
|
1416
|
+
* whether the mechanism runs at all — that is
|
|
1417
|
+
* `query-windows.searchByMeaning`, Automatic by default
|
|
1418
|
+
* (on whenever an embedding model is set up).
|
|
1419
|
+
*/
|
|
1420
|
+
readonly topK: {
|
|
1421
|
+
readonly type: "integer";
|
|
1422
|
+
readonly default: 40;
|
|
1423
|
+
readonly min: 1;
|
|
1424
|
+
readonly label: {
|
|
1425
|
+
readonly en: "Closest matches per query";
|
|
1426
|
+
};
|
|
1427
|
+
readonly description: "How many of the closest matches each retrieval query returns. A wider pool for the ranker to score, not a cap on what this arm contributes.";
|
|
1428
|
+
};
|
|
1429
|
+
/**
|
|
1430
|
+
* How sharply a weak resemblance is discounted — and
|
|
1431
|
+
* emphatically **not** a minimum.
|
|
1432
|
+
*
|
|
1433
|
+
* ⚠ **This replaced `minScore: 0.35`, and the replacement is
|
|
1434
|
+
* a ruling rather than a rename.** A minimum similarity
|
|
1435
|
+
* removes a row from the pool outright, and a row that is not
|
|
1436
|
+
* in the pool can no longer be found by keyword, by name or
|
|
1437
|
+
* by proximity either — one mechanism's opinion silently
|
|
1438
|
+
* disabling four others. The governing rule is that a weak or
|
|
1439
|
+
* unavailable mechanism *subtracts a signal* and never
|
|
1440
|
+
* removes a candidate, so the cutoff could not stay whatever
|
|
1441
|
+
* number it was set to. (It was never read either; nothing
|
|
1442
|
+
* anywhere consumed `minScore`.)
|
|
1443
|
+
*
|
|
1444
|
+
* What replaces it shapes the **contribution** instead:
|
|
1445
|
+
*
|
|
1446
|
+
* semantic = cos ** similarityFalloff
|
|
1447
|
+
*
|
|
1448
|
+
* 1 is the raw cosine and is the off position. Above 1 the
|
|
1449
|
+
* curve is convex, fixed at both ends (0→0, 1→1), so a
|
|
1450
|
+
* near-miss loses most of its contribution while a strong
|
|
1451
|
+
* match keeps nearly all of its own — and the row stays in
|
|
1452
|
+
* the pool at every value, which is the whole point.
|
|
1453
|
+
*
|
|
1454
|
+
* ⚠ **Chosen as a shape because a threshold is not
|
|
1455
|
+
* portable.** Cosine distributions are not comparable across
|
|
1456
|
+
* embedding models: one model puts unrelated text at 0.1 and
|
|
1457
|
+
* another at 0.6, so `0.35` means "almost everything" on the
|
|
1458
|
+
* first and "almost nothing" on the second, and an install
|
|
1459
|
+
* that swaps models silently changes what its lorebook
|
|
1460
|
+
* retrieves. An exponent has no cliff to move. It is
|
|
1461
|
+
* strictly monotonic, so it can never reorder this
|
|
1462
|
+
* mechanism's own hits or turn one off — it only decides how
|
|
1463
|
+
* much the semantic signal is allowed to outweigh a keyword
|
|
1464
|
+
* that actually fired.
|
|
1465
|
+
*/
|
|
1466
|
+
readonly similarityFalloff: {
|
|
1467
|
+
readonly type: "number";
|
|
1468
|
+
readonly default: 1;
|
|
1469
|
+
readonly min: 1;
|
|
1470
|
+
readonly max: 8;
|
|
1471
|
+
readonly label: {
|
|
1472
|
+
readonly en: "Discount weak matches";
|
|
1473
|
+
};
|
|
1474
|
+
readonly description: "How sharply a loose resemblance counts for less than a close one. 1 takes the similarity as it comes; higher pushes vague matches down without ever removing them, so they can still be found by a keyword or a name.";
|
|
1475
|
+
};
|
|
1476
|
+
};
|
|
1477
|
+
};
|
|
1478
|
+
} | undefined;
|
|
1479
|
+
}>;
|
|
1480
|
+
/**
|
|
1481
|
+
* The third mechanism — retrieval by the names a scene is using.
|
|
1482
|
+
*
|
|
1483
|
+
* The keyword mechanism matches an author's written keys against a window; the vector
|
|
1484
|
+
* mechanism matches an embedding. This one matches **entities**: the characters,
|
|
1485
|
+
* places and things the recent conversation named, against the same entities
|
|
1486
|
+
* found in every lorebook entry and every earlier message. A peer of the other
|
|
1487
|
+
* two rather than a signal inside one, because it queries a different index and
|
|
1488
|
+
* ranks on a different question.
|
|
1489
|
+
*
|
|
1490
|
+
* Three things follow, and they are why it exists:
|
|
1491
|
+
*
|
|
1492
|
+
* 1. **It is how a book with no keywords works.** An entry nobody indexed is
|
|
1493
|
+
* reached because the scene is naming the same people it names. The
|
|
1494
|
+
* `admitThreshold` control on the lore nodes does this *inside* the keyword
|
|
1495
|
+
* scan; this does it as a source of candidates in its own right.
|
|
1496
|
+
* 2. **It searches the transcript**, which nothing else does. The keyword scan
|
|
1497
|
+
* reads only a bounded recent window and the semantic mechanism never
|
|
1498
|
+
* searches messages (its binding asks the index for lorebook entries
|
|
1499
|
+
* only), so this is the one way to retrieve an *older message* by what it
|
|
1500
|
+
* was about.
|
|
1501
|
+
* 3. **It needs no embedding model.** Names are matched, not encoded, so this
|
|
1502
|
+
* is available on every install rather than only on the ones with a model
|
|
1503
|
+
* loaded.
|
|
1504
|
+
*
|
|
1505
|
+
* It reads annotations written in the background, so it is cheap per turn: the
|
|
1506
|
+
* work of finding names in a lorebook happens when the lorebook is written, not
|
|
1507
|
+
* when a turn is taken.
|
|
1508
|
+
* @experimental
|
|
1509
|
+
*/
|
|
1510
|
+
export declare const entitySearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1511
|
+
main: string;
|
|
1512
|
+
hits: string;
|
|
1513
|
+
/**
|
|
1514
|
+
* Earlier messages, as candidates in the declared
|
|
1515
|
+
* **`recalledLines`** band, headed by that band's intent
|
|
1516
|
+
* (2026-09-27; they sat in the transcript's `messages` band
|
|
1517
|
+
* before, budgeted and rendered nowhere).
|
|
1518
|
+
*
|
|
1519
|
+
* A port of its own rather than part of `main`, because the two
|
|
1520
|
+
* are budgeted separately and a pipeline that wants lore found
|
|
1521
|
+
* by name almost certainly does not want its context window
|
|
1522
|
+
* spent on retrieved transcript by accident.
|
|
1523
|
+
*/
|
|
1524
|
+
messages: string;
|
|
1525
|
+
}, {
|
|
1526
|
+
scope: string;
|
|
1527
|
+
/**
|
|
1528
|
+
* **Whose private lore this search may return** — a participant
|
|
1529
|
+
* reference, with `core:query/character-lore@1`'s exact
|
|
1530
|
+
* semantics (2026-10-02): unwired, `null` or empty, the
|
|
1531
|
+
* scope decides as it always did; a `character:<id>` reads
|
|
1532
|
+
* that character's own private lore and nobody else's; any
|
|
1533
|
+
* other reference reads none. The leak guard for a search
|
|
1534
|
+
* wired inside a repeating clause, where the run's scope is
|
|
1535
|
+
* not the voice being written.
|
|
1536
|
+
*/
|
|
1537
|
+
speaker: string;
|
|
1538
|
+
}, "core:query/entity-search@1"> & {
|
|
1539
|
+
kind: 'query';
|
|
1540
|
+
slots?: {
|
|
1541
|
+
readonly params: {
|
|
1542
|
+
readonly kind: "parameters";
|
|
1543
|
+
readonly facet: "weights";
|
|
1544
|
+
readonly schema: {
|
|
1545
|
+
/**
|
|
1546
|
+
* **On by default — 5** (ruled 2026-09-30: all supported
|
|
1547
|
+
* retrieval is on by default; built 2026-10-02). It was 0,
|
|
1548
|
+
* the `maxRecursionDepth` / `admitThreshold` convention of
|
|
1549
|
+
* "turned on rather than arrived at"; the ruling replaced
|
|
1550
|
+
* that convention for retrieval. 0 still turns it off — a
|
|
1551
|
+
* preset that wants keys only says so.
|
|
1552
|
+
*/
|
|
1553
|
+
readonly maxEntries: {
|
|
1554
|
+
readonly type: "integer";
|
|
1555
|
+
readonly default: 5;
|
|
1556
|
+
readonly min: 0;
|
|
1557
|
+
readonly quick: true;
|
|
1558
|
+
readonly label: {
|
|
1559
|
+
readonly en: "Entries found by name";
|
|
1560
|
+
};
|
|
1561
|
+
readonly description: "How many lorebook entries this may bring in because the conversation is naming the same people, places and things they do. 0 turns it off.";
|
|
1562
|
+
};
|
|
1563
|
+
/**
|
|
1564
|
+
* Separate from `maxEntries`, because the two answer
|
|
1565
|
+
* different questions and only one of them has somewhere to
|
|
1566
|
+
* go today.
|
|
1567
|
+
*/
|
|
1568
|
+
readonly maxMessages: {
|
|
1569
|
+
readonly type: "integer";
|
|
1570
|
+
readonly default: 20;
|
|
1571
|
+
readonly min: 0;
|
|
1572
|
+
readonly label: {
|
|
1573
|
+
readonly en: "Earlier messages found by name";
|
|
1574
|
+
};
|
|
1575
|
+
readonly description: "How many earlier messages this may return, as recalled lines, for naming what the scene is naming. They reach the prompt only where a pipeline ranks them and its context template places {{{recalledLines}}}. 0 turns this half off.";
|
|
1576
|
+
};
|
|
1577
|
+
/**
|
|
1578
|
+
* The recalled lines' **share** — a band-namespaced field,
|
|
1579
|
+
* because this definition publishes lore on `main`
|
|
1580
|
+
* and its own band on `messages`. Published as the band's
|
|
1581
|
+
* intent at the head of `messages` whenever `maxMessages`
|
|
1582
|
+
* turns the half on; the cap is `maxMessages`, which
|
|
1583
|
+
* already says it. The default is one lore lane's.
|
|
1584
|
+
*/
|
|
1585
|
+
readonly recalledLinesShare: {
|
|
1586
|
+
readonly type: "number";
|
|
1587
|
+
readonly min: 0;
|
|
1588
|
+
readonly default: 0.1667;
|
|
1589
|
+
readonly label: {
|
|
1590
|
+
readonly en: "Share — recalled lines";
|
|
1591
|
+
};
|
|
1592
|
+
readonly description: {
|
|
1593
|
+
readonly en: "How much of the context window recalled lines may take, relative to every other source. The ranker normalises the shares it is handed; set this to zero to leave recalled lines out.";
|
|
1594
|
+
};
|
|
1595
|
+
};
|
|
1596
|
+
readonly scanDepth: {
|
|
1597
|
+
readonly type: "integer";
|
|
1598
|
+
readonly default: 10;
|
|
1599
|
+
readonly label: {
|
|
1600
|
+
readonly en: "Messages read for names";
|
|
1601
|
+
};
|
|
1602
|
+
readonly description: "How many recent messages are read to decide what the scene is currently about.";
|
|
1603
|
+
};
|
|
1604
|
+
/**
|
|
1605
|
+
* The mechanism's strength, and it is declared rather than
|
|
1606
|
+
* constant because the graded overlap *compresses* what it
|
|
1607
|
+
* measures: one strongly-shared name saturates around 0.63
|
|
1608
|
+
* and two around 0.86, so a weight sized for a 0/1 signal
|
|
1609
|
+
* would leave the improvement invisible.
|
|
1610
|
+
*
|
|
1611
|
+
* The default is deliberately the keyword weight: one thing
|
|
1612
|
+
* the conversation is naming that not every entry names is
|
|
1613
|
+
* worth about as much as one of an entry's own keys firing,
|
|
1614
|
+
* and the saturation then keeps it strictly below a full
|
|
1615
|
+
* keyword match — so authored keys still win, and this only
|
|
1616
|
+
* ever adds.
|
|
1617
|
+
*/
|
|
1618
|
+
readonly entityWeight: {
|
|
1619
|
+
readonly type: "number";
|
|
1620
|
+
readonly default: 0.35;
|
|
1621
|
+
readonly min: 0;
|
|
1622
|
+
readonly max: 1;
|
|
1623
|
+
readonly label: {
|
|
1624
|
+
readonly en: "Strength";
|
|
1625
|
+
};
|
|
1626
|
+
readonly description: "How much weight a shared name carries against the other ways an entry can be found. 0 leaves the arm finding things and ranking them last.";
|
|
1627
|
+
};
|
|
1628
|
+
};
|
|
1629
|
+
};
|
|
1630
|
+
} | undefined;
|
|
1631
|
+
}>;
|
|
1632
|
+
/**
|
|
1633
|
+
* Documentation search — the guide genre's one retrieval mechanism (built
|
|
1634
|
+
* 2026-09-16).
|
|
1635
|
+
*
|
|
1636
|
+
* The app compiles its docs — its own guides and the SDK's — into a section
|
|
1637
|
+
* index at build time (title, anchor, body text per heading). This reads the
|
|
1638
|
+
* person's most recent messages, ranks every section against them, and
|
|
1639
|
+
* publishes the relevant ones as candidates in its own declared band,
|
|
1640
|
+
* **`docsExcerpts`** (2026-09-27; it borrowed `worldLore` before) — so the
|
|
1641
|
+
* ranker budgets them and a template places them as `{{{docsExcerpts}}}`,
|
|
1642
|
+
* framed as the app's manual rather than as a story's lore, with an `{{else}}`
|
|
1643
|
+
* for the turn nothing matched. Each excerpt starts with its page's path.
|
|
1644
|
+
*
|
|
1645
|
+
* A question the docs do not cover publishes the band's intent and nothing
|
|
1646
|
+
* else — on purpose: an empty band is what lets the prompt say "nothing in the
|
|
1647
|
+
* docs matched" instead of handing a model loosely related text to extrapolate
|
|
1648
|
+
* from.
|
|
1649
|
+
*
|
|
1650
|
+
* `optional`, and it degrades to nothing: an install whose docs were never
|
|
1651
|
+
* compiled (a fresh checkout, `npm test`) publishes an empty band with its
|
|
1652
|
+
* intent, and the turn loses excerpts rather than failing.
|
|
1653
|
+
* @internal
|
|
1654
|
+
*/
|
|
1655
|
+
export declare const docsSearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1656
|
+
main: string;
|
|
1657
|
+
candidates: string;
|
|
1658
|
+
}, {
|
|
1659
|
+
scope: string;
|
|
1660
|
+
}, "core:query/docs-search@1"> & {
|
|
1661
|
+
kind: 'query';
|
|
1662
|
+
slots?: {
|
|
1663
|
+
readonly params: {
|
|
1664
|
+
readonly kind: "parameters";
|
|
1665
|
+
readonly facet: "weights";
|
|
1666
|
+
readonly schema: {
|
|
1667
|
+
readonly share: {
|
|
1668
|
+
type: 'number';
|
|
1669
|
+
min: number;
|
|
1670
|
+
default: number;
|
|
1671
|
+
quick: boolean;
|
|
1672
|
+
label: {
|
|
1673
|
+
en: string;
|
|
1674
|
+
};
|
|
1675
|
+
description: {
|
|
1676
|
+
en: string;
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
readonly maxEntries: {
|
|
1680
|
+
type: 'integer';
|
|
1681
|
+
min: number;
|
|
1682
|
+
default?: number | undefined;
|
|
1683
|
+
label: {
|
|
1684
|
+
en: string;
|
|
1685
|
+
};
|
|
1686
|
+
description: {
|
|
1687
|
+
en: string;
|
|
1688
|
+
};
|
|
1689
|
+
};
|
|
1690
|
+
readonly priority: {
|
|
1691
|
+
type: 'enum';
|
|
1692
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
1693
|
+
members: {
|
|
1694
|
+
key: string;
|
|
1695
|
+
label: {
|
|
1696
|
+
en: string;
|
|
1697
|
+
};
|
|
1698
|
+
description: {
|
|
1699
|
+
en: string;
|
|
1700
|
+
};
|
|
1701
|
+
}[];
|
|
1702
|
+
default: 'normal';
|
|
1703
|
+
label: {
|
|
1704
|
+
en: string;
|
|
1705
|
+
};
|
|
1706
|
+
description: {
|
|
1707
|
+
en: string;
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
readonly scanDepth: {
|
|
1711
|
+
readonly type: "integer";
|
|
1712
|
+
readonly min: 1;
|
|
1713
|
+
readonly default: 4;
|
|
1714
|
+
readonly quick: true;
|
|
1715
|
+
readonly label: {
|
|
1716
|
+
readonly en: "Messages searched";
|
|
1717
|
+
};
|
|
1718
|
+
readonly description: {
|
|
1719
|
+
readonly en: "How many of the most recent messages are read for the person's questions. Only their own messages are searched, never the guide's replies, and the newest counts most.";
|
|
1720
|
+
};
|
|
1721
|
+
};
|
|
1722
|
+
};
|
|
1723
|
+
};
|
|
1724
|
+
} | undefined;
|
|
1725
|
+
}>;
|
|
1726
|
+
/**
|
|
1727
|
+
* The mention detector — the query half of the entity-vector space.
|
|
1728
|
+
*
|
|
1729
|
+
* What the current scene refers to by **describing** it rather than by naming
|
|
1730
|
+
* it: *"the captain"*, *"the order"*, *"that bridge"*. Nothing in the lexical
|
|
1731
|
+
* stack can see these — no key matches them, no trigram folds them onto a
|
|
1732
|
+
* title, and the gazetteer has nothing to look up — and they are, as the plan
|
|
1733
|
+
* puts it, the references people actually write.
|
|
1734
|
+
*
|
|
1735
|
+
* A Query and not a Task, because the answer depends on the world's own
|
|
1736
|
+
* vocabulary: a description that turns out to be an authored lower-case name
|
|
1737
|
+
* (*"the ashguard"*) is dropped here, since the exact matcher owns it.
|
|
1738
|
+
* @experimental
|
|
1739
|
+
*/
|
|
1740
|
+
export declare const mentionSpans: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1741
|
+
main: string;
|
|
1742
|
+
/** The mentions with their offsets, for a receipt to point at. */
|
|
1743
|
+
mentions: string;
|
|
1744
|
+
/** The same strings in the same order, for the embed Provider. */
|
|
1745
|
+
texts: string;
|
|
1746
|
+
}, {
|
|
1747
|
+
scope: string;
|
|
1748
|
+
}, "core:query/mention-spans@1"> & {
|
|
1749
|
+
kind: 'query';
|
|
1750
|
+
slots?: {
|
|
1751
|
+
readonly params: {
|
|
1752
|
+
readonly kind: "parameters";
|
|
1753
|
+
readonly facet: "weights";
|
|
1754
|
+
readonly schema: {
|
|
1755
|
+
/**
|
|
1756
|
+
* **On by default — 8** (ruled 2026-09-30: all supported
|
|
1757
|
+
* retrieval is on by default; built 2026-10-02). It was 0.
|
|
1758
|
+
* Still the mechanism's one switch: 0 turns it off.
|
|
1759
|
+
*
|
|
1760
|
+
* **This is the entity-vector mechanism's one switch**, and it is
|
|
1761
|
+
* on the first node of the chain on purpose: switched off,
|
|
1762
|
+
* this returns before reading anything, `embed-text` is
|
|
1763
|
+
* handed no texts and makes no model call, and `entity-link`
|
|
1764
|
+
* returns before its own read. The mechanism costs literally
|
|
1765
|
+
* nothing until somebody asks for it — not a message read,
|
|
1766
|
+
* not an embedding.
|
|
1767
|
+
*
|
|
1768
|
+
* `entity-link.maxLinks` is therefore a ceiling rather than
|
|
1769
|
+
* a second switch and ships non-zero: a feature whose two
|
|
1770
|
+
* controls both default to off is one where turning the
|
|
1771
|
+
* first one up appears to do nothing.
|
|
1772
|
+
*/
|
|
1773
|
+
readonly maxMentions: {
|
|
1774
|
+
readonly type: "integer";
|
|
1775
|
+
readonly default: 8;
|
|
1776
|
+
readonly min: 0;
|
|
1777
|
+
readonly quick: true;
|
|
1778
|
+
readonly label: {
|
|
1779
|
+
readonly en: "Descriptions to follow up";
|
|
1780
|
+
};
|
|
1781
|
+
readonly description: "How many descriptive references in the recent messages — \"the captain\", \"the order\" — are matched against what your entries are called, for entries no keyword reached. Needs an embedding model; 0 turns the whole arm off.";
|
|
1782
|
+
};
|
|
1783
|
+
readonly scanDepth: {
|
|
1784
|
+
readonly type: "integer";
|
|
1785
|
+
readonly default: 10;
|
|
1786
|
+
readonly label: {
|
|
1787
|
+
readonly en: "Messages read for descriptions";
|
|
1788
|
+
};
|
|
1789
|
+
readonly description: "How many recent messages are read for descriptions. A description points at what is being discussed now, so this is deliberately short.";
|
|
1790
|
+
};
|
|
1791
|
+
};
|
|
1792
|
+
};
|
|
1793
|
+
} | undefined;
|
|
1794
|
+
}>;
|
|
1795
|
+
/**
|
|
1796
|
+
* The entity-vector mechanism — mention → name linking.
|
|
1797
|
+
*
|
|
1798
|
+
* A second named vector space holding **one vector per name** rather than one
|
|
1799
|
+
* per entry: an entry's title, the aliases its body declares, and for a
|
|
1800
|
+
* character-anchored entry the bound character's names. Queried with the
|
|
1801
|
+
* descriptions `core:query/mention-spans@1` found, so *"the captain"* reaches
|
|
1802
|
+
* Captain Vell and *"the order"* reaches The Ashguard Riders.
|
|
1803
|
+
*
|
|
1804
|
+
* ## A separate space, not a second use of the content vectors
|
|
1805
|
+
*
|
|
1806
|
+
* Different text at different lengths means different similarity
|
|
1807
|
+
* distributions, so a cutoff tuned for two-word names is wrong for
|
|
1808
|
+
* two-hundred-word passages. The two want different weights, because *"is
|
|
1809
|
+
* called that"* and *"is about that"* are different evidence. And they
|
|
1810
|
+
* invalidate independently — renaming re-embeds the names and not the content;
|
|
1811
|
+
* rewriting the body re-embeds the content and not the names. Comparing a short
|
|
1812
|
+
* string to a short string is also what embeddings are most reliable at, where
|
|
1813
|
+
* a two-word mention against a whole-entry vector is a granularity mismatch.
|
|
1814
|
+
*
|
|
1815
|
+
* ## ⚠ It may only reorder. It may never admit.
|
|
1816
|
+
*
|
|
1817
|
+
* The pool is the `candidates` in-port, and this returns that same list with a
|
|
1818
|
+
* signal attached to whatever linked. There is no id it can emit that some
|
|
1819
|
+
* other mechanism did not already produce, and that is a wiring guarantee
|
|
1820
|
+
* rather than a promise in a comment.
|
|
1821
|
+
*
|
|
1822
|
+
* It matters because invented proper nouns are where embeddings are least
|
|
1823
|
+
* reliable: "Vell" has no learned meaning, so its vector is assembled from
|
|
1824
|
+
* subword fragments and Vell, Vall and Vela cluster. A confident wrong link is
|
|
1825
|
+
* worse than a miss — it would inject wrong lore at high confidence into a
|
|
1826
|
+
* fixed budget, displacing right lore. Constrained to reordering, the same
|
|
1827
|
+
* wrong link costs a position and a line in the receipt naming it.
|
|
1828
|
+
*
|
|
1829
|
+
* So: exact and trigram matching own invented names; entity vectors own
|
|
1830
|
+
* descriptive references.
|
|
1831
|
+
*
|
|
1832
|
+
* ## No threshold, anywhere
|
|
1833
|
+
*
|
|
1834
|
+
* Links rank, they do not gate. What bounds this is a **count**, over links
|
|
1835
|
+
* ordered by match quality — never a similarity cutoff, because *"is 0.62 a
|
|
1836
|
+
* match"* has no answer that survives changing the encoder, and a number that
|
|
1837
|
+
* needs per-corpus calibration is a number nobody can set.
|
|
1838
|
+
* @experimental
|
|
1839
|
+
*/
|
|
1840
|
+
export declare const entityLink: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1841
|
+
main: string;
|
|
1842
|
+
candidates: string;
|
|
1843
|
+
/** Each link as text — *matched "the captain" → Captain Vell*. */
|
|
1844
|
+
links: string;
|
|
1845
|
+
}, {
|
|
1846
|
+
scope: string;
|
|
1847
|
+
/**
|
|
1848
|
+
* ⚠ **The pool, and the reason this mechanism cannot admit.** It
|
|
1849
|
+
* scores what arrives here and returns it; an entry no other
|
|
1850
|
+
* mechanism produced is not in this list and therefore cannot
|
|
1851
|
+
* be in the output.
|
|
1852
|
+
*/
|
|
1853
|
+
candidates: string;
|
|
1854
|
+
/** The descriptions, from `core:query/mention-spans@1`. */
|
|
1855
|
+
mentions: string;
|
|
1856
|
+
/** Their embeddings, in the same order. Index alignment is the contract. */
|
|
1857
|
+
vectors: string;
|
|
1858
|
+
/**
|
|
1859
|
+
* **Whose private lore this search may return** — a participant
|
|
1860
|
+
* reference, with `core:query/character-lore@1`'s exact
|
|
1861
|
+
* semantics (2026-10-02): unwired, `null` or empty, the
|
|
1862
|
+
* scope decides as it always did; a `character:<id>` reads
|
|
1863
|
+
* that character's own private lore and nobody else's; any
|
|
1864
|
+
* other reference reads none. The leak guard for a search
|
|
1865
|
+
* wired inside a repeating clause, where the run's scope is
|
|
1866
|
+
* not the voice being written.
|
|
1867
|
+
*/
|
|
1868
|
+
speaker: string;
|
|
1869
|
+
}, "core:query/entity-link@1"> & {
|
|
1870
|
+
kind: 'query';
|
|
1871
|
+
slots?: {
|
|
1872
|
+
readonly params: {
|
|
1873
|
+
readonly kind: "parameters";
|
|
1874
|
+
readonly facet: "weights";
|
|
1875
|
+
readonly schema: {
|
|
1876
|
+
/**
|
|
1877
|
+
* A **ceiling, not the mechanism's switch** — see
|
|
1878
|
+
* `mention-spans.maxMentions`, which is. Non-zero so that
|
|
1879
|
+
* turning the mechanism on with one control does something.
|
|
1880
|
+
*/
|
|
1881
|
+
readonly maxLinks: {
|
|
1882
|
+
readonly type: "integer";
|
|
1883
|
+
readonly default: 5;
|
|
1884
|
+
readonly min: 0;
|
|
1885
|
+
readonly label: {
|
|
1886
|
+
readonly en: "Most entries linked";
|
|
1887
|
+
};
|
|
1888
|
+
readonly description: "A ceiling on how many entries one turn may have matched to a description. The best matches are kept; this never brings in an entry nothing else found, it only changes where one comes in the order.";
|
|
1889
|
+
};
|
|
1890
|
+
};
|
|
1891
|
+
};
|
|
1892
|
+
} | undefined;
|
|
1893
|
+
}>;
|
|
1894
|
+
/** Illegal by construction elsewhere; used to prove the purity probe. @internal */
|
|
1895
|
+
export declare const network: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1896
|
+
main: string;
|
|
1897
|
+
}, import("@serene-pub/sdk").PortDecl, "test:query/network@1"> & {
|
|
1898
|
+
kind: 'query';
|
|
1899
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1900
|
+
}>;
|
|
1901
|
+
/**
|
|
1902
|
+
* Builds the object a context template renders against.
|
|
1903
|
+
*
|
|
1904
|
+
* A Task, not a Query, even though it reads the cast: what it *is* is the
|
|
1905
|
+
* resolution — which characters appear, which get named, which scenario wins —
|
|
1906
|
+
* and that is a decision anyone should be able to replace. The read reaches the
|
|
1907
|
+
* host like any other (a Task never holds host services itself).
|
|
1908
|
+
*
|
|
1909
|
+
* Separate from Assemble on purpose. Assemble allocates a budget and renders;
|
|
1910
|
+
* this decides what there is to render. A plugin that wants different character
|
|
1911
|
+
* cards should not have to reimplement token allocation to get them.
|
|
1912
|
+
* @public
|
|
1913
|
+
*/
|
|
1914
|
+
export declare const sessionCast: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1915
|
+
main: string;
|
|
1916
|
+
cast: string;
|
|
1917
|
+
/**
|
|
1918
|
+
* The seated envoys on their own (additive
|
|
1919
|
+
* 2026-09-21): `{ slug, key, origin, name, speaks,
|
|
1920
|
+
* default, position, removedAt }` per seat, live and departed,
|
|
1921
|
+
* in seat order — the rows `main` already carries under
|
|
1922
|
+
* `envoys`, offered as a port so a pool or a strategy can be
|
|
1923
|
+
* wired to them without taking the whole cast. There is no
|
|
1924
|
+
* separate envoy query node, and none should be made.
|
|
1925
|
+
*/
|
|
1926
|
+
envoys: string;
|
|
1927
|
+
}, {
|
|
1928
|
+
scope: string;
|
|
1929
|
+
}, "core:query/session-cast@1"> & {
|
|
1930
|
+
kind: 'query';
|
|
1931
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1932
|
+
}>;
|
|
1933
|
+
/**
|
|
1934
|
+
* The session's settings document, re-read.
|
|
1935
|
+
*
|
|
1936
|
+
* Every core inlet that takes a session already publishes the document on
|
|
1937
|
+
* its `session` port, resolved once by the host at run start. This node is
|
|
1938
|
+
* the second way in: placed **after a write that may have moved a value** —
|
|
1939
|
+
* a turn-order write, an annex write — so the rest of the graph reads what
|
|
1940
|
+
* is stored now rather than what the run began with. Same document, same
|
|
1941
|
+
* resolver (`resolveSessionSettings`), no other table read.
|
|
1942
|
+
* @experimental
|
|
1943
|
+
*/
|
|
1944
|
+
export declare const sessionSettings: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1945
|
+
main: string;
|
|
1946
|
+
}, {
|
|
1947
|
+
scope: string;
|
|
1948
|
+
}, "core:query/session-settings@1"> & {
|
|
1949
|
+
kind: 'query';
|
|
1950
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
1951
|
+
}>;
|
|
1952
|
+
/** How the speaking character regards everyone else. @experimental */
|
|
1953
|
+
export declare const relationshipsPerspectives: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
1954
|
+
main: string;
|
|
1955
|
+
relationshipsPerspectives: string;
|
|
1956
|
+
}, {
|
|
1957
|
+
scope: string;
|
|
1958
|
+
}, "core:query/relationships-perspectives@1"> & {
|
|
1959
|
+
kind: 'query';
|
|
1960
|
+
slots?: {
|
|
1961
|
+
params: {
|
|
1962
|
+
kind: 'parameters';
|
|
1963
|
+
facet: 'weights';
|
|
1964
|
+
schema: {
|
|
1965
|
+
maxEntries: {
|
|
1966
|
+
type: 'integer';
|
|
1967
|
+
/**
|
|
1968
|
+
* ⚠ **No `default:`, and its absence is the declaration.**
|
|
1969
|
+
*
|
|
1970
|
+
* Neither spec ever named this slot, so `resolveInput` never
|
|
1971
|
+
* resolved it and `bindings.ts` called `capRelationships` with
|
|
1972
|
+
* `undefined` on every run this node type has ever made — which
|
|
1973
|
+
* that function reads as *no ceiling at all* and returns the
|
|
1974
|
+
* section whole. `respond` wires `params: slot.params()` now, so
|
|
1975
|
+
* whatever is declared here becomes live; under ruling D-8 the
|
|
1976
|
+
* declared default must therefore BE the value every run has
|
|
1977
|
+
* actually used, and that value is "uncapped".
|
|
1978
|
+
*
|
|
1979
|
+
* Uncapped is not expressible as a number here. `0` is already
|
|
1980
|
+
* taken and means the opposite — `capRelationships` returns
|
|
1981
|
+
* `null` for it, so the section is dropped entirely, which is the
|
|
1982
|
+
* `admitThreshold` / `maxEntries` off-switch convention this
|
|
1983
|
+
* package uses everywhere. A negative sentinel IS what
|
|
1984
|
+
* `capRelationships` reads as "no cap" (`cap < 0` returns the
|
|
1985
|
+
* section), but `min: 0` forbids one and no other parameter in
|
|
1986
|
+
* this package uses a negative sentinel; inventing the convention
|
|
1987
|
+
* here would be a design decision riding in on a wiring fix. And
|
|
1988
|
+
* a large finite number is not the value either — it is a
|
|
1989
|
+
* different value that is *usually* indistinguishable, which is
|
|
1990
|
+
* the kind of nearly-right that D-8 exists to refuse.
|
|
1991
|
+
*
|
|
1992
|
+
* So: no default. `resolveSlot`'s params branch copies a schema
|
|
1993
|
+
* default only `if (v?.default !== undefined)`, and
|
|
1994
|
+
* `reconcileConfigs` back-fills a row only when a declaration
|
|
1995
|
+
* carries one — so an untouched install resolves `undefined` and
|
|
1996
|
+
* stays uncapped, exactly as before. The control renders as an
|
|
1997
|
+
* empty box, which `NumberControl` and the panel already treat as
|
|
1998
|
+
* "unset" (an emptied box commits `undefined` and clears the
|
|
1999
|
+
* row), so the empty state round-trips rather than being a hole.
|
|
2000
|
+
*/
|
|
2001
|
+
min: number;
|
|
2002
|
+
quick: boolean;
|
|
2003
|
+
label: {
|
|
2004
|
+
en: string;
|
|
2005
|
+
};
|
|
2006
|
+
description: {
|
|
2007
|
+
en: string;
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
};
|
|
2012
|
+
} | undefined;
|
|
2013
|
+
}>;
|
|
2014
|
+
/**
|
|
2015
|
+
* How everyone else regards the speaking character, and who is known to all.
|
|
2016
|
+
*
|
|
2017
|
+
* `legendaryFigures` rides here rather than on the other node, and the choice
|
|
2018
|
+
* is arguable enough to write down: it is neither the speaker's view nor a view
|
|
2019
|
+
* of the speaker, it is what is *publicly known* — which is the same kind of
|
|
2020
|
+
* claim as "how others regard you" and the opposite kind from "what you think
|
|
2021
|
+
* of them". Splitting it into a third node would put a mostly-empty block in
|
|
2022
|
+
* every prompt on every install that has never marked a node legendary.
|
|
2023
|
+
* @experimental
|
|
2024
|
+
*/
|
|
2025
|
+
export declare const relationshipsKnown: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2026
|
+
main: string;
|
|
2027
|
+
relationshipsKnown: string;
|
|
2028
|
+
}, {
|
|
2029
|
+
scope: string;
|
|
2030
|
+
}, "core:query/relationships-known@1"> & {
|
|
2031
|
+
kind: 'query';
|
|
2032
|
+
slots?: {
|
|
2033
|
+
params: {
|
|
2034
|
+
kind: 'parameters';
|
|
2035
|
+
facet: 'weights';
|
|
2036
|
+
schema: {
|
|
2037
|
+
maxEntries: {
|
|
2038
|
+
type: 'integer';
|
|
2039
|
+
/**
|
|
2040
|
+
* ⚠ **No `default:`, and its absence is the declaration.**
|
|
2041
|
+
*
|
|
2042
|
+
* Neither spec ever named this slot, so `resolveInput` never
|
|
2043
|
+
* resolved it and `bindings.ts` called `capRelationships` with
|
|
2044
|
+
* `undefined` on every run this node type has ever made — which
|
|
2045
|
+
* that function reads as *no ceiling at all* and returns the
|
|
2046
|
+
* section whole. `respond` wires `params: slot.params()` now, so
|
|
2047
|
+
* whatever is declared here becomes live; under ruling D-8 the
|
|
2048
|
+
* declared default must therefore BE the value every run has
|
|
2049
|
+
* actually used, and that value is "uncapped".
|
|
2050
|
+
*
|
|
2051
|
+
* Uncapped is not expressible as a number here. `0` is already
|
|
2052
|
+
* taken and means the opposite — `capRelationships` returns
|
|
2053
|
+
* `null` for it, so the section is dropped entirely, which is the
|
|
2054
|
+
* `admitThreshold` / `maxEntries` off-switch convention this
|
|
2055
|
+
* package uses everywhere. A negative sentinel IS what
|
|
2056
|
+
* `capRelationships` reads as "no cap" (`cap < 0` returns the
|
|
2057
|
+
* section), but `min: 0` forbids one and no other parameter in
|
|
2058
|
+
* this package uses a negative sentinel; inventing the convention
|
|
2059
|
+
* here would be a design decision riding in on a wiring fix. And
|
|
2060
|
+
* a large finite number is not the value either — it is a
|
|
2061
|
+
* different value that is *usually* indistinguishable, which is
|
|
2062
|
+
* the kind of nearly-right that D-8 exists to refuse.
|
|
2063
|
+
*
|
|
2064
|
+
* So: no default. `resolveSlot`'s params branch copies a schema
|
|
2065
|
+
* default only `if (v?.default !== undefined)`, and
|
|
2066
|
+
* `reconcileConfigs` back-fills a row only when a declaration
|
|
2067
|
+
* carries one — so an untouched install resolves `undefined` and
|
|
2068
|
+
* stays uncapped, exactly as before. The control renders as an
|
|
2069
|
+
* empty box, which `NumberControl` and the panel already treat as
|
|
2070
|
+
* "unset" (an emptied box commits `undefined` and clears the
|
|
2071
|
+
* row), so the empty state round-trips rather than being a hole.
|
|
2072
|
+
*/
|
|
2073
|
+
min: number;
|
|
2074
|
+
quick: boolean;
|
|
2075
|
+
label: {
|
|
2076
|
+
en: string;
|
|
2077
|
+
};
|
|
2078
|
+
description: {
|
|
2079
|
+
en: string;
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
} | undefined;
|
|
2085
|
+
}>;
|
|
2086
|
+
/**
|
|
2087
|
+
* The narrative graph as a retrieval **mechanism** (ruling 2026-09-10).
|
|
2088
|
+
*
|
|
2089
|
+
* ⚠ The ruling calls this an *arm*, and the id deliberately does not. Two
|
|
2090
|
+
* reasons, and the second is the stronger: the project's vocabulary retires *arm* in
|
|
2091
|
+
* favour of **mechanism**, and every sibling in this package is named for what
|
|
2092
|
+
* it retrieves rather than for the machinery — `entity-search`,
|
|
2093
|
+
* `vector-search`, `world-lore`. The word survives in the *descriptions* on
|
|
2094
|
+
* those siblings, which is prose a user reads; an id is a frozen
|
|
2095
|
+
* contract, which is the one place a retired word should not land.
|
|
2096
|
+
*
|
|
2097
|
+
* The two nodes above are a *dump*: they hand the whole graph section to the
|
|
2098
|
+
* template, in whatever order the database returned the rows, and the only
|
|
2099
|
+
* control over it is a ceiling. Every other source the prompt is built from is
|
|
2100
|
+
* shared, ranked and allocated — which is what makes "world lore matters more
|
|
2101
|
+
* than history in this chat" sayable, and what makes "why is this entry here"
|
|
2102
|
+
* answerable. Relationships were the one source none of that reached.
|
|
2103
|
+
*
|
|
2104
|
+
* This is the same three sections read as **candidates**, one per relationship,
|
|
2105
|
+
* in the `relationships` band the ranker and the budget have carried since they
|
|
2106
|
+
* were written. What it buys is the whole retrieval surface at once: the band's
|
|
2107
|
+
* share divides the window, `select` decides what fits, and every relationship
|
|
2108
|
+
* arrives on the receipt with a reason.
|
|
2109
|
+
*
|
|
2110
|
+
* ## Ranked here, not by a second ranker
|
|
2111
|
+
*
|
|
2112
|
+
* `core:task/rank-hybrid@1` takes this like any other candidate source — the
|
|
2113
|
+
* band exists, the share exists, the entry cap exists — so there is no new rank
|
|
2114
|
+
* node and no new signal weight. What this node contributes is the **order**,
|
|
2115
|
+
* as a `presetScore` the ranker uses directly: scene presence first, then
|
|
2116
|
+
* whether the speaker is party to the tie, then how recently it changed. The
|
|
2117
|
+
* arithmetic is deterministic and the receipt states each term, which is the
|
|
2118
|
+
* standard `presetScore` carries — `core:query/entity-search@1` ranks its own
|
|
2119
|
+
* hits the same way for the same reason.
|
|
2120
|
+
*
|
|
2121
|
+
* ⚠ **It does not duplicate the two nodes above.** All three reach
|
|
2122
|
+
* `core:task/build-template-context@1`, on the same two in-ports and never
|
|
2123
|
+
* twice: this band is what those sections are built from on a run that
|
|
2124
|
+
* allocated any of it, and the two nodes' own dump is what they are built from
|
|
2125
|
+
* on a run that did not — which is every run until somebody raises the
|
|
2126
|
+
* relationships share. See docs/embeddings-and-rag.md.
|
|
2127
|
+
*
|
|
2128
|
+
* `relationshipSlots` rather than a declaration of its own, so the ceiling here
|
|
2129
|
+
* means exactly what it means on the two nodes above: on/off plus a ceiling,
|
|
2130
|
+
* with an absent value uncapped and 0 leaving it out altogether.
|
|
2131
|
+
*
|
|
2132
|
+
* ## Nobody speaking: the cast-wide read (2026-09-29)
|
|
2133
|
+
*
|
|
2134
|
+
* The three sections are claims about a SPEAKER, and a scope whose
|
|
2135
|
+
* `currentCharacterId` is null has none — an Adventure turn is the narrator's
|
|
2136
|
+
* entry, and its planner and narrator are nobody's voice. Such a scope reads
|
|
2137
|
+
* the **cast-wide read** instead: every relationship a cast member holds, one
|
|
2138
|
+
* candidate each in the `castRelationships` lane, headed by its holder and
|
|
2139
|
+
* naming the other end. A host decides what it may carry; Serene Pub withholds
|
|
2140
|
+
* a member's secrets, since nobody's voice is not the holder's. Ordered
|
|
2141
|
+
* the same way — presence (both ends in the cast), then recency; no tie
|
|
2142
|
+
* touches a speaker. Which agents are handed that band is the spec's choice:
|
|
2143
|
+
* a voice is somebody speaking, and wires none of it.
|
|
2144
|
+
*
|
|
2145
|
+
* `loreLinks` switches the one-hop walk from the entries the turn chose (a
|
|
2146
|
+
* room's ways out, what an item belongs to). On by default, which is what this
|
|
2147
|
+
* node has always done; a genre whose places say their own ways out ("From
|
|
2148
|
+
* here:") turns it off, so a place link is said once, by the place.
|
|
2149
|
+
* @experimental
|
|
2150
|
+
*/
|
|
2151
|
+
export declare const relationshipSearch: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2152
|
+
main: string;
|
|
2153
|
+
hits: string;
|
|
2154
|
+
/**
|
|
2155
|
+
* How many ties were walked, how many the scene was present
|
|
2156
|
+
* for, and what the ceiling did — the mechanism-level half of
|
|
2157
|
+
* the trail, which no per-candidate row can carry.
|
|
2158
|
+
*
|
|
2159
|
+
* Declared rather than merely published, unlike the lore lanes'
|
|
2160
|
+
* own diagnostics: an undeclared out-port is invisible to
|
|
2161
|
+
* `validate.ts` and unreadable by a plugin, which is the finding
|
|
2162
|
+
* `core:task/rank-hybrid@1`'s `groups` cost a release.
|
|
2163
|
+
*/
|
|
2164
|
+
diagnostics: string;
|
|
2165
|
+
}, {
|
|
2166
|
+
scope: string;
|
|
2167
|
+
}, "core:query/relationship-search@1"> & {
|
|
2168
|
+
kind: 'query';
|
|
2169
|
+
slots?: {
|
|
2170
|
+
readonly params: {
|
|
2171
|
+
readonly kind: 'parameters';
|
|
2172
|
+
readonly facet: 'weights';
|
|
2173
|
+
readonly schema: {
|
|
2174
|
+
readonly share: {
|
|
2175
|
+
type: 'number';
|
|
2176
|
+
min: number;
|
|
2177
|
+
default: number;
|
|
2178
|
+
quick: boolean;
|
|
2179
|
+
label: {
|
|
2180
|
+
en: string;
|
|
2181
|
+
};
|
|
2182
|
+
description: {
|
|
2183
|
+
en: string;
|
|
2184
|
+
};
|
|
2185
|
+
};
|
|
2186
|
+
readonly priority: {
|
|
2187
|
+
type: 'enum';
|
|
2188
|
+
of: readonly ["low", "normal", "high", "always"];
|
|
2189
|
+
members: {
|
|
2190
|
+
key: string;
|
|
2191
|
+
label: {
|
|
2192
|
+
en: string;
|
|
2193
|
+
};
|
|
2194
|
+
description: {
|
|
2195
|
+
en: string;
|
|
2196
|
+
};
|
|
2197
|
+
}[];
|
|
2198
|
+
default: 'normal';
|
|
2199
|
+
label: {
|
|
2200
|
+
en: string;
|
|
2201
|
+
};
|
|
2202
|
+
description: {
|
|
2203
|
+
en: string;
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
readonly maxEntries: {
|
|
2207
|
+
type: 'integer';
|
|
2208
|
+
/**
|
|
2209
|
+
* ⚠ **No `default:`, and its absence is the declaration.**
|
|
2210
|
+
*
|
|
2211
|
+
* Neither spec ever named this slot, so `resolveInput` never
|
|
2212
|
+
* resolved it and `bindings.ts` called `capRelationships` with
|
|
2213
|
+
* `undefined` on every run this node type has ever made — which
|
|
2214
|
+
* that function reads as *no ceiling at all* and returns the
|
|
2215
|
+
* section whole. `respond` wires `params: slot.params()` now, so
|
|
2216
|
+
* whatever is declared here becomes live; under ruling D-8 the
|
|
2217
|
+
* declared default must therefore BE the value every run has
|
|
2218
|
+
* actually used, and that value is "uncapped".
|
|
2219
|
+
*
|
|
2220
|
+
* Uncapped is not expressible as a number here. `0` is already
|
|
2221
|
+
* taken and means the opposite — `capRelationships` returns
|
|
2222
|
+
* `null` for it, so the section is dropped entirely, which is the
|
|
2223
|
+
* `admitThreshold` / `maxEntries` off-switch convention this
|
|
2224
|
+
* package uses everywhere. A negative sentinel IS what
|
|
2225
|
+
* `capRelationships` reads as "no cap" (`cap < 0` returns the
|
|
2226
|
+
* section), but `min: 0` forbids one and no other parameter in
|
|
2227
|
+
* this package uses a negative sentinel; inventing the convention
|
|
2228
|
+
* here would be a design decision riding in on a wiring fix. And
|
|
2229
|
+
* a large finite number is not the value either — it is a
|
|
2230
|
+
* different value that is *usually* indistinguishable, which is
|
|
2231
|
+
* the kind of nearly-right that D-8 exists to refuse.
|
|
2232
|
+
*
|
|
2233
|
+
* So: no default. `resolveSlot`'s params branch copies a schema
|
|
2234
|
+
* default only `if (v?.default !== undefined)`, and
|
|
2235
|
+
* `reconcileConfigs` back-fills a row only when a declaration
|
|
2236
|
+
* carries one — so an untouched install resolves `undefined` and
|
|
2237
|
+
* stays uncapped, exactly as before. The control renders as an
|
|
2238
|
+
* empty box, which `NumberControl` and the panel already treat as
|
|
2239
|
+
* "unset" (an emptied box commits `undefined` and clears the
|
|
2240
|
+
* row), so the empty state round-trips rather than being a hole.
|
|
2241
|
+
*/
|
|
2242
|
+
min: number;
|
|
2243
|
+
quick: boolean;
|
|
2244
|
+
label: {
|
|
2245
|
+
en: string;
|
|
2246
|
+
};
|
|
2247
|
+
description: {
|
|
2248
|
+
en: string;
|
|
2249
|
+
};
|
|
2250
|
+
};
|
|
2251
|
+
/**
|
|
2252
|
+
* The lore-link hop: relationships one edge from an entry
|
|
2253
|
+
* this turn's keyword scan chose, with an entry at an end
|
|
2254
|
+
* (a *lore link*).
|
|
2255
|
+
*
|
|
2256
|
+
* `true` is what every run before it did, so the default
|
|
2257
|
+
* moves nothing. Off, the hop is not walked at all — no
|
|
2258
|
+
* link read, no second scan — and the band holds cast ties
|
|
2259
|
+
* only. Adventure's preset turns it off: a place
|
|
2260
|
+
* link belongs to the place ("From here:"), and a hop would
|
|
2261
|
+
* spend the band on a door no section renders.
|
|
2262
|
+
*/
|
|
2263
|
+
readonly loreLinks: {
|
|
2264
|
+
readonly type: "boolean";
|
|
2265
|
+
readonly default: true;
|
|
2266
|
+
readonly label: {
|
|
2267
|
+
readonly en: "Follow lore links";
|
|
2268
|
+
};
|
|
2269
|
+
readonly description: {
|
|
2270
|
+
readonly en: "Also offer the links one step from the lore this turn found — a room’s ways out, what an item belongs to. Off keeps the band to relationships between characters.";
|
|
2271
|
+
};
|
|
2272
|
+
};
|
|
2273
|
+
};
|
|
2274
|
+
};
|
|
2275
|
+
} | undefined;
|
|
2276
|
+
}>;
|
|
2277
|
+
/**
|
|
2278
|
+
* 🚧 **A transcript's attachments** (2026-10-02).
|
|
2279
|
+
*
|
|
2280
|
+
* Takes the history read's rows and publishes, per message id, the files its
|
|
2281
|
+
* active revision shows — `core:image` and `core:file` parts, in part order —
|
|
2282
|
+
* as `HistoryAttachmentV1` references (`core:shape/media-by-message@1`). One
|
|
2283
|
+
* query for the whole transcript. A text file arrives with its body (up to
|
|
2284
|
+
* `textFileBytes`), because a text file reaches every model as text and the
|
|
2285
|
+
* placement step after this one cannot read a disk.
|
|
2286
|
+
*
|
|
2287
|
+
* Reads only rows of the run's own session; a message of any other session
|
|
2288
|
+
* contributes nothing. A message with no files is absent from the record.
|
|
2289
|
+
* @experimental
|
|
2290
|
+
*/
|
|
2291
|
+
export declare const historyAttachments: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2292
|
+
main: string;
|
|
2293
|
+
attachments: string;
|
|
2294
|
+
}, {
|
|
2295
|
+
messages: string;
|
|
2296
|
+
}, "core:query/history-attachments@1"> & {
|
|
2297
|
+
kind: 'query';
|
|
2298
|
+
slots?: {
|
|
2299
|
+
readonly params: {
|
|
2300
|
+
readonly kind: "parameters";
|
|
2301
|
+
readonly facet: "weights";
|
|
2302
|
+
readonly schema: {
|
|
2303
|
+
readonly textFileBytes: {
|
|
2304
|
+
readonly type: "integer";
|
|
2305
|
+
readonly min: 0;
|
|
2306
|
+
readonly default: 65536;
|
|
2307
|
+
readonly label: {
|
|
2308
|
+
readonly en: "Text file read limit (bytes)";
|
|
2309
|
+
};
|
|
2310
|
+
readonly description: {
|
|
2311
|
+
readonly en: "How much of each attached text file is read for the prompt. The placement step trims it further to its own token budget and says when it did.";
|
|
2312
|
+
};
|
|
2313
|
+
};
|
|
2314
|
+
};
|
|
2315
|
+
};
|
|
2316
|
+
} | undefined;
|
|
2317
|
+
}>;
|
|
2318
|
+
/**
|
|
2319
|
+
* Which tools this session can call, and how each one is described to a model.
|
|
2320
|
+
*
|
|
2321
|
+
* A Query rather than a literal on `advertise-tools`, because the answer is
|
|
2322
|
+
* not a property of the spec: the core tools are fixed, but an install's
|
|
2323
|
+
* extensions are not, and a spec that listed its tools by hand would advertise
|
|
2324
|
+
* a tool an uninstalled plugin no longer provides — and refuse, by name, the
|
|
2325
|
+
* one that was installed yesterday.
|
|
2326
|
+
*
|
|
2327
|
+
* Each entry is `{ name, description, parameters }` with `parameters` as JSON
|
|
2328
|
+
* Schema, which is the shape `advertise-tools` takes and the shape every
|
|
2329
|
+
* native tool API wants. Nothing here executes anything; `run-tool` does that,
|
|
2330
|
+
* and refuses any name this list did not carry.
|
|
2331
|
+
* @experimental
|
|
2332
|
+
*/
|
|
2333
|
+
export declare const availableTools: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2334
|
+
main: string;
|
|
2335
|
+
tools: string;
|
|
2336
|
+
}, {
|
|
2337
|
+
scope: string;
|
|
2338
|
+
}, "core:query/available-tools@1"> & {
|
|
2339
|
+
kind: 'query';
|
|
2340
|
+
slots?: {
|
|
2341
|
+
readonly params: {
|
|
2342
|
+
readonly kind: "parameters";
|
|
2343
|
+
readonly schema: {
|
|
2344
|
+
readonly include: {
|
|
2345
|
+
readonly type: "string[]";
|
|
2346
|
+
readonly description: "Offer only these tools, by name, in this order. Empty offers every tool the session has.";
|
|
2347
|
+
};
|
|
2348
|
+
readonly plugins: {
|
|
2349
|
+
readonly type: "boolean";
|
|
2350
|
+
readonly default: true;
|
|
2351
|
+
readonly description: "Offer tools contributed by the session's enabled extensions, as well as the built-in ones.";
|
|
2352
|
+
};
|
|
2353
|
+
};
|
|
2354
|
+
};
|
|
2355
|
+
} | undefined;
|
|
2356
|
+
}>;
|
|
2357
|
+
/**
|
|
2358
|
+
* Create a message.
|
|
2359
|
+
*
|
|
2360
|
+
* Split from the old `commitMessage`, which decided new-vs-update from whether an id
|
|
2361
|
+
* happened to be present. That was an implicit branch, and specs may not branch because
|
|
2362
|
+
* implicit branches are unreadable: two specs that did different things looked identical,
|
|
2363
|
+
* and the receipt could not tell you which had happened. Two ids, two names, no inference.
|
|
2364
|
+
*
|
|
2365
|
+
* Gate-eligible, so it publishes the discriminated write result rather than raw ids.
|
|
2366
|
+
* Under async review this is a proposal a reviewer may still reject.
|
|
2367
|
+
*/
|
|
2368
|
+
/**
|
|
2369
|
+
* The create pipeline's read: what the session's cast wants to
|
|
2370
|
+
* say first — one entry per character in position order, each carrying the
|
|
2371
|
+
* full greeting history (the first text seeds the message, the rest become
|
|
2372
|
+
* swipes), interpolated against the session's first persona.
|
|
2373
|
+
*
|
|
2374
|
+
* A Query, because deciding what a greeting *is* — group-only lists, the
|
|
2375
|
+
* interpolation, the fallback line — is exactly the kind of decision a
|
|
2376
|
+
* custom genre should be able to replace without reimplementing the write.
|
|
2377
|
+
* @experimental
|
|
2378
|
+
*/
|
|
2379
|
+
export declare const sessionGreetings: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2380
|
+
main: string;
|
|
2381
|
+
greetings: string;
|
|
2382
|
+
}, {
|
|
2383
|
+
scope: string;
|
|
2384
|
+
}, "core:query/session-greetings@1"> & {
|
|
2385
|
+
kind: 'query';
|
|
2386
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2387
|
+
}>;
|
|
2388
|
+
/**
|
|
2389
|
+
* A seated envoy's **declared greeting**, interpolated
|
|
2390
|
+
* (2026-09-28) — the line an envoy opens a new session with
|
|
2391
|
+
* (`EnvoyDecl.greeting`): the Lair's Castellan introduces the game.
|
|
2392
|
+
*
|
|
2393
|
+
* The create pipeline's read, beside `session-greetings@1`, which stays the
|
|
2394
|
+
* CARDS' greetings. A Query for the same reason that one is: what a greeting
|
|
2395
|
+
* says is a decision a custom genre may replace without reimplementing the
|
|
2396
|
+
* write.
|
|
2397
|
+
*
|
|
2398
|
+
* **Absent** — `text` empty — when the envoy is not seated in the session
|
|
2399
|
+
* or declares no greeting, so a spec writes behind a junction on `text` and
|
|
2400
|
+
* a session whose envoy was never seated gets no line under its name.
|
|
2401
|
+
* Interpolated with the envoy as `{{char}}`, the session's `{{playerLabel}}`
|
|
2402
|
+
* and the party as `{{characterNames}}` (empty at creation for a genre that
|
|
2403
|
+
* seats nobody yet, so the copy writes `{{#if characterNames}}`).
|
|
2404
|
+
*
|
|
2405
|
+
* No model call: a create run is a person waiting (`lair-create`).
|
|
2406
|
+
* @experimental
|
|
2407
|
+
*/
|
|
2408
|
+
export declare const envoyGreeting: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2409
|
+
main: string;
|
|
2410
|
+
text: string;
|
|
2411
|
+
}, {
|
|
2412
|
+
scope: string;
|
|
2413
|
+
}, "core:query/envoy-greeting@1"> & {
|
|
2414
|
+
kind: 'query';
|
|
2415
|
+
slots?: {
|
|
2416
|
+
readonly params: {
|
|
2417
|
+
readonly kind: "parameters";
|
|
2418
|
+
readonly schema: {
|
|
2419
|
+
/** The envoy, by its genre-local key (`castellan`). */
|
|
2420
|
+
readonly envoy: {
|
|
2421
|
+
readonly type: "text";
|
|
2422
|
+
readonly label: {
|
|
2423
|
+
readonly en: "Envoy";
|
|
2424
|
+
};
|
|
2425
|
+
readonly description: "Which of the genre's envoys greets, by its key.";
|
|
2426
|
+
};
|
|
2427
|
+
};
|
|
2428
|
+
};
|
|
2429
|
+
} | undefined;
|
|
2430
|
+
}>;
|
|
2431
|
+
/**
|
|
2432
|
+
* 🚧 The **standing turn plan** a character turn plays from (Lair character
|
|
2433
|
+
* turns, owner ruling 2026-09-30).
|
|
2434
|
+
*
|
|
2435
|
+
* A planner's row carries the turns it planned (`create-message@1`'s
|
|
2436
|
+
* `turnPlan`, stored as `metadata.turnPlan`). Each named member then takes a
|
|
2437
|
+
* **character turn** of their own — a separate run, fired off the turn order
|
|
2438
|
+
* — and that run reads the plan back here: the planner's document (where the
|
|
2439
|
+
* scene is, what was planned) and the prose describing a room nobody filed.
|
|
2440
|
+
*
|
|
2441
|
+
* The plan that **stands** is the newest planner's row in the session's
|
|
2442
|
+
* history, unless a person's line on `main` is newer than it — a person
|
|
2443
|
+
* speaking after a plan has moved the story past it. With `messageId` (a
|
|
2444
|
+
* regenerate or swipe re-voicing that row) only rows older than it count, so
|
|
2445
|
+
* a re-voiced line reads the plan it was played from. No plan standing, every
|
|
2446
|
+
* port reads absent and the turn plays from the scene as it stands.
|
|
2447
|
+
* @experimental
|
|
2448
|
+
*/
|
|
2449
|
+
export declare const turnPlan: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2450
|
+
main: string;
|
|
2451
|
+
/** The planner's document, as the planner's row stored it. */
|
|
2452
|
+
plan: string;
|
|
2453
|
+
/** Prose describing the room the plan heads into, when the plan carried any. */
|
|
2454
|
+
locationPassage: string;
|
|
2455
|
+
}, {
|
|
2456
|
+
scope: string;
|
|
2457
|
+
/** The row a regenerate or swipe re-voices — the inlet's `messageId`. Absent on a fresh turn. */
|
|
2458
|
+
messageId: string;
|
|
2459
|
+
}, "core:query/turn-plan@1"> & {
|
|
2460
|
+
kind: 'query';
|
|
2461
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2462
|
+
}>;
|
|
2463
|
+
/**
|
|
2464
|
+
* The session's **annex**: read one owner's
|
|
2465
|
+
* document out of `sessions.annex`.
|
|
2466
|
+
*
|
|
2467
|
+
* The annex is the pipeline layer's free field, namespaced by owner key — a
|
|
2468
|
+
* genre id, a plugin id, or a user-authored spec's slug. `metadata` is
|
|
2469
|
+
* core's own and read-only from here; this is where a spec keeps what it
|
|
2470
|
+
* needs to remember without core ever reinterpreting it.
|
|
2471
|
+
*
|
|
2472
|
+
* The owner defaults to the running spec's own namespace, which is the
|
|
2473
|
+
* whole safety of it: a spec reads its own document by default and has to
|
|
2474
|
+
* say `sharedAnnex` out loud to read anybody else's.
|
|
2475
|
+
* @experimental
|
|
2476
|
+
*/
|
|
2477
|
+
export declare const sessionAnnex: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2478
|
+
main: string;
|
|
2479
|
+
}, {
|
|
2480
|
+
scope: string;
|
|
2481
|
+
/**
|
|
2482
|
+
* `'ai'` for the prompt-safe view: only the values the
|
|
2483
|
+
* model's context may carry — those whose audience holds `ai`,
|
|
2484
|
+
* `participant`, or the `speaker` below. Absent is everything,
|
|
2485
|
+
* as a pipeline reads it. A literal.
|
|
2486
|
+
*
|
|
2487
|
+
* `'template'` reads what a template may
|
|
2488
|
+
* reference: every DECLARED key of every owner in scope — core
|
|
2489
|
+
* and the enabled plugins, for the session's genre — as
|
|
2490
|
+
* `{ <owner>: { <key>: value } }`. `owner` and `sharedAnnex`
|
|
2491
|
+
* do not apply; a key no declaration covers is left out. Law
|
|
2492
|
+
* T2 lets it feed only a template node's `annex` in-port.
|
|
2493
|
+
*/
|
|
2494
|
+
view: string;
|
|
2495
|
+
/** Whose prompt, for `view: 'ai'` — a `character:` or `envoy:` reference. */
|
|
2496
|
+
speaker: string;
|
|
2497
|
+
}, "core:query/session-annex@1"> & {
|
|
2498
|
+
kind: 'query';
|
|
2499
|
+
slots?: {
|
|
2500
|
+
readonly params: {
|
|
2501
|
+
readonly kind: "parameters";
|
|
2502
|
+
readonly facet: "behavior";
|
|
2503
|
+
readonly schema: {
|
|
2504
|
+
readonly owner: {
|
|
2505
|
+
readonly type: "string";
|
|
2506
|
+
readonly default: "";
|
|
2507
|
+
readonly label: {
|
|
2508
|
+
readonly en: "Owner";
|
|
2509
|
+
};
|
|
2510
|
+
readonly description: {
|
|
2511
|
+
readonly en: "Whose document to read. Blank means this pipeline's own.";
|
|
2512
|
+
};
|
|
2513
|
+
};
|
|
2514
|
+
readonly sharedAnnex: {
|
|
2515
|
+
readonly type: "boolean";
|
|
2516
|
+
readonly default: false;
|
|
2517
|
+
readonly label: {
|
|
2518
|
+
readonly en: "Read another owner";
|
|
2519
|
+
};
|
|
2520
|
+
readonly description: {
|
|
2521
|
+
readonly en: "Allow reading a document this pipeline does not own. Off refuses, with a note on the receipt.";
|
|
2522
|
+
};
|
|
2523
|
+
};
|
|
2524
|
+
};
|
|
2525
|
+
};
|
|
2526
|
+
} | undefined;
|
|
2527
|
+
}>;
|
|
2528
|
+
/**
|
|
2529
|
+
* The messages a summary is drawn from — both pins on one export, the way a
|
|
2530
|
+
* pinned constructor carries its version at the call site (04 §4b):
|
|
2531
|
+
* `C.summarizeSource.v1(…)` for the shared summarize specs,
|
|
2532
|
+
* `C.summarizeSource.v2(…)` for a genre's summarize-scene. `id` and
|
|
2533
|
+
* `descriptor` stay `@1`'s, so nothing that held this export changes
|
|
2534
|
+
* meaning; `@2`'s descriptor rides its constructor
|
|
2535
|
+
* (`typeof C.summarizeSource.v2` types a binding).
|
|
2536
|
+
* @internal
|
|
2537
|
+
*/
|
|
2538
|
+
export declare const summarizeSource: {
|
|
2539
|
+
id: "core:query/summarize-source@1";
|
|
2540
|
+
descriptor: import("@serene-pub/sdk").Descriptor<{
|
|
2541
|
+
main: string;
|
|
2542
|
+
messages: string;
|
|
2543
|
+
}, {
|
|
2544
|
+
scope: string;
|
|
2545
|
+
request: string;
|
|
2546
|
+
}, "core:query/summarize-source@1"> & {
|
|
2547
|
+
kind: 'query';
|
|
2548
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2549
|
+
};
|
|
2550
|
+
v2: import("@serene-pub/sdk").NodeCtor<import("@serene-pub/sdk").Descriptor<{
|
|
2551
|
+
main: string;
|
|
2552
|
+
/** The story's rows on the story channel, oldest first. */
|
|
2553
|
+
messages: string;
|
|
2554
|
+
/** The aside rows inside the range, oldest first, each carrying its channel. */
|
|
2555
|
+
asides: string;
|
|
2556
|
+
}, {
|
|
2557
|
+
scope: string;
|
|
2558
|
+
request: string;
|
|
2559
|
+
}, "core:query/summarize-source@2"> & {
|
|
2560
|
+
kind: 'query';
|
|
2561
|
+
slots?: {
|
|
2562
|
+
readonly params: {
|
|
2563
|
+
readonly kind: "parameters";
|
|
2564
|
+
readonly facet: "behavior";
|
|
2565
|
+
readonly schema: {
|
|
2566
|
+
/** The story's lane — `main` for every core genre. */
|
|
2567
|
+
readonly channel: {
|
|
2568
|
+
readonly type: "string";
|
|
2569
|
+
readonly default: "main";
|
|
2570
|
+
readonly label: {
|
|
2571
|
+
readonly en: "Story channel";
|
|
2572
|
+
};
|
|
2573
|
+
readonly description: {
|
|
2574
|
+
readonly en: "Which of the session's channels holds the story. The chat log is 'main'.";
|
|
2575
|
+
};
|
|
2576
|
+
};
|
|
2577
|
+
/**
|
|
2578
|
+
* Channels read as asides: rows matched by prefix
|
|
2579
|
+
* (`sanctum` matches `sanctum:2`), each attached to the
|
|
2580
|
+
* story line before it. Empty reads the story alone.
|
|
2581
|
+
*/
|
|
2582
|
+
readonly asides: {
|
|
2583
|
+
readonly type: "list";
|
|
2584
|
+
readonly item: {
|
|
2585
|
+
readonly type: "text";
|
|
2586
|
+
};
|
|
2587
|
+
readonly label: {
|
|
2588
|
+
readonly en: "Aside channels";
|
|
2589
|
+
};
|
|
2590
|
+
readonly description: {
|
|
2591
|
+
readonly en: "Side channels whose lines the summary reads as context, not as events — the Lair's 'sanctum'. Leave it empty to read the story alone.";
|
|
2592
|
+
};
|
|
2593
|
+
};
|
|
2594
|
+
};
|
|
2595
|
+
};
|
|
2596
|
+
} | undefined;
|
|
2597
|
+
}> & {
|
|
2598
|
+
descriptor: import("@serene-pub/sdk").Descriptor<{
|
|
2599
|
+
main: string;
|
|
2600
|
+
/** The story's rows on the story channel, oldest first. */
|
|
2601
|
+
messages: string;
|
|
2602
|
+
/** The aside rows inside the range, oldest first, each carrying its channel. */
|
|
2603
|
+
asides: string;
|
|
2604
|
+
}, {
|
|
2605
|
+
scope: string;
|
|
2606
|
+
request: string;
|
|
2607
|
+
}, "core:query/summarize-source@2"> & {
|
|
2608
|
+
kind: 'query';
|
|
2609
|
+
slots?: {
|
|
2610
|
+
readonly params: {
|
|
2611
|
+
readonly kind: "parameters";
|
|
2612
|
+
readonly facet: "behavior";
|
|
2613
|
+
readonly schema: {
|
|
2614
|
+
/** The story's lane — `main` for every core genre. */
|
|
2615
|
+
readonly channel: {
|
|
2616
|
+
readonly type: "string";
|
|
2617
|
+
readonly default: "main";
|
|
2618
|
+
readonly label: {
|
|
2619
|
+
readonly en: "Story channel";
|
|
2620
|
+
};
|
|
2621
|
+
readonly description: {
|
|
2622
|
+
readonly en: "Which of the session's channels holds the story. The chat log is 'main'.";
|
|
2623
|
+
};
|
|
2624
|
+
};
|
|
2625
|
+
/**
|
|
2626
|
+
* Channels read as asides: rows matched by prefix
|
|
2627
|
+
* (`sanctum` matches `sanctum:2`), each attached to the
|
|
2628
|
+
* story line before it. Empty reads the story alone.
|
|
2629
|
+
*/
|
|
2630
|
+
readonly asides: {
|
|
2631
|
+
readonly type: "list";
|
|
2632
|
+
readonly item: {
|
|
2633
|
+
readonly type: "text";
|
|
2634
|
+
};
|
|
2635
|
+
readonly label: {
|
|
2636
|
+
readonly en: "Aside channels";
|
|
2637
|
+
};
|
|
2638
|
+
readonly description: {
|
|
2639
|
+
readonly en: "Side channels whose lines the summary reads as context, not as events — the Lair's 'sanctum'. Leave it empty to read the story alone.";
|
|
2640
|
+
};
|
|
2641
|
+
};
|
|
2642
|
+
};
|
|
2643
|
+
};
|
|
2644
|
+
} | undefined;
|
|
2645
|
+
};
|
|
2646
|
+
};
|
|
2647
|
+
v1: import("@serene-pub/sdk").NodeCtor<import("@serene-pub/sdk").Descriptor<{
|
|
2648
|
+
main: string;
|
|
2649
|
+
messages: string;
|
|
2650
|
+
}, {
|
|
2651
|
+
scope: string;
|
|
2652
|
+
request: string;
|
|
2653
|
+
}, "core:query/summarize-source@1"> & {
|
|
2654
|
+
kind: 'query';
|
|
2655
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2656
|
+
}>;
|
|
2657
|
+
};
|
|
2658
|
+
/**
|
|
2659
|
+
* The keywords an entry is proposed to be found by — **without a model**.
|
|
2660
|
+
*
|
|
2661
|
+
* ## The defect it exists for
|
|
2662
|
+
*
|
|
2663
|
+
* The summarizer writes a history entry with `keys: []`. Keyword matching is the
|
|
2664
|
+
* only retrieval mechanism on by shipped default, and a history row carries no
|
|
2665
|
+
* title for `nameMatch` to read either, so a summary a user made *so the model
|
|
2666
|
+
* would remember* cannot be found by anything. Measured on the core corpus:
|
|
2667
|
+
* with no keys, **0 of 12** history entries are reachable by any conversation
|
|
2668
|
+
* about them.
|
|
2669
|
+
*
|
|
2670
|
+
* ## ⚠ Why it is not a Provider, and why that is the whole point
|
|
2671
|
+
*
|
|
2672
|
+
* Every sibling in this section calls a model — `name-entry@1` writes the title,
|
|
2673
|
+
* `extract-cast@1` reads the cast. This one is `core:query`, computes from the
|
|
2674
|
+
* lorebook it already has, and **cannot invent a keyword**: every key it emits
|
|
2675
|
+
* is a substring of the text it was given. A proposal that cannot hallucinate
|
|
2676
|
+
* needs no review for hallucination, only for judgement, which is a far cheaper
|
|
2677
|
+
* review — and it costs no tokens, no connection and no wait.
|
|
2678
|
+
*
|
|
2679
|
+
* ## ⚠ The failure mode it is built against
|
|
2680
|
+
*
|
|
2681
|
+
* **Character names are the worst possible keys for a scene.** They are also
|
|
2682
|
+
* what any extractor finds first, and if every scene's entry is keyed on who was
|
|
2683
|
+
* in it then every one of them fires whenever that person is mentioned. That
|
|
2684
|
+
* replaces *"history entries never fire"* with *"all history entries fire
|
|
2685
|
+
* together"*, which is worse — one entry crowding out the rest, across a whole
|
|
2686
|
+
* lane, in a fixed budget where a wrong entry displaces a right one.
|
|
2687
|
+
*
|
|
2688
|
+
* Measured, on ten messages that name two cast members and nothing else:
|
|
2689
|
+
* **0 of 12** history entries fire, and **11 of 12** with the guards against it
|
|
2690
|
+
* removed. Everything the node does is downstream of that number.
|
|
2691
|
+
*
|
|
2692
|
+
* ⚠ There are two guards, not one, and the measurement needed both removed. A
|
|
2693
|
+
* name in every scene also fails the *statistical* test — it already matches
|
|
2694
|
+
* most of the book — so on a lorebook with entries to count over, either one
|
|
2695
|
+
* holds the line. On a lorebook with two entries in it, only the structural
|
|
2696
|
+
* rule can, and that is the lorebook a user has when they start making
|
|
2697
|
+
* summaries.
|
|
2698
|
+
*
|
|
2699
|
+
* ## What a consumer gets
|
|
2700
|
+
*
|
|
2701
|
+
* `keys` carries each proposal with its evidence — where in the text it occurs,
|
|
2702
|
+
* the sentence around it, how distinctive it is in this lorebook, and how many
|
|
2703
|
+
* other entries it already matches — and `rejected` carries every candidate
|
|
2704
|
+
* turned away with the rule that turned it away. Both exist because this node
|
|
2705
|
+
* **proposes and never writes**: what it emits is meant to reach a person who
|
|
2706
|
+
* can edit it before `core:outlet/create-lore-entry@1` stores anything, and a
|
|
2707
|
+
* reviewer who has to hunt for the reason will approve without reading.
|
|
2708
|
+
*
|
|
2709
|
+
* ⚠ It never proposes **secondary** keys. Those carry a user's `selectiveLogic`
|
|
2710
|
+
* conditions — *"fire on dragon, but not when statue is present"* — which is an
|
|
2711
|
+
* author saying *not here*, and nothing that guesses is entitled to say it.
|
|
2712
|
+
* @internal
|
|
2713
|
+
*/
|
|
2714
|
+
export declare const entryKeys: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2715
|
+
main: string;
|
|
2716
|
+
/** The proposals, each with the evidence for it. */
|
|
2717
|
+
keys: string;
|
|
2718
|
+
/** Every candidate turned away, and the rule that turned it away. */
|
|
2719
|
+
rejected: string;
|
|
2720
|
+
}, {
|
|
2721
|
+
/** The lorebook and the cast — what distinctiveness is measured against. */
|
|
2722
|
+
scope: string;
|
|
2723
|
+
/**
|
|
2724
|
+
* The passage keys are proposed for.
|
|
2725
|
+
*
|
|
2726
|
+
* `content`, matching `name-entry@1`, so both proposal steps take
|
|
2727
|
+
* the drafted summary off the same out-port under the same name.
|
|
2728
|
+
*/
|
|
2729
|
+
content: string;
|
|
2730
|
+
}, "core:query/entry-keys@1"> & {
|
|
2731
|
+
kind: 'query';
|
|
2732
|
+
slots?: {
|
|
2733
|
+
readonly params: {
|
|
2734
|
+
readonly kind: "parameters";
|
|
2735
|
+
readonly facet: "weights";
|
|
2736
|
+
readonly schema: {
|
|
2737
|
+
/**
|
|
2738
|
+
* ⚠ **A ceiling on firing opportunities, not a display
|
|
2739
|
+
* preference.** Any single key matching admits the entry, so
|
|
2740
|
+
* this is how wide the entry's door is — and the keyword
|
|
2741
|
+
* signal is `matched / keys.length`, so a longer list also
|
|
2742
|
+
* makes the entry *rank* worse for the same single hit.
|
|
2743
|
+
*
|
|
2744
|
+
* Five: a scene is about a place, a thing and an event or
|
|
2745
|
+
* two. Measured at eight, with the ordinary-word cap opened
|
|
2746
|
+
* with it, **six of twelve** history entries fire on
|
|
2747
|
+
* narrative prose naming nothing from any scene — against
|
|
2748
|
+
* one at five — and the shared-name probe stops being clean.
|
|
2749
|
+
* **0 is off**, in the `admitThreshold` convention.
|
|
2750
|
+
*
|
|
2751
|
+
* It is a ceiling and never a target — fewer is the normal
|
|
2752
|
+
* result and none is a valid one.
|
|
2753
|
+
*/
|
|
2754
|
+
readonly maxKeys: {
|
|
2755
|
+
readonly type: "integer";
|
|
2756
|
+
readonly default: 5;
|
|
2757
|
+
readonly min: 0;
|
|
2758
|
+
readonly max: 20;
|
|
2759
|
+
readonly quick: true;
|
|
2760
|
+
readonly label: {
|
|
2761
|
+
readonly en: "Most keywords suggested";
|
|
2762
|
+
};
|
|
2763
|
+
readonly description: "A ceiling on how many keywords are proposed for one entry. Each one is another way the entry can be pulled into a prompt, so a short list is usually a better one. 0 suggests none.";
|
|
2764
|
+
};
|
|
2765
|
+
/**
|
|
2766
|
+
* ⚠ **The one calibration a user can actually reason about**,
|
|
2767
|
+
* and the reason the others are not here. How rare a word has
|
|
2768
|
+
* to be, how short it may be, how much of a name to keep —
|
|
2769
|
+
* those are measurements, not preferences, and a settings
|
|
2770
|
+
* panel cannot perform them.
|
|
2771
|
+
*
|
|
2772
|
+
* This one is a preference, because it trades two things a
|
|
2773
|
+
* user can feel: an ordinary word like "watch" or "left" is
|
|
2774
|
+
* how an entry gets found when it names nothing proper, and
|
|
2775
|
+
* it is also how an entry starts firing on any scene at all.
|
|
2776
|
+
* Two ordinary words of five; 0 restricts suggestions to
|
|
2777
|
+
* names and places, which measured cleanest and left two of
|
|
2778
|
+
* twelve summaries with no keys at all.
|
|
2779
|
+
*/
|
|
2780
|
+
readonly maxOrdinaryWords: {
|
|
2781
|
+
readonly type: "integer";
|
|
2782
|
+
readonly default: 2;
|
|
2783
|
+
readonly min: 0;
|
|
2784
|
+
readonly max: 20;
|
|
2785
|
+
readonly label: {
|
|
2786
|
+
readonly en: "Ordinary words allowed";
|
|
2787
|
+
};
|
|
2788
|
+
readonly description: "How many of the suggestions may be everyday words rather than names of people, places or things. Names are far less likely to pull the entry into an unrelated scene; 0 suggests names only.";
|
|
2789
|
+
};
|
|
2790
|
+
};
|
|
2791
|
+
};
|
|
2792
|
+
} | undefined;
|
|
2793
|
+
}>;
|
|
2794
|
+
/** @internal */
|
|
2795
|
+
export declare const graphScenes: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2796
|
+
main: string;
|
|
2797
|
+
scenes: string;
|
|
2798
|
+
}, {
|
|
2799
|
+
scope: string;
|
|
2800
|
+
}, "core:query/graph-scenes@1"> & {
|
|
2801
|
+
kind: 'query';
|
|
2802
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2803
|
+
}>;
|
|
2804
|
+
/**
|
|
2805
|
+
* The session's stats and states, resolved — an inventory is one, the
|
|
2806
|
+
* `inventory` list stat (phase 3b retired possessions as edges).
|
|
2807
|
+
*
|
|
2808
|
+
* `{ world, cast, slots, who, version }` — the same object `stateFor(sessionId)`
|
|
2809
|
+
* returns and the shape `state` on `core:task/build-template-context@1` takes.
|
|
2810
|
+
* Every value is already resolved down session → lorebook → card →
|
|
2811
|
+
* declaration default, with absence meaning **inherit** rather than zero, and
|
|
2812
|
+
* derived slots computed rather than read.
|
|
2813
|
+
*
|
|
2814
|
+
* A Query, and a plain one: what it is is a read. There is no as-of parameter
|
|
2815
|
+
* — this is the `current` view, and the temporal registry that would give the
|
|
2816
|
+
* other one is not built (see docs/stats-and-states.md).
|
|
2817
|
+
*
|
|
2818
|
+
* `version` is the session's **state version**: a counter every applied change moves, in turn order,
|
|
2819
|
+
* under a lock. A run that reads state here and later asks to change it
|
|
2820
|
+
* hands the version back as `base` on `resolve-state-changes@1` /
|
|
2821
|
+
* `set-state@1`, so a change proposed against a state that has since moved
|
|
2822
|
+
* is rebased or superseded rather than applied blind. The same number rides
|
|
2823
|
+
* the resolved document as `state.version`, where an enabled-when can name it.
|
|
2824
|
+
* @experimental
|
|
2825
|
+
*/
|
|
2826
|
+
export declare const sessionState: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2827
|
+
main: string;
|
|
2828
|
+
state: string;
|
|
2829
|
+
version: string;
|
|
2830
|
+
}, {
|
|
2831
|
+
scope: string;
|
|
2832
|
+
}, "core:query/session-state@1"> & {
|
|
2833
|
+
kind: 'query';
|
|
2834
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2835
|
+
}>;
|
|
2836
|
+
/**
|
|
2837
|
+
* 🚧 How many of an item are held, and how many are left (attributes phase 3a,
|
|
2838
|
+
* 2026-09-26).
|
|
2839
|
+
*
|
|
2840
|
+
* An item is a `core:entry/item@1` lore entry whose **supply** is unique,
|
|
2841
|
+
* limited to N, or unlimited; a holder's **held count** rides the list item
|
|
2842
|
+
* that references it (`{ entryId, count }`) in any list slot the session
|
|
2843
|
+
* tracks — usually `inventory`. This answers, per entry asked about:
|
|
2844
|
+
* `{ entryId, name, supply, limit, held, remaining, holders }` —
|
|
2845
|
+
* `held` = Σ count across the session's owners (the world and every cast
|
|
2846
|
+
* member), `remaining` = limit − held, never below zero, and `null` for an
|
|
2847
|
+
* unlimited supply.
|
|
2848
|
+
*
|
|
2849
|
+
* ⚠ **It answers; it never enforces.** The owner ruled that supply is enforced
|
|
2850
|
+
* by genre pipelines: a pipeline that hands out the last key reads this first
|
|
2851
|
+
* and decides what a zero means (refuse, swap, narrate a shortage). The host
|
|
2852
|
+
* writes whatever the gate accepts.
|
|
2853
|
+
*
|
|
2854
|
+
* `entryIds` optional: with none it answers for every item entry in the
|
|
2855
|
+
* session's lorebook. An entry outside that lorebook is not answered for — the
|
|
2856
|
+
* scoping refusal, as for every Query.
|
|
2857
|
+
* @experimental
|
|
2858
|
+
*/
|
|
2859
|
+
export declare const itemSupply: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2860
|
+
main: string;
|
|
2861
|
+
supply: string;
|
|
2862
|
+
}, {
|
|
2863
|
+
scope: string;
|
|
2864
|
+
entryIds: string;
|
|
2865
|
+
}, "core:query/item-supply@1"> & {
|
|
2866
|
+
kind: 'query';
|
|
2867
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
2868
|
+
}>;
|
|
2869
|
+
/**
|
|
2870
|
+
* 🚧 The stats a **lorebook** holds — for its world, each cast member and each
|
|
2871
|
+
* place — as durable values (owner-confirmed 2026-09-27: "Pipelines should be
|
|
2872
|
+
* allowed to query stats from the lorebook as well").
|
|
2873
|
+
*
|
|
2874
|
+
* ## The book's layer, and no session needed
|
|
2875
|
+
*
|
|
2876
|
+
* What write-back recorded onto the book's timeline, plus what an author set
|
|
2877
|
+
* on the lorebook, a cast member or a place: the row in force per owner and
|
|
2878
|
+
* slot, the same one a new session played in the book would inherit. Nothing
|
|
2879
|
+
* falls through to a card or a declaration default — a slot the book never
|
|
2880
|
+
* valued is an absent key, not the default — and no session is read, so a
|
|
2881
|
+
* pipeline with no session in play (a run the scope grants the book to) can
|
|
2882
|
+
* read it.
|
|
2883
|
+
*
|
|
2884
|
+
* `{ lorebookId, branchId, slots, world, cast, locations }`, keyed like
|
|
2885
|
+
* `session-state@1`'s document: `world.hp`; `cast.byId[castMemberId]` and
|
|
2886
|
+
* `cast[slug]` over one set of objects, each carrying `id` (the **cast
|
|
2887
|
+
* member's** id — `lorebook_bindings.id`, never the card's), `key` and `name`;
|
|
2888
|
+
* `locations` the same by location entry id. `branchId` is the line read
|
|
2889
|
+
* (null is main).
|
|
2890
|
+
*
|
|
2891
|
+
* ## Only what the book tracks
|
|
2892
|
+
*
|
|
2893
|
+
* A lorebook has no genre, so its vocabulary is phase 1's **world
|
|
2894
|
+
* attributes**: the sheets on the lorebook, its cast members and its places,
|
|
2895
|
+
* plus every declared, pickable slot the book holds a durable value for. It
|
|
2896
|
+
* fails closed: an undeclared slot, or one a mechanism keeps, is never read.
|
|
2897
|
+
*
|
|
2898
|
+
* ## Where on the book
|
|
2899
|
+
*
|
|
2900
|
+
* By default: the scope session's own line and moment when the book is that
|
|
2901
|
+
* session's; otherwise the book's **most recently used** line (the line of
|
|
2902
|
+
* the session played most recently) at the **head** of its timeline. On a
|
|
2903
|
+
* branch, main's dated values count only up to the fork date. The document
|
|
2904
|
+
* says where it read: `branchId`, `moment` (null = head), `forkedAt` — where
|
|
2905
|
+
* main was cut, which on a fork of a fork is the EARLIEST fork date along the
|
|
2906
|
+
* parent chain, not the branch's own (null = no cut).
|
|
2907
|
+
*
|
|
2908
|
+
* 🚧 A custom reading, all optional: `branch` — `'main'`, `'mostRecent'`,
|
|
2909
|
+
* `'session'` or a branch id of this book; `at` — `'head'` or a story date
|
|
2910
|
+
* `{ year, month?, day? }`, keeping only values dated on or before it;
|
|
2911
|
+
* `forkCut: false` — let all of main through on a branch. A branch of
|
|
2912
|
+
* another book is refused like the book.
|
|
2913
|
+
*
|
|
2914
|
+
* ## Scope
|
|
2915
|
+
*
|
|
2916
|
+
* The scope session's own lorebook by default. `lorebookId` may name that
|
|
2917
|
+
* book, or one the run's scope grants; any other is **refused** with a
|
|
2918
|
+
* sentence, never read as empty — and so is an owner filter naming a cast
|
|
2919
|
+
* member or place of another book.
|
|
2920
|
+
* @experimental
|
|
2921
|
+
*/
|
|
2922
|
+
export declare const lorebookState: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
2923
|
+
main: string;
|
|
2924
|
+
state: string;
|
|
2925
|
+
}, {
|
|
2926
|
+
/** Which session's lorebook, when `lorebookId` does not say. Optional. */
|
|
2927
|
+
scope: string;
|
|
2928
|
+
/** A lorebook id: the scope session's own, or one the run's scope grants. Optional. */
|
|
2929
|
+
lorebookId: string;
|
|
2930
|
+
/**
|
|
2931
|
+
* One owner: `"world"`, `{ kind: 'cast_member', id }` or
|
|
2932
|
+
* `{ kind: 'location', id }` (the session kinds `session`,
|
|
2933
|
+
* `session_cast`, `session_location` are translated). Optional.
|
|
2934
|
+
*/
|
|
2935
|
+
owner: string;
|
|
2936
|
+
/** 🚧 `'main'`, `'mostRecent'`, `'session'` or a branch id of this book. Optional. */
|
|
2937
|
+
branch: string;
|
|
2938
|
+
/** 🚧 `'head'` or a story date `{ year, month?, day? }`. Optional. */
|
|
2939
|
+
at: string;
|
|
2940
|
+
/** 🚧 `false` lets all of main through on a branch. Optional. */
|
|
2941
|
+
forkCut: string;
|
|
2942
|
+
}, "core:query/lorebook-state@1"> & {
|
|
2943
|
+
kind: 'query';
|
|
2944
|
+
slots?: {
|
|
2945
|
+
readonly params: {
|
|
2946
|
+
readonly kind: "parameters";
|
|
2947
|
+
readonly schema: {
|
|
2948
|
+
/**
|
|
2949
|
+
* Which stats to read, by full id (`core:slot/hp@1`) or
|
|
2950
|
+
* local name (`hp`). Empty or absent reads every stat the
|
|
2951
|
+
* book tracks; a name it does not track reads nothing.
|
|
2952
|
+
*/
|
|
2953
|
+
readonly slotIds: {
|
|
2954
|
+
readonly type: "list";
|
|
2955
|
+
readonly item: {
|
|
2956
|
+
readonly type: "text";
|
|
2957
|
+
};
|
|
2958
|
+
readonly label: {
|
|
2959
|
+
readonly en: "Only these stats";
|
|
2960
|
+
};
|
|
2961
|
+
readonly description: "Which stats to read, by name. Leave it empty for every stat the lorebook tracks.";
|
|
2962
|
+
};
|
|
2963
|
+
};
|
|
2964
|
+
};
|
|
2965
|
+
} | undefined;
|
|
2966
|
+
}>;
|
|
2967
|
+
/**
|
|
2968
|
+
* 🚧 The **stat trail**: one stat's values over time, for one owner — the
|
|
2969
|
+
* world, a cast member or a place (owner-confirmed 2026-09-27: "stats over
|
|
2970
|
+
* time / over cast progression"). Its document is on `trail` (and `main`).
|
|
2971
|
+
*
|
|
2972
|
+
* ## Two clocks
|
|
2973
|
+
*
|
|
2974
|
+
* - `messages` — the scope session's own changes, in message order. A swiped
|
|
2975
|
+
* or regenerated reply's changes are gone (the swipe retracts them), and a
|
|
2976
|
+
* branched session holds its own copies, so neither leaks in.
|
|
2977
|
+
* - `timeline` — what the lorebook recorded across every session, ordered by
|
|
2978
|
+
* the date of the history entry each hangs from (the one story-date
|
|
2979
|
+
* comparator). An undated value — an author's, or one recorded before any
|
|
2980
|
+
* capture — sorts first.
|
|
2981
|
+
* - `both` (default) — the timeline, then the session's messages: the session
|
|
2982
|
+
* is played at the book's present. A timeline value this session itself
|
|
2983
|
+
* recorded is dropped here, since it is already one of its points.
|
|
2984
|
+
*
|
|
2985
|
+
* Each point: `{ value, layer: 'session' | 'timeline', anchor, provenance }` —
|
|
2986
|
+
* `anchor` is `{ messageId }` or `{ historyEntryId, date }`; `provenance` is
|
|
2987
|
+
* `{ updatedBy, sessionId, messageId, sceneId, note, createdAt }` (who wrote
|
|
2988
|
+
* it: `user`, `run:<id>`, or `session:<id>` for write-back). The document is
|
|
2989
|
+
* `{ lorebookId, sessionId, branchId, owner, slotId, mode, tracked, points }`;
|
|
2990
|
+
* `tracked: false` with no points when neither the book nor the session tracks
|
|
2991
|
+
* the slot (fails closed).
|
|
2992
|
+
*
|
|
2993
|
+
* ## Limits
|
|
2994
|
+
*
|
|
2995
|
+
* `last` keeps the newest N points after every other cut. `since` is
|
|
2996
|
+
* `{ messageId?, date? }`: `messageId` keeps session points AFTER that
|
|
2997
|
+
* message (and drops the timeline in `both`, which precedes it); `date` keeps
|
|
2998
|
+
* timeline points dated ON or after it (a date is a period).
|
|
2999
|
+
*
|
|
3000
|
+
* ## Where on the book
|
|
3001
|
+
*
|
|
3002
|
+
* The timeline stands where `lorebook-state@1` does, with the same optional
|
|
3003
|
+
* `branch`, `at` and `forkCut` ports: on a branch, main's values after the
|
|
3004
|
+
* fork date are not points; at a date, nothing dated after it is. The
|
|
3005
|
+
* session's own messages are its own and are not cut. The document adds
|
|
3006
|
+
* `moment` and `forkedAt` (the effective cut, as in `lorebook-state@1`).
|
|
3007
|
+
*
|
|
3008
|
+
* Scoped like `lorebook-state@1`: the scope session's lorebook, or one the
|
|
3009
|
+
* run's scope grants; any other, or an owner of another book, is refused.
|
|
3010
|
+
* @experimental
|
|
3011
|
+
*/
|
|
3012
|
+
export declare const statTrail: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
3013
|
+
main: string;
|
|
3014
|
+
trail: string;
|
|
3015
|
+
points: string;
|
|
3016
|
+
}, {
|
|
3017
|
+
scope: string;
|
|
3018
|
+
/** A lorebook id: the scope session's own, or one the run's scope grants. Optional. */
|
|
3019
|
+
lorebookId: string;
|
|
3020
|
+
/** `"world"` (default), `{ kind: 'cast_member', id }` or `{ kind: 'location', id }`. */
|
|
3021
|
+
owner: string;
|
|
3022
|
+
/** `{ messageId?, date?: { year, month?, day? } }`. Optional. */
|
|
3023
|
+
since: string;
|
|
3024
|
+
/** 🚧 `'main'`, `'mostRecent'`, `'session'` or a branch id of this book. Optional. */
|
|
3025
|
+
branch: string;
|
|
3026
|
+
/** 🚧 `'head'` or a story date `{ year, month?, day? }`. Optional. */
|
|
3027
|
+
at: string;
|
|
3028
|
+
/** 🚧 `false` lets all of main through on a branch. Optional. */
|
|
3029
|
+
forkCut: string;
|
|
3030
|
+
}, "core:query/stat-trail@1"> & {
|
|
3031
|
+
kind: 'query';
|
|
3032
|
+
slots?: {
|
|
3033
|
+
readonly params: {
|
|
3034
|
+
readonly kind: "parameters";
|
|
3035
|
+
readonly schema: {
|
|
3036
|
+
/** The stat, by full id or local name. */
|
|
3037
|
+
readonly slotId: {
|
|
3038
|
+
readonly type: "text";
|
|
3039
|
+
readonly quick: true;
|
|
3040
|
+
readonly label: {
|
|
3041
|
+
readonly en: "Stat";
|
|
3042
|
+
};
|
|
3043
|
+
readonly description: "Which stat to follow, by name — for example hp.";
|
|
3044
|
+
};
|
|
3045
|
+
readonly mode: {
|
|
3046
|
+
readonly type: "enum";
|
|
3047
|
+
readonly of: readonly ["both", "messages", "timeline"];
|
|
3048
|
+
readonly members: readonly [{
|
|
3049
|
+
readonly key: "both";
|
|
3050
|
+
readonly label: {
|
|
3051
|
+
readonly en: "Both";
|
|
3052
|
+
};
|
|
3053
|
+
readonly description: {
|
|
3054
|
+
readonly en: "Across sessions, then this session.";
|
|
3055
|
+
};
|
|
3056
|
+
}, {
|
|
3057
|
+
readonly key: "messages";
|
|
3058
|
+
readonly label: {
|
|
3059
|
+
readonly en: "This session";
|
|
3060
|
+
};
|
|
3061
|
+
readonly description: {
|
|
3062
|
+
readonly en: "This session, message by message.";
|
|
3063
|
+
};
|
|
3064
|
+
}, {
|
|
3065
|
+
readonly key: "timeline";
|
|
3066
|
+
readonly label: {
|
|
3067
|
+
readonly en: "Across sessions";
|
|
3068
|
+
};
|
|
3069
|
+
readonly description: {
|
|
3070
|
+
readonly en: "What the lorebook recorded across sessions, by story date.";
|
|
3071
|
+
};
|
|
3072
|
+
}];
|
|
3073
|
+
readonly default: "both";
|
|
3074
|
+
readonly quick: true;
|
|
3075
|
+
readonly label: {
|
|
3076
|
+
readonly en: "Which trail";
|
|
3077
|
+
};
|
|
3078
|
+
readonly description: "This session message by message, what the lorebook recorded across sessions by story date, or both.";
|
|
3079
|
+
};
|
|
3080
|
+
readonly last: {
|
|
3081
|
+
readonly type: "integer";
|
|
3082
|
+
readonly default: 50;
|
|
3083
|
+
readonly min: 1;
|
|
3084
|
+
readonly max: 1000;
|
|
3085
|
+
readonly label: {
|
|
3086
|
+
readonly en: "Most changes listed";
|
|
3087
|
+
};
|
|
3088
|
+
readonly description: "Keep only the most recent changes, up to this many.";
|
|
3089
|
+
};
|
|
3090
|
+
};
|
|
3091
|
+
};
|
|
3092
|
+
} | undefined;
|
|
3093
|
+
}>;
|
|
3094
|
+
/**
|
|
3095
|
+
* Change state — or ask to.
|
|
3096
|
+
*
|
|
3097
|
+
* ## Why `propose` is the default
|
|
3098
|
+
*
|
|
3099
|
+
* The three writers do not have equal authority.
|
|
3100
|
+
* A person editing a bar is authoritative; a genre's own script rolling damage
|
|
3101
|
+
* is authoritative because the genre author wrote the arithmetic; a **model**
|
|
3102
|
+
* is neither, and a model that could set a number silently is a model that can
|
|
3103
|
+
* rewrite the fiction between two messages with no receipt a player can
|
|
3104
|
+
* refuse. Defaulting to `propose` means a spec that wires a model's output
|
|
3105
|
+
* straight into this node produces a pending line with Accept / Reject, and a
|
|
3106
|
+
* genre that wants the other behaviour says so in one parameter.
|
|
3107
|
+
*
|
|
3108
|
+
* ## Why it is a Task
|
|
3109
|
+
*
|
|
3110
|
+
* It writes, which a Task is not otherwise supposed to do, and the alternative
|
|
3111
|
+
* is worse: the one-live-row rule allows a spec **one** write-class Consumer and that one is the
|
|
3112
|
+
* message. A damage roll that also saves a reply would be unspecifiable. What
|
|
3113
|
+
* makes it defensible rather than a hole is that these rows are not the run's
|
|
3114
|
+
* primary artifact — every one of them is anchored to a message and retracted
|
|
3115
|
+
* with it, so a rejected turn takes its state changes with it.
|
|
3116
|
+
*
|
|
3117
|
+
* `changes` is one ordered list of `{ owner, slotId, value }` — or, for a
|
|
3118
|
+
* list slot, `{ owner, slotId, op: 'add' | 'remove', items }`. An item
|
|
3119
|
+
* changing hands is exactly that on the owner's `inventory` stat (phase 3b
|
|
3120
|
+
* retired the `{ owner, entryId, delta }` possession edge; the model-facing
|
|
3121
|
+
* item line survives on `resolve-state-changes@1`, which turns it into this). One
|
|
3122
|
+
* port because one turn's changes are one ordered list, and splitting them
|
|
3123
|
+
* would let a spec apply half of them.
|
|
3124
|
+
*
|
|
3125
|
+
* 🚧 A **clock line** `{ kind: 'clock', by, unit }` (live scenes §6, ★3) is
|
|
3126
|
+
* the state-keeper asking to move the session's story clock forward. `propose`
|
|
3127
|
+
* holds it as a **clock proposal** (`state_proposals.kind` `clock`), whose
|
|
3128
|
+
* Accept advances the clock; `apply` passes it over — neither applied nor
|
|
3129
|
+
* refused — because a moved clock is announced through a host seam a task does
|
|
3130
|
+
* not have: a spec that applies the keeper's clock wires *Advance story clock*
|
|
3131
|
+
* from `resolve-state-changes@1`'s `clock` out-port (Adventure's trusted arm).
|
|
3132
|
+
*/
|
|
3133
|
+
/**
|
|
3134
|
+
* Changes a model NAMED, turned into changes `set-state` can write.
|
|
3135
|
+
*
|
|
3136
|
+
* ## A Query, because resolving a name is a READ
|
|
3137
|
+
*
|
|
3138
|
+
* "Verity" becomes a cast row by looking her up in this session's cast, which
|
|
3139
|
+
* is a read of the host and therefore a Query's job — a Task is handed no
|
|
3140
|
+
* services. That also buys the scoping refusal for free: the cast it
|
|
3141
|
+
* matches against is the cast of the session on the `scope` port and no other.
|
|
3142
|
+
*
|
|
3143
|
+
* ## Why this is a node and not a leniency inside `set-state`
|
|
3144
|
+
*
|
|
3145
|
+
* `core:task/set-state@1` takes an owner as `{ kind, id }` — a row, resolved,
|
|
3146
|
+
* unambiguous. A model has no row ids: it has the names the transcript gave it
|
|
3147
|
+
* ("Verity", "the world") and the local name of a stat ("hp"). Something has to
|
|
3148
|
+
* resolve one into the other, and the two candidates were this node or a
|
|
3149
|
+
* widened `set-state`.
|
|
3150
|
+
*
|
|
3151
|
+
* It is this node, because the two callers are genuinely different. A genre's
|
|
3152
|
+
* own script that rolled damage knows which cast row it hit and must not have
|
|
3153
|
+
* its exact owner re-guessed by a fuzzy name match; a model's proposal has
|
|
3154
|
+
* nothing else to offer. Widening `set-state` would make every writer pay for
|
|
3155
|
+
* the model's ambiguity, and would move a resolution failure inside the node
|
|
3156
|
+
* that writes — where it can only be a refusal, never a line on the receipt.
|
|
3157
|
+
*
|
|
3158
|
+
* The same resolution the three state tools do (`set_state`, `give_item`,
|
|
3159
|
+
* `take_item`), reached from a structured block instead of from a tool call.
|
|
3160
|
+
* An item line (`{ owner, entryId, delta }`) resolves to an `add` / `remove`
|
|
3161
|
+
* with a held count on the owner's `inventory` stat, refused as a sentence
|
|
3162
|
+
* when the session does not track inventory (phase 3b).
|
|
3163
|
+
*
|
|
3164
|
+
* ## A name it cannot resolve is a RESULT, not a halt
|
|
3165
|
+
*
|
|
3166
|
+
* A keeper that named five changes and got one character's name wrong should
|
|
3167
|
+
* land four proposals and a sentence about the fifth. `refused` carries those
|
|
3168
|
+
* sentences so the receipt can show them; `changes` carries what resolved.
|
|
3169
|
+
* Halting the turn over one bad name would lose the other four, which is the
|
|
3170
|
+
* same argument `set-state`'s own per-change refusal makes.
|
|
3171
|
+
* @experimental
|
|
3172
|
+
*/
|
|
3173
|
+
export declare const resolveStateChanges: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
3174
|
+
main: string;
|
|
3175
|
+
/** Ready for `core:task/set-state@1`'s `changes` port — each carrying `base` when one was wired. */
|
|
3176
|
+
changes: string;
|
|
3177
|
+
/** One sentence per change that named something not here. */
|
|
3178
|
+
refused: string;
|
|
3179
|
+
/**
|
|
3180
|
+
* 🚧 The clock move the `clock` port resolved, `{ by, unit }` —
|
|
3181
|
+
* absent when there is none. What `core:task/clock-step@1`'s
|
|
3182
|
+
* `step` takes, so a spec that applies the keeper's clock
|
|
3183
|
+
* (Trust the narrator) moves it through *Advance story
|
|
3184
|
+
* clock*; the same move rides `changes` for `propose`.
|
|
3185
|
+
*/
|
|
3186
|
+
clock: string;
|
|
3187
|
+
}, {
|
|
3188
|
+
/**
|
|
3189
|
+
* `[{ owner, slot, value } | { owner, entryId, delta }]` as a
|
|
3190
|
+
* model writes them: `owner` is a name from the conversation or
|
|
3191
|
+
* `world`, `slot` is a stat's local name (`hp`) or its full id,
|
|
3192
|
+
* and an item line moves `delta` of a lore entry into (+) or
|
|
3193
|
+
* out of (−) the owner's inventory.
|
|
3194
|
+
*/
|
|
3195
|
+
changes: string;
|
|
3196
|
+
/**
|
|
3197
|
+
* Who a change that names no `owner` is for, as participant
|
|
3198
|
+
* references (2026-09-28): each such change
|
|
3199
|
+
* is made once per reference, the same slot and value on each —
|
|
3200
|
+
* the Lair's Whisper writes its one line on every recipient the
|
|
3201
|
+
* press collected (`core:inlet/user-message@1.recipients`). A
|
|
3202
|
+
* `character:<id>` resolves to that seated cast member; any
|
|
3203
|
+
* other reference, or a character this session does not seat,
|
|
3204
|
+
* is a sentence on `refused`. A change that names its own
|
|
3205
|
+
* `owner` keeps it. Optional: unwired, an owner-less change is
|
|
3206
|
+
* the world's, as before.
|
|
3207
|
+
*/
|
|
3208
|
+
owners: string;
|
|
3209
|
+
/**
|
|
3210
|
+
* 🚧 **Whose stats this keeper keeps** (stat ownership, owner
|
|
3211
|
+
* ruling 2026-09-30): `'world'` — the world and its places, so
|
|
3212
|
+
* a change naming a cast member is refused; or one participant
|
|
3213
|
+
* reference (`character:<id>`) — that member alone, so a change
|
|
3214
|
+
* to the world, a place or anybody else is refused. Either may
|
|
3215
|
+
* also be a party speaker (`{ characterId }`, or `{ name }` as a
|
|
3216
|
+
* plan writes it, resolved like a change's `owner`), and a list
|
|
3217
|
+
* keeps every item it holds, read flat — an absent item keeps
|
|
3218
|
+
* nobody more. Each refusal is a sentence on `refused`. Unwired,
|
|
3219
|
+
* any owner may be named, as before. The Lair's Castellan keeper
|
|
3220
|
+
* wires `'world'` and the delvers it voiced this turn; each
|
|
3221
|
+
* character turn's keeper wires its own speaker.
|
|
3222
|
+
*/
|
|
3223
|
+
keeps: string;
|
|
3224
|
+
/** Which session's cast the names are resolved against. */
|
|
3225
|
+
scope: string;
|
|
3226
|
+
/**
|
|
3227
|
+
* The planner's document, whose `worldHints` are a second,
|
|
3228
|
+
* smaller set of named changes: where this turn happens, the
|
|
3229
|
+
* time of day and the weather.
|
|
3230
|
+
*
|
|
3231
|
+
* Its own port rather than more entries on `changes`, because
|
|
3232
|
+
* a reference is `{node, port}` with no sub-path — a spec
|
|
3233
|
+
* cannot join one node's list to another node's object on one
|
|
3234
|
+
* port, and the two are written by different agents answering
|
|
3235
|
+
* different questions. A hint that repeats what the world
|
|
3236
|
+
* already says proposes nothing, which is what makes "repeat
|
|
3237
|
+
* the state when this turn changes none of it" safe to ask of
|
|
3238
|
+
* the planner.
|
|
3239
|
+
*/
|
|
3240
|
+
plan: string;
|
|
3241
|
+
/**
|
|
3242
|
+
* 🚧 **A clock proposal** (live scenes §6, ★3, 2026-10-13): the
|
|
3243
|
+
* keeper's answer, whose `clock` list (`[{ by, unit }]`, empty
|
|
3244
|
+
* on the ordinary turn) is how much story time the scene took.
|
|
3245
|
+
* The whole answer for `plan`'s reason — a reference has no
|
|
3246
|
+
* sub-path — and a bare `{ by, unit }` reads the same. The
|
|
3247
|
+
* first entry resolves onto `changes` as `{ kind: 'clock', by,
|
|
3248
|
+
* unit }` (what `set-state` proposes) and onto the `clock`
|
|
3249
|
+
* out-port; forward only — a whole `by` above zero, within
|
|
3250
|
+
* `CLOCK_STEP_MAX`, in one of `STORY_TIME_UNITS` — and only
|
|
3251
|
+
* when the session's clock could move by it. Anything else is
|
|
3252
|
+
* a sentence on `refused`. 🚧 A well-formed ask the story
|
|
3253
|
+
* cannot take (no clock yet, a date the calendar cannot place)
|
|
3254
|
+
* also rides `changes` as `{ kind: 'clock', by, unit, skipped
|
|
3255
|
+
* }`, `skipped` saying why, for `set-state` to write to the
|
|
3256
|
+
* ledger (live scenes §15 G16) — never onto `clock`.
|
|
3257
|
+
* Optional: unwired, no clock move.
|
|
3258
|
+
* ⚠ Not the planner's `timeOfDay` hint, which is a world stat.
|
|
3259
|
+
*/
|
|
3260
|
+
clock: string;
|
|
3261
|
+
/**
|
|
3262
|
+
* The **state version** this turn read: the session-state
|
|
3263
|
+
* query's `version`. Passed through onto every resolved change
|
|
3264
|
+
* as `base`, so `set-state` can tell a delta against the state
|
|
3265
|
+
* the model saw from one against a state that has since moved.
|
|
3266
|
+
* Optional: a spec that wires none proposes against whatever
|
|
3267
|
+
* is current at the write.
|
|
3268
|
+
*/
|
|
3269
|
+
base: string;
|
|
3270
|
+
/**
|
|
3271
|
+
* 🚧 `core:query/item-supply@1`'s answer (phase 3b). Optional,
|
|
3272
|
+
* and the only way supply is ever checked: core never enforces
|
|
3273
|
+
* it (owner ruling 2026-09-25), so a genre that wants a unique
|
|
3274
|
+
* item to stay unique wires this, and an item line granting
|
|
3275
|
+
* more than is left lands on `refused` as a sentence. A take
|
|
3276
|
+
* frees what that owner held before the turn's gives are
|
|
3277
|
+
* counted.
|
|
3278
|
+
*/
|
|
3279
|
+
supply: string;
|
|
3280
|
+
}, "core:query/resolve-state-changes@1"> & {
|
|
3281
|
+
kind: 'query';
|
|
3282
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
3283
|
+
}>;
|
|
3284
|
+
/**
|
|
3285
|
+
* The session's attached lorebook, **listed** — every entry, or the one with a
|
|
3286
|
+
* given name.
|
|
3287
|
+
*
|
|
3288
|
+
* ## Not a retrieval, and that is the whole point
|
|
3289
|
+
*
|
|
3290
|
+
* The four entries-shaped definitions above — `lorebook-triggers@1`,
|
|
3291
|
+
* `world-lore@1`, `character-lore@1`, `history-entries@1` — are one keyword
|
|
3292
|
+
* scan over the conversation, and an entry reaches a prompt through them only
|
|
3293
|
+
* by matching a key, by clearing `admitThreshold` on other evidence, or by
|
|
3294
|
+
* declaring itself `constant`. That is right for a reply and it is no use at
|
|
3295
|
+
* all to a genre that needs to see the book: on a **create** run there is no
|
|
3296
|
+
* conversation to scan, so the window is empty and only always-on entries are
|
|
3297
|
+
* admitted — and a genre asking *is there a room called the Cellar?*, *pick one
|
|
3298
|
+
* of these as the secret*, or *who are the suspects?* had no door at all.
|
|
3299
|
+
*
|
|
3300
|
+
* This is that door, and it is deliberately dull: **no mechanism runs, nothing
|
|
3301
|
+
* is scored, nothing is ranked.** `main` and `entries` carry one bare list of
|
|
3302
|
+
* rows — a **listing**, never `core:shape/context-candidates@1` — so there is
|
|
3303
|
+
* no order of merit in it for a reader to mistake for one. A spec that wants
|
|
3304
|
+
* the book ranked concatenates it into the ranker like any other source; this
|
|
3305
|
+
* node will not do it for them.
|
|
3306
|
+
*
|
|
3307
|
+
* ## The rows are retrieval's rows
|
|
3308
|
+
*
|
|
3309
|
+
* Same fields, from the same host read and the same `toLoreEntry` projection
|
|
3310
|
+
* the four definitions above publish on each candidate's `payload` — `id`,
|
|
3311
|
+
* `source`, `name`, `content`, `keys`, `constant`, `enabled`, `position`,
|
|
3312
|
+
* `priority`, the matcher set, `bindingCharacterId`,
|
|
3313
|
+
* `fingerprint`, and history's `year` / `month` / `day`. That is the contract
|
|
3314
|
+
* worth having: a task written against a retrieved entry reads a listed one
|
|
3315
|
+
* without a second shape to learn, and there is no second projection to keep in
|
|
3316
|
+
* step (the vocabularies are reconciled at the host's read, not merged).
|
|
3317
|
+
* The one addition is asked for: `withLinks` puts each row's lore links on it
|
|
3318
|
+
* as `links` (`LoreLinkRow[]`), said from that row.
|
|
3319
|
+
*
|
|
3320
|
+
* ## What it will not hand over
|
|
3321
|
+
*
|
|
3322
|
+
* · **Another session's lorebook.** `scope` decides which session, and a
|
|
3323
|
+
* `sessionId` that disagrees with the run's is refused with a sentence
|
|
3324
|
+
* (`assertScoped`), never filtered down to an empty list.
|
|
3325
|
+
* · **Disabled or archived entries.** `enabled: false` is a switch the author
|
|
3326
|
+
* left off and `archived` is the column whose stated meaning is *don't
|
|
3327
|
+
* retrieve it and don't show it to me*; a listing that offered either would
|
|
3328
|
+
* make a switched-off room exist and a shelved suspect answer for a crime.
|
|
3329
|
+
* Both are filtered at the read. (The scan above still *sees* disabled rows,
|
|
3330
|
+
* on purpose — it reports them on `skipped` so a person can be told why their
|
|
3331
|
+
* lore did not come in. Nothing here changes that.)
|
|
3332
|
+
* · **Character lore that is private from the current speaker.** The read
|
|
3333
|
+
* applies the same binding-visibility policy the four definitions above run
|
|
3334
|
+
* under, so this is not a way around it. In the case this node exists for —
|
|
3335
|
+
* a create run, an oracle, anything narrator-shaped — `currentCharacterId` is
|
|
3336
|
+
* null, the policy is omniscient, and the whole book comes back.
|
|
3337
|
+
*
|
|
3338
|
+
* ## No `optional`
|
|
3339
|
+
*
|
|
3340
|
+
* Absent, so a failure is the run's failure. A genre that picked its secret
|
|
3341
|
+
* from this list cannot be handed an empty one and carry on: `optional: true`
|
|
3342
|
+
* turns an error into an empty `ok`, and an empty book and a book that failed
|
|
3343
|
+
* to load are the same value to every reader downstream. It is also not a node
|
|
3344
|
+
* a person should be able to switch off — a Twenty Questions pipeline without
|
|
3345
|
+
* it has nothing to play with.
|
|
3346
|
+
* @experimental
|
|
3347
|
+
*/
|
|
3348
|
+
export declare const lorebookEntries: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
3349
|
+
main: string;
|
|
3350
|
+
entries: string;
|
|
3351
|
+
}, {
|
|
3352
|
+
scope: string;
|
|
3353
|
+
}, "core:query/lorebook-entries@1"> & {
|
|
3354
|
+
kind: 'query';
|
|
3355
|
+
slots?: {
|
|
3356
|
+
readonly params: {
|
|
3357
|
+
readonly kind: "parameters";
|
|
3358
|
+
readonly schema: {
|
|
3359
|
+
/**
|
|
3360
|
+
* Which entry types to list — `core:entry/world-lore`,
|
|
3361
|
+
* `core:entry/character-lore`, `core:entry/history`, or a
|
|
3362
|
+
* plugin's own. Bare ids, no `@version`: the version is a
|
|
3363
|
+
* separate column and a type's rows are its rows across
|
|
3364
|
+
* versions.
|
|
3365
|
+
*
|
|
3366
|
+
* A `list` of `text` rather than an `enum` of the three
|
|
3367
|
+
* core ids, because the set is open — an install with a
|
|
3368
|
+
* plugin entry type has more of them, and an enum frozen
|
|
3369
|
+
* into this definition's content hash could not grow
|
|
3370
|
+
* without a re-projection. An id no type declares matches
|
|
3371
|
+
* nothing, which is the honest answer to a typo.
|
|
3372
|
+
*
|
|
3373
|
+
* Empty or absent lists every entry type.
|
|
3374
|
+
*
|
|
3375
|
+
* Named `entryTypes` rather than `types`: *type* alone
|
|
3376
|
+
* is the word four other vocabularies use — a node type, a
|
|
3377
|
+
* session type, a part type — and a parameter may not take
|
|
3378
|
+
* the bare noun.
|
|
3379
|
+
*/
|
|
3380
|
+
readonly entryTypes: {
|
|
3381
|
+
readonly type: "list";
|
|
3382
|
+
readonly item: {
|
|
3383
|
+
readonly type: "text";
|
|
3384
|
+
};
|
|
3385
|
+
readonly label: {
|
|
3386
|
+
readonly en: "Entry types listed";
|
|
3387
|
+
};
|
|
3388
|
+
readonly description: "Which kinds of entry to list, by type id — world lore, character lore, history, or a type an extension declares. Leave it empty for all of them.";
|
|
3389
|
+
};
|
|
3390
|
+
/**
|
|
3391
|
+
* The *does it exist* case: one exact name, matched
|
|
3392
|
+
* case-insensitively with surrounding whitespace trimmed
|
|
3393
|
+
* on both sides.
|
|
3394
|
+
*
|
|
3395
|
+
* Exact and never a substring or a pattern. A genre asking
|
|
3396
|
+
* "is there a room called the Cellar?" needs *yes* or *no*,
|
|
3397
|
+
* and a match that also returned "Cellar Door" and "The
|
|
3398
|
+
* Wine Cellars" would answer a question nobody asked — the
|
|
3399
|
+
* search-shaped reading of this node is the keyword scan
|
|
3400
|
+
* above, which already exists and is better at it.
|
|
3401
|
+
*
|
|
3402
|
+
* History entries have no name at all (the type declares no
|
|
3403
|
+
* title role), so naming one lists nothing.
|
|
3404
|
+
*
|
|
3405
|
+
* Absent lists every entry of the chosen types.
|
|
3406
|
+
*/
|
|
3407
|
+
readonly name: {
|
|
3408
|
+
readonly type: "text";
|
|
3409
|
+
readonly quick: true;
|
|
3410
|
+
readonly label: {
|
|
3411
|
+
readonly en: "Only the entry named";
|
|
3412
|
+
};
|
|
3413
|
+
readonly description: "List only the entry with exactly this name, ignoring capitalisation and surrounding spaces. Leave it empty to list them all.";
|
|
3414
|
+
};
|
|
3415
|
+
/**
|
|
3416
|
+
* A ceiling on rows read, not a page: there is no offset
|
|
3417
|
+
* and no cursor, so raising it is the only way to see more.
|
|
3418
|
+
*
|
|
3419
|
+
* 500 is a large lorebook and 2000 is a ceiling on the
|
|
3420
|
+
* ceiling — this list is usually on its way into a prompt,
|
|
3421
|
+
* and a book that would not fit in a context window is not
|
|
3422
|
+
* made to fit by asking for all of it. The cap is enforced
|
|
3423
|
+
* at the read as well as declared here; a node's parameter
|
|
3424
|
+
* is a control, never a promise the host takes on trust.
|
|
3425
|
+
*/
|
|
3426
|
+
readonly limit: {
|
|
3427
|
+
readonly type: "integer";
|
|
3428
|
+
readonly default: 500;
|
|
3429
|
+
readonly min: 1;
|
|
3430
|
+
readonly max: 2000;
|
|
3431
|
+
readonly label: {
|
|
3432
|
+
readonly en: "Most entries listed";
|
|
3433
|
+
};
|
|
3434
|
+
readonly description: "A ceiling on how many entries are listed. When there are more, the newest are listed. There is no second page — raising this is the only way to see more.";
|
|
3435
|
+
};
|
|
3436
|
+
/**
|
|
3437
|
+
* Each row's **lore links**, on the row as `links`
|
|
3438
|
+
* (`LoreLinkRow[]`) — 2026-09-29. Drizzle's
|
|
3439
|
+
* `with: { … }` in spirit: the listing stays a listing, and a
|
|
3440
|
+
* reader that wants a room's ways out says so.
|
|
3441
|
+
*
|
|
3442
|
+
* Each link is said **from the listed entry** — its wording
|
|
3443
|
+
* from here, the far end named — and only a link that is a
|
|
3444
|
+
* way out of here is listed: between two entries, standing
|
|
3445
|
+
* (active, not secret) on the session's line at its moment,
|
|
3446
|
+
* both ends live, and never one drawn *into* here with no
|
|
3447
|
+
* wording back (one way, inbound). The far end passes the
|
|
3448
|
+
* visibility gate for the WIRED `speaker`; with none wired,
|
|
3449
|
+
* a far end the listing does not itself carry is named only
|
|
3450
|
+
* when every voice may see it — an unwired listing may be
|
|
3451
|
+
* read once and shared by every voice in a turn (the Lair's
|
|
3452
|
+
* rooms). Never a way round the gate.
|
|
3453
|
+
*
|
|
3454
|
+
* Off by default: a row read without it carries no `links`
|
|
3455
|
+
* at all, so every spec written before it reads exactly what
|
|
3456
|
+
* it did.
|
|
3457
|
+
*/
|
|
3458
|
+
readonly withLinks: {
|
|
3459
|
+
readonly type: "boolean";
|
|
3460
|
+
readonly default: false;
|
|
3461
|
+
readonly label: {
|
|
3462
|
+
readonly en: "With each entry’s links";
|
|
3463
|
+
};
|
|
3464
|
+
readonly description: "Also list, on each entry, the links that lead from it to other entries — a room’s ways out, what it is inside — each said from that entry.";
|
|
3465
|
+
};
|
|
3466
|
+
};
|
|
3467
|
+
};
|
|
3468
|
+
} | undefined;
|
|
3469
|
+
}>;
|
|
3470
|
+
/**
|
|
3471
|
+
* 🚧 The **likeness images** of everyone on stage, as one media list — the
|
|
3472
|
+
* Scene action's references.
|
|
3473
|
+
*
|
|
3474
|
+
* Stage order: the switched-on cast in seat order, then the personas in
|
|
3475
|
+
* theirs — the order `core:var/likenesses@1` lays the tag lines out in, so
|
|
3476
|
+
* the n-th picture and the n-th tag line are the same person. Each one's
|
|
3477
|
+
* likeness image, else their avatar (`likenessOf`); someone with neither,
|
|
3478
|
+
* or whose file is gone or is not an image, is skipped. Not capped here:
|
|
3479
|
+
* the picture step's host caps references at the drawing sheet's maximum
|
|
3480
|
+
* and says so.
|
|
3481
|
+
* @experimental
|
|
3482
|
+
*/
|
|
3483
|
+
export declare const likenessImages: import("@serene-pub/sdk").Pinned<import("@serene-pub/sdk").Descriptor<{
|
|
3484
|
+
main: string;
|
|
3485
|
+
references: string;
|
|
3486
|
+
}, {
|
|
3487
|
+
scope: string;
|
|
3488
|
+
}, "core:query/likeness-images@1"> & {
|
|
3489
|
+
kind: 'query';
|
|
3490
|
+
slots?: Record<string, import("@serene-pub/sdk").SlotDecl> | undefined;
|
|
3491
|
+
}>;
|
|
3492
|
+
//# sourceMappingURL=queries.d.ts.map
|