@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.
Files changed (186) hide show
  1. package/README.md +24 -20
  2. package/dist/actions.d.ts +150 -68
  3. package/dist/actions.js +90 -36
  4. package/dist/annexFields.d.ts +8 -4
  5. package/dist/annexFields.js +5 -2
  6. package/dist/announce.d.ts +78 -28
  7. package/dist/announce.js +14 -5
  8. package/dist/attributes.d.ts +9 -6
  9. package/dist/attributes.js +9 -5
  10. package/dist/bands.d.ts +41 -6
  11. package/dist/bands.js +83 -33
  12. package/dist/builder.d.ts +161 -58
  13. package/dist/builder.js +128 -22
  14. package/dist/candidates.d.ts +5 -3
  15. package/dist/candidates.js +3 -2
  16. package/dist/clauses.d.ts +2 -1
  17. package/dist/clauses.js +2 -1
  18. package/dist/component.d.ts +24 -7
  19. package/dist/component.js +16 -6
  20. package/dist/componentBuild.d.ts +16 -5
  21. package/dist/componentBuild.js +14 -5
  22. package/dist/componentClient.d.ts +61 -30
  23. package/dist/componentClient.js +11 -1
  24. package/dist/componentImports.d.ts +8 -5
  25. package/dist/componentImports.js +23 -4
  26. package/dist/componentModule.js +2 -1
  27. package/dist/componentWire.d.ts +2 -1
  28. package/dist/componentWire.js +34 -2
  29. package/dist/config.d.ts +28 -14
  30. package/dist/config.js +20 -10
  31. package/dist/connections.d.ts +9 -4
  32. package/dist/connections.js +7 -4
  33. package/dist/declarations.d.ts +46 -17
  34. package/dist/declarations.js +46 -15
  35. package/dist/descriptors.d.ts +242 -97
  36. package/dist/descriptors.js +145 -41
  37. package/dist/dev.d.ts +6 -5
  38. package/dist/dev.js +6 -5
  39. package/dist/document.d.ts +74 -25
  40. package/dist/document.js +32 -11
  41. package/dist/dowry.d.ts +241 -0
  42. package/dist/dowry.js +315 -0
  43. package/dist/engines.d.ts +16 -7
  44. package/dist/engines.js +6 -4
  45. package/dist/eventMapLaws.d.ts +19 -8
  46. package/dist/eventMapLaws.js +9 -6
  47. package/dist/events.d.ts +101 -39
  48. package/dist/events.js +106 -33
  49. package/dist/executor.d.ts +122 -41
  50. package/dist/executor.js +195 -96
  51. package/dist/extension.d.ts +99 -35
  52. package/dist/extension.js +43 -9
  53. package/dist/facets.d.ts +2 -1
  54. package/dist/facets.js +4 -2
  55. package/dist/foldedSections.d.ts +4 -2
  56. package/dist/foldedSections.js +2 -1
  57. package/dist/genres.d.ts +123 -41
  58. package/dist/genres.js +127 -22
  59. package/dist/guardedConnection.d.ts +4 -3
  60. package/dist/guardedConnection.js +4 -3
  61. package/dist/handlebarsReach.d.ts +1 -1
  62. package/dist/handlebarsReach.js +1 -1
  63. package/dist/hash.d.ts +16 -5
  64. package/dist/hash.js +14 -4
  65. package/dist/hookGrants.d.ts +3 -2
  66. package/dist/hookGrants.js +6 -4
  67. package/dist/hooks.d.ts +21 -16
  68. package/dist/hooks.js +12 -10
  69. package/dist/hostElements.d.ts +41 -17
  70. package/dist/hostElements.js +49 -17
  71. package/dist/i18n.d.ts +5 -3
  72. package/dist/i18n.js +5 -3
  73. package/dist/identity.d.ts +5 -4
  74. package/dist/identity.js +5 -4
  75. package/dist/index.d.ts +5 -0
  76. package/dist/index.js +15 -0
  77. package/dist/layout.d.ts +36 -15
  78. package/dist/layout.js +2 -2
  79. package/dist/loadouts.d.ts +97 -0
  80. package/dist/loadouts.js +81 -0
  81. package/dist/media.d.ts +26 -4
  82. package/dist/media.js +2 -1
  83. package/dist/messageBlocks.d.ts +44 -32
  84. package/dist/messageBlocks.js +23 -18
  85. package/dist/migration.d.ts +16 -8
  86. package/dist/migration.js +14 -8
  87. package/dist/names.d.ts +2 -1
  88. package/dist/names.js +2 -1
  89. package/dist/nodeInput.d.ts +2 -1
  90. package/dist/nodeInput.js +2 -1
  91. package/dist/participants.d.ts +22 -15
  92. package/dist/participants.js +14 -12
  93. package/dist/personGate.d.ts +2 -1
  94. package/dist/personGate.js +2 -1
  95. package/dist/pluginHarness.d.ts +8 -3
  96. package/dist/pluginHarness.js +4 -2
  97. package/dist/pluginPermissions.d.ts +2 -1
  98. package/dist/pluginPermissions.js +12 -1
  99. package/dist/pluginRuleRef.d.ts +2 -2
  100. package/dist/pluginRuleRef.js +1 -1
  101. package/dist/predicates.d.ts +16 -11
  102. package/dist/predicates.js +7 -6
  103. package/dist/preview.d.ts +8 -3
  104. package/dist/preview.js +2 -1
  105. package/dist/promptBlocks.d.ts +5 -3
  106. package/dist/promptBlocks.js +5 -3
  107. package/dist/rankingDecisions.d.ts +2 -1
  108. package/dist/rankingDecisions.js +2 -1
  109. package/dist/receipt.d.ts +65 -29
  110. package/dist/receipt.js +9 -4
  111. package/dist/receiverRules.js +3 -2
  112. package/dist/refs.d.ts +34 -9
  113. package/dist/refs.js +33 -13
  114. package/dist/registry.d.ts +42 -23
  115. package/dist/registry.js +7 -5
  116. package/dist/review.d.ts +16 -5
  117. package/dist/review.js +11 -4
  118. package/dist/sampling.d.ts +54 -0
  119. package/dist/sampling.js +95 -3
  120. package/dist/sceneSettings.d.ts +312 -0
  121. package/dist/sceneSettings.js +425 -0
  122. package/dist/scope.d.ts +6 -4
  123. package/dist/scope.js +4 -3
  124. package/dist/scripts.d.ts +81 -14
  125. package/dist/scripts.js +90 -11
  126. package/dist/sessionDossier.d.ts +521 -0
  127. package/dist/sessionDossier.js +33 -0
  128. package/dist/sessionLayout.d.ts +303 -19
  129. package/dist/sessionLayout.js +354 -40
  130. package/dist/sessionSettings.d.ts +8 -5
  131. package/dist/settings.d.ts +45 -20
  132. package/dist/settings.js +19 -12
  133. package/dist/settingsSlot.d.ts +11 -8
  134. package/dist/settingsSlot.js +11 -8
  135. package/dist/shapes.d.ts +103 -41
  136. package/dist/shapes.js +105 -40
  137. package/dist/sheets.d.ts +4 -2
  138. package/dist/sheets.js +6 -3
  139. package/dist/statShapes.d.ts +2 -1
  140. package/dist/statShapes.js +2 -1
  141. package/dist/status.d.ts +13 -9
  142. package/dist/status.js +8 -6
  143. package/dist/storage.d.ts +2 -1
  144. package/dist/storage.js +2 -1
  145. package/dist/storyTime.d.ts +13 -7
  146. package/dist/storyTime.js +11 -6
  147. package/dist/strokes.d.ts +176 -0
  148. package/dist/strokes.js +281 -0
  149. package/dist/surfaces.d.ts +54 -25
  150. package/dist/surfaces.js +3 -3
  151. package/dist/template.d.ts +9 -5
  152. package/dist/template.js +5 -3
  153. package/dist/templateCheck.d.ts +2 -2
  154. package/dist/templateCheck.js +2 -2
  155. package/dist/templateFit.d.ts +37 -8
  156. package/dist/templateFit.js +92 -8
  157. package/dist/templateIds.d.ts +3 -3
  158. package/dist/templateIds.js +3 -3
  159. package/dist/templateScopeAt.d.ts +21 -11
  160. package/dist/templateScopeAt.js +21 -11
  161. package/dist/testing.d.ts +11 -4
  162. package/dist/testing.js +13 -5
  163. package/dist/tokenizers.d.ts +2 -2
  164. package/dist/tokenizers.js +2 -2
  165. package/dist/turnLock.d.ts +4 -2
  166. package/dist/turnLock.js +2 -1
  167. package/dist/turnOrder.d.ts +17 -11
  168. package/dist/turnOrder.js +9 -5
  169. package/dist/validate.d.ts +11 -8
  170. package/dist/validate.js +81 -10
  171. package/dist/values.d.ts +17 -8
  172. package/dist/values.js +11 -6
  173. package/dist/variables.d.ts +46 -7
  174. package/dist/variables.js +87 -6
  175. package/dist/verdicts.d.ts +20 -13
  176. package/dist/verdicts.js +17 -11
  177. package/dist/widgetDecls.d.ts +8 -4
  178. package/dist/widgetDecls.js +4 -2
  179. package/dist/widgets.d.ts +987 -94
  180. package/dist/widgets.js +93 -18
  181. package/dist/wire.d.ts +13 -6
  182. package/dist/wire.js +3 -3
  183. package/dist/worldinfo.d.ts +11 -6
  184. package/dist/worldinfo.js +8 -4
  185. package/host-elements.d.ts +13 -0
  186. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Ranking decisions (PLAN-sdk-1.0 §3.9, R64): what a ranker says about each
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 (01 §1, 02 §2). The first-class record of a run, and the thing the
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 (F34, ephemeral) and raw embedding
6
- * vectors (16 §1a, recorded by reference).
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
- /** halt/err detail — "why did nothing happen" is otherwise unanswerable (01 §5). */
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
- /** Which map iteration produced this entry (01 §4). */
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
- /** Which sampler fields the adapter honoured vs dropped (12 §2). */
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
- /** Provider only — recorded verbatim (F16). */
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
- /** Resolved config reference, e.g. oracleRef → 'generate' (16 §5b-i). */
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 (R-21 (1)). Its
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 (18 S5), one record per
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 (18 §4e). "Which of my thirty filters ate that word" is
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 (18 S2/S4/S5).
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" (S4).
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 18 §4c. `connection:KoboldCpp` marks a stop guard the
163
- * connection carries (18 §4b), which every pipeline using that connection
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 S4.
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
- /** Who stopped it, when an admin did (13 §3). `cancelled` is not `err`. */
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 (13 §3). Recorded and
202
- * deliberately excluded from elapsed: queue wait consumes no budget (F13) and
203
- * trips no timeout (F36).
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 (13 §2). Default on for event-triggered runs,
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 (R-21 (4)).
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 (R-19, R-21 "optional,
240
- * taken"): the last status a node set — *{speaker} is typing* — and the
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 (F34) and this is the one exception.
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 (01 §4a).
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 (01 §8).
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
- /** Gate decisions enter provenance; replay honours them (F15). */
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
- /** Render a receipt the way the run inspector would (17 §4). Used in tests as documentation. @experimental */
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 (01 §1, 02 §2). The first-class record of a run, and the thing the
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 (F34, ephemeral) and raw embedding
6
- * vectors (16 §1a, recorded by reference).
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
- /** Render a receipt the way the run inspector would (17 §4). Used in tests as documentation. @experimental */
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}`);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 🚧 The receiver's rules (C7): what the page does with an element a remote
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 (C7, R21).
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 (04 §4), and config references (F35).
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 (plans/29 R-18 (2); built 2026-09-16 as U5g):
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
- /** Unresolved marker: resolve to the first oracle reachable forward (16 §5b-i). */
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 (13 §12 finding i).
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 (R-7 P2, refined 2026-09-16; `FieldDecl.shared`).
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 16 §5a rejected; per-source intent
86
- * lives on the source now (R-7 P5) and travels as candidate metadata, so
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 (16 §5b-i).
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 (13 §12 finding i).
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 (R-7 P2, refined 2026-09-16; `FieldDecl.shared`).
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 16 §5a rejected; per-source intent
68
- * lives on the source now (R-7 P5) and travels as candidate metadata, so
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 (16 §5b-i).
123
+ * explicit form, so nothing implicit survives into rows.
124
+ * @ruling 16 §5b-i
105
125
  */
106
126
  downstreamOracle: () => ({
107
127
  __ref: 'slot',