@listen-fire/engine-contracts 0.12.0-rc.6 → 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.
package/dist/catalog.d.ts CHANGED
@@ -1386,7 +1386,7 @@ declare const transformSignatureSchema: z.ZodObject<{
1386
1386
  }, z.core.$strip>>>;
1387
1387
  nodes: z.ZodOptional<z.ZodArray<z.ZodType<ExpressionType, unknown, z.core.$ZodTypeInternals<ExpressionType, unknown>>>>;
1388
1388
  }, z.core.$strip>;
1389
- output: z.ZodOptional<z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
1389
+ output: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
1390
1390
  kind: z.ZodLiteral<"value">;
1391
1391
  type: z.ZodType<ExpressionType, unknown, z.core.$ZodTypeInternals<ExpressionType, unknown>>;
1392
1392
  optional: z.ZodOptional<z.ZodBoolean>;
@@ -1406,32 +1406,7 @@ declare const transformSignatureSchema: z.ZodObject<{
1406
1406
  description: z.ZodOptional<z.ZodString>;
1407
1407
  }, z.core.$strip>>;
1408
1408
  description: z.ZodOptional<z.ZodString>;
1409
- }, z.core.$strip>], "kind">, z.ZodObject<{
1410
- previously: z.ZodOptional<z.ZodArray<z.ZodObject<{
1411
- before: z.ZodNumber;
1412
- output: z.ZodDiscriminatedUnion<[z.ZodObject<{
1413
- kind: z.ZodLiteral<"value">;
1414
- type: z.ZodType<ExpressionType, unknown, z.core.$ZodTypeInternals<ExpressionType, unknown>>;
1415
- optional: z.ZodOptional<z.ZodBoolean>;
1416
- description: z.ZodOptional<z.ZodString>;
1417
- }, z.core.$strip>, z.ZodObject<{
1418
- kind: z.ZodLiteral<"record">;
1419
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
1420
- type: z.ZodType<ExpressionType, unknown, z.core.$ZodTypeInternals<ExpressionType, unknown>>;
1421
- optional: z.ZodOptional<z.ZodBoolean>;
1422
- description: z.ZodOptional<z.ZodString>;
1423
- }, z.core.$strip>>;
1424
- }, z.core.$strip>, z.ZodObject<{
1425
- kind: z.ZodLiteral<"records">;
1426
- fields: z.ZodRecord<z.ZodString, z.ZodObject<{
1427
- type: z.ZodType<ExpressionType, unknown, z.core.$ZodTypeInternals<ExpressionType, unknown>>;
1428
- optional: z.ZodOptional<z.ZodBoolean>;
1429
- description: z.ZodOptional<z.ZodString>;
1430
- }, z.core.$strip>>;
1431
- description: z.ZodOptional<z.ZodString>;
1432
- }, z.core.$strip>], "kind">;
1433
- }, z.core.$strip>>>;
1434
- }, z.core.$strip>>>;
1409
+ }, z.core.$strip>], "kind">>;
1435
1410
  }, z.core.$strip>;
1436
1411
  export type TransformSignature = z.infer<typeof transformSignatureSchema>;
1437
1412
  /**
package/dist/catalog.js CHANGED
@@ -1083,10 +1083,8 @@ exports.schemaTypeDescriptorSchema = zod_1.z.object({
1083
1083
  * `deleteRecord` — a promise per type, like a field's `writable`. Default
1084
1084
  * (unset) ⇒ no: an adapter declares it on exactly the types its
1085
1085
  * `deleteRecord` removes (Attio objects, but not its notes; Evertrace
1086
- * searches, lists and list entries, but not its signals). Since language
1087
- * version 5 the checker refuses `delete x` where `x`'s type does not
1088
- * declare it; versions 1–4 leave it to the run, which fails where the
1089
- * adapter refuses.
1086
+ * searches, lists and list entries, but not its signals). The checker refuses
1087
+ * `delete x` where `x`'s type does not declare it.
1090
1088
  */
1091
1089
  deletable: zod_1.z.boolean().optional(),
1092
1090
  /**
@@ -1479,18 +1477,6 @@ const transformOutputKindSchema = zod_1.z.discriminatedUnion('kind', [
1479
1477
  description: zod_1.z.string().optional(),
1480
1478
  }),
1481
1479
  ]);
1482
- /**
1483
- * A plugin whose output changed shape keeps its older shapes beside the
1484
- * current one: `previously` lists what a call handed back to a movement pinned
1485
- * before language version `before`, earliest first. A call runs, and is typed,
1486
- * under its movement's pin (`transformOutputUnder`). Removing a language
1487
- * version removes its entries.
1488
- */
1489
- const transformOutputSchema = transformOutputKindSchema.and(zod_1.z.object({
1490
- previously: zod_1.z
1491
- .array(zod_1.z.object({ before: zod_1.z.number().int(), output: transformOutputKindSchema }))
1492
- .optional(),
1493
- }));
1494
1480
  const transformSignatureSchema = zod_1.z.object({
1495
1481
  /** Unique transform identifier — the value an author writes in
1496
1482
  * `-[…:#transform { plugin: "<name>" }]->`. Must be unique across
@@ -1523,7 +1509,7 @@ const transformSignatureSchema = zod_1.z.object({
1523
1509
  * traversal. */
1524
1510
  additions: transformAdditionsSchema,
1525
1511
  /**
1526
- * What a PLAIN call hands back — see `transformOutputSchema`. Absent is
1512
+ * What a PLAIN call hands back — see `transformOutputKindSchema`. Absent is
1527
1513
  * nobody having said, and the language keeps such a plugin to `through [ … ]`
1528
1514
  * stages, where its output goes to the extractor rather than to a name.
1529
1515
  *
@@ -1531,7 +1517,7 @@ const transformSignatureSchema = zod_1.z.object({
1531
1517
  * when it found something declares that field `optional`, and every read of
1532
1518
  * it downstream then has to discharge the absence.
1533
1519
  */
1534
- output: transformOutputSchema.optional(),
1520
+ output: transformOutputKindSchema.optional(),
1535
1521
  });
1536
1522
  /**
1537
1523
  * Sentinel type id used in `describe(typeId)` to request the adapter's
@@ -9,7 +9,7 @@ export declare const HOST_RECORDING_VERSION = 2;
9
9
  export declare function canonicalJson(value: unknown): string;
10
10
  declare const runInputSchema: z.ZodObject<{
11
11
  source: z.ZodString;
12
- languageVersion: z.ZodNumber;
12
+ languageVersion: z.ZodString;
13
13
  movementName: z.ZodOptional<z.ZodString>;
14
14
  event: z.ZodCustom<{
15
15
  pipelineInputId: string;
@@ -81,7 +81,7 @@ declare const runInputSchema: z.ZodObject<{
81
81
  }, z.core.$strip>;
82
82
  declare const resumeInputSchema: z.ZodObject<{
83
83
  source: z.ZodString;
84
- languageVersion: z.ZodNumber;
84
+ languageVersion: z.ZodString;
85
85
  movementName: z.ZodOptional<z.ZodString>;
86
86
  event: z.ZodCustom<{
87
87
  pipelineInputId: string;
@@ -203,7 +203,7 @@ export declare const hostRecordingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
203
203
  entry: z.ZodLiteral<"run">;
204
204
  input: z.ZodObject<{
205
205
  source: z.ZodString;
206
- languageVersion: z.ZodNumber;
206
+ languageVersion: z.ZodString;
207
207
  movementName: z.ZodOptional<z.ZodString>;
208
208
  event: z.ZodCustom<{
209
209
  pipelineInputId: string;
@@ -303,7 +303,7 @@ export declare const hostRecordingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
303
303
  entry: z.ZodLiteral<"resume">;
304
304
  input: z.ZodObject<{
305
305
  source: z.ZodString;
306
- languageVersion: z.ZodNumber;
306
+ languageVersion: z.ZodString;
307
307
  movementName: z.ZodOptional<z.ZodString>;
308
308
  event: z.ZodCustom<{
309
309
  pipelineInputId: string;
@@ -411,7 +411,7 @@ export declare const hostRecordingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
411
411
  entry: z.ZodLiteral<"settleRace">;
412
412
  input: z.ZodObject<{
413
413
  source: z.ZodString;
414
- languageVersion: z.ZodNumber;
414
+ languageVersion: z.ZodString;
415
415
  movementName: z.ZodOptional<z.ZodString>;
416
416
  event: z.ZodCustom<{
417
417
  pipelineInputId: string;
@@ -520,7 +520,7 @@ export declare const hostRecordingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
520
520
  entry: z.ZodLiteral<"callbackBody">;
521
521
  input: z.ZodObject<{
522
522
  source: z.ZodString;
523
- languageVersion: z.ZodNumber;
523
+ languageVersion: z.ZodString;
524
524
  movementName: z.ZodOptional<z.ZodString>;
525
525
  event: z.ZodCustom<{
526
526
  pipelineInputId: string;
@@ -37,7 +37,7 @@ const isObject = (value) => typeof value === 'object' && value !== null && !Arra
37
37
  const catalogSchema = zod_1.z.custom((value) => isObject(value) && isObject(value.adapters) && isObject(value.credentials) && isObject(value.plugins), 'a catalog snapshot');
38
38
  const eventSchema = zod_1.z.custom((value) => isObject(value) && typeof value.adapterType === 'string', 'a trigger event');
39
39
  const stateSchema = zod_1.z.custom((value) => isObject(value) && typeof value.address === 'string', 'a parked scope state');
40
- const languageVersionSchema = zod_1.z.number().int();
40
+ const languageVersionSchema = zod_1.z.string();
41
41
  const runInputSchema = zod_1.z.object({
42
42
  source: zod_1.z.string(),
43
43
  // Optional on the contract (absent: the current version), but a recording
@@ -29,8 +29,8 @@ export interface ParkedCode {
29
29
  mapping: unknown;
30
30
  op: unknown;
31
31
  }
32
- /** Version 1 (the TypeScript engine, language versions 1–4): code rides as
33
- * its syntax tree, which the version pin keeps identical. */
32
+ /** Version 1 (the earlier TypeScript engine): code rides as
33
+ * its syntax tree, which the pin keeps identical. */
34
34
  export interface CodeAsTree extends ParkedCode {
35
35
  version: 1;
36
36
  closure: ClosureExpression;
@@ -48,7 +48,7 @@ export interface CodeAsTree extends ParkedCode {
48
48
  * (`…/expr/nested/<start>-<end>/value/…`).
49
49
  */
50
50
  export type CodePlace = string;
51
- /** Version 2 (the Rust engine, language version 5 on): code is its place in
51
+ /** Version 2 (the Rust engine): code is its place in
52
52
  * the pinned program (a collection op its span among its statement's
53
53
  * calls), and the libraries ride beside it (`ParkedScopeState.libraries`). */
54
54
  export interface CodeByPlace extends ParkedCode {
@@ -119,7 +119,7 @@ export type BindingDescriptor<C extends ParkedCode = CodeAsTree> = {
119
119
  handle: WriteRecord;
120
120
  targetType: string;
121
121
  graph: HandleGraphDescriptor;
122
- /** The record before the handle's write (`-[:@old]->`, version 4 on),
122
+ /** The record before the handle's write (`-[:@old]->`),
123
123
  * itself a handle. A rehearsed write's `old` is the handle itself, which
124
124
  * JSON cannot nest, so it is said instead (`oldIsSelf`). */
125
125
  old?: BindingDescriptor<C>;
@@ -278,7 +278,7 @@ export type BindingDescriptor<C extends ParkedCode = CodeAsTree> = {
278
278
  * node on no edge, and on a park written before landings kept it. */
279
279
  landedOn?: string;
280
280
  edges: Record<string, NodeEdgeDescriptor<C>>;
281
- /** A record an extraction call found (version 5): the content that call
281
+ /** A record an extraction call found: the content that call
282
282
  * read, as resources (what `-[f:_resources]->` walks off it). Absent
283
283
  * on every other node, and on a park written before calls kept it. */
284
284
  resources?: ResourceDescriptor[];
@@ -435,8 +435,8 @@ export type ScopeLink<C extends ParkedCode = CodeAsTree> = {
435
435
  * rebuilds the scope chain by rehydrating each scope in order.
436
436
  */
437
437
  export interface ParkedScopeState<C extends ParkedCode = CodeAsTree> {
438
- /** The park state contract's version: 1 for the TypeScript engine's
439
- * states (language versions 1–4), 2 for the Rust engine's (5 on). */
438
+ /** The park state contract's version: 1 for the earlier TypeScript
439
+ * engine's states, 2 for the Rust engine's. */
440
440
  version: C['version'];
441
441
  /** The parked statement's canonical lexical address — the resume entry
442
442
  * point. */
@@ -68,10 +68,6 @@ function pluginSpecOf(declaration) {
68
68
  // whatever its scheduling dependency says — `dataDependency` says WHEN it
69
69
  // runs, not what it runs on.
70
70
  const fedByExtraction = signature.dataDependency === 'extracted_context' && authorParams.length === 0;
71
- const earlierOutputs = (signature.output?.previously ?? []).map((entry) => ({
72
- before: entry.before,
73
- output: pluginOutputOf(entry.output),
74
- }));
75
71
  // Every argument's declared type, the auto-fed ones included: a plain call
76
72
  // writes those itself.
77
73
  const argTypes = Object.fromEntries(signature.params.map((p) => [p.name, fieldTypeOfExpressionType(p.type)]));
@@ -84,7 +80,6 @@ function pluginSpecOf(declaration) {
84
80
  ...(fedArgs.length ? { fedArgs } : {}),
85
81
  ...(fedByExtraction ? { fedByExtraction: true } : {}),
86
82
  ...(signature.output !== undefined ? { output: pluginOutputOf(signature.output) } : {}),
87
- ...(earlierOutputs.length > 0 ? { earlierOutputs } : {}),
88
83
  // The author's words, which the language service's hover leads with.
89
84
  ...(signature.description !== undefined && signature.description.length > 0 ? { description: signature.description } : {}),
90
85
  };
@@ -1498,10 +1498,6 @@ export declare const WirePluginSpec: z.ZodObject<{
1498
1498
  }, z.core.$strip>>>;
1499
1499
  fedByExtraction: z.ZodOptional<z.ZodLiteral<true>>;
1500
1500
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1501
- earlierOutputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1502
- before: z.ZodNumber;
1503
- output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1504
- }, z.core.$strip>>>;
1505
1501
  description: z.ZodOptional<z.ZodString>;
1506
1502
  }, z.core.$strip>;
1507
1503
  export type WirePluginSpecShape = z.infer<typeof WirePluginSpec>;
@@ -1528,10 +1524,6 @@ export declare const WirePluginsDeclaration: z.ZodObject<{
1528
1524
  }, z.core.$strip>>>;
1529
1525
  fedByExtraction: z.ZodOptional<z.ZodLiteral<true>>;
1530
1526
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1531
- earlierOutputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1532
- before: z.ZodNumber;
1533
- output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1534
- }, z.core.$strip>>>;
1535
1527
  description: z.ZodOptional<z.ZodString>;
1536
1528
  }, z.core.$strip>;
1537
1529
  }, z.core.$strip>>;
@@ -1556,8 +1548,11 @@ export type WireModuleKindShape = z.infer<typeof WireModuleKind>;
1556
1548
  * other host leaves empty (a module asking for a page is refused by name),
1557
1549
  * and `wake`, which stays empty unless named (nobody is told work is due;
1558
1550
  * a scheduled worker finds it), and `ocr`, which stays empty unless named
1559
- * (a scanned file is refused, saying the slot is empty). */
1560
- 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"];
1561
1556
  export declare const WireCoreSlot: z.ZodEnum<{
1562
1557
  store: "store";
1563
1558
  models: "models";
@@ -1568,6 +1563,7 @@ export declare const WireCoreSlot: z.ZodEnum<{
1568
1563
  browser: "browser";
1569
1564
  wake: "wake";
1570
1565
  ocr: "ocr";
1566
+ secrets: "secrets";
1571
1567
  }>;
1572
1568
  export type WireCoreSlotShape = z.infer<typeof WireCoreSlot>;
1573
1569
  /** One construction argument the install supplies (an Airtable `base`, a
@@ -1626,6 +1622,7 @@ export declare const WireModuleDeclarations: z.ZodObject<{
1626
1622
  browser: "browser";
1627
1623
  wake: "wake";
1628
1624
  ocr: "ocr";
1625
+ secrets: "secrets";
1629
1626
  }>>;
1630
1627
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1631
1628
  name: z.ZodString;
@@ -1715,10 +1712,6 @@ export declare const WireModuleDeclarations: z.ZodObject<{
1715
1712
  }, z.core.$strip>>>;
1716
1713
  fedByExtraction: z.ZodOptional<z.ZodLiteral<true>>;
1717
1714
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1718
- earlierOutputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1719
- before: z.ZodNumber;
1720
- output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1721
- }, z.core.$strip>>>;
1722
1715
  description: z.ZodOptional<z.ZodString>;
1723
1716
  }, z.core.$strip>;
1724
1717
  }, z.core.$strip>>;
@@ -1771,6 +1764,7 @@ export declare const WireManifestResult: z.ZodObject<{
1771
1764
  browser: "browser";
1772
1765
  wake: "wake";
1773
1766
  ocr: "ocr";
1767
+ secrets: "secrets";
1774
1768
  }>>;
1775
1769
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
1776
1770
  name: z.ZodString;
@@ -1860,10 +1854,6 @@ export declare const WireManifestResult: z.ZodObject<{
1860
1854
  }, z.core.$strip>>>;
1861
1855
  fedByExtraction: z.ZodOptional<z.ZodLiteral<true>>;
1862
1856
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1863
- earlierOutputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1864
- before: z.ZodNumber;
1865
- output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1866
- }, z.core.$strip>>>;
1867
1857
  description: z.ZodOptional<z.ZodString>;
1868
1858
  }, z.core.$strip>;
1869
1859
  }, z.core.$strip>>;
@@ -2276,6 +2266,7 @@ export declare const METHODS: {
2276
2266
  browser: "browser";
2277
2267
  wake: "wake";
2278
2268
  ocr: "ocr";
2269
+ secrets: "secrets";
2279
2270
  }>>;
2280
2271
  settings: z.ZodOptional<z.ZodArray<z.ZodObject<{
2281
2272
  name: z.ZodString;
@@ -2365,10 +2356,6 @@ export declare const METHODS: {
2365
2356
  }, z.core.$strip>>>;
2366
2357
  fedByExtraction: z.ZodOptional<z.ZodLiteral<true>>;
2367
2358
  output: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2368
- earlierOutputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2369
- before: z.ZodNumber;
2370
- output: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2371
- }, z.core.$strip>>>;
2372
2359
  description: z.ZodOptional<z.ZodString>;
2373
2360
  }, z.core.$strip>;
2374
2361
  }, z.core.$strip>>;
package/dist/protocol.js CHANGED
@@ -376,7 +376,7 @@ exports.WireSchemaTypeDescriptor = zod_1.z
376
376
  references: zod_1.z.array(exports.WireSchemaReferenceDescriptor),
377
377
  /** The type's records can be removed by `deleteRecord` (absent ⇒ no) —
378
378
  * named because it is the one promise `delete` is checked against
379
- * (language version 5); it is optional, so an older server is unchanged. */
379
+ * ; it is optional, so an older server is unchanged. */
380
380
  deletable: zod_1.z.boolean().optional(),
381
381
  })
382
382
  .passthrough();
@@ -705,7 +705,6 @@ exports.WirePluginSpec = zod_1.z.object({
705
705
  fedArgs: zod_1.z.array(zod_1.z.object({ name: zod_1.z.string(), required: zod_1.z.literal(true).optional() })).optional(),
706
706
  fedByExtraction: zod_1.z.literal(true).optional(),
707
707
  output: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
708
- earlierOutputs: zod_1.z.array(zod_1.z.object({ before: zod_1.z.number().int().positive(), output: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()) })).optional(),
709
708
  /** What the plugin does, in its author's words: shown when an author hovers a call. */
710
709
  description: zod_1.z.string().optional(),
711
710
  });
@@ -739,8 +738,11 @@ exports.WireModuleKind = zod_1.z.enum(exports.MODULE_KINDS);
739
738
  * other host leaves empty (a module asking for a page is refused by name),
740
739
  * and `wake`, which stays empty unless named (nobody is told work is due;
741
740
  * a scheduled worker finds it), and `ocr`, which stays empty unless named
742
- * (a scanned file is refused, saying the slot is empty). */
743
- 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'];
744
746
  exports.WireCoreSlot = zod_1.z.enum(exports.CORE_SLOTS);
745
747
  /** One construction argument the install supplies (an Airtable `base`, a
746
748
  * Sheets `spreadsheet`): asked for when the module is set up (`lf connect`,
@@ -83,13 +83,13 @@ export interface RunInput {
83
83
  */
84
84
  credentialIds?: Readonly<Record<string, string>>;
85
85
  /** What each segment of the run may consume (docs/contracts/run-limits.md).
86
- * Absent ⇒ the engine's defaults. Version 5 and later (the Rust engine). */
86
+ * Absent ⇒ the engine's defaults. (The Rust engine.) */
87
87
  limits?: SegmentLimits;
88
88
  /** How long each segment may take, waits on the host included, in whole
89
89
  * seconds. The host keeps it, not the engine: past it, the requests already
90
90
  * at the host finish, nothing more is served, and the segment fails with
91
91
  * MOVENG_LIMIT_WALL_CLOCK. Absent ⇒ the deployment's
92
- * MOVEMENT_MAX_SEGMENT_SECONDS, else 900. Version 5 and later. */
92
+ * MOVEMENT_MAX_SEGMENT_SECONDS, else 900. */
93
93
  maxSegmentSeconds?: number;
94
94
  }
95
95
  /** A segment's limits, each a whole positive number; an absent one is the
@@ -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);
@@ -12,7 +12,7 @@ export declare const JudgeArbitrateRequest: z.ZodObject<{
12
12
  }, z.core.$strip>>;
13
13
  }, z.core.$strip>>;
14
14
  }, z.core.$strip>;
15
- languageVersion: z.ZodNumber;
15
+ languageVersion: z.ZodString;
16
16
  }, z.core.$strip>;
17
17
  export type JudgeArbitrateRequestShape = z.infer<typeof JudgeArbitrateRequest>;
18
18
  export declare const JudgeArbitrateAnswer: z.ZodObject<{
@@ -16,8 +16,8 @@ exports.JudgeArbitrateRequest = zod_1.z.object({
16
16
  candidates: zod_1.z.array(zod_1.z.record(zod_1.z.string(), zod_1.z.unknown())),
17
17
  recordType: zod_1.z.string(),
18
18
  constraints: protocol_1.WireUniquenessConstraints,
19
- /** The asking run's language version: whether a blank key is a key. */
20
- languageVersion: zod_1.z.number().int().positive(),
19
+ /** The asking run's pin (a release's version): whether a blank key is a key. */
20
+ languageVersion: zod_1.z.string(),
21
21
  });
22
22
  exports.JudgeArbitrateAnswer = zod_1.z.object({
23
23
  index: zod_1.z.number().int().nonnegative().nullable(),
@@ -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>;
@@ -25,7 +25,7 @@ export declare function mergeUniqueness(a: UniquenessConstraints | undefined, b:
25
25
  * An identity key component that says nothing: absent, or text with nothing
26
26
  * in it. An empty key is no key — two records that both lack a name are not
27
27
  * thereby the same record — so such a component never matches and is never
28
- * matched on. Blank text is no key at every pin: version 1's matching of ""
28
+ * matched on. Blank text is no key at every pin: the earlier matching of ""
29
29
  * like any other value is retired. The pin is still taken so the rules keep
30
30
  * one signature with the rest of this file.
31
31
  */
@@ -42,7 +42,7 @@ function mergeUniqueness(a, b) {
42
42
  * An identity key component that says nothing: absent, or text with nothing
43
43
  * in it. An empty key is no key — two records that both lack a name are not
44
44
  * thereby the same record — so such a component never matches and is never
45
- * matched on. Blank text is no key at every pin: version 1's matching of ""
45
+ * matched on. Blank text is no key at every pin: the earlier matching of ""
46
46
  * like any other value is retired. The pin is still taken so the rules keep
47
47
  * one signature with the rest of this file.
48
48
  */
@@ -1,8 +1,8 @@
1
1
  import { CATALOG_SNAPSHOT_VERSION, DEPRECATED_CATALOG_SNAPSHOT_VERSIONS, SUPPORTED_CATALOG_SNAPSHOT_VERSIONS } from '@listen-fire/movement-lang';
2
2
  export { CATALOG_SNAPSHOT_VERSION, DEPRECATED_CATALOG_SNAPSHOT_VERSIONS, SUPPORTED_CATALOG_SNAPSHOT_VERSIONS };
3
3
  /** A parked flow's state (docs/contracts/park-state.md). Engine to engine: a
4
- * host stores it and hands it back. Version 2 is the Rust engine's (language
5
- * version 5 on); the TypeScript engine (versions 1–4) writes and reads 1. */
4
+ * host stores it and hands it back. Version 2 is the Rust engine's; the earlier
5
+ * TypeScript engine wrote and read 1. */
6
6
  export declare const PARK_STATE_VERSION = 2;
7
7
  /** The park state versions this release reads: each engine its own. */
8
8
  export declare const SUPPORTED_PARK_STATE_VERSIONS: ReadonlySet<number>;
@@ -42,17 +42,19 @@ export declare const CONTRACTS: {
42
42
  readonly supported: readonly [2];
43
43
  readonly deprecated: readonly [];
44
44
  };
45
- readonly 'language-versions': {
46
- readonly current: number;
47
- readonly supported: readonly number[];
48
- readonly deprecated: readonly number[];
49
- };
50
45
  readonly 'system-caller': {
51
46
  readonly current: 1;
52
47
  readonly supported: readonly [1];
53
48
  readonly deprecated: readonly [];
54
49
  };
55
50
  };
51
+ /** The language's contract (docs/contracts/language-versions.md) is not an
52
+ * integer of its own: it is the release's version, and a release reads the
53
+ * pins that share its compatibility key. */
54
+ export declare const LANGUAGE_CONTRACT: {
55
+ readonly version: string;
56
+ readonly key: string | undefined;
57
+ };
56
58
  /** Refuse a `segment.open` whose host families version this host does not
57
59
  * serve: it names the contract, the version it was handed and the ones it
58
60
  * serves. An opening that names no version is refused the same way. */
package/dist/versions.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- // The six contracts' versions, as one table. Each is an integer the contract's
2
+ // The integer contracts' versions, as one table. Each is an integer the contract's
3
3
  // doc under docs/contracts/ states, and a test holds each constant here equal
4
4
  // to its doc and the table equal to docs/contracts/README.md.
5
5
  //
@@ -8,7 +8,7 @@
8
8
  // the version at the point of difference, never by a forked reader. A version
9
9
  // this release does not support is refused at the boundary, loudly.
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.CONTRACTS = exports.SYSTEM_CALLER_VERSION = exports.SUPPORTED_HOST_FAMILIES_VERSIONS = exports.HOST_FAMILIES_VERSION = exports.SUPPORTED_PARK_STATE_VERSIONS = exports.PARK_STATE_VERSION = exports.SUPPORTED_CATALOG_SNAPSHOT_VERSIONS = exports.DEPRECATED_CATALOG_SNAPSHOT_VERSIONS = exports.CATALOG_SNAPSHOT_VERSION = void 0;
11
+ exports.LANGUAGE_CONTRACT = exports.CONTRACTS = exports.SYSTEM_CALLER_VERSION = exports.SUPPORTED_HOST_FAMILIES_VERSIONS = exports.HOST_FAMILIES_VERSION = exports.SUPPORTED_PARK_STATE_VERSIONS = exports.PARK_STATE_VERSION = exports.SUPPORTED_CATALOG_SNAPSHOT_VERSIONS = exports.DEPRECATED_CATALOG_SNAPSHOT_VERSIONS = exports.CATALOG_SNAPSHOT_VERSION = void 0;
12
12
  exports.refuseUnsupportedHostFamiliesVersion = refuseUnsupportedHostFamiliesVersion;
13
13
  exports.refuseUnsupportedParkStateVersion = refuseUnsupportedParkStateVersion;
14
14
  const movement_lang_1 = require("@listen-fire/movement-lang");
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "DEPRECATED_CATALOG_SNAPSHOT_VERSIONS", { enumera
17
17
  Object.defineProperty(exports, "SUPPORTED_CATALOG_SNAPSHOT_VERSIONS", { enumerable: true, get: function () { return movement_lang_1.SUPPORTED_CATALOG_SNAPSHOT_VERSIONS; } });
18
18
  const protocol_1 = require("./protocol");
19
19
  /** A parked flow's state (docs/contracts/park-state.md). Engine to engine: a
20
- * host stores it and hands it back. Version 2 is the Rust engine's (language
21
- * version 5 on); the TypeScript engine (versions 1–4) writes and reads 1. */
20
+ * host stores it and hands it back. Version 2 is the Rust engine's; the earlier
21
+ * TypeScript engine wrote and read 1. */
22
22
  exports.PARK_STATE_VERSION = 2;
23
23
  /** The park state versions this release reads: each engine its own. */
24
24
  exports.SUPPORTED_PARK_STATE_VERSIONS = new Set([1, 2]);
@@ -45,13 +45,15 @@ exports.CONTRACTS = {
45
45
  deprecated: [],
46
46
  },
47
47
  'adapter-protocol': { current: protocol_1.MANIFEST_PROTOCOL_VERSION, supported: [protocol_1.MANIFEST_PROTOCOL_VERSION], deprecated: [] },
48
- 'language-versions': {
49
- current: movement_lang_1.CURRENT_LANGUAGE_VERSION,
50
- supported: [...movement_lang_1.SUPPORTED_LANGUAGE_VERSIONS],
51
- deprecated: [...movement_lang_1.DEPRECATED_LANGUAGE_VERSIONS],
52
- },
53
48
  'system-caller': { current: exports.SYSTEM_CALLER_VERSION, supported: [exports.SYSTEM_CALLER_VERSION], deprecated: [] },
54
49
  };
50
+ /** The language's contract (docs/contracts/language-versions.md) is not an
51
+ * integer of its own: it is the release's version, and a release reads the
52
+ * pins that share its compatibility key. */
53
+ exports.LANGUAGE_CONTRACT = {
54
+ version: movement_lang_1.LANGUAGE_VERSION,
55
+ key: (0, movement_lang_1.compatibilityKey)(movement_lang_1.LANGUAGE_VERSION),
56
+ };
55
57
  /** Refuse a `segment.open` whose host families version this host does not
56
58
  * serve: it names the contract, the version it was handed and the ones it
57
59
  * serves. An opening that names no version is refused the same way. */
@@ -108,7 +108,7 @@ export interface WriteRecord {
108
108
  * target system computed that the author never wrote. In-memory
109
109
  * handle-read surface only. */
110
110
  resultData?: Record<string, unknown>;
111
- /** What the record held when the write found it (version 4 on): the values
111
+ /** What the record held when the write found it: the values
112
112
  * the handle reads for fields its write neither sent nor got back. Kept
113
113
  * apart from `resultData` because a handle that parents a later write
114
114
  * hands the adapter only what its own write got back (`ParentLink.data`),
@@ -124,7 +124,7 @@ export interface WriteRecord {
124
124
  edgeName: string;
125
125
  toRecordType: string;
126
126
  toExternalId: string;
127
- /** Version 1's link body: the to side was FOUND by the body's criteria
127
+ /** The earlier language's link body: the to side was FOUND by the body's criteria
128
128
  * in the same statement — never created, never written — rather than a
129
129
  * bound handle. */
130
130
  foundTarget?: boolean;
@@ -157,8 +157,8 @@ export interface WriteRecord {
157
157
  */
158
158
  note?: string;
159
159
  /**
160
- * This record is a SNAPSHOT — a record as it once stood (`-[:@old]->`,
161
- * version 4 on), not a live position — so it has no address: it is equal
160
+ * This record is a SNAPSHOT — a record as it once stood (`-[:@old]->`),
161
+ * not a live position — so it has no address: it is equal
162
162
  * only to itself, never to the live handle that shares its id.
163
163
  */
164
164
  snapshot?: true;
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.6",
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.6"
33
+ "@listen-fire/movement-lang": "^0.12.0-rc.8"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "20.16.5",