@listen-fire/engine-contracts 0.15.2 → 0.15.3

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.
@@ -0,0 +1,12 @@
1
+ import type { ActorIdentity } from './adapter';
2
+ export declare const ACTOR_FIELDS: readonly ["Id", "Email", "Domain", "Phone", "Name", "Proven"];
3
+ export interface NormalisedActor {
4
+ Id: string;
5
+ Email?: string;
6
+ Domain?: string;
7
+ Phone?: string;
8
+ Name?: string;
9
+ Proven: boolean;
10
+ }
11
+ /** `null` when the identity names nobody: a field that may be absent is better than an empty one a filter could match. */
12
+ export declare function normalisedActor(identity: ActorIdentity): NormalisedActor | null;
package/dist/actor.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ACTOR_FIELDS = void 0;
4
+ exports.normalisedActor = normalisedActor;
5
+ exports.ACTOR_FIELDS = ['Id', 'Email', 'Domain', 'Phone', 'Name', 'Proven'];
6
+ // The characters trimmed, named in docs/contracts/actor-field.md because
7
+ // `String.prototype.trim` and Rust's `str::trim` differ on U+FEFF and U+0085.
8
+ const TRIMMED = '\\t-\\r \\u0085\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff';
9
+ const TRIMMED_ENDS = new RegExp(`^[${TRIMMED}]+|[${TRIMMED}]+$`, 'g');
10
+ const trimmed = (text) => text.replace(TRIMMED_ENDS, '');
11
+ /** `null` when the identity names nobody: a field that may be absent is better than an empty one a filter could match. */
12
+ function normalisedActor(identity) {
13
+ if (trimmed(identity.identifier) === '')
14
+ return null;
15
+ const actor = { Id: identity.identifier, Proven: identity.proven === true };
16
+ // The address is `email`, else the identifier of an `email` identity ([Who acted]).
17
+ const given = identity.email ?? (identity.scheme === 'email' ? identity.identifier : undefined);
18
+ const address = given === undefined ? undefined : trimmed(given).toLowerCase();
19
+ if (address !== undefined && address !== '') {
20
+ actor.Email = address;
21
+ // The last `@`, so `a@x.com.evil.com` can never read as `x.com`.
22
+ const at = address.lastIndexOf('@');
23
+ if (at !== -1 && at < address.length - 1)
24
+ actor.Domain = address.slice(at + 1);
25
+ }
26
+ if (identity.scheme === 'phone') {
27
+ const digits = identity.identifier.replace(/\D/g, '');
28
+ if (digits !== '')
29
+ actor.Phone = digits;
30
+ }
31
+ const name = identity.name ?? identity.label;
32
+ if (name !== undefined && name !== '')
33
+ actor.Name = name;
34
+ return actor;
35
+ }
package/dist/adapter.d.ts CHANGED
@@ -66,6 +66,10 @@ export interface ActorIdentity {
66
66
  name?: string;
67
67
  /** Fallback display label when `name` isn't available. */
68
68
  label?: string;
69
+ /** True when the module checked that the source system vouches for this
70
+ * identity (a verified address, a signed request). Absent reads as not
71
+ * proven: it is a claim only the module can make. */
72
+ proven?: boolean;
69
73
  }
70
74
  /**
71
75
  * An ordered actor candidate parsed from an inbound event by the adapter's
@@ -63,6 +63,7 @@ declare const runInputSchema: z.ZodObject<{
63
63
  email?: string | undefined;
64
64
  name?: string | undefined;
65
65
  label?: string | undefined;
66
+ proven?: boolean | undefined;
66
67
  } | undefined;
67
68
  } | undefined;
68
69
  }, {
@@ -113,6 +114,7 @@ declare const runInputSchema: z.ZodObject<{
113
114
  email?: string | undefined;
114
115
  name?: string | undefined;
115
116
  label?: string | undefined;
117
+ proven?: boolean | undefined;
116
118
  } | undefined;
117
119
  } | undefined;
118
120
  }>;
@@ -188,6 +190,7 @@ declare const resumeInputSchema: z.ZodObject<{
188
190
  email?: string | undefined;
189
191
  name?: string | undefined;
190
192
  label?: string | undefined;
193
+ proven?: boolean | undefined;
191
194
  } | undefined;
192
195
  } | undefined;
193
196
  }, {
@@ -238,6 +241,7 @@ declare const resumeInputSchema: z.ZodObject<{
238
241
  email?: string | undefined;
239
242
  name?: string | undefined;
240
243
  label?: string | undefined;
244
+ proven?: boolean | undefined;
241
245
  } | undefined;
242
246
  } | undefined;
243
247
  }>;
@@ -363,6 +367,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
363
367
  email?: string | undefined;
364
368
  name?: string | undefined;
365
369
  label?: string | undefined;
370
+ proven?: boolean | undefined;
366
371
  } | undefined;
367
372
  } | undefined;
368
373
  }, {
@@ -413,6 +418,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
413
418
  email?: string | undefined;
414
419
  name?: string | undefined;
415
420
  label?: string | undefined;
421
+ proven?: boolean | undefined;
416
422
  } | undefined;
417
423
  } | undefined;
418
424
  }>;
@@ -516,6 +522,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
516
522
  email?: string | undefined;
517
523
  name?: string | undefined;
518
524
  label?: string | undefined;
525
+ proven?: boolean | undefined;
519
526
  } | undefined;
520
527
  } | undefined;
521
528
  }, {
@@ -566,6 +573,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
566
573
  email?: string | undefined;
567
574
  name?: string | undefined;
568
575
  label?: string | undefined;
576
+ proven?: boolean | undefined;
569
577
  } | undefined;
570
578
  } | undefined;
571
579
  }>;
@@ -677,6 +685,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
677
685
  email?: string | undefined;
678
686
  name?: string | undefined;
679
687
  label?: string | undefined;
688
+ proven?: boolean | undefined;
680
689
  } | undefined;
681
690
  } | undefined;
682
691
  }, {
@@ -727,6 +736,7 @@ export declare const hostRecordingSchema: z.ZodPreprocess<z.ZodDiscriminatedUnio
727
736
  email?: string | undefined;
728
737
  name?: string | undefined;
729
738
  label?: string | undefined;
739
+ proven?: boolean | undefined;
730
740
  } | undefined;
731
741
  } | undefined;
732
742
  }>;
package/dist/event.d.ts CHANGED
@@ -109,6 +109,7 @@ export declare const triggerEventSchema: z.ZodObject<{
109
109
  email: z.ZodOptional<z.ZodString>;
110
110
  name: z.ZodOptional<z.ZodString>;
111
111
  label: z.ZodOptional<z.ZodString>;
112
+ proven: z.ZodOptional<z.ZodBoolean>;
112
113
  }, z.core.$strip>>;
113
114
  }, z.core.$strip>>;
114
115
  }, z.core.$strip>;
package/dist/event.js CHANGED
@@ -34,6 +34,7 @@ const firedActorSchema = zod_1.z.object({
34
34
  email: zod_1.z.string().optional(),
35
35
  name: zod_1.z.string().optional(),
36
36
  label: zod_1.z.string().optional(),
37
+ proven: zod_1.z.boolean().optional(),
37
38
  });
38
39
  /** The source system's identifier for the record an inbound event is about. */
39
40
  exports.inboundRecordRefSchema = zod_1.z.object({
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export type { AdapterSnapshot, CatalogSnapshot, LanguageVersion } from '@listen-fire/movement-lang';
2
+ export * from './actor';
2
3
  export * from './adapter';
3
4
  export * from './arrivals';
4
5
  export * from './catalog';
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.RelatedPage = void 0;
28
+ __exportStar(require("./actor"), exports);
28
29
  __exportStar(require("./adapter"), exports);
29
30
  __exportStar(require("./arrivals"), exports);
30
31
  __exportStar(require("./catalog"), exports);
@@ -12,7 +12,7 @@ export declare const ADAPTER_TEAM_HEADER = "x-listen-fire-team";
12
12
  export declare const MANIFEST_PROTOCOL_VERSION = 2;
13
13
  /** The highest minor of version 2 this release speaks: a host reads 2.0 to
14
14
  * 2.`PROTOCOL_MINOR` (docs/contracts/adapter-protocol.md "Minors of version 2"). */
15
- export declare const PROTOCOL_MINOR = 8;
15
+ export declare const PROTOCOL_MINOR = 9;
16
16
  /** The method that names a minor's feature, by name or by its ending
17
17
  * (`<slot>.watch`). Data, so the Rust twin (module-wire
18
18
  * `envelope::PROTOCOL_MINORS`) is test-held equal to it. */
@@ -25,8 +25,9 @@ export type ProtocolMinorUse = {
25
25
  * speaking the minor may call it; a module offering it needs nothing of an
26
26
  * older host, which never calls it, so offering one never raises the minor
27
27
  * a module states. A minor that names no method has no row: 2.0, 2.3
28
- * (labelled poll events), 2.7 (`pollAgainAt`) and 2.8 (`hostRelease` on a
29
- * slot request), each a host behaviour. */
28
+ * (labelled poll events), 2.7 (`pollAgainAt`), 2.8 (`hostRelease` on a
29
+ * slot request) and 2.9 (`proven` on an actor identity), each a host
30
+ * behaviour. */
30
31
  export declare const PROTOCOL_MINORS: readonly {
31
32
  minor: number;
32
33
  feature: string;
@@ -456,6 +457,7 @@ export declare const WireTriggerEvent: z.ZodObject<{
456
457
  email: z.ZodOptional<z.ZodString>;
457
458
  name: z.ZodOptional<z.ZodString>;
458
459
  label: z.ZodOptional<z.ZodString>;
460
+ proven: z.ZodOptional<z.ZodBoolean>;
459
461
  }, z.core.$strip>>>;
460
462
  }, z.core.$strip>>;
461
463
  }, z.core.$strip>;
@@ -684,6 +686,7 @@ export declare const WireActorIdentity: z.ZodObject<{
684
686
  email: z.ZodOptional<z.ZodString>;
685
687
  name: z.ZodOptional<z.ZodString>;
686
688
  label: z.ZodOptional<z.ZodString>;
689
+ proven: z.ZodOptional<z.ZodBoolean>;
687
690
  }, z.core.$strip>;
688
691
  /** Mirror of `ActorCandidate`. */
689
692
  export declare const WireActorCandidate: z.ZodObject<{
@@ -698,6 +701,7 @@ export declare const WireActorCandidate: z.ZodObject<{
698
701
  email: z.ZodOptional<z.ZodString>;
699
702
  name: z.ZodOptional<z.ZodString>;
700
703
  label: z.ZodOptional<z.ZodString>;
704
+ proven: z.ZodOptional<z.ZodBoolean>;
701
705
  }, z.core.$strip>;
702
706
  source: z.ZodEnum<{
703
707
  originator: "originator";
@@ -1365,6 +1369,7 @@ export declare const WireGetActorCandidatesInput: z.ZodObject<{
1365
1369
  email: z.ZodOptional<z.ZodString>;
1366
1370
  name: z.ZodOptional<z.ZodString>;
1367
1371
  label: z.ZodOptional<z.ZodString>;
1372
+ proven: z.ZodOptional<z.ZodBoolean>;
1368
1373
  }, z.core.$strip>>>;
1369
1374
  }, z.core.$strip>>;
1370
1375
  }, z.core.$strip>;
@@ -1437,6 +1442,7 @@ export declare const WireExtractActorInput: z.ZodObject<{
1437
1442
  email: z.ZodOptional<z.ZodString>;
1438
1443
  name: z.ZodOptional<z.ZodString>;
1439
1444
  label: z.ZodOptional<z.ZodString>;
1445
+ proven: z.ZodOptional<z.ZodBoolean>;
1440
1446
  }, z.core.$strip>>>;
1441
1447
  }, z.core.$strip>>;
1442
1448
  }, z.core.$strip>;
@@ -2324,6 +2330,7 @@ export declare const WireArrival: z.ZodUnion<readonly [z.ZodObject<{
2324
2330
  email: z.ZodOptional<z.ZodString>;
2325
2331
  name: z.ZodOptional<z.ZodString>;
2326
2332
  label: z.ZodOptional<z.ZodString>;
2333
+ proven: z.ZodOptional<z.ZodBoolean>;
2327
2334
  }, z.core.$strip>>;
2328
2335
  }, z.core.$strip>, z.ZodObject<{
2329
2336
  edge: z.ZodString;
@@ -2386,6 +2393,7 @@ export declare const WirePollEdgeResult: z.ZodObject<{
2386
2393
  email: z.ZodOptional<z.ZodString>;
2387
2394
  name: z.ZodOptional<z.ZodString>;
2388
2395
  label: z.ZodOptional<z.ZodString>;
2396
+ proven: z.ZodOptional<z.ZodBoolean>;
2389
2397
  }, z.core.$strip>>;
2390
2398
  }, z.core.$strip>, z.ZodObject<{
2391
2399
  edge: z.ZodString;
@@ -2438,6 +2446,7 @@ export declare const AdapterWakeBody: z.ZodObject<{
2438
2446
  email: z.ZodOptional<z.ZodString>;
2439
2447
  name: z.ZodOptional<z.ZodString>;
2440
2448
  label: z.ZodOptional<z.ZodString>;
2449
+ proven: z.ZodOptional<z.ZodBoolean>;
2441
2450
  }, z.core.$strip>>;
2442
2451
  }, z.core.$strip>, z.ZodObject<{
2443
2452
  edge: z.ZodString;
@@ -2531,6 +2540,7 @@ export declare const WireInboundCheck: z.ZodDiscriminatedUnion<[z.ZodObject<{
2531
2540
  email: z.ZodOptional<z.ZodString>;
2532
2541
  name: z.ZodOptional<z.ZodString>;
2533
2542
  label: z.ZodOptional<z.ZodString>;
2543
+ proven: z.ZodOptional<z.ZodBoolean>;
2534
2544
  }, z.core.$strip>>;
2535
2545
  }, z.core.$strip>, z.ZodObject<{
2536
2546
  edge: z.ZodString;
@@ -3781,6 +3791,7 @@ export declare const METHODS: {
3781
3791
  email: z.ZodOptional<z.ZodString>;
3782
3792
  name: z.ZodOptional<z.ZodString>;
3783
3793
  label: z.ZodOptional<z.ZodString>;
3794
+ proven: z.ZodOptional<z.ZodBoolean>;
3784
3795
  }, z.core.$strip>>;
3785
3796
  }, z.core.$strip>, z.ZodObject<{
3786
3797
  edge: z.ZodString;
@@ -4197,6 +4208,7 @@ export declare const METHODS: {
4197
4208
  email: z.ZodOptional<z.ZodString>;
4198
4209
  name: z.ZodOptional<z.ZodString>;
4199
4210
  label: z.ZodOptional<z.ZodString>;
4211
+ proven: z.ZodOptional<z.ZodBoolean>;
4200
4212
  }, z.core.$strip>>>;
4201
4213
  }, z.core.$strip>>;
4202
4214
  }, z.core.$strip>;
@@ -4213,6 +4225,7 @@ export declare const METHODS: {
4213
4225
  email: z.ZodOptional<z.ZodString>;
4214
4226
  name: z.ZodOptional<z.ZodString>;
4215
4227
  label: z.ZodOptional<z.ZodString>;
4228
+ proven: z.ZodOptional<z.ZodBoolean>;
4216
4229
  }, z.core.$strip>;
4217
4230
  source: z.ZodEnum<{
4218
4231
  originator: "originator";
@@ -4289,6 +4302,7 @@ export declare const METHODS: {
4289
4302
  email: z.ZodOptional<z.ZodString>;
4290
4303
  name: z.ZodOptional<z.ZodString>;
4291
4304
  label: z.ZodOptional<z.ZodString>;
4305
+ proven: z.ZodOptional<z.ZodBoolean>;
4292
4306
  }, z.core.$strip>>>;
4293
4307
  }, z.core.$strip>>;
4294
4308
  }, z.core.$strip>;
@@ -4304,6 +4318,7 @@ export declare const METHODS: {
4304
4318
  email: z.ZodOptional<z.ZodString>;
4305
4319
  name: z.ZodOptional<z.ZodString>;
4306
4320
  label: z.ZodOptional<z.ZodString>;
4321
+ proven: z.ZodOptional<z.ZodBoolean>;
4307
4322
  }, z.core.$strip>>;
4308
4323
  };
4309
4324
  readonly describeOpaqueId: {
@@ -4387,6 +4402,7 @@ export declare const METHODS: {
4387
4402
  email: z.ZodOptional<z.ZodString>;
4388
4403
  name: z.ZodOptional<z.ZodString>;
4389
4404
  label: z.ZodOptional<z.ZodString>;
4405
+ proven: z.ZodOptional<z.ZodBoolean>;
4390
4406
  }, z.core.$strip>>;
4391
4407
  }, z.core.$strip>, z.ZodObject<{
4392
4408
  edge: z.ZodString;
@@ -4476,6 +4492,7 @@ export declare const METHODS: {
4476
4492
  email: z.ZodOptional<z.ZodString>;
4477
4493
  name: z.ZodOptional<z.ZodString>;
4478
4494
  label: z.ZodOptional<z.ZodString>;
4495
+ proven: z.ZodOptional<z.ZodBoolean>;
4479
4496
  }, z.core.$strip>>;
4480
4497
  }, z.core.$strip>, z.ZodObject<{
4481
4498
  edge: z.ZodString;
package/dist/protocol.js CHANGED
@@ -42,13 +42,14 @@ exports.ADAPTER_TEAM_HEADER = 'x-listen-fire-team';
42
42
  exports.MANIFEST_PROTOCOL_VERSION = 2;
43
43
  /** The highest minor of version 2 this release speaks: a host reads 2.0 to
44
44
  * 2.`PROTOCOL_MINOR` (docs/contracts/adapter-protocol.md "Minors of version 2"). */
45
- exports.PROTOCOL_MINOR = 8;
45
+ exports.PROTOCOL_MINOR = 9;
46
46
  /** Each minor of version 2 whose hosts speak a method, and that method. A host
47
47
  * speaking the minor may call it; a module offering it needs nothing of an
48
48
  * older host, which never calls it, so offering one never raises the minor
49
49
  * a module states. A minor that names no method has no row: 2.0, 2.3
50
- * (labelled poll events), 2.7 (`pollAgainAt`) and 2.8 (`hostRelease` on a
51
- * slot request), each a host behaviour. */
50
+ * (labelled poll events), 2.7 (`pollAgainAt`), 2.8 (`hostRelease` on a
51
+ * slot request) and 2.9 (`proven` on an actor identity), each a host
52
+ * behaviour. */
52
53
  exports.PROTOCOL_MINORS = [
53
54
  { minor: 1, feature: 'a <slot>.watch method', uses: { methodEndingWith: '.watch' } },
54
55
  { minor: 2, feature: 'work.enqueueIfAbsent', uses: { method: 'work.enqueueIfAbsent' } },
@@ -437,6 +438,7 @@ exports.WireActorIdentity = zod_1.z.object({
437
438
  email: zod_1.z.string().optional(),
438
439
  name: zod_1.z.string().optional(),
439
440
  label: zod_1.z.string().optional(),
441
+ proven: zod_1.z.boolean().optional(),
440
442
  });
441
443
  /** Mirror of `ActorCandidate`. */
442
444
  exports.WireActorCandidate = zod_1.z.object({
@@ -47,7 +47,7 @@ export declare const CONTRACTS: {
47
47
  readonly current: 2;
48
48
  readonly supported: readonly [2];
49
49
  readonly deprecated: readonly [];
50
- readonly minor: 8;
50
+ readonly minor: 9;
51
51
  };
52
52
  readonly 'system-caller': {
53
53
  readonly current: 1;
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.15.2",
4
+ "version": "0.15.3",
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.23.4 <23"
@@ -30,7 +30,7 @@
30
30
  "type": "commonjs",
31
31
  "dependencies": {
32
32
  "zod": "4.1.12",
33
- "@listen-fire/movement-lang": "^0.15.2"
33
+ "@listen-fire/movement-lang": "^0.15.3"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "20.16.5",