@cotal-ai/core 0.101.7 → 0.103.1

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.
@@ -6,6 +6,7 @@
6
6
  * same objects: implementations never import each other, and a private copy keeps passing after
7
7
  * the manager's contract changes.
8
8
  */
9
+ import { type EpCaller } from "./endpoint-subjects.js";
9
10
  /** `turn` (workflow runs, cotal-lang §5.3): wake the TARGET seat for one turn on behalf of a
10
11
  * workflow run. The manager relays and stays run-ignorant: `payload` is an opaque bounded string
11
12
  * the seat pulls back verbatim through `turn-pending` — its shape is the runtime↔connector
@@ -91,4 +92,16 @@ export declare const TURN_OUTPUT_SCHEMA: {
91
92
  };
92
93
  };
93
94
  };
95
+ /** The reserved reply-rail nonce of a turn notice (SPEC 14.3). A seat's own requests use random
96
+ * nonces, so no reply it awaits can arrive on this one. */
97
+ export declare const TURN_NOTICE_NONCE = "turn-pending-notice-v1";
98
+ /** The subject a manager publishes a turn notice on: the seat's own reply rail (the versioned one
99
+ * when the seat's credential is an issuance, SPEC 13.15), under the manager's instance and serve
100
+ * epoch. Only that instance's serve credential may publish it, and every baseline seat credential
101
+ * may read it, so the notice needs no new grant. It carries no turn: the seat answers it with its
102
+ * authenticated `turn-pending` pull. */
103
+ export declare function turnNoticeSubject(space: string, instanceId: string, epoch: number, seat: EpCaller): string;
104
+ /** The seat's subscription for {@link turnNoticeSubject}: its launching manager instance at any
105
+ * epoch, so a manager that re-serves under a new epoch still reaches it. */
106
+ export declare function turnNoticeFilter(space: string, instanceId: string, seat: EpCaller): string;
94
107
  //# sourceMappingURL=turn-contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"turn-contract.d.ts","sourceRoot":"","sources":["../src/turn-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;2BAQ2B;AAC3B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWnB,CAAC;AACZ;;4EAE4E;AAC5E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBpB,CAAC"}
1
+ {"version":3,"file":"turn-contract.d.ts","sourceRoot":"","sources":["../src/turn-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvH;;;;;;;;2BAQ2B;AAC3B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWnB,CAAC;AACZ;;4EAE4E;AAC5E,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBpB,CAAC;AAYZ;4DAC4D;AAC5D,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D;;;;yCAIyC;AACzC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAE1G;AAED;6EAC6E;AAC7E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAK1F"}
@@ -6,6 +6,8 @@
6
6
  * same objects: implementations never import each other, and a private copy keeps passing after
7
7
  * the manager's contract changes.
8
8
  */
9
+ import { callerRailTokens, endpointToken, epPlaneTokens, epReplySubject } from "./endpoint-subjects.js";
10
+ import { assertLifecycleToken, spacePrefix } from "./subjects.js";
9
11
  /** `turn` (workflow runs, cotal-lang §5.3): wake the TARGET seat for one turn on behalf of a
10
12
  * workflow run. The manager relays and stays run-ignorant: `payload` is an opaque bounded string
11
13
  * the seat pulls back verbatim through `turn-pending` — its shape is the runtime↔connector
@@ -59,4 +61,23 @@ function deepFreeze(v) {
59
61
  }
60
62
  return v;
61
63
  }
64
+ /** The reserved reply-rail nonce of a turn notice (SPEC 14.3). A seat's own requests use random
65
+ * nonces, so no reply it awaits can arrive on this one. */
66
+ export const TURN_NOTICE_NONCE = "turn-pending-notice-v1";
67
+ /** The subject a manager publishes a turn notice on: the seat's own reply rail (the versioned one
68
+ * when the seat's credential is an issuance, SPEC 13.15), under the manager's instance and serve
69
+ * epoch. Only that instance's serve credential may publish it, and every baseline seat credential
70
+ * may read it, so the notice needs no new grant. It carries no turn: the seat answers it with its
71
+ * authenticated `turn-pending` pull. */
72
+ export function turnNoticeSubject(space, instanceId, epoch, seat) {
73
+ return epReplySubject(space, { endpoint: "manager", instanceId, epoch, caller: seat, nonce: TURN_NOTICE_NONCE });
74
+ }
75
+ /** The seat's subscription for {@link turnNoticeSubject}: its launching manager instance at any
76
+ * epoch, so a manager that re-serves under a new epoch still reaches it. */
77
+ export function turnNoticeFilter(space, instanceId, seat) {
78
+ return [
79
+ spacePrefix(space), ...epPlaneTokens(seat), "reply", endpointToken("manager"), assertLifecycleToken(instanceId, "instanceId"), "*",
80
+ ...callerRailTokens(seat), TURN_NOTICE_NONCE,
81
+ ].join(".");
82
+ }
62
83
  //# sourceMappingURL=turn-contract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"turn-contract.js","sourceRoot":"","sources":["../src/turn-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;2BAQ2B;AAC3B,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC;IAClE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;IACnE,UAAU,EAAE;QACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE;QAC3D,UAA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D,OAAO,CAAC,CAAC;AACX,CAAC;AAED;4DAC4D;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAE1D;;;;yCAIyC;AACzC,MAAM,UAAU,iBAAiB,CAAC,KAAa,EAAE,UAAkB,EAAE,KAAa,EAAE,IAAc;IAChG,OAAO,cAAc,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACnH,CAAC;AAED;6EAC6E;AAC7E,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,UAAkB,EAAE,IAAc;IAChF,OAAO;QACL,WAAW,CAAC,KAAK,CAAC,EAAE,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,GAAG;QAClI,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,iBAAiB;KAC7C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/core",
3
3
  "description": "The Cotal protocol: endpoint, subjects, message types, the NATS client layer, and the extension contracts.",
4
- "version": "0.101.7",
4
+ "version": "0.103.1",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
7
7
  "cotal",