@serene-pub/sdk 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/README.md +24 -20
- package/dist/actions.d.ts +150 -68
- package/dist/actions.js +90 -36
- package/dist/annexFields.d.ts +8 -4
- package/dist/annexFields.js +5 -2
- package/dist/announce.d.ts +78 -28
- package/dist/announce.js +14 -5
- package/dist/attributes.d.ts +9 -6
- package/dist/attributes.js +9 -5
- package/dist/bands.d.ts +41 -6
- package/dist/bands.js +83 -33
- package/dist/builder.d.ts +161 -58
- package/dist/builder.js +128 -22
- package/dist/candidates.d.ts +5 -3
- package/dist/candidates.js +3 -2
- package/dist/clauses.d.ts +2 -1
- package/dist/clauses.js +2 -1
- package/dist/component.d.ts +24 -7
- package/dist/component.js +16 -6
- package/dist/componentBuild.d.ts +16 -5
- package/dist/componentBuild.js +14 -5
- package/dist/componentClient.d.ts +61 -30
- package/dist/componentClient.js +11 -1
- package/dist/componentImports.d.ts +8 -5
- package/dist/componentImports.js +23 -4
- package/dist/componentModule.js +2 -1
- package/dist/componentWire.d.ts +2 -1
- package/dist/componentWire.js +34 -2
- package/dist/config.d.ts +28 -14
- package/dist/config.js +20 -10
- package/dist/connections.d.ts +9 -4
- package/dist/connections.js +7 -4
- package/dist/declarations.d.ts +46 -17
- package/dist/declarations.js +46 -15
- package/dist/descriptors.d.ts +242 -97
- package/dist/descriptors.js +145 -41
- package/dist/dev.d.ts +6 -5
- package/dist/dev.js +6 -5
- package/dist/document.d.ts +74 -25
- package/dist/document.js +32 -11
- package/dist/dowry.d.ts +241 -0
- package/dist/dowry.js +315 -0
- package/dist/engines.d.ts +16 -7
- package/dist/engines.js +6 -4
- package/dist/eventMapLaws.d.ts +19 -8
- package/dist/eventMapLaws.js +9 -6
- package/dist/events.d.ts +101 -39
- package/dist/events.js +106 -33
- package/dist/executor.d.ts +122 -41
- package/dist/executor.js +195 -96
- package/dist/extension.d.ts +99 -35
- package/dist/extension.js +43 -9
- package/dist/facets.d.ts +2 -1
- package/dist/facets.js +4 -2
- package/dist/foldedSections.d.ts +4 -2
- package/dist/foldedSections.js +2 -1
- package/dist/genres.d.ts +123 -41
- package/dist/genres.js +127 -22
- package/dist/guardedConnection.d.ts +4 -3
- package/dist/guardedConnection.js +4 -3
- package/dist/handlebarsReach.d.ts +1 -1
- package/dist/handlebarsReach.js +1 -1
- package/dist/hash.d.ts +16 -5
- package/dist/hash.js +14 -4
- package/dist/hookGrants.d.ts +3 -2
- package/dist/hookGrants.js +6 -4
- package/dist/hooks.d.ts +21 -16
- package/dist/hooks.js +12 -10
- package/dist/hostElements.d.ts +41 -17
- package/dist/hostElements.js +49 -17
- package/dist/i18n.d.ts +5 -3
- package/dist/i18n.js +5 -3
- package/dist/identity.d.ts +5 -4
- package/dist/identity.js +5 -4
- package/dist/index.d.ts +5 -0
- package/dist/index.js +15 -0
- package/dist/layout.d.ts +36 -15
- package/dist/layout.js +2 -2
- package/dist/loadouts.d.ts +97 -0
- package/dist/loadouts.js +81 -0
- package/dist/media.d.ts +26 -4
- package/dist/media.js +2 -1
- package/dist/messageBlocks.d.ts +44 -32
- package/dist/messageBlocks.js +23 -18
- package/dist/migration.d.ts +16 -8
- package/dist/migration.js +14 -8
- package/dist/names.d.ts +2 -1
- package/dist/names.js +2 -1
- package/dist/nodeInput.d.ts +2 -1
- package/dist/nodeInput.js +2 -1
- package/dist/participants.d.ts +22 -15
- package/dist/participants.js +14 -12
- package/dist/personGate.d.ts +2 -1
- package/dist/personGate.js +2 -1
- package/dist/pluginHarness.d.ts +8 -3
- package/dist/pluginHarness.js +4 -2
- package/dist/pluginPermissions.d.ts +2 -1
- package/dist/pluginPermissions.js +12 -1
- package/dist/pluginRuleRef.d.ts +2 -2
- package/dist/pluginRuleRef.js +1 -1
- package/dist/predicates.d.ts +16 -11
- package/dist/predicates.js +7 -6
- package/dist/preview.d.ts +8 -3
- package/dist/preview.js +2 -1
- package/dist/promptBlocks.d.ts +5 -3
- package/dist/promptBlocks.js +5 -3
- package/dist/rankingDecisions.d.ts +2 -1
- package/dist/rankingDecisions.js +2 -1
- package/dist/receipt.d.ts +65 -29
- package/dist/receipt.js +9 -4
- package/dist/receiverRules.js +3 -2
- package/dist/refs.d.ts +34 -9
- package/dist/refs.js +33 -13
- package/dist/registry.d.ts +42 -23
- package/dist/registry.js +7 -5
- package/dist/review.d.ts +16 -5
- package/dist/review.js +11 -4
- package/dist/sampling.d.ts +54 -0
- package/dist/sampling.js +95 -3
- package/dist/sceneSettings.d.ts +312 -0
- package/dist/sceneSettings.js +425 -0
- package/dist/scope.d.ts +6 -4
- package/dist/scope.js +4 -3
- package/dist/scripts.d.ts +81 -14
- package/dist/scripts.js +90 -11
- package/dist/sessionDossier.d.ts +521 -0
- package/dist/sessionDossier.js +33 -0
- package/dist/sessionLayout.d.ts +303 -19
- package/dist/sessionLayout.js +354 -40
- package/dist/sessionSettings.d.ts +8 -5
- package/dist/settings.d.ts +45 -20
- package/dist/settings.js +19 -12
- package/dist/settingsSlot.d.ts +11 -8
- package/dist/settingsSlot.js +11 -8
- package/dist/shapes.d.ts +103 -41
- package/dist/shapes.js +105 -40
- package/dist/sheets.d.ts +4 -2
- package/dist/sheets.js +6 -3
- package/dist/statShapes.d.ts +2 -1
- package/dist/statShapes.js +2 -1
- package/dist/status.d.ts +13 -9
- package/dist/status.js +8 -6
- package/dist/storage.d.ts +2 -1
- package/dist/storage.js +2 -1
- package/dist/storyTime.d.ts +13 -7
- package/dist/storyTime.js +11 -6
- package/dist/strokes.d.ts +176 -0
- package/dist/strokes.js +281 -0
- package/dist/surfaces.d.ts +54 -25
- package/dist/surfaces.js +3 -3
- package/dist/template.d.ts +9 -5
- package/dist/template.js +5 -3
- package/dist/templateCheck.d.ts +2 -2
- package/dist/templateCheck.js +2 -2
- package/dist/templateFit.d.ts +37 -8
- package/dist/templateFit.js +92 -8
- package/dist/templateIds.d.ts +3 -3
- package/dist/templateIds.js +3 -3
- package/dist/templateScopeAt.d.ts +21 -11
- package/dist/templateScopeAt.js +21 -11
- package/dist/testing.d.ts +11 -4
- package/dist/testing.js +13 -5
- package/dist/tokenizers.d.ts +2 -2
- package/dist/tokenizers.js +2 -2
- package/dist/turnLock.d.ts +4 -2
- package/dist/turnLock.js +2 -1
- package/dist/turnOrder.d.ts +17 -11
- package/dist/turnOrder.js +9 -5
- package/dist/validate.d.ts +11 -8
- package/dist/validate.js +81 -10
- package/dist/values.d.ts +17 -8
- package/dist/values.js +11 -6
- package/dist/variables.d.ts +46 -7
- package/dist/variables.js +87 -6
- package/dist/verdicts.d.ts +20 -13
- package/dist/verdicts.js +17 -11
- package/dist/widgetDecls.d.ts +8 -4
- package/dist/widgetDecls.js +4 -2
- package/dist/widgets.d.ts +987 -94
- package/dist/widgets.js +93 -18
- package/dist/wire.d.ts +13 -6
- package/dist/wire.js +3 -3
- package/dist/worldinfo.d.ts +11 -6
- package/dist/worldinfo.js +8 -4
- package/host-elements.d.ts +13 -0
- package/package.json +1 -1
package/dist/rankingDecisions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Ranking decisions
|
|
2
|
+
* Ranking decisions: what a ranker says about each
|
|
3
3
|
* candidate it judged. A node that publishes an array of these on a port of
|
|
4
4
|
* shape `core:shape/decisions@1` (`S.decisions`) has them recorded by the
|
|
5
5
|
* host automatically — nothing else to opt into.
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* A decision with no derivable subject (a message or relationship band) is
|
|
15
15
|
* counted on its ranking, not stored.
|
|
16
|
+
* @ruling PLAN-sdk-1.0 §3.9, R64
|
|
16
17
|
*/
|
|
17
18
|
/** The shape id a decisions port carries. @experimental */
|
|
18
19
|
export const DECISIONS_SHAPE = 'core:shape/decisions@1';
|
package/dist/receipt.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Receipts
|
|
2
|
+
* Receipts. The first-class record of a run, and the thing the
|
|
3
3
|
* whole design's explicability claim rests on.
|
|
4
4
|
*
|
|
5
|
-
* Deliberately absent: progress messages (
|
|
6
|
-
* vectors (
|
|
5
|
+
* Deliberately absent: progress messages (ephemeral) and raw embedding
|
|
6
|
+
* vectors (recorded by reference).
|
|
7
|
+
* @ruling 01 §1, 02 §2, F34, 16 §1a
|
|
7
8
|
*/
|
|
8
9
|
import type { ScopeKind } from './config.js';
|
|
9
10
|
/** @experimental */
|
|
@@ -20,12 +21,18 @@ export interface NodeReceipt {
|
|
|
20
21
|
elapsedMs: number;
|
|
21
22
|
input?: unknown;
|
|
22
23
|
output?: unknown;
|
|
23
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* halt/err detail — "why did nothing happen" is otherwise unanswerable.
|
|
26
|
+
* @ruling 01 §5
|
|
27
|
+
*/
|
|
24
28
|
reason?: string;
|
|
25
29
|
attempts?: number;
|
|
26
30
|
cacheHit?: boolean;
|
|
27
31
|
blockMode?: 'sequential' | 'parallel';
|
|
28
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Which map iteration produced this entry.
|
|
34
|
+
* @ruling 01 §4
|
|
35
|
+
*/
|
|
29
36
|
iteration?: number;
|
|
30
37
|
timeoutMsApplied?: number;
|
|
31
38
|
timedOut?: boolean;
|
|
@@ -35,10 +42,16 @@ export interface NodeReceipt {
|
|
|
35
42
|
* the flag that stops that reading as a success.
|
|
36
43
|
*/
|
|
37
44
|
recoveredAsEmpty?: boolean;
|
|
38
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Which sampler fields the adapter honoured vs dropped.
|
|
47
|
+
* @ruling 12 §2
|
|
48
|
+
*/
|
|
39
49
|
samplingApplied?: Record<string, unknown>;
|
|
40
50
|
samplingIgnored?: string[];
|
|
41
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Provider only — recorded verbatim.
|
|
53
|
+
* @ruling F16
|
|
54
|
+
*/
|
|
42
55
|
request?: unknown;
|
|
43
56
|
response?: unknown;
|
|
44
57
|
tokens?: number;
|
|
@@ -61,7 +74,10 @@ export interface NodeReceipt {
|
|
|
61
74
|
tokensCached?: number;
|
|
62
75
|
/** Tokens WRITTEN to the cache, where a service bills the two halves apart. */
|
|
63
76
|
tokensCacheWrite?: number;
|
|
64
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Resolved config reference, e.g. oracleRef → 'generate'.
|
|
79
|
+
* @ruling 16 §5b-i
|
|
80
|
+
*/
|
|
65
81
|
resolvedRefs?: Record<string, string>;
|
|
66
82
|
/**
|
|
67
83
|
* Which layer each of this node's config values won at, per slot, per
|
|
@@ -87,18 +103,20 @@ export interface NodeReceipt {
|
|
|
87
103
|
*/
|
|
88
104
|
swap?: NodeSwap | null;
|
|
89
105
|
/**
|
|
90
|
-
* This outlet ran in a dry run and committed nothing
|
|
106
|
+
* This outlet ran in a dry run and committed nothing. Its
|
|
91
107
|
* output carries a synthetic id, and the event it would have caused is
|
|
92
108
|
* flagged the same way in `emitted`.
|
|
109
|
+
* @ruling R-21 (1)
|
|
93
110
|
*/
|
|
94
111
|
dry?: true;
|
|
95
112
|
notes?: string[];
|
|
96
113
|
/**
|
|
97
|
-
* Script chains applied around this invocation
|
|
114
|
+
* Script chains applied around this invocation, one record per
|
|
98
115
|
* link, in application order. `appliedBy` distinguishes the substrate
|
|
99
116
|
* (executor-applied at a declared hook) from a binding invoking an
|
|
100
|
-
* interior point
|
|
117
|
+
* interior point. "Which of my thirty filters ate that word" is
|
|
101
118
|
* answered here, per link.
|
|
119
|
+
* @ruling 18 S5, 18 §4e
|
|
102
120
|
*/
|
|
103
121
|
scripts?: ScriptApplicationRecord[];
|
|
104
122
|
}
|
|
@@ -142,13 +160,14 @@ export interface ReceiptMeta {
|
|
|
142
160
|
[key: string]: unknown;
|
|
143
161
|
}
|
|
144
162
|
/**
|
|
145
|
-
* One script link's application, as the receipt keeps it
|
|
163
|
+
* One script link's application, as the receipt keeps it.
|
|
146
164
|
*
|
|
147
165
|
* A failing link is tolerated, not hidden: `result: 'err'` with the reason,
|
|
148
166
|
* and the chain continues — recorded exactly like an optional node's absorbed
|
|
149
167
|
* failure. A stop script's `verdict` is its index; `won: true` marks the
|
|
150
|
-
* earliest, which is the answer to "why did my reply cut off"
|
|
168
|
+
* earliest, which is the answer to "why did my reply cut off".
|
|
151
169
|
* @internal
|
|
170
|
+
* @ruling 18 S2/S4/S5, S4
|
|
152
171
|
*/
|
|
153
172
|
export interface ScriptApplicationRecord {
|
|
154
173
|
scriptId: number;
|
|
@@ -159,10 +178,11 @@ export interface ScriptApplicationRecord {
|
|
|
159
178
|
appliedBy: 'substrate' | 'binding';
|
|
160
179
|
/**
|
|
161
180
|
* Where the link came from when it was not the node's own chain — the
|
|
162
|
-
* provenance half of
|
|
163
|
-
* connection carries
|
|
181
|
+
* provenance half of this record. `connection:KoboldCpp` marks a stop guard the
|
|
182
|
+
* connection carries, which every pipeline using that connection
|
|
164
183
|
* inherits; absent means the pipeline-resolved chain. "Reply ended by
|
|
165
|
-
* `connection:kobold / chatml-guard` at index 412" is this field plus
|
|
184
|
+
* `connection:kobold / chatml-guard` at index 412" is this field plus the stop script's `won`.
|
|
185
|
+
* @ruling 18 §4c, 18 §4b, S4
|
|
166
186
|
*/
|
|
167
187
|
via?: string;
|
|
168
188
|
result: 'ok' | 'err' | 'skip';
|
|
@@ -195,18 +215,23 @@ export interface Receipt {
|
|
|
195
215
|
outcome: Outcome;
|
|
196
216
|
haltNodeKey?: string;
|
|
197
217
|
haltReason?: string;
|
|
198
|
-
/**
|
|
218
|
+
/**
|
|
219
|
+
* Who stopped it, when an admin did. `cancelled` is not `err`.
|
|
220
|
+
* @ruling 13 §3
|
|
221
|
+
*/
|
|
199
222
|
cancelledBy?: string;
|
|
200
223
|
/**
|
|
201
|
-
* Time spent in the admin-visible queue before dequeue
|
|
202
|
-
* deliberately excluded from elapsed: queue wait consumes no budget
|
|
203
|
-
* trips no timeout
|
|
224
|
+
* Time spent in the admin-visible queue before dequeue. Recorded and
|
|
225
|
+
* deliberately excluded from elapsed: queue wait consumes no budget and
|
|
226
|
+
* trips no timeout.
|
|
227
|
+
* @ruling 13 §3, F13, F36
|
|
204
228
|
*/
|
|
205
229
|
queuedMs?: number;
|
|
206
230
|
/**
|
|
207
231
|
* True when this run halted before any effectful node and the receipt was
|
|
208
|
-
* reduced to attribution only
|
|
232
|
+
* reduced to attribution only. Default on for event-triggered runs,
|
|
209
233
|
* which is where the per-message multiplier lives.
|
|
234
|
+
* @ruling 13 §2
|
|
210
235
|
*/
|
|
211
236
|
compact?: boolean;
|
|
212
237
|
/** How many node rows the compaction dropped — so the count is never a mystery. */
|
|
@@ -219,7 +244,7 @@ export interface Receipt {
|
|
|
219
244
|
preview?: import('./preview.js').PreviewReport;
|
|
220
245
|
/**
|
|
221
246
|
* Who portrays each participant this run asked about — resolved by the
|
|
222
|
-
* host **once, at run start**, and pinned here like config
|
|
247
|
+
* host **once, at run start**, and pinned here like config.
|
|
223
248
|
*
|
|
224
249
|
* Keyed by participant reference (`character:12` → `{ by: 'ai' }`,
|
|
225
250
|
* `character:7` → `{ by: 'person', userId: '3' }`, `owner` → …). The
|
|
@@ -233,16 +258,18 @@ export interface Receipt {
|
|
|
233
258
|
* with no session behind it and on a preview that halts before any
|
|
234
259
|
* oracle (a token count, the inspector's debug preview): nobody speaks
|
|
235
260
|
* on those, so there is nobody to portray.
|
|
261
|
+
* @ruling R-21 (4)
|
|
236
262
|
*/
|
|
237
263
|
portrayals?: import('./participants.js').Portrayals;
|
|
238
264
|
/**
|
|
239
|
-
* What the run was doing when it ended badly
|
|
240
|
-
*
|
|
265
|
+
* What the run was doing when it ended badly:
|
|
266
|
+
* the last status a node set — *{speaker} is typing* — and the
|
|
241
267
|
* node that set it. Present only when the outcome is `halt`, `err` or
|
|
242
268
|
* `cancelled`; never on `ok`, never on a preview's halt, and never as a
|
|
243
|
-
* node row — statuses are ephemeral
|
|
269
|
+
* node row — statuses are ephemeral and this is the one exception.
|
|
244
270
|
* The host fills `{speaker}` before the receipt is stored; the client
|
|
245
271
|
* resolves the locale.
|
|
272
|
+
* @ruling R-19, R-21 ("optional, taken"), F34
|
|
246
273
|
*/
|
|
247
274
|
lastStatus?: import('./status.js').LastStatus;
|
|
248
275
|
nodes: NodeReceipt[];
|
|
@@ -258,13 +285,14 @@ export interface Receipt {
|
|
|
258
285
|
*/
|
|
259
286
|
notes?: string[];
|
|
260
287
|
/**
|
|
261
|
-
* One row per loop block that ran, and why it stopped
|
|
288
|
+
* One row per loop block that ran, and why it stopped.
|
|
262
289
|
*
|
|
263
290
|
* The note above says the same thing for the ceiling case in a sentence,
|
|
264
291
|
* and a sentence is not a fact anything can switch on: "did the agent
|
|
265
292
|
* finish, or did it run out of turns" is the question a tool loop's caller
|
|
266
293
|
* asks, and reading it back out of prose is how a caller ends up matching
|
|
267
294
|
* on wording. `iterations` counts the bodies that ran, whatever ended them.
|
|
295
|
+
* @ruling 01 §4a
|
|
268
296
|
*/
|
|
269
297
|
loops?: Array<{
|
|
270
298
|
clauseId: string;
|
|
@@ -278,8 +306,9 @@ export interface Receipt {
|
|
|
278
306
|
stopped: 'predicate' | 'ceiling' | 'interrupted';
|
|
279
307
|
}>;
|
|
280
308
|
/**
|
|
281
|
-
* Events core emitted as a consequence of writes in this run
|
|
309
|
+
* Events core emitted as a consequence of writes in this run.
|
|
282
310
|
* `dry` marks one a dry run recorded and never dispatched.
|
|
311
|
+
* @ruling 01 §8
|
|
283
312
|
*/
|
|
284
313
|
emitted: Array<{
|
|
285
314
|
event: string;
|
|
@@ -287,7 +316,10 @@ export interface Receipt {
|
|
|
287
316
|
subscribers: number;
|
|
288
317
|
dry?: true;
|
|
289
318
|
}>;
|
|
290
|
-
/**
|
|
319
|
+
/**
|
|
320
|
+
* Gate decisions enter provenance; replay honours them.
|
|
321
|
+
* @ruling F15
|
|
322
|
+
*/
|
|
291
323
|
reviews?: Array<{
|
|
292
324
|
nodeKey: string;
|
|
293
325
|
position: string;
|
|
@@ -308,6 +340,10 @@ export interface Receipt {
|
|
|
308
340
|
*/
|
|
309
341
|
meta?: ReceiptMeta;
|
|
310
342
|
}
|
|
311
|
-
/**
|
|
343
|
+
/**
|
|
344
|
+
* Render a receipt the way the run inspector would. Used in tests as documentation.
|
|
345
|
+
* @experimental
|
|
346
|
+
* @ruling 17 §4
|
|
347
|
+
*/
|
|
312
348
|
export declare function renderReceipt(r: Receipt): string;
|
|
313
349
|
//# sourceMappingURL=receipt.d.ts.map
|
package/dist/receipt.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Receipts
|
|
2
|
+
* Receipts. The first-class record of a run, and the thing the
|
|
3
3
|
* whole design's explicability claim rests on.
|
|
4
4
|
*
|
|
5
|
-
* Deliberately absent: progress messages (
|
|
6
|
-
* vectors (
|
|
5
|
+
* Deliberately absent: progress messages (ephemeral) and raw embedding
|
|
6
|
+
* vectors (recorded by reference).
|
|
7
|
+
* @ruling 01 §1, 02 §2, F34, 16 §1a
|
|
7
8
|
*/
|
|
8
9
|
import { renderPreview } from './preview.js';
|
|
9
10
|
import { renderStatusText } from './status.js';
|
|
10
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Render a receipt the way the run inspector would. Used in tests as documentation.
|
|
13
|
+
* @experimental
|
|
14
|
+
* @ruling 17 §4
|
|
15
|
+
*/
|
|
11
16
|
export function renderReceipt(r) {
|
|
12
17
|
const out = [];
|
|
13
18
|
out.push(`run ${r.runId} spec ${r.specId} v${r.specVersion} seed ${r.seed}`);
|
package/dist/receiverRules.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 🚧 The receiver's rules
|
|
2
|
+
* 🚧 The receiver's rules: what the page does with an element a remote
|
|
3
3
|
* component places and an attribute it writes, beyond the vocabulary table
|
|
4
4
|
* ({@link hostAttributeAllowed}, {@link hostAttributeValueFinding}) — the
|
|
5
5
|
* rules that turn on WHOSE box it is, and the rule that the value a check
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
* the harness does not), the tag an update is judged against, and what the
|
|
35
35
|
* remote writes into a subtree these rules refused.
|
|
36
36
|
*
|
|
37
|
-
* @experimental 🚧 provisional with the vocabulary it extends
|
|
37
|
+
* @experimental 🚧 provisional with the vocabulary it extends.
|
|
38
|
+
* @ruling C7, C7, R21
|
|
38
39
|
*/
|
|
39
40
|
import { hostAttributeAllowed, hostAttributeValueFinding, isHostElement } from './hostElements.js';
|
|
40
41
|
/** The owner id of core's own component — the one box the owner rules favour. */
|
package/dist/refs.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* References — edges as data
|
|
2
|
+
* References — edges as data, and config references.
|
|
3
3
|
*
|
|
4
4
|
* $ref creates a *data* edge and compiles 1:1 to a pipeline_edges row.
|
|
5
5
|
* slot.* creates a *config* reference, which is resolved before execution and is
|
|
6
6
|
* therefore not an edge and creates no dependency in the graph.
|
|
7
7
|
* @experimental
|
|
8
|
+
* @ruling 04 §4, F35
|
|
8
9
|
*/
|
|
9
10
|
export interface DataRef {
|
|
10
11
|
readonly __ref: 'data';
|
|
@@ -14,19 +15,23 @@ export interface DataRef {
|
|
|
14
15
|
/** @public */
|
|
15
16
|
export interface SlotRef {
|
|
16
17
|
readonly __ref: 'slot';
|
|
17
|
-
slot: 'connection' | 'sampling' | 'prompts' | 'template' | 'params' | 'variables';
|
|
18
|
+
slot: 'connection' | 'sampling' | 'prompts' | 'template' | 'params' | 'variables' | 'workflow';
|
|
18
19
|
/** Whose config. Undefined = this node's own. */
|
|
19
20
|
ofNode?: string;
|
|
20
21
|
/**
|
|
21
|
-
* An **envoy's** config
|
|
22
|
+
* An **envoy's** config:
|
|
22
23
|
* the genre-declared defaults for `envoy:<key>`, resolved through the
|
|
23
24
|
* config chain at the address `envoy:<key>` exactly as a node's are —
|
|
24
25
|
* the host projects the declaration at `author` and an admin's tuning
|
|
25
26
|
* sits above it. Compiles to `resolvedRefs[slot] = 'envoy:<key>'`
|
|
26
27
|
* after the genre the spec serves is checked for the key.
|
|
28
|
+
* @ruling plans/29 R-18 (2), U5g (2026-09-16)
|
|
27
29
|
*/
|
|
28
30
|
ofEnvoy?: string;
|
|
29
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Unresolved marker: resolve to the first oracle reachable forward.
|
|
33
|
+
* @ruling 16 §5b-i
|
|
34
|
+
*/
|
|
30
35
|
resolveDownstreamOracle?: boolean;
|
|
31
36
|
}
|
|
32
37
|
/** @experimental */
|
|
@@ -58,19 +63,31 @@ export declare const envoyConfigKey: (key: string) => string;
|
|
|
58
63
|
export declare const isEnvoyConfigKey: (key: string) => boolean;
|
|
59
64
|
/** @public */
|
|
60
65
|
export declare const slot: {
|
|
66
|
+
/**
|
|
67
|
+
* A **loadout** value — what a `loadout` slot holds: the shipped or
|
|
68
|
+
* pub loadout a model call runs on, by id. Unlike the other members this is
|
|
69
|
+
* a value, not a reference to another node's slot: it goes in a preset
|
|
70
|
+
* (`p.loadout('generate', slot.loadout('core:loadout/reply@1'))`).
|
|
71
|
+
* The id is checked against the grammar here; whether it names a
|
|
72
|
+
* registered declaration is checked by the host at seed and bind.
|
|
73
|
+
*/
|
|
74
|
+
loadout: <const Id extends `${string}:loadout/${string}`>(id: Id) => {
|
|
75
|
+
id: Id;
|
|
76
|
+
};
|
|
61
77
|
connection: (ofNode?: NodeAddress) => SlotRef;
|
|
62
78
|
sampling: (ofNode?: NodeAddress) => SlotRef;
|
|
63
79
|
/**
|
|
64
80
|
* With a target, the slot is *shared*: the node reads the target's authored
|
|
65
81
|
* prompts and declares none of its own to configure. One authored text, one
|
|
66
82
|
* place to edit it — three nodes that each demanded the same system prompt
|
|
67
|
-
* is the defect this exists to close
|
|
83
|
+
* is the defect this exists to close.
|
|
84
|
+
* @ruling 13 §12 finding i
|
|
68
85
|
*/
|
|
69
86
|
prompts: (of?: NodeAddress | EnvoyAddress) => SlotRef;
|
|
70
87
|
template: () => SlotRef;
|
|
71
88
|
/**
|
|
72
89
|
* With a target, the slot's **shared** fields resolve at the target — and
|
|
73
|
-
* only those (
|
|
90
|
+
* only those (`FieldDecl.shared`).
|
|
74
91
|
*
|
|
75
92
|
* A definition marks the `params` fields several nodes of one spec hold in
|
|
76
93
|
* common — the lore lanes' seven scan knobs, the embed pair's switch —
|
|
@@ -82,9 +99,10 @@ export declare const slot: {
|
|
|
82
99
|
*
|
|
83
100
|
* ⚠ It used to read the whole slot at the target, and its docblock argued
|
|
84
101
|
* for the ranker as the owner of "every query's minimums and weights". That
|
|
85
|
-
* is the per-source map on the ranker
|
|
86
|
-
* lives on the source now
|
|
102
|
+
* is the per-source map on the ranker that was rejected; per-source intent
|
|
103
|
+
* lives on the source now and travels as candidate metadata, so
|
|
87
104
|
* nothing needs to read the ranker's params from a query any more.
|
|
105
|
+
* @ruling R-7 P2 (2026-09-16), 16 §5a, R-7 P5
|
|
88
106
|
*/
|
|
89
107
|
params: (ofNode?: NodeAddress) => SlotRef;
|
|
90
108
|
/**
|
|
@@ -93,13 +111,20 @@ export declare const slot: {
|
|
|
93
111
|
* rather than declaring a parallel set nobody would think to keep in step.
|
|
94
112
|
*/
|
|
95
113
|
variables: (ofNode?: NodeAddress) => SlotRef;
|
|
114
|
+
/**
|
|
115
|
+
* 🚧 The node's `workflow` slot: a `{ id }` naming a host `workflows` row
|
|
116
|
+
* (a ComfyUI graph), which the host resolves and hands to the adapter.
|
|
117
|
+
* @ruling DESIGN-image-generation §4.10
|
|
118
|
+
*/
|
|
119
|
+
workflow: (ofNode?: NodeAddress) => SlotRef;
|
|
96
120
|
/** Explicit oracle reference — always unambiguous. */
|
|
97
121
|
oracleRef: (node: NodeAddress) => SlotRef;
|
|
98
122
|
connectionOf: (node: NodeAddress) => SlotRef;
|
|
99
123
|
samplingOf: (node: NodeAddress) => SlotRef;
|
|
100
124
|
/**
|
|
101
125
|
* Resolves at publish to the first oracle reachable forward. Compiles to the
|
|
102
|
-
* explicit form, so nothing implicit survives into rows
|
|
126
|
+
* explicit form, so nothing implicit survives into rows.
|
|
127
|
+
* @ruling 16 §5b-i
|
|
103
128
|
*/
|
|
104
129
|
downstreamOracle: () => SlotRef;
|
|
105
130
|
};
|
package/dist/refs.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* References — edges as data (04 §4), and config references (F35).
|
|
3
|
-
*
|
|
4
|
-
* $ref creates a *data* edge and compiles 1:1 to a pipeline_edges row.
|
|
5
|
-
* slot.* creates a *config* reference, which is resolved before execution and is
|
|
6
|
-
* therefore not an edge and creates no dependency in the graph.
|
|
7
|
-
* @experimental
|
|
8
|
-
*/
|
|
1
|
+
import { isLoadoutId } from './loadouts.js';
|
|
9
2
|
/** @experimental */
|
|
10
3
|
export function $ref(node, port = 'main') {
|
|
11
4
|
return { __ref: 'data', node, port };
|
|
@@ -26,6 +19,20 @@ export const envoyConfigKey = (key) => `${ENVOY_CONFIG_PREFIX}${key}`;
|
|
|
26
19
|
export const isEnvoyConfigKey = (key) => key.startsWith(ENVOY_CONFIG_PREFIX);
|
|
27
20
|
/** @public */
|
|
28
21
|
export const slot = {
|
|
22
|
+
/**
|
|
23
|
+
* A **loadout** value — what a `loadout` slot holds: the shipped or
|
|
24
|
+
* pub loadout a model call runs on, by id. Unlike the other members this is
|
|
25
|
+
* a value, not a reference to another node's slot: it goes in a preset
|
|
26
|
+
* (`p.loadout('generate', slot.loadout('core:loadout/reply@1'))`).
|
|
27
|
+
* The id is checked against the grammar here; whether it names a
|
|
28
|
+
* registered declaration is checked by the host at seed and bind.
|
|
29
|
+
*/
|
|
30
|
+
loadout: (id) => {
|
|
31
|
+
if (!isLoadoutId(id))
|
|
32
|
+
throw new Error(`'${id}' is not a loadout id — write '<owner>:loadout/<kebab-name>@<major>' ` +
|
|
33
|
+
`(e.g. 'core:loadout/extraction@1').`);
|
|
34
|
+
return { id };
|
|
35
|
+
},
|
|
29
36
|
connection: (ofNode) => ({
|
|
30
37
|
__ref: 'slot',
|
|
31
38
|
slot: 'connection',
|
|
@@ -40,7 +47,8 @@ export const slot = {
|
|
|
40
47
|
* With a target, the slot is *shared*: the node reads the target's authored
|
|
41
48
|
* prompts and declares none of its own to configure. One authored text, one
|
|
42
49
|
* place to edit it — three nodes that each demanded the same system prompt
|
|
43
|
-
* is the defect this exists to close
|
|
50
|
+
* is the defect this exists to close.
|
|
51
|
+
* @ruling 13 §12 finding i
|
|
44
52
|
*/
|
|
45
53
|
prompts: (of) => isEnvoyAddress(of)
|
|
46
54
|
? { __ref: 'slot', slot: 'prompts', ofEnvoy: of.envoy }
|
|
@@ -52,7 +60,7 @@ export const slot = {
|
|
|
52
60
|
template: () => ({ __ref: 'slot', slot: 'template' }),
|
|
53
61
|
/**
|
|
54
62
|
* With a target, the slot's **shared** fields resolve at the target — and
|
|
55
|
-
* only those (
|
|
63
|
+
* only those (`FieldDecl.shared`).
|
|
56
64
|
*
|
|
57
65
|
* A definition marks the `params` fields several nodes of one spec hold in
|
|
58
66
|
* common — the lore lanes' seven scan knobs, the embed pair's switch —
|
|
@@ -64,9 +72,10 @@ export const slot = {
|
|
|
64
72
|
*
|
|
65
73
|
* ⚠ It used to read the whole slot at the target, and its docblock argued
|
|
66
74
|
* for the ranker as the owner of "every query's minimums and weights". That
|
|
67
|
-
* is the per-source map on the ranker
|
|
68
|
-
* lives on the source now
|
|
75
|
+
* is the per-source map on the ranker that was rejected; per-source intent
|
|
76
|
+
* lives on the source now and travels as candidate metadata, so
|
|
69
77
|
* nothing needs to read the ranker's params from a query any more.
|
|
78
|
+
* @ruling R-7 P2 (2026-09-16), 16 §5a, R-7 P5
|
|
70
79
|
*/
|
|
71
80
|
params: (ofNode) => ({
|
|
72
81
|
__ref: 'slot',
|
|
@@ -83,6 +92,16 @@ export const slot = {
|
|
|
83
92
|
slot: 'variables',
|
|
84
93
|
ofNode: addr(ofNode),
|
|
85
94
|
}),
|
|
95
|
+
/**
|
|
96
|
+
* 🚧 The node's `workflow` slot: a `{ id }` naming a host `workflows` row
|
|
97
|
+
* (a ComfyUI graph), which the host resolves and hands to the adapter.
|
|
98
|
+
* @ruling DESIGN-image-generation §4.10
|
|
99
|
+
*/
|
|
100
|
+
workflow: (ofNode) => ({
|
|
101
|
+
__ref: 'slot',
|
|
102
|
+
slot: 'workflow',
|
|
103
|
+
ofNode: addr(ofNode),
|
|
104
|
+
}),
|
|
86
105
|
/** Explicit oracle reference — always unambiguous. */
|
|
87
106
|
oracleRef: (node) => ({
|
|
88
107
|
__ref: 'slot',
|
|
@@ -101,7 +120,8 @@ export const slot = {
|
|
|
101
120
|
}),
|
|
102
121
|
/**
|
|
103
122
|
* Resolves at publish to the first oracle reachable forward. Compiles to the
|
|
104
|
-
* explicit form, so nothing implicit survives into rows
|
|
123
|
+
* explicit form, so nothing implicit survives into rows.
|
|
124
|
+
* @ruling 16 §5b-i
|
|
105
125
|
*/
|
|
106
126
|
downstreamOracle: () => ({
|
|
107
127
|
__ref: 'slot',
|