@listen-fire/engine-contracts 0.12.0-rc.7 → 0.12.0-rc.8

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.
@@ -1548,8 +1548,11 @@ export type WireModuleKindShape = z.infer<typeof WireModuleKind>;
1548
1548
  * other host leaves empty (a module asking for a page is refused by name),
1549
1549
  * and `wake`, which stays empty unless named (nobody is told work is due;
1550
1550
  * a scheduled worker finds it), and `ocr`, which stays empty unless named
1551
- * (a scanned file is refused, saying the slot is empty). */
1552
- export declare const CORE_SLOTS: readonly ["models", "judge", "store", "files", "limiter", "loopGuard", "browser", "wake", "ocr"];
1551
+ * (a scanned file is refused, saying the slot is empty). `secrets` is
1552
+ * where credentials are kept (`lf`'s default: its secrets file); a secrets
1553
+ * module's own settings come from the environment or that file, never
1554
+ * from itself. */
1555
+ export declare const CORE_SLOTS: readonly ["models", "judge", "store", "files", "limiter", "loopGuard", "browser", "wake", "ocr", "secrets"];
1553
1556
  export declare const WireCoreSlot: z.ZodEnum<{
1554
1557
  store: "store";
1555
1558
  models: "models";
@@ -1560,6 +1563,7 @@ export declare const WireCoreSlot: z.ZodEnum<{
1560
1563
  browser: "browser";
1561
1564
  wake: "wake";
1562
1565
  ocr: "ocr";
1566
+ secrets: "secrets";
1563
1567
  }>;
1564
1568
  export type WireCoreSlotShape = z.infer<typeof WireCoreSlot>;
1565
1569
  /** One construction argument the install supplies (an Airtable `base`, a
@@ -1618,6 +1622,7 @@ export declare const WireModuleDeclarations: z.ZodObject<{
1618
1622
  browser: "browser";
1619
1623
  wake: "wake";
1620
1624
  ocr: "ocr";
1625
+ secrets: "secrets";
1621
1626
  }>>;
1622
1627
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1623
1628
  name: z.ZodString;
@@ -1759,6 +1764,7 @@ export declare const WireManifestResult: z.ZodObject<{
1759
1764
  browser: "browser";
1760
1765
  wake: "wake";
1761
1766
  ocr: "ocr";
1767
+ secrets: "secrets";
1762
1768
  }>>;
1763
1769
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1764
1770
  name: z.ZodString;
@@ -2260,6 +2266,7 @@ export declare const METHODS: {
2260
2266
  browser: "browser";
2261
2267
  wake: "wake";
2262
2268
  ocr: "ocr";
2269
+ secrets: "secrets";
2263
2270
  }>>;
2264
2271
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
2265
2272
  name: z.ZodString;
package/dist/protocol.js CHANGED
@@ -738,8 +738,11 @@ exports.WireModuleKind = zod_1.z.enum(exports.MODULE_KINDS);
738
738
  * other host leaves empty (a module asking for a page is refused by name),
739
739
  * and `wake`, which stays empty unless named (nobody is told work is due;
740
740
  * a scheduled worker finds it), and `ocr`, which stays empty unless named
741
- * (a scanned file is refused, saying the slot is empty). */
742
- exports.CORE_SLOTS = ['models', 'judge', 'store', 'files', 'limiter', 'loopGuard', 'browser', 'wake', 'ocr'];
741
+ * (a scanned file is refused, saying the slot is empty). `secrets` is
742
+ * where credentials are kept (`lf`'s default: its secrets file); a secrets
743
+ * module's own settings come from the environment or that file, never
744
+ * from itself. */
745
+ exports.CORE_SLOTS = ['models', 'judge', 'store', 'files', 'limiter', 'loopGuard', 'browser', 'wake', 'ocr', 'secrets'];
743
746
  exports.WireCoreSlot = zod_1.z.enum(exports.CORE_SLOTS);
744
747
  /** One construction argument the install supplies (an Airtable `base`, a
745
748
  * Sheets `spreadsheet`): asked for when the module is set up (`lf connect`,
@@ -5,3 +5,4 @@ export * from './files';
5
5
  export * from './browser';
6
6
  export * from './wake';
7
7
  export * from './ocr';
8
+ export * from './secrets';
@@ -24,3 +24,4 @@ __exportStar(require("./files"), exports);
24
24
  __exportStar(require("./browser"), exports);
25
25
  __exportStar(require("./wake"), exports);
26
26
  __exportStar(require("./ocr"), exports);
27
+ __exportStar(require("./secrets"), exports);
@@ -0,0 +1,65 @@
1
+ import { z } from 'zod';
2
+ export declare const SECRETS_METHODS: readonly ["secrets.resolve", "secrets.writeBack", "secrets.list", "secrets.lock", "secrets.unlock", "secrets.assertWritable", "secrets.create", "secrets.replace", "secrets.delete"];
3
+ /** What `secrets.resolve` answers (or null: nothing is stored under the ref). */
4
+ export declare const SecretsRecord: z.ZodObject<{
5
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
6
+ version: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export declare const SecretsWriteBackAnswer: z.ZodDiscriminatedUnion<[z.ZodObject<{
9
+ kind: z.ZodLiteral<"written">;
10
+ record: z.ZodObject<{
11
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
12
+ version: z.ZodString;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>, z.ZodObject<{
15
+ kind: z.ZodLiteral<"not_persisted">;
16
+ record: z.ZodObject<{
17
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
18
+ version: z.ZodString;
19
+ }, z.core.$strip>;
20
+ why: z.ZodString;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ kind: z.ZodLiteral<"conflict">;
23
+ current: z.ZodObject<{
24
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
25
+ version: z.ZodString;
26
+ }, z.core.$strip>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ kind: z.ZodLiteral<"missing">;
29
+ }, z.core.$strip>], "kind">;
30
+ /** How an entry is bound: an install of a module, a hand-written legacy
31
+ * entry, or a credential the module declares. */
32
+ export declare const SecretsBinding: z.ZodUnion<readonly [z.ZodLiteral<"install">, z.ZodLiteral<"legacy">, z.ZodObject<{
33
+ credential: z.ZodString;
34
+ }, z.core.$strip>]>;
35
+ export type SecretsBindingShape = z.infer<typeof SecretsBinding>;
36
+ export declare const SecretsListed: z.ZodObject<{
37
+ ref: z.ZodString;
38
+ external: z.ZodString;
39
+ binding: z.ZodUnion<readonly [z.ZodLiteral<"install">, z.ZodLiteral<"legacy">, z.ZodObject<{
40
+ credential: z.ZodString;
41
+ }, z.core.$strip>]>;
42
+ version: z.ZodString;
43
+ }, z.core.$strip>;
44
+ /** `secrets.lock` answers a token, or null when another holds the lease. */
45
+ export declare const SecretsLockAnswer: z.ZodNullable<z.ZodObject<{
46
+ token: z.ZodString;
47
+ }, z.core.$strip>>;
48
+ /** What `secrets.assertWritable`, `create`, `replace` and `delete` answer
49
+ * besides null: the module keeps its credentials where lf cannot change them. */
50
+ export declare const SecretsReadOnlyAnswer: z.ZodObject<{
51
+ kind: z.ZodLiteral<"read_only">;
52
+ reason: z.ZodString;
53
+ }, z.core.$strip>;
54
+ export declare const SecretsEntryAnswer: z.ZodNullable<z.ZodObject<{
55
+ kind: z.ZodLiteral<"read_only">;
56
+ reason: z.ZodString;
57
+ }, z.core.$strip>>;
58
+ export declare const SecretsEntryRequest: z.ZodObject<{
59
+ ref: z.ZodString;
60
+ external: z.ZodString;
61
+ binding: z.ZodUnion<readonly [z.ZodLiteral<"install">, z.ZodLiteral<"legacy">, z.ZodObject<{
62
+ credential: z.ZodString;
63
+ }, z.core.$strip>]>;
64
+ fields: z.ZodRecord<z.ZodString, z.ZodString>;
65
+ }, z.core.$strip>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // The secrets slot's methods (docs/contracts/secrets-slot.md): where lf's
3
+ // credentials are kept. A module resolves and lists what it holds, takes a
4
+ // write-back by version, holds a credential under a lease while a refresh
5
+ // spends its token, and changes whole entries for `lf connect` and
6
+ // `lf credential`. Token refresh stays in lf; a module only stores.
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.SecretsEntryRequest = exports.SecretsEntryAnswer = exports.SecretsReadOnlyAnswer = exports.SecretsLockAnswer = exports.SecretsListed = exports.SecretsBinding = exports.SecretsWriteBackAnswer = exports.SecretsRecord = exports.SECRETS_METHODS = void 0;
9
+ const zod_1 = require("zod");
10
+ exports.SECRETS_METHODS = [
11
+ 'secrets.resolve',
12
+ 'secrets.writeBack',
13
+ 'secrets.list',
14
+ 'secrets.lock',
15
+ 'secrets.unlock',
16
+ 'secrets.assertWritable',
17
+ 'secrets.create',
18
+ 'secrets.replace',
19
+ 'secrets.delete',
20
+ ];
21
+ const Fields = zod_1.z.record(zod_1.z.string(), zod_1.z.string());
22
+ /** What `secrets.resolve` answers (or null: nothing is stored under the ref). */
23
+ exports.SecretsRecord = zod_1.z.object({ fields: Fields, version: zod_1.z.string().min(1) });
24
+ exports.SecretsWriteBackAnswer = zod_1.z.discriminatedUnion('kind', [
25
+ zod_1.z.object({ kind: zod_1.z.literal('written'), record: exports.SecretsRecord }),
26
+ zod_1.z.object({ kind: zod_1.z.literal('not_persisted'), record: exports.SecretsRecord, why: zod_1.z.string() }),
27
+ zod_1.z.object({ kind: zod_1.z.literal('conflict'), current: exports.SecretsRecord }),
28
+ zod_1.z.object({ kind: zod_1.z.literal('missing') }),
29
+ ]);
30
+ /** How an entry is bound: an install of a module, a hand-written legacy
31
+ * entry, or a credential the module declares. */
32
+ exports.SecretsBinding = zod_1.z.union([zod_1.z.literal('install'), zod_1.z.literal('legacy'), zod_1.z.object({ credential: zod_1.z.string().min(1) })]);
33
+ exports.SecretsListed = zod_1.z.object({ ref: zod_1.z.string().min(1), external: zod_1.z.string().min(1), binding: exports.SecretsBinding, version: zod_1.z.string() });
34
+ /** `secrets.lock` answers a token, or null when another holds the lease. */
35
+ exports.SecretsLockAnswer = zod_1.z.object({ token: zod_1.z.string().min(1) }).nullable();
36
+ /** What `secrets.assertWritable`, `create`, `replace` and `delete` answer
37
+ * besides null: the module keeps its credentials where lf cannot change them. */
38
+ exports.SecretsReadOnlyAnswer = zod_1.z.object({ kind: zod_1.z.literal('read_only'), reason: zod_1.z.string().min(1) });
39
+ exports.SecretsEntryAnswer = exports.SecretsReadOnlyAnswer.nullable();
40
+ exports.SecretsEntryRequest = zod_1.z.object({ ref: zod_1.z.string().min(1), external: zod_1.z.string().min(1), binding: exports.SecretsBinding, fields: Fields });
@@ -39,6 +39,7 @@ export declare const WireSlotManifest: z.ZodObject<{
39
39
  browser: "browser";
40
40
  wake: "wake";
41
41
  ocr: "ocr";
42
+ secrets: "secrets";
42
43
  }>;
43
44
  methods: z.ZodArray<z.ZodString>;
44
45
  }, z.core.$strip>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@listen-fire/engine-contracts",
3
3
  "license": "Apache-2.0",
4
- "version": "0.12.0-rc.7",
4
+ "version": "0.12.0-rc.8",
5
5
  "description": "The contracts the movement engine speaks: the tenant id, the host families and entry-point inputs, the parked state, file descriptors, the adapter protocol, the adapter contract and its manifest, the catalog's schema types and positions, the Expression vocabulary, plugins as data and the model names. Runtime-neutral: no Node import, no ambient types.",
6
6
  "engines": {
7
7
  "node": "22.20.0"
@@ -30,7 +30,7 @@
30
30
  "type": "commonjs",
31
31
  "dependencies": {
32
32
  "zod": "4.1.12",
33
- "@listen-fire/movement-lang": "^0.12.0-rc.7"
33
+ "@listen-fire/movement-lang": "^0.12.0-rc.8"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "20.16.5",