@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/settings.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Plugin settings — the schema an extension declares, and the four things core does
|
|
3
|
-
* with it
|
|
3
|
+
* with it.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* The design promises "the same schema strategy as node config and review steps — one
|
|
6
6
|
* renderer, three uses." That promise is only real if it is literally the same
|
|
7
7
|
* declaration, so `FieldDecl` here is the same shape node `params` use, plus the two
|
|
8
8
|
* fields that only mean something for plugin settings (`scope`, `side`). An extension
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* 1. **The form** core renders in plugin settings — no UI work by the author.
|
|
14
14
|
* 2. **Validation** of stored values, on save and on update.
|
|
15
15
|
* 3. **The manifest entry**, extracted statically by the compiler — never by running
|
|
16
|
-
* the author's code
|
|
16
|
+
* the author's code.
|
|
17
17
|
* 4. **Typed access** from the extension's own hooks: `settings.values` is inferred,
|
|
18
18
|
* so `apiKey` is a `SecretValue` and a mistyped key does not compile.
|
|
19
19
|
*
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
* secrets" sounds safer than storing them — but an extension keeping credentials in its
|
|
24
24
|
* own data directory has no key and no crypto facility, so the realistic outcome is
|
|
25
25
|
* plaintext on the user's disk, unencrypted *and* unauditable. Declining custody produced
|
|
26
|
-
* the worse result
|
|
26
|
+
* the worse result.
|
|
27
27
|
*
|
|
28
28
|
* What makes accepting it defensible is that the field is **typed**, which is what lets
|
|
29
|
-
* core mechanically redact it from receipts
|
|
29
|
+
* core mechanically redact it from receipts, exclude it from export and
|
|
30
30
|
* keep it write-only in the UI. A free-form column cannot tell a key from a note.
|
|
31
|
+
* @ruling 12 §6, F6, 03 §3, 13 §6, F16, 12 §7
|
|
31
32
|
*/
|
|
32
33
|
import type { MediaKind } from './media.js';
|
|
33
34
|
import { type I18nText } from './i18n.js';
|
|
@@ -141,7 +142,7 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
141
142
|
*/
|
|
142
143
|
quick?: boolean;
|
|
143
144
|
/**
|
|
144
|
-
* Which lens renders this one field
|
|
145
|
+
* Which lens renders this one field, when it is not the slot's.
|
|
145
146
|
*
|
|
146
147
|
* A slot carries a `facet` and every field of it lands there — which is
|
|
147
148
|
* right for a `params` slot of tunables and wrong for the substrate's
|
|
@@ -149,6 +150,7 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
149
150
|
* beside `enabled`'s. Declared on the field rather than special-cased in
|
|
150
151
|
* the panel, so a plugin whose one slot holds a weight and a switch can
|
|
151
152
|
* say the same thing. Absent means the slot's.
|
|
153
|
+
* @ruling 05 §3
|
|
152
154
|
*/
|
|
153
155
|
facet?: string;
|
|
154
156
|
/**
|
|
@@ -167,10 +169,11 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
167
169
|
members?: readonly MemberDecl[];
|
|
168
170
|
/**
|
|
169
171
|
* For `secret`: lend it to this package's nodes when they run in another
|
|
170
|
-
* package's pipeline
|
|
172
|
+
* package's pipeline. Off by default — a node you made public runs
|
|
171
173
|
* for other packages without your keys unless you lend them. Either way
|
|
172
174
|
* the code holds a **secret handle**, never the value: `ctx.fetch` fills it
|
|
173
175
|
* in at the network boundary, for your declared hosts only.
|
|
176
|
+
* @ruling R63
|
|
174
177
|
*/
|
|
175
178
|
lend?: boolean;
|
|
176
179
|
/**
|
|
@@ -197,7 +200,10 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
197
200
|
min?: number;
|
|
198
201
|
max?: number;
|
|
199
202
|
of?: O;
|
|
200
|
-
/**
|
|
203
|
+
/**
|
|
204
|
+
* Options sourced from the live connection, e.g. `'connection.voices'`.
|
|
205
|
+
* @ruling 17 §2b
|
|
206
|
+
*/
|
|
201
207
|
from?: string;
|
|
202
208
|
/**
|
|
203
209
|
* Blocks activation when unset. The plugin is **not broken** — it is installed,
|
|
@@ -262,8 +268,8 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
262
268
|
narrows?: string;
|
|
263
269
|
/**
|
|
264
270
|
* A node `params` field several nodes of one spec hold **in common**, and
|
|
265
|
-
* therefore resolve at ONE owner's address (
|
|
266
|
-
* per spec
|
|
271
|
+
* therefore resolve at ONE owner's address (one owner per setting
|
|
272
|
+
* per spec).
|
|
267
273
|
*
|
|
268
274
|
* Where a node's `params` slot is a reference — `slot.params({ node })` —
|
|
269
275
|
* the executor resolves its fields in two halves: a field marked `shared`
|
|
@@ -279,12 +285,13 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
279
285
|
* side by side, and a spec that references an owner gets exactly those.
|
|
280
286
|
* A spec referencing an owner whose schema marks nothing `shared` has
|
|
281
287
|
* written a reference that resolves nothing, and `validate()` says so.
|
|
282
|
-
* `validate()`'s
|
|
288
|
+
* `validate()`'s one-owner diagnostic is keyed on it as well: two own-node
|
|
283
289
|
* `params` owners in one spec that both declare a `shared` field under the
|
|
284
290
|
* same name are two addresses for one setting.
|
|
285
291
|
*
|
|
286
292
|
* Unset on plugin settings, genre fields and entry shapes, where there is
|
|
287
293
|
* no second node to share with.
|
|
294
|
+
* @ruling R-7 P2 (refined 2026-09-16), plans/30 U3b, P2
|
|
288
295
|
*/
|
|
289
296
|
shared?: boolean;
|
|
290
297
|
/**
|
|
@@ -296,8 +303,14 @@ export interface FieldDecl<T extends FieldType = FieldType, O extends readonly s
|
|
|
296
303
|
* `'story-time'` (🚧): a `string` holding a position on the story
|
|
297
304
|
* calendar in its canonical line (`412-03-05 22:30`, `storyTime.ts`) — the
|
|
298
305
|
* field a clock/date stat is declared as (`core:stat-shape/story-time@1`).
|
|
306
|
+
*
|
|
307
|
+
* `'logit-bias'` (🚧): a `text` field holding an ordered list of logit bias
|
|
308
|
+
* entries, `{ text, value }` rows (`LogitBiasEntry`, `sampling.ts`) — the
|
|
309
|
+
* text a word, `{exact text}` or `[token ids]`, the value a bias from −100
|
|
310
|
+
* to 100. The renderer draws rows, not a textarea; a legacy `{ "<id>": bias }`
|
|
311
|
+
* object reads as `[<id>]` rows (`readLogitBiasValue`).
|
|
299
312
|
*/
|
|
300
|
-
format?: 'json' | 'story-time';
|
|
313
|
+
format?: 'json' | 'story-time' | 'logit-bias';
|
|
301
314
|
}
|
|
302
315
|
/** @public */
|
|
303
316
|
export type SettingsSchema = Record<string, FieldDecl>;
|
|
@@ -310,7 +323,7 @@ export declare function fieldLabel(decl: {
|
|
|
310
323
|
label?: I18nText;
|
|
311
324
|
}, language?: string): string | undefined;
|
|
312
325
|
/**
|
|
313
|
-
* Every display-text fault in one settings schema
|
|
326
|
+
* Every display-text fault in one settings schema, as sentences that
|
|
314
327
|
* name the field: each field's `label` and its `description`; each
|
|
315
328
|
* `members[]` band's label and description; and the
|
|
316
329
|
* same for a `list`'s `item` and an `object`'s `fields`, recursively. A schema
|
|
@@ -322,6 +335,7 @@ export declare function fieldLabel(decl: {
|
|
|
322
335
|
* `of` stays unread: an enum's options are stored values, not display text,
|
|
323
336
|
* and their labels live on `members[]`.
|
|
324
337
|
* @experimental
|
|
338
|
+
* @ruling R-20
|
|
325
339
|
*/
|
|
326
340
|
export declare function settingsSchemaFindings(schema: unknown, where: string): string[];
|
|
327
341
|
/** The media kinds a `media` field offers. Images unless it says otherwise. @experimental */
|
|
@@ -360,7 +374,10 @@ export interface SettingsFinding {
|
|
|
360
374
|
field?: string;
|
|
361
375
|
severity: 'error' | 'warning';
|
|
362
376
|
message: string;
|
|
363
|
-
/**
|
|
377
|
+
/**
|
|
378
|
+
* What to do instead — required, like every other finding in this SDK.
|
|
379
|
+
* @ruling 15 §1.3
|
|
380
|
+
*/
|
|
364
381
|
fix: string;
|
|
365
382
|
}
|
|
366
383
|
/** Mistakes that would otherwise become silent leaks or dead form fields. @experimental */
|
|
@@ -370,7 +387,10 @@ export declare function checkValues(schema: SettingsSchema, values: Record<strin
|
|
|
370
387
|
/** @experimental */
|
|
371
388
|
export interface Reconciled {
|
|
372
389
|
values: Record<string, unknown>;
|
|
373
|
-
/**
|
|
390
|
+
/**
|
|
391
|
+
* Stored values the new schema no longer declares. **Never deleted**.
|
|
392
|
+
* @ruling 12 §6, 02 §7
|
|
393
|
+
*/
|
|
374
394
|
orphaned: Array<{
|
|
375
395
|
field: string;
|
|
376
396
|
value: unknown;
|
|
@@ -381,11 +401,12 @@ export interface Reconciled {
|
|
|
381
401
|
/**
|
|
382
402
|
* What an update does to values that already exist.
|
|
383
403
|
*
|
|
384
|
-
* The rule is the one
|
|
404
|
+
* The rule is the one already applied to a node swap's orphaned slots: **unmigrated
|
|
385
405
|
* values land in diagnostics rather than disappearing.** An author who renames a field
|
|
386
406
|
* and an admin who then downgrades should both get their data back; silently dropping it
|
|
387
407
|
* makes the update irreversible in the one direction that matters.
|
|
388
408
|
* @internal
|
|
409
|
+
* @ruling 12 §5
|
|
389
410
|
*/
|
|
390
411
|
export declare function reconcile(schema: SettingsSchema, stored: Record<string, unknown>): Reconciled;
|
|
391
412
|
/** What the settings form sends back. A secret reports only whether it is set. @internal */
|
|
@@ -394,24 +415,27 @@ export declare function forClient(schema: SettingsSchema, values: Record<string,
|
|
|
394
415
|
export declare function forExport(schema: SettingsSchema, values: Record<string, unknown>): Record<string, unknown>;
|
|
395
416
|
/**
|
|
396
417
|
* What the declaring extension's own hook receives — the only place plaintext appears,
|
|
397
|
-
* and only for the extension that owns the field. Same shape as
|
|
418
|
+
* and only for the extension that owns the field. Same shape as the per-call injection
|
|
398
419
|
* of connection material.
|
|
420
|
+
* @ruling F18
|
|
399
421
|
*/
|
|
400
422
|
/**
|
|
401
|
-
* The handle plugin code holds for a secret setting — never its value
|
|
423
|
+
* The handle plugin code holds for a secret setting — never its value.
|
|
402
424
|
* `nonce` is minted by the host per plugin load, so a handle cannot be forged
|
|
403
425
|
* from text that came from anywhere but the host.
|
|
404
426
|
* @experimental
|
|
427
|
+
* @ruling R63
|
|
405
428
|
*/
|
|
406
429
|
export declare const secretHandle: (key: string, nonce: string) => string;
|
|
407
430
|
/** A secret's key, as a handle can carry it. @experimental */
|
|
408
431
|
export declare const SECRET_KEY: RegExp;
|
|
409
432
|
/**
|
|
410
|
-
* What a hook's `settings` carries
|
|
433
|
+
* What a hook's `settings` carries: every value, and a **secret handle**
|
|
411
434
|
* in place of each secret — so the plugin's code never holds a key — beside
|
|
412
435
|
* the plaintext the host keeps for the fetch bridge and the scrub, and the
|
|
413
436
|
* keys the package lends to its nodes in other packages' pipelines.
|
|
414
437
|
* @internal
|
|
438
|
+
* @ruling R63
|
|
415
439
|
*/
|
|
416
440
|
export declare function forOwningHookSplit(schema: SettingsSchema, values: Record<string, unknown>, decrypt: (cipher: string) => string, nonce: string): {
|
|
417
441
|
settings: Record<string, unknown>;
|
|
@@ -468,8 +492,9 @@ export declare class SettingsError extends Error {
|
|
|
468
492
|
/**
|
|
469
493
|
* Declare a plugin's settings. The compiler extracts this statically into the manifest,
|
|
470
494
|
* so it must be a literal — a schema assembled at runtime cannot be read without running
|
|
471
|
-
* the author's code, which the packager never does
|
|
495
|
+
* the author's code, which the packager never does.
|
|
472
496
|
* @public
|
|
497
|
+
* @ruling F6, 03 §3
|
|
473
498
|
*/
|
|
474
499
|
export declare function defineSettings<const S extends SettingsSchema>(schema: S): PluginSettings<S>;
|
|
475
500
|
/**
|
package/dist/settings.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Plugin settings — the schema an extension declares, and the four things core does
|
|
3
|
-
* with it
|
|
3
|
+
* with it.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
5
|
+
* The design promises "the same schema strategy as node config and review steps — one
|
|
6
6
|
* renderer, three uses." That promise is only real if it is literally the same
|
|
7
7
|
* declaration, so `FieldDecl` here is the same shape node `params` use, plus the two
|
|
8
8
|
* fields that only mean something for plugin settings (`scope`, `side`). An extension
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* 1. **The form** core renders in plugin settings — no UI work by the author.
|
|
14
14
|
* 2. **Validation** of stored values, on save and on update.
|
|
15
15
|
* 3. **The manifest entry**, extracted statically by the compiler — never by running
|
|
16
|
-
* the author's code
|
|
16
|
+
* the author's code.
|
|
17
17
|
* 4. **Typed access** from the extension's own hooks: `settings.values` is inferred,
|
|
18
18
|
* so `apiKey` is a `SecretValue` and a mistyped key does not compile.
|
|
19
19
|
*
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
* secrets" sounds safer than storing them — but an extension keeping credentials in its
|
|
24
24
|
* own data directory has no key and no crypto facility, so the realistic outcome is
|
|
25
25
|
* plaintext on the user's disk, unencrypted *and* unauditable. Declining custody produced
|
|
26
|
-
* the worse result
|
|
26
|
+
* the worse result.
|
|
27
27
|
*
|
|
28
28
|
* What makes accepting it defensible is that the field is **typed**, which is what lets
|
|
29
|
-
* core mechanically redact it from receipts
|
|
29
|
+
* core mechanically redact it from receipts, exclude it from export and
|
|
30
30
|
* keep it write-only in the UI. A free-form column cannot tell a key from a note.
|
|
31
|
+
* @ruling 12 §6, F6, 03 §3, 13 §6, F16, 12 §7
|
|
31
32
|
*/
|
|
32
33
|
import { pluginRuleRef } from './pluginRuleRef.js';
|
|
33
34
|
import { i18nFindings, i18nText } from './i18n.js';
|
|
@@ -44,7 +45,7 @@ export function fieldLabel(decl, language = 'en') {
|
|
|
44
45
|
return i18nText(decl.label, language);
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
|
-
* Every display-text fault in one settings schema
|
|
48
|
+
* Every display-text fault in one settings schema, as sentences that
|
|
48
49
|
* name the field: each field's `label` and its `description`; each
|
|
49
50
|
* `members[]` band's label and description; and the
|
|
50
51
|
* same for a `list`'s `item` and an `object`'s `fields`, recursively. A schema
|
|
@@ -56,6 +57,7 @@ export function fieldLabel(decl, language = 'en') {
|
|
|
56
57
|
* `of` stays unread: an enum's options are stored values, not display text,
|
|
57
58
|
* and their labels live on `members[]`.
|
|
58
59
|
* @experimental
|
|
60
|
+
* @ruling R-20
|
|
59
61
|
*/
|
|
60
62
|
export function settingsSchemaFindings(schema, where) {
|
|
61
63
|
if (schema === undefined)
|
|
@@ -196,7 +198,7 @@ export function checkSchema(schema) {
|
|
|
196
198
|
});
|
|
197
199
|
}
|
|
198
200
|
}
|
|
199
|
-
if (d.type === 'enum' && !d.of?.length && !d.from) {
|
|
201
|
+
if (d.type === 'enum' && !d.of?.length && !d.members?.length && !d.from) {
|
|
200
202
|
f.push({
|
|
201
203
|
field: key,
|
|
202
204
|
severity: 'error',
|
|
@@ -336,11 +338,12 @@ export function checkValues(schema, values) {
|
|
|
336
338
|
/**
|
|
337
339
|
* What an update does to values that already exist.
|
|
338
340
|
*
|
|
339
|
-
* The rule is the one
|
|
341
|
+
* The rule is the one already applied to a node swap's orphaned slots: **unmigrated
|
|
340
342
|
* values land in diagnostics rather than disappearing.** An author who renames a field
|
|
341
343
|
* and an admin who then downgrades should both get their data back; silently dropping it
|
|
342
344
|
* makes the update irreversible in the one direction that matters.
|
|
343
345
|
* @internal
|
|
346
|
+
* @ruling 12 §5
|
|
344
347
|
*/
|
|
345
348
|
export function reconcile(schema, stored) {
|
|
346
349
|
const values = {};
|
|
@@ -380,24 +383,27 @@ export function forExport(schema, values) {
|
|
|
380
383
|
}
|
|
381
384
|
/**
|
|
382
385
|
* What the declaring extension's own hook receives — the only place plaintext appears,
|
|
383
|
-
* and only for the extension that owns the field. Same shape as
|
|
386
|
+
* and only for the extension that owns the field. Same shape as the per-call injection
|
|
384
387
|
* of connection material.
|
|
388
|
+
* @ruling F18
|
|
385
389
|
*/
|
|
386
390
|
/**
|
|
387
|
-
* The handle plugin code holds for a secret setting — never its value
|
|
391
|
+
* The handle plugin code holds for a secret setting — never its value.
|
|
388
392
|
* `nonce` is minted by the host per plugin load, so a handle cannot be forged
|
|
389
393
|
* from text that came from anywhere but the host.
|
|
390
394
|
* @experimental
|
|
395
|
+
* @ruling R63
|
|
391
396
|
*/
|
|
392
397
|
export const secretHandle = (key, nonce) => `\u27E6secret:${key}:${nonce}\u27E7`;
|
|
393
398
|
/** A secret's key, as a handle can carry it. @experimental */
|
|
394
399
|
export const SECRET_KEY = /^[A-Za-z0-9_.-]+$/;
|
|
395
400
|
/**
|
|
396
|
-
* What a hook's `settings` carries
|
|
401
|
+
* What a hook's `settings` carries: every value, and a **secret handle**
|
|
397
402
|
* in place of each secret — so the plugin's code never holds a key — beside
|
|
398
403
|
* the plaintext the host keeps for the fetch bridge and the scrub, and the
|
|
399
404
|
* keys the package lends to its nodes in other packages' pipelines.
|
|
400
405
|
* @internal
|
|
406
|
+
* @ruling R63
|
|
401
407
|
*/
|
|
402
408
|
export function forOwningHookSplit(schema, values, decrypt, nonce) {
|
|
403
409
|
const settings = {};
|
|
@@ -469,8 +475,9 @@ export class SettingsError extends Error {
|
|
|
469
475
|
/**
|
|
470
476
|
* Declare a plugin's settings. The compiler extracts this statically into the manifest,
|
|
471
477
|
* so it must be a literal — a schema assembled at runtime cannot be read without running
|
|
472
|
-
* the author's code, which the packager never does
|
|
478
|
+
* the author's code, which the packager never does.
|
|
473
479
|
* @public
|
|
480
|
+
* @ruling F6, 03 §3
|
|
474
481
|
*/
|
|
475
482
|
export function defineSettings(schema) {
|
|
476
483
|
const errs = checkSchema(schema).filter((x) => x.severity === 'error');
|
package/dist/settingsSlot.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `settings` slot — the one slot the substrate declares (
|
|
3
|
-
* 2026-09-15
|
|
2
|
+
* The `settings` slot — the one slot the substrate declares (ruled
|
|
3
|
+
* 2026-09-15).
|
|
4
4
|
*
|
|
5
5
|
* Three switches have always been read by the executor off `config[key]
|
|
6
6
|
* .settings.*` — `enabled` to skip an optional node, `review` to park a gated
|
|
7
7
|
* one, `mode` to run a gather clause in turn — and until 2026-09-16 nothing
|
|
8
8
|
* *declared* them: `settings` was not a `SlotKind`, and the configuration
|
|
9
9
|
* panel synthesised the three controls by hand, wording and defaults included.
|
|
10
|
-
* A control the executor honours and no declaration names is the shape
|
|
11
|
-
* calls a
|
|
10
|
+
* A control the executor honours and no declaration names is the shape the
|
|
11
|
+
* substrate calls a key and the config chain calls a slot; this file makes the second
|
|
12
12
|
* word true.
|
|
13
13
|
*
|
|
14
14
|
* What is declared here is derived, never authored. A definition says
|
|
15
15
|
* `optional: true` or `effects: 'write'` and the slot follows from that; a
|
|
16
16
|
* clause says `gather` and its `mode` follows. The projection
|
|
17
17
|
* (`snapshotRegistry`) writes the slot onto the registry row so the panel
|
|
18
|
-
* reads it from rows like every other slot
|
|
18
|
+
* reads it from rows like every other slot, and the content hash leaves it
|
|
19
19
|
* out — see `authoredSlots` — because a slot nobody authored cannot be a change
|
|
20
20
|
* to what somebody authored; `optional` and `effects` are hashed already.
|
|
21
21
|
*
|
|
22
22
|
* The addresses are unchanged: `<nodeKey>.settings.enabled`,
|
|
23
23
|
* `<nodeKey>.settings.review`, `<clauseId>.settings.mode`. Every stored row at
|
|
24
24
|
* one of them is exactly as valid as it was.
|
|
25
|
+
* @ruling R-9, 01 §1, 12 §2, 01, 12 §2, F6
|
|
25
26
|
*/
|
|
26
27
|
import type { FieldDecl } from './settings.js';
|
|
27
28
|
import type { SlotDecl } from './descriptors.js';
|
|
@@ -47,15 +48,16 @@ export declare const ENABLED_FIELD: FieldDecl;
|
|
|
47
48
|
*/
|
|
48
49
|
export declare const ENABLED_STEP_FIELD: FieldDecl;
|
|
49
50
|
/**
|
|
50
|
-
* `review` — the gate's position on a node whose `effects` gate
|
|
51
|
+
* `review` — the gate's position on a node whose `effects` gate.
|
|
51
52
|
*
|
|
52
53
|
* Declared per gated node from its `reviewDefault`, which an author may set
|
|
53
54
|
* **on** and can never set to *never* — the declaration's `of` has no such
|
|
54
|
-
* value, which is
|
|
55
|
+
* value, which is enforced by the field language rather than by a check.
|
|
55
56
|
* The two retired spellings (`sync`, `async`) are folded to `on` here exactly
|
|
56
57
|
* as `resolvePosition` folds them at run time, so the panel's default and the
|
|
57
58
|
* gate's agree.
|
|
58
59
|
* @experimental
|
|
60
|
+
* @ruling 01 §7, F14
|
|
59
61
|
*/
|
|
60
62
|
export declare function reviewField(reviewDefault: ReviewPosition | undefined): FieldDecl;
|
|
61
63
|
/**
|
|
@@ -99,10 +101,11 @@ export declare function clauseSettingsSlotFor(clause: {
|
|
|
99
101
|
* `effects` and `reviewDefault`. The first two are contract and hashed on
|
|
100
102
|
* their own terms, so digesting the slot again would move every optional and
|
|
101
103
|
* every gated definition's pin for a projection change nobody authored;
|
|
102
|
-
* `reviewDefault` is policy
|
|
104
|
+
* `reviewDefault` is policy and hashed nowhere. The name is
|
|
103
105
|
* reserved (`checkNoAuthoredSettings`), so stripping by name can never strip
|
|
104
106
|
* something an author wrote.
|
|
105
107
|
* @experimental
|
|
108
|
+
* @ruling plans/31 V6
|
|
106
109
|
*/
|
|
107
110
|
export declare function authoredSlots<T>(slots: Record<string, T> | undefined): Record<string, T>;
|
|
108
111
|
//# sourceMappingURL=settingsSlot.d.ts.map
|
package/dist/settingsSlot.js
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The `settings` slot — the one slot the substrate declares (
|
|
3
|
-
* 2026-09-15
|
|
2
|
+
* The `settings` slot — the one slot the substrate declares (ruled
|
|
3
|
+
* 2026-09-15).
|
|
4
4
|
*
|
|
5
5
|
* Three switches have always been read by the executor off `config[key]
|
|
6
6
|
* .settings.*` — `enabled` to skip an optional node, `review` to park a gated
|
|
7
7
|
* one, `mode` to run a gather clause in turn — and until 2026-09-16 nothing
|
|
8
8
|
* *declared* them: `settings` was not a `SlotKind`, and the configuration
|
|
9
9
|
* panel synthesised the three controls by hand, wording and defaults included.
|
|
10
|
-
* A control the executor honours and no declaration names is the shape
|
|
11
|
-
* calls a
|
|
10
|
+
* A control the executor honours and no declaration names is the shape the
|
|
11
|
+
* substrate calls a key and the config chain calls a slot; this file makes the second
|
|
12
12
|
* word true.
|
|
13
13
|
*
|
|
14
14
|
* What is declared here is derived, never authored. A definition says
|
|
15
15
|
* `optional: true` or `effects: 'write'` and the slot follows from that; a
|
|
16
16
|
* clause says `gather` and its `mode` follows. The projection
|
|
17
17
|
* (`snapshotRegistry`) writes the slot onto the registry row so the panel
|
|
18
|
-
* reads it from rows like every other slot
|
|
18
|
+
* reads it from rows like every other slot, and the content hash leaves it
|
|
19
19
|
* out — see `authoredSlots` — because a slot nobody authored cannot be a change
|
|
20
20
|
* to what somebody authored; `optional` and `effects` are hashed already.
|
|
21
21
|
*
|
|
22
22
|
* The addresses are unchanged: `<nodeKey>.settings.enabled`,
|
|
23
23
|
* `<nodeKey>.settings.review`, `<clauseId>.settings.mode`. Every stored row at
|
|
24
24
|
* one of them is exactly as valid as it was.
|
|
25
|
+
* @ruling R-9, 01 §1, 12 §2, 01, 12 §2, F6
|
|
25
26
|
*/
|
|
26
27
|
import { CLAUSE_MODE_DECL } from './clauses.js';
|
|
27
28
|
import { POSITIONS, resolvePosition } from './review.js';
|
|
@@ -62,15 +63,16 @@ export const ENABLED_STEP_FIELD = Object.freeze({
|
|
|
62
63
|
},
|
|
63
64
|
});
|
|
64
65
|
/**
|
|
65
|
-
* `review` — the gate's position on a node whose `effects` gate
|
|
66
|
+
* `review` — the gate's position on a node whose `effects` gate.
|
|
66
67
|
*
|
|
67
68
|
* Declared per gated node from its `reviewDefault`, which an author may set
|
|
68
69
|
* **on** and can never set to *never* — the declaration's `of` has no such
|
|
69
|
-
* value, which is
|
|
70
|
+
* value, which is enforced by the field language rather than by a check.
|
|
70
71
|
* The two retired spellings (`sync`, `async`) are folded to `on` here exactly
|
|
71
72
|
* as `resolvePosition` folds them at run time, so the panel's default and the
|
|
72
73
|
* gate's agree.
|
|
73
74
|
* @experimental
|
|
75
|
+
* @ruling 01 §7, F14
|
|
74
76
|
*/
|
|
75
77
|
export function reviewField(reviewDefault) {
|
|
76
78
|
return {
|
|
@@ -152,10 +154,11 @@ export function clauseSettingsSlotFor(clause) {
|
|
|
152
154
|
* `effects` and `reviewDefault`. The first two are contract and hashed on
|
|
153
155
|
* their own terms, so digesting the slot again would move every optional and
|
|
154
156
|
* every gated definition's pin for a projection change nobody authored;
|
|
155
|
-
* `reviewDefault` is policy
|
|
157
|
+
* `reviewDefault` is policy and hashed nowhere. The name is
|
|
156
158
|
* reserved (`checkNoAuthoredSettings`), so stripping by name can never strip
|
|
157
159
|
* something an author wrote.
|
|
158
160
|
* @experimental
|
|
161
|
+
* @ruling plans/31 V6
|
|
159
162
|
*/
|
|
160
163
|
export function authoredSlots(slots) {
|
|
161
164
|
if (!slots || !(SETTINGS_SLOT in slots))
|