@the-open-engine/zeroshot 6.29.0 → 6.29.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.
Files changed (304) hide show
  1. package/cli/index.js +2 -4
  2. package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
  3. package/lib/agent-cli-provider/adapters/codex.js +0 -1
  4. package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
  5. package/lib/cluster/client.cjs +30 -7
  6. package/lib/cluster/client.d.cts +52 -0
  7. package/lib/cluster/client.d.mts +52 -0
  8. package/lib/cluster/client.d.ts +4 -6
  9. package/lib/cluster/client.mjs +32 -9
  10. package/lib/cluster/connection-state.cjs +25 -0
  11. package/lib/cluster/connection-state.d.cts +13 -0
  12. package/lib/cluster/connection-state.d.mts +13 -0
  13. package/lib/cluster/connection-state.d.ts +13 -0
  14. package/lib/cluster/connection-state.mjs +21 -0
  15. package/lib/{target/hosted-run/contracts.js → cluster/connection-types.cjs} +0 -1
  16. package/lib/cluster/connection-types.d.cts +33 -0
  17. package/lib/cluster/connection-types.d.mts +33 -0
  18. package/lib/cluster/connection-types.d.ts +33 -0
  19. package/lib/cluster/connection-types.mjs +1 -0
  20. package/lib/cluster/connection.cjs +18 -46
  21. package/lib/cluster/connection.d.cts +26 -0
  22. package/lib/cluster/connection.d.mts +26 -0
  23. package/lib/cluster/connection.d.ts +7 -25
  24. package/lib/cluster/connection.mjs +12 -42
  25. package/lib/cluster/errors.cjs +9 -1
  26. package/lib/cluster/errors.d.cts +29 -0
  27. package/lib/cluster/errors.d.mts +29 -0
  28. package/lib/cluster/errors.d.ts +4 -0
  29. package/lib/cluster/errors.mjs +7 -0
  30. package/lib/cluster/frames.d.cts +12 -0
  31. package/lib/cluster/frames.d.mts +12 -0
  32. package/lib/cluster/generated/protocol-schema.d.cts +1 -0
  33. package/lib/cluster/generated/protocol-schema.d.mts +1 -0
  34. package/lib/cluster/generated/protocol.d.cts +781 -0
  35. package/lib/cluster/generated/protocol.d.mts +781 -0
  36. package/lib/cluster/index.cjs +2 -2
  37. package/lib/cluster/index.d.cts +13 -0
  38. package/lib/cluster/index.d.mts +13 -0
  39. package/lib/cluster/index.d.ts +3 -3
  40. package/lib/cluster/index.mjs +2 -2
  41. package/lib/cluster/json-source.cjs +1 -0
  42. package/lib/cluster/json-source.d.cts +5 -0
  43. package/lib/cluster/json-source.d.mts +5 -0
  44. package/lib/cluster/json-source.d.ts +1 -0
  45. package/lib/cluster/json-source.mjs +1 -0
  46. package/lib/cluster/payload-value.cjs +1 -0
  47. package/lib/cluster/payload-value.d.cts +8 -0
  48. package/lib/cluster/payload-value.d.mts +8 -0
  49. package/lib/cluster/payload-value.d.ts +1 -0
  50. package/lib/cluster/payload-value.mjs +1 -0
  51. package/lib/cluster/queue.d.cts +15 -0
  52. package/lib/cluster/queue.d.mts +15 -0
  53. package/lib/cluster/socket.cjs +8 -0
  54. package/lib/cluster/socket.d.cts +13 -0
  55. package/lib/cluster/socket.d.mts +13 -0
  56. package/lib/cluster/socket.d.ts +2 -0
  57. package/lib/cluster/socket.mjs +7 -0
  58. package/lib/cluster/subscriptions.d.cts +73 -0
  59. package/lib/cluster/subscriptions.d.mts +73 -0
  60. package/lib/cluster/subscriptions.d.ts +5 -1
  61. package/lib/cluster/validators.cjs +1 -0
  62. package/lib/cluster/validators.d.cts +7 -0
  63. package/lib/cluster/validators.d.mts +7 -0
  64. package/lib/cluster/validators.d.ts +1 -0
  65. package/lib/cluster/validators.mjs +1 -0
  66. package/lib/cluster-worker/engine-adapter.js +4 -10
  67. package/lib/cluster-worker/profiles.js +1 -42
  68. package/lib/hosted-session/authority.cjs +61 -0
  69. package/lib/hosted-session/authority.d.cts +3 -0
  70. package/lib/hosted-session/authority.d.mts +3 -0
  71. package/lib/hosted-session/authority.d.ts +3 -0
  72. package/lib/hosted-session/authority.mjs +57 -0
  73. package/lib/hosted-session/coordinator.cjs +78 -51
  74. package/lib/hosted-session/coordinator.d.cts +11 -0
  75. package/lib/hosted-session/coordinator.d.mts +11 -0
  76. package/lib/hosted-session/coordinator.d.ts +4 -2
  77. package/lib/hosted-session/coordinator.mjs +75 -51
  78. package/lib/hosted-session/errors.cjs +25 -0
  79. package/lib/hosted-session/errors.d.cts +10 -0
  80. package/lib/hosted-session/errors.d.mts +10 -0
  81. package/lib/hosted-session/errors.d.ts +10 -0
  82. package/lib/hosted-session/errors.mjs +19 -0
  83. package/lib/hosted-session/index.cjs +4 -1
  84. package/lib/hosted-session/index.d.cts +2 -0
  85. package/lib/hosted-session/index.d.mts +2 -0
  86. package/lib/hosted-session/index.d.ts +2 -2
  87. package/lib/hosted-session/index.mjs +1 -1
  88. package/lib/hosted-session/reconnecting-watch.cjs +131 -0
  89. package/lib/hosted-session/reconnecting-watch.d.cts +13 -0
  90. package/lib/hosted-session/reconnecting-watch.d.mts +13 -0
  91. package/lib/hosted-session/reconnecting-watch.d.ts +13 -0
  92. package/lib/hosted-session/reconnecting-watch.mjs +127 -0
  93. package/lib/hosted-session/types.d.cts +32 -0
  94. package/lib/hosted-session/types.d.mts +32 -0
  95. package/lib/hosted-session/types.d.ts +19 -7
  96. package/lib/hosted-target/access-url.cjs +44 -0
  97. package/lib/hosted-target/access-url.d.cts +2 -0
  98. package/lib/hosted-target/access-url.d.mts +2 -0
  99. package/lib/hosted-target/access-url.d.ts +2 -0
  100. package/lib/hosted-target/access-url.mjs +41 -0
  101. package/lib/hosted-target/adapter-request.cjs +12 -0
  102. package/lib/hosted-target/adapter-request.d.cts +17 -0
  103. package/lib/hosted-target/adapter-request.d.mts +17 -0
  104. package/lib/hosted-target/adapter-request.d.ts +17 -0
  105. package/lib/hosted-target/adapter-request.mjs +9 -0
  106. package/lib/hosted-target/adapter-types.cjs +2 -0
  107. package/lib/hosted-target/adapter-types.d.cts +27 -0
  108. package/lib/hosted-target/adapter-types.d.mts +27 -0
  109. package/lib/hosted-target/adapter-types.d.ts +27 -0
  110. package/lib/hosted-target/adapter-types.mjs +1 -0
  111. package/lib/hosted-target/bounds.cjs +10 -0
  112. package/lib/hosted-target/bounds.d.cts +7 -0
  113. package/lib/hosted-target/bounds.d.mts +7 -0
  114. package/lib/hosted-target/bounds.d.ts +7 -0
  115. package/lib/hosted-target/bounds.mjs +7 -0
  116. package/lib/hosted-target/capsule-error-response.cjs +76 -0
  117. package/lib/hosted-target/capsule-error-response.d.cts +2 -0
  118. package/lib/hosted-target/capsule-error-response.d.mts +2 -0
  119. package/lib/hosted-target/capsule-error-response.d.ts +2 -0
  120. package/lib/hosted-target/capsule-error-response.mjs +73 -0
  121. package/lib/hosted-target/errors.cjs +88 -0
  122. package/lib/hosted-target/errors.d.cts +36 -0
  123. package/lib/hosted-target/errors.d.mts +36 -0
  124. package/lib/hosted-target/errors.d.ts +36 -0
  125. package/lib/hosted-target/errors.mjs +75 -0
  126. package/lib/hosted-target/index.cjs +16 -0
  127. package/lib/hosted-target/index.d.cts +3 -0
  128. package/lib/hosted-target/index.d.mts +3 -0
  129. package/lib/hosted-target/index.d.ts +3 -0
  130. package/lib/hosted-target/index.mjs +2 -0
  131. package/lib/hosted-target/response-validation.cjs +169 -0
  132. package/lib/hosted-target/response-validation.d.cts +5 -0
  133. package/lib/hosted-target/response-validation.d.mts +5 -0
  134. package/lib/hosted-target/response-validation.d.ts +5 -0
  135. package/lib/hosted-target/response-validation.mjs +163 -0
  136. package/lib/hosted-target/retry-executor.cjs +51 -0
  137. package/lib/hosted-target/retry-executor.d.cts +8 -0
  138. package/lib/hosted-target/retry-executor.d.mts +8 -0
  139. package/lib/hosted-target/retry-executor.d.ts +8 -0
  140. package/lib/hosted-target/retry-executor.mjs +48 -0
  141. package/lib/hosted-target/retry.cjs +78 -0
  142. package/lib/hosted-target/retry.d.cts +9 -0
  143. package/lib/hosted-target/retry.d.mts +9 -0
  144. package/lib/hosted-target/retry.d.ts +9 -0
  145. package/lib/hosted-target/retry.mjs +73 -0
  146. package/lib/hosted-target/target-adapter.cjs +10 -0
  147. package/lib/hosted-target/target-adapter.d.cts +3 -0
  148. package/lib/hosted-target/target-adapter.d.mts +3 -0
  149. package/lib/hosted-target/target-adapter.d.ts +3 -0
  150. package/lib/hosted-target/target-adapter.mjs +7 -0
  151. package/lib/hosted-target/types.cjs +4 -0
  152. package/lib/hosted-target/types.d.cts +50 -0
  153. package/lib/hosted-target/types.d.mts +50 -0
  154. package/lib/hosted-target/types.d.ts +50 -0
  155. package/lib/hosted-target/types.mjs +1 -0
  156. package/lib/hosted-target/zero-cloud-v1-adapter.cjs +185 -0
  157. package/lib/hosted-target/zero-cloud-v1-adapter.d.cts +13 -0
  158. package/lib/hosted-target/zero-cloud-v1-adapter.d.mts +13 -0
  159. package/lib/hosted-target/zero-cloud-v1-adapter.d.ts +13 -0
  160. package/lib/hosted-target/zero-cloud-v1-adapter.mjs +181 -0
  161. package/lib/start-cluster.js +3 -3
  162. package/lib/target/bounded-response.cjs +51 -0
  163. package/lib/target/bounded-response.d.cts +1 -0
  164. package/lib/target/bounded-response.d.mts +1 -0
  165. package/lib/target/bounded-response.d.ts +1 -0
  166. package/lib/target/bounded-response.js +51 -0
  167. package/lib/target/bounded-response.mjs +48 -0
  168. package/lib/target/credential-lock.js +1 -3
  169. package/lib/target/credential-store.js +9 -4
  170. package/lib/target/device-flow.cjs +213 -0
  171. package/lib/target/device-flow.d.cts +54 -0
  172. package/lib/target/device-flow.d.mts +54 -0
  173. package/lib/target/device-flow.d.ts +26 -14
  174. package/lib/target/device-flow.js +162 -58
  175. package/lib/target/device-flow.mjs +203 -0
  176. package/lib/target/discovery-errors.cjs +10 -0
  177. package/lib/target/discovery-errors.d.cts +3 -0
  178. package/lib/target/discovery-errors.d.mts +3 -0
  179. package/lib/target/discovery-errors.d.ts +3 -0
  180. package/lib/target/discovery-errors.js +10 -0
  181. package/lib/target/discovery-errors.mjs +6 -0
  182. package/lib/target/discovery-sections.cjs +191 -0
  183. package/lib/target/discovery-sections.d.cts +52 -0
  184. package/lib/target/discovery-sections.d.mts +52 -0
  185. package/lib/target/discovery-sections.d.ts +52 -0
  186. package/lib/target/discovery-sections.js +191 -0
  187. package/lib/target/discovery-sections.mjs +179 -0
  188. package/lib/target/discovery-validation.cjs +109 -0
  189. package/lib/target/discovery-validation.d.cts +28 -0
  190. package/lib/target/discovery-validation.d.mts +28 -0
  191. package/lib/target/discovery-validation.d.ts +28 -0
  192. package/lib/target/discovery-validation.js +109 -0
  193. package/lib/target/discovery-validation.mjs +99 -0
  194. package/lib/target/discovery.cjs +112 -0
  195. package/lib/target/discovery.d.cts +74 -0
  196. package/lib/target/discovery.d.mts +74 -0
  197. package/lib/target/discovery.d.ts +67 -5
  198. package/lib/target/discovery.js +94 -79
  199. package/lib/target/discovery.mjs +105 -0
  200. package/lib/target/index.d.ts +6 -6
  201. package/lib/target/index.js +36 -36
  202. package/lib/target/oauth-http.d.ts +2 -0
  203. package/lib/target/oauth-http.js +25 -0
  204. package/lib/target/refresh-exchange.d.ts +11 -0
  205. package/lib/target/refresh-exchange.js +24 -0
  206. package/lib/target/refresh-revocation.d.ts +8 -0
  207. package/lib/target/refresh-revocation.js +19 -0
  208. package/lib/target/route-template.cjs +85 -0
  209. package/lib/target/route-template.d.cts +7 -0
  210. package/lib/target/route-template.d.mts +7 -0
  211. package/lib/target/route-template.d.ts +7 -0
  212. package/lib/target/route-template.js +85 -0
  213. package/lib/target/route-template.mjs +81 -0
  214. package/lib/target/session-errors.d.ts +4 -0
  215. package/lib/target/session-errors.js +12 -0
  216. package/lib/target/session-verification.d.ts +10 -0
  217. package/lib/target/session-verification.js +42 -0
  218. package/lib/target/target-registry.d.ts +7 -3
  219. package/lib/target/target-registry.js +41 -10
  220. package/lib/target/target-session-manager.d.ts +48 -0
  221. package/lib/target/target-session-manager.js +226 -0
  222. package/lib/target/target-session.d.ts +39 -32
  223. package/lib/target/target-session.js +63 -151
  224. package/lib/target/token-response.cjs +51 -0
  225. package/lib/target/token-response.d.cts +7 -0
  226. package/lib/target/token-response.d.mts +7 -0
  227. package/lib/target/token-response.d.ts +7 -0
  228. package/lib/target/token-response.js +51 -0
  229. package/lib/target/token-response.mjs +48 -0
  230. package/package.json +4 -7
  231. package/scripts/build-cluster.js +23 -3
  232. package/scripts/opcore-introduced-check.js +0 -2
  233. package/src/agent-cli-provider/adapters/codex.ts +0 -1
  234. package/src/cluster/client.ts +42 -15
  235. package/src/cluster/connection-state.ts +33 -0
  236. package/src/cluster/connection-types.ts +28 -0
  237. package/src/cluster/connection.ts +37 -68
  238. package/src/cluster/errors.ts +5 -0
  239. package/src/cluster/index.ts +3 -1
  240. package/src/cluster/json-source.ts +1 -0
  241. package/src/cluster/payload-value.ts +1 -0
  242. package/src/cluster/socket.ts +13 -0
  243. package/src/cluster/subscriptions.ts +7 -2
  244. package/src/cluster/validators.ts +1 -0
  245. package/src/cluster/ws.d.ts +1 -1
  246. package/src/hosted-session/authority.ts +77 -0
  247. package/src/hosted-session/coordinator.ts +113 -56
  248. package/src/hosted-session/errors.ts +21 -0
  249. package/src/hosted-session/index.ts +14 -2
  250. package/src/hosted-session/reconnecting-watch.ts +148 -0
  251. package/src/hosted-session/types.ts +22 -8
  252. package/src/hosted-target/access-url.ts +46 -0
  253. package/src/hosted-target/adapter-request.ts +28 -0
  254. package/src/hosted-target/adapter-types.ts +39 -0
  255. package/src/hosted-target/bounds.ts +1 -0
  256. package/src/hosted-target/capsule-error-response.ts +107 -0
  257. package/src/hosted-target/errors.ts +36 -35
  258. package/src/hosted-target/index.ts +10 -23
  259. package/src/hosted-target/response-validation.ts +170 -62
  260. package/src/hosted-target/retry-executor.ts +62 -0
  261. package/src/hosted-target/retry.ts +47 -11
  262. package/src/hosted-target/target-adapter.ts +12 -8
  263. package/src/hosted-target/types.ts +19 -18
  264. package/src/hosted-target/zero-cloud-v1-adapter.ts +229 -316
  265. package/src/isolation-manager.js +1 -16
  266. package/src/target/bounded-response.ts +68 -0
  267. package/src/target/credential-lock.ts +1 -3
  268. package/src/target/credential-store.ts +14 -10
  269. package/src/target/device-flow.ts +209 -85
  270. package/src/target/discovery-errors.ts +6 -0
  271. package/src/target/discovery-sections.ts +251 -0
  272. package/src/target/discovery-validation.ts +144 -0
  273. package/src/target/discovery.ts +163 -97
  274. package/src/target/index.ts +15 -11
  275. package/src/target/oauth-http.ts +27 -0
  276. package/src/target/refresh-exchange.ts +36 -0
  277. package/src/target/refresh-revocation.ts +29 -0
  278. package/src/target/route-template.ts +105 -0
  279. package/src/target/session-errors.ts +9 -0
  280. package/src/target/session-verification.ts +51 -0
  281. package/src/target/target-registry.ts +60 -27
  282. package/src/target/target-session-manager.ts +285 -0
  283. package/src/target/target-session.ts +105 -226
  284. package/src/target/token-response.ts +62 -0
  285. package/docker/zeroshot-oecp/Cargo.toml +0 -12
  286. package/docker/zeroshot-oecp/Dockerfile +0 -65
  287. package/docker/zeroshot-oecp/src/main.rs +0 -32
  288. package/lib/target/bounded-json.d.ts +0 -6
  289. package/lib/target/bounded-json.js +0 -43
  290. package/lib/target/hosted-run/client.d.ts +0 -26
  291. package/lib/target/hosted-run/client.js +0 -158
  292. package/lib/target/hosted-run/commands.d.ts +0 -4
  293. package/lib/target/hosted-run/commands.js +0 -113
  294. package/lib/target/hosted-run/contracts.d.ts +0 -49
  295. package/lib/target/hosted-run/input.d.ts +0 -5
  296. package/lib/target/hosted-run/input.js +0 -200
  297. package/lib/target/hosted-run.d.ts +0 -4
  298. package/lib/target/hosted-run.js +0 -12
  299. package/src/target/bounded-json.ts +0 -48
  300. package/src/target/hosted-run/client.ts +0 -198
  301. package/src/target/hosted-run/commands.ts +0 -140
  302. package/src/target/hosted-run/contracts.ts +0 -53
  303. package/src/target/hosted-run/input.ts +0 -199
  304. package/src/target/hosted-run.ts +0 -8
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.connectInitialized = exports.connect = exports.ClusterClient = exports.WatchSubscriptionStream = exports.LogsSubscriptionStream = exports.AgentAttachSubscriptionStream = exports.Connection = exports.PROTOCOL_DIAGNOSTIC_CAPACITY = exports.CONNECTION_TRANSITIONS = exports.CLOSE_REASON_MAX_BYTES = exports.assertGraphSpec = exports.assertGraphProfileSupported = exports.assertGraphProfile = exports.ClusterTransportError = exports.ClusterTimeoutError = exports.ClusterStateError = exports.ClusterRpcError = exports.ClusterRequestError = exports.ClusterProtocolError = exports.ClusterInternalError = exports.ClusterError = exports.ClusterConfigError = exports.SUBSCRIPTION_QUEUE_MAX_BYTES = void 0;
17
+ exports.connectInitialized = exports.connect = exports.ClusterClient = exports.WatchSubscriptionStream = exports.LogsSubscriptionStream = exports.AgentAttachSubscriptionStream = exports.Connection = exports.PROTOCOL_DIAGNOSTIC_CAPACITY = exports.CONNECTION_TRANSITIONS = exports.assertGraphSpec = exports.assertGraphProfileSupported = exports.assertGraphProfile = exports.ClusterUpgradeError = exports.ClusterTransportError = exports.ClusterTimeoutError = exports.ClusterStateError = exports.ClusterRpcError = exports.ClusterRequestError = exports.ClusterProtocolError = exports.ClusterInternalError = exports.ClusterError = exports.ClusterConfigError = exports.SUBSCRIPTION_QUEUE_MAX_BYTES = void 0;
18
18
  __exportStar(require("./generated/protocol.cjs"), exports);
19
19
  var queue_js_1 = require("./queue.cjs");
20
20
  Object.defineProperty(exports, "SUBSCRIPTION_QUEUE_MAX_BYTES", { enumerable: true, get: function () { return queue_js_1.SUBSCRIPTION_QUEUE_MAX_BYTES; } });
@@ -28,6 +28,7 @@ Object.defineProperty(exports, "ClusterRpcError", { enumerable: true, get: funct
28
28
  Object.defineProperty(exports, "ClusterStateError", { enumerable: true, get: function () { return errors_js_1.ClusterStateError; } });
29
29
  Object.defineProperty(exports, "ClusterTimeoutError", { enumerable: true, get: function () { return errors_js_1.ClusterTimeoutError; } });
30
30
  Object.defineProperty(exports, "ClusterTransportError", { enumerable: true, get: function () { return errors_js_1.ClusterTransportError; } });
31
+ Object.defineProperty(exports, "ClusterUpgradeError", { enumerable: true, get: function () { return errors_js_1.ClusterUpgradeError; } });
31
32
  var validators_js_1 = require("./validators.cjs");
32
33
  Object.defineProperty(exports, "assertGraphProfile", { enumerable: true, get: function () { return validators_js_1.assertGraphProfile; } });
33
34
  Object.defineProperty(exports, "assertGraphProfileSupported", { enumerable: true, get: function () { return validators_js_1.assertGraphProfileSupported; } });
@@ -35,7 +36,6 @@ Object.defineProperty(exports, "assertGraphSpec", { enumerable: true, get: funct
35
36
  __exportStar(require("./payload-value.cjs"), exports);
36
37
  __exportStar(require("./json-source.cjs"), exports);
37
38
  var connection_js_1 = require("./connection.cjs");
38
- Object.defineProperty(exports, "CLOSE_REASON_MAX_BYTES", { enumerable: true, get: function () { return connection_js_1.CLOSE_REASON_MAX_BYTES; } });
39
39
  Object.defineProperty(exports, "CONNECTION_TRANSITIONS", { enumerable: true, get: function () { return connection_js_1.CONNECTION_TRANSITIONS; } });
40
40
  Object.defineProperty(exports, "PROTOCOL_DIAGNOSTIC_CAPACITY", { enumerable: true, get: function () { return connection_js_1.PROTOCOL_DIAGNOSTIC_CAPACITY; } });
41
41
  Object.defineProperty(exports, "Connection", { enumerable: true, get: function () { return connection_js_1.Connection; } });
@@ -0,0 +1,13 @@
1
+ export * from './generated/protocol.js';
2
+ export { SUBSCRIPTION_QUEUE_MAX_BYTES } from './queue.js';
3
+ export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, ClusterUpgradeError, } from './errors.js';
4
+ export { assertGraphProfile, assertGraphProfileSupported, assertGraphSpec } from './validators.js';
5
+ export * from './payload-value.js';
6
+ export * from './json-source.js';
7
+ export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.js';
8
+ export type { CallOptions, ConnectionState, ConnectionCloseSnapshot, } from './connection.js';
9
+ export type { WebSocketLike } from './socket.js';
10
+ export { AgentAttachSubscriptionStream, LogsSubscriptionStream, WatchSubscriptionStream, } from './subscriptions.js';
11
+ export type { Subscription, SubscriptionClosedItem, SubscriptionItem, WatchSubscriptionItem, WatchSubscriptionClosedItem, } from './subscriptions.js';
12
+ export { ClusterClient, connect, connectInitialized } from './client.js';
13
+ export type { AgentAttachSubscription, CoherentWatchSubscription, ConnectInitializedResult, ConnectOptions, LogsSubscription, WatchSubscription, WebSocketFactoryOptions, } from './client.js';
@@ -0,0 +1,13 @@
1
+ export * from './generated/protocol.js';
2
+ export { SUBSCRIPTION_QUEUE_MAX_BYTES } from './queue.js';
3
+ export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, ClusterUpgradeError, } from './errors.js';
4
+ export { assertGraphProfile, assertGraphProfileSupported, assertGraphSpec } from './validators.js';
5
+ export * from './payload-value.js';
6
+ export * from './json-source.js';
7
+ export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.js';
8
+ export type { CallOptions, ConnectionState, ConnectionCloseSnapshot, } from './connection.js';
9
+ export type { WebSocketLike } from './socket.js';
10
+ export { AgentAttachSubscriptionStream, LogsSubscriptionStream, WatchSubscriptionStream, } from './subscriptions.js';
11
+ export type { Subscription, SubscriptionClosedItem, SubscriptionItem, WatchSubscriptionItem, WatchSubscriptionClosedItem, } from './subscriptions.js';
12
+ export { ClusterClient, connect, connectInitialized } from './client.js';
13
+ export type { AgentAttachSubscription, CoherentWatchSubscription, ConnectInitializedResult, ConnectOptions, LogsSubscription, WatchSubscription, WebSocketFactoryOptions, } from './client.js';
@@ -1,11 +1,11 @@
1
1
  export * from './generated/protocol.js';
2
2
  export { SUBSCRIPTION_QUEUE_MAX_BYTES } from './queue.js';
3
- export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, } from './errors.js';
3
+ export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, ClusterUpgradeError, } from './errors.js';
4
4
  export { assertGraphProfile, assertGraphProfileSupported, assertGraphSpec } from './validators.js';
5
5
  export * from './payload-value.js';
6
6
  export * from './json-source.js';
7
- export { CLOSE_REASON_MAX_BYTES, CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.js';
8
- export type { CallOptions, ConnectionState, } from './connection.js';
7
+ export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.js';
8
+ export type { CallOptions, ConnectionState, ConnectionCloseSnapshot, } from './connection.js';
9
9
  export type { WebSocketLike } from './socket.js';
10
10
  export { AgentAttachSubscriptionStream, LogsSubscriptionStream, WatchSubscriptionStream, } from './subscriptions.js';
11
11
  export type { Subscription, SubscriptionClosedItem, SubscriptionItem, WatchSubscriptionItem, WatchSubscriptionClosedItem, } from './subscriptions.js';
@@ -1,9 +1,9 @@
1
1
  export * from './generated/protocol.mjs';
2
2
  export { SUBSCRIPTION_QUEUE_MAX_BYTES } from './queue.mjs';
3
- export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, } from './errors.mjs';
3
+ export { ClusterConfigError, ClusterError, ClusterInternalError, ClusterProtocolError, ClusterRequestError, ClusterRpcError, ClusterStateError, ClusterTimeoutError, ClusterTransportError, ClusterUpgradeError, } from './errors.mjs';
4
4
  export { assertGraphProfile, assertGraphProfileSupported, assertGraphSpec } from './validators.mjs';
5
5
  export * from './payload-value.mjs';
6
6
  export * from './json-source.mjs';
7
- export { CLOSE_REASON_MAX_BYTES, CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.mjs';
7
+ export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, Connection } from './connection.mjs';
8
8
  export { AgentAttachSubscriptionStream, LogsSubscriptionStream, WatchSubscriptionStream, } from './subscriptions.mjs';
9
9
  export { ClusterClient, connect, connectInitialized } from './client.mjs';
@@ -7,6 +7,7 @@ exports.assertDistinctRequestSources = assertDistinctRequestSources;
7
7
  const errors_js_1 = require("./errors.cjs");
8
8
  const protocol_js_1 = require("./generated/protocol.cjs");
9
9
  exports.MAX_REQUEST_BYTES = protocol_js_1.MAX_FRAME_BYTES;
10
+ /** Decode one already-bounded request body with strict UTF-8 and JSON handling. */
10
11
  function decodeBoundedJson(bytes) {
11
12
  if (bytes.length > exports.MAX_REQUEST_BYTES) {
12
13
  throw new errors_js_1.ClusterRequestError(`request payload of ${bytes.length} bytes exceeds the ${exports.MAX_REQUEST_BYTES} byte limit`, 'OVERSIZED_JSON');
@@ -0,0 +1,5 @@
1
+ export declare const MAX_REQUEST_BYTES: 1048576;
2
+ /** Decode one already-bounded request body with strict UTF-8 and JSON handling. */
3
+ export declare function decodeBoundedJson(bytes: Uint8Array): unknown;
4
+ export declare function readBoundedSource(source: AsyncIterable<Uint8Array | string>): Promise<Uint8Array>;
5
+ export declare function assertDistinctRequestSources(graph: string, input: string | undefined): asserts input is string;
@@ -0,0 +1,5 @@
1
+ export declare const MAX_REQUEST_BYTES: 1048576;
2
+ /** Decode one already-bounded request body with strict UTF-8 and JSON handling. */
3
+ export declare function decodeBoundedJson(bytes: Uint8Array): unknown;
4
+ export declare function readBoundedSource(source: AsyncIterable<Uint8Array | string>): Promise<Uint8Array>;
5
+ export declare function assertDistinctRequestSources(graph: string, input: string | undefined): asserts input is string;
@@ -1,4 +1,5 @@
1
1
  export declare const MAX_REQUEST_BYTES: 1048576;
2
+ /** Decode one already-bounded request body with strict UTF-8 and JSON handling. */
2
3
  export declare function decodeBoundedJson(bytes: Uint8Array): unknown;
3
4
  export declare function readBoundedSource(source: AsyncIterable<Uint8Array | string>): Promise<Uint8Array>;
4
5
  export declare function assertDistinctRequestSources(graph: string, input: string | undefined): asserts input is string;
@@ -1,6 +1,7 @@
1
1
  import { ClusterRequestError } from './errors.mjs';
2
2
  import { MAX_FRAME_BYTES } from './generated/protocol.mjs';
3
3
  export const MAX_REQUEST_BYTES = MAX_FRAME_BYTES;
4
+ /** Decode one already-bounded request body with strict UTF-8 and JSON handling. */
4
5
  export function decodeBoundedJson(bytes) {
5
6
  if (bytes.length > MAX_REQUEST_BYTES) {
6
7
  throw new ClusterRequestError(`request payload of ${bytes.length} bytes exceeds the ${MAX_REQUEST_BYTES} byte limit`, 'OVERSIZED_JSON');
@@ -64,6 +64,7 @@ function evaluate(type, value, path) {
64
64
  }
65
65
  }
66
66
  }
67
+ /** Return the first deterministic schema issue without retaining the input value. */
67
68
  function firstInputValidationIssue(type, value, path = '') {
68
69
  const issue = evaluate(type, value, path);
69
70
  return issue ? { path: issue.path, code: issue.code } : null;
@@ -0,0 +1,8 @@
1
+ import type { PayloadType } from './generated/protocol.js';
2
+ export type InputValidationIssue = {
3
+ readonly path: string;
4
+ readonly code: 'TYPE_MISMATCH' | 'MISSING_REQUIRED_FIELD' | 'UNKNOWN_FIELD' | 'UNKNOWN_ENUM_LABEL';
5
+ };
6
+ /** Return the first deterministic schema issue without retaining the input value. */
7
+ export declare function firstInputValidationIssue(type: PayloadType, value: unknown, path?: string): InputValidationIssue | null;
8
+ export declare function assertInputValue(type: PayloadType, value: unknown): void;
@@ -0,0 +1,8 @@
1
+ import type { PayloadType } from './generated/protocol.js';
2
+ export type InputValidationIssue = {
3
+ readonly path: string;
4
+ readonly code: 'TYPE_MISMATCH' | 'MISSING_REQUIRED_FIELD' | 'UNKNOWN_FIELD' | 'UNKNOWN_ENUM_LABEL';
5
+ };
6
+ /** Return the first deterministic schema issue without retaining the input value. */
7
+ export declare function firstInputValidationIssue(type: PayloadType, value: unknown, path?: string): InputValidationIssue | null;
8
+ export declare function assertInputValue(type: PayloadType, value: unknown): void;
@@ -3,5 +3,6 @@ export type InputValidationIssue = {
3
3
  readonly path: string;
4
4
  readonly code: 'TYPE_MISMATCH' | 'MISSING_REQUIRED_FIELD' | 'UNKNOWN_FIELD' | 'UNKNOWN_ENUM_LABEL';
5
5
  };
6
+ /** Return the first deterministic schema issue without retaining the input value. */
6
7
  export declare function firstInputValidationIssue(type: PayloadType, value: unknown, path?: string): InputValidationIssue | null;
7
8
  export declare function assertInputValue(type: PayloadType, value: unknown): void;
@@ -60,6 +60,7 @@ function evaluate(type, value, path) {
60
60
  }
61
61
  }
62
62
  }
63
+ /** Return the first deterministic schema issue without retaining the input value. */
63
64
  export function firstInputValidationIssue(type, value, path = '') {
64
65
  const issue = evaluate(type, value, path);
65
66
  return issue ? { path: issue.path, code: issue.code } : null;
@@ -0,0 +1,15 @@
1
+ export declare const SUBSCRIPTION_QUEUE_MAX_BYTES: number;
2
+ export type QueueValue<T> = {
3
+ readonly done: false;
4
+ readonly value: T;
5
+ } | {
6
+ readonly done: true;
7
+ };
8
+ export declare class BoundedQueue<T> {
9
+ #private;
10
+ get retainedCount(): number;
11
+ push(value: T, bytes: number): 'buffered' | 'delivered' | 'overflow' | 'closed';
12
+ recv(): Promise<QueueValue<T>>;
13
+ endRetainingBuffer(): void;
14
+ closeAndDiscard(): void;
15
+ }
@@ -0,0 +1,15 @@
1
+ export declare const SUBSCRIPTION_QUEUE_MAX_BYTES: number;
2
+ export type QueueValue<T> = {
3
+ readonly done: false;
4
+ readonly value: T;
5
+ } | {
6
+ readonly done: true;
7
+ };
8
+ export declare class BoundedQueue<T> {
9
+ #private;
10
+ get retainedCount(): number;
11
+ push(value: T, bytes: number): 'buffered' | 'delivered' | 'overflow' | 'closed';
12
+ recv(): Promise<QueueValue<T>>;
13
+ endRetainingBuffer(): void;
14
+ closeAndDiscard(): void;
15
+ }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addSocketListener = addSocketListener;
4
+ exports.addSocketEmitterListener = addSocketEmitterListener;
4
5
  const errors_js_1 = require("./errors.cjs");
5
6
  function addSocketListener(socket, type, listener) {
6
7
  if (socket.addEventListener) {
@@ -13,3 +14,10 @@ function addSocketListener(socket, type, listener) {
13
14
  }
14
15
  throw new errors_js_1.ClusterConfigError('WebSocket implementation must support event listeners', 'INVALID_WEBSOCKET');
15
16
  }
17
+ function addSocketEmitterListener(socket, type, listener) {
18
+ if (socket.on) {
19
+ socket.on(type, listener);
20
+ return () => (socket.off ?? socket.removeListener)?.call(socket, type, listener);
21
+ }
22
+ return addSocketListener(socket, type, listener);
23
+ }
@@ -0,0 +1,13 @@
1
+ export interface WebSocketLike {
2
+ readonly readyState: number;
3
+ send(data: string, callback?: (error?: Error) => void): void | Promise<void>;
4
+ close(code?: number, reason?: string): void | Promise<void>;
5
+ terminate?(): void;
6
+ addEventListener?(type: string, listener: (...args: unknown[]) => void): void;
7
+ removeEventListener?(type: string, listener: (...args: unknown[]) => void): void;
8
+ on?(type: string, listener: (...args: unknown[]) => void): void;
9
+ off?(type: string, listener: (...args: unknown[]) => void): void;
10
+ removeListener?(type: string, listener: (...args: unknown[]) => void): void;
11
+ }
12
+ export declare function addSocketListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
13
+ export declare function addSocketEmitterListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
@@ -0,0 +1,13 @@
1
+ export interface WebSocketLike {
2
+ readonly readyState: number;
3
+ send(data: string, callback?: (error?: Error) => void): void | Promise<void>;
4
+ close(code?: number, reason?: string): void | Promise<void>;
5
+ terminate?(): void;
6
+ addEventListener?(type: string, listener: (...args: unknown[]) => void): void;
7
+ removeEventListener?(type: string, listener: (...args: unknown[]) => void): void;
8
+ on?(type: string, listener: (...args: unknown[]) => void): void;
9
+ off?(type: string, listener: (...args: unknown[]) => void): void;
10
+ removeListener?(type: string, listener: (...args: unknown[]) => void): void;
11
+ }
12
+ export declare function addSocketListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
13
+ export declare function addSocketEmitterListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
@@ -2,6 +2,7 @@ export interface WebSocketLike {
2
2
  readonly readyState: number;
3
3
  send(data: string, callback?: (error?: Error) => void): void | Promise<void>;
4
4
  close(code?: number, reason?: string): void | Promise<void>;
5
+ terminate?(): void;
5
6
  addEventListener?(type: string, listener: (...args: unknown[]) => void): void;
6
7
  removeEventListener?(type: string, listener: (...args: unknown[]) => void): void;
7
8
  on?(type: string, listener: (...args: unknown[]) => void): void;
@@ -9,3 +10,4 @@ export interface WebSocketLike {
9
10
  removeListener?(type: string, listener: (...args: unknown[]) => void): void;
10
11
  }
11
12
  export declare function addSocketListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
13
+ export declare function addSocketEmitterListener(socket: WebSocketLike, type: string, listener: (...args: unknown[]) => void): () => void;
@@ -10,3 +10,10 @@ export function addSocketListener(socket, type, listener) {
10
10
  }
11
11
  throw new ClusterConfigError('WebSocket implementation must support event listeners', 'INVALID_WEBSOCKET');
12
12
  }
13
+ export function addSocketEmitterListener(socket, type, listener) {
14
+ if (socket.on) {
15
+ socket.on(type, listener);
16
+ return () => (socket.off ?? socket.removeListener)?.call(socket, type, listener);
17
+ }
18
+ return addSocketListener(socket, type, listener);
19
+ }
@@ -0,0 +1,73 @@
1
+ import type { AgentAttachEvent, LogRecord, SubscriptionCloseReason, WatchEvent, WatchParams, WatchResult } from './generated/protocol.js';
2
+ import { Connection } from './connection.js';
3
+ import type { SubscriptionRegistration } from './connection.js';
4
+ import type { FrameRecord } from './frames.js';
5
+ export type SubscriptionClosedItem = {
6
+ readonly type: 'closed';
7
+ readonly reason: SubscriptionCloseReason;
8
+ };
9
+ export type WatchSubscriptionClosedItem = SubscriptionClosedItem & {
10
+ readonly lastDeliveredCursor?: string | null;
11
+ };
12
+ export type SubscriptionItem<T> = {
13
+ readonly type: 'event';
14
+ readonly event: T;
15
+ } | SubscriptionClosedItem;
16
+ export type WatchSubscriptionItem = {
17
+ readonly type: 'event';
18
+ readonly runId: string;
19
+ readonly cursor: string;
20
+ readonly event: WatchEvent;
21
+ } | WatchSubscriptionClosedItem;
22
+ export interface Subscription<T> extends AsyncIterator<SubscriptionItem<T>>, AsyncIterable<SubscriptionItem<T>> {
23
+ readonly subscriptionId: string;
24
+ readonly retainedCount: number;
25
+ cancel(): Promise<void>;
26
+ }
27
+ export interface WatchSubscription {
28
+ readonly result: WatchResult;
29
+ readonly stream: WatchSubscriptionStream;
30
+ }
31
+ type FrameParser<T> = (frame: FrameRecord) => SubscriptionItem<T>;
32
+ declare class SubscriptionStream<T> implements Subscription<T> {
33
+ #private;
34
+ protected readonly connection: Connection;
35
+ protected readonly registration: SubscriptionRegistration;
36
+ private readonly parse;
37
+ constructor(connection: Connection, registration: SubscriptionRegistration, parse: FrameParser<T>);
38
+ get subscriptionId(): string;
39
+ get retainedCount(): number;
40
+ [Symbol.asyncIterator](): this;
41
+ next(): Promise<IteratorResult<SubscriptionItem<T>>>;
42
+ return(): Promise<IteratorResult<SubscriptionItem<T>>>;
43
+ throw(error?: unknown): Promise<IteratorResult<SubscriptionItem<T>>>;
44
+ cancel(): Promise<void>;
45
+ }
46
+ export declare class LogsSubscriptionStream extends SubscriptionStream<LogRecord> {
47
+ constructor(connection: Connection, registration: SubscriptionRegistration);
48
+ }
49
+ export declare class AgentAttachSubscriptionStream extends SubscriptionStream<AgentAttachEvent> {
50
+ constructor(connection: Connection, registration: SubscriptionRegistration);
51
+ }
52
+ type WatchStreamInit = {
53
+ readonly connection: Connection;
54
+ readonly registration: SubscriptionRegistration;
55
+ readonly result: WatchResult;
56
+ readonly params: WatchParams;
57
+ readonly lastSeenRunId?: string;
58
+ readonly lastSeenCursor?: string;
59
+ };
60
+ export declare class WatchSubscriptionStream implements AsyncIterator<WatchSubscriptionItem>, AsyncIterable<WatchSubscriptionItem> {
61
+ #private;
62
+ constructor(init: WatchStreamInit);
63
+ get subscriptionId(): string;
64
+ get retainedCount(): number;
65
+ get lastDeliveredCursor(): string | null | undefined;
66
+ [Symbol.asyncIterator](): this;
67
+ next(): Promise<IteratorResult<WatchSubscriptionItem>>;
68
+ return(): Promise<IteratorResult<WatchSubscriptionItem>>;
69
+ throw(error?: unknown): Promise<IteratorResult<WatchSubscriptionItem>>;
70
+ cancel(): Promise<void>;
71
+ reconnect(freshConnection: Connection): Promise<WatchSubscription>;
72
+ }
73
+ export {};
@@ -0,0 +1,73 @@
1
+ import type { AgentAttachEvent, LogRecord, SubscriptionCloseReason, WatchEvent, WatchParams, WatchResult } from './generated/protocol.js';
2
+ import { Connection } from './connection.js';
3
+ import type { SubscriptionRegistration } from './connection.js';
4
+ import type { FrameRecord } from './frames.js';
5
+ export type SubscriptionClosedItem = {
6
+ readonly type: 'closed';
7
+ readonly reason: SubscriptionCloseReason;
8
+ };
9
+ export type WatchSubscriptionClosedItem = SubscriptionClosedItem & {
10
+ readonly lastDeliveredCursor?: string | null;
11
+ };
12
+ export type SubscriptionItem<T> = {
13
+ readonly type: 'event';
14
+ readonly event: T;
15
+ } | SubscriptionClosedItem;
16
+ export type WatchSubscriptionItem = {
17
+ readonly type: 'event';
18
+ readonly runId: string;
19
+ readonly cursor: string;
20
+ readonly event: WatchEvent;
21
+ } | WatchSubscriptionClosedItem;
22
+ export interface Subscription<T> extends AsyncIterator<SubscriptionItem<T>>, AsyncIterable<SubscriptionItem<T>> {
23
+ readonly subscriptionId: string;
24
+ readonly retainedCount: number;
25
+ cancel(): Promise<void>;
26
+ }
27
+ export interface WatchSubscription {
28
+ readonly result: WatchResult;
29
+ readonly stream: WatchSubscriptionStream;
30
+ }
31
+ type FrameParser<T> = (frame: FrameRecord) => SubscriptionItem<T>;
32
+ declare class SubscriptionStream<T> implements Subscription<T> {
33
+ #private;
34
+ protected readonly connection: Connection;
35
+ protected readonly registration: SubscriptionRegistration;
36
+ private readonly parse;
37
+ constructor(connection: Connection, registration: SubscriptionRegistration, parse: FrameParser<T>);
38
+ get subscriptionId(): string;
39
+ get retainedCount(): number;
40
+ [Symbol.asyncIterator](): this;
41
+ next(): Promise<IteratorResult<SubscriptionItem<T>>>;
42
+ return(): Promise<IteratorResult<SubscriptionItem<T>>>;
43
+ throw(error?: unknown): Promise<IteratorResult<SubscriptionItem<T>>>;
44
+ cancel(): Promise<void>;
45
+ }
46
+ export declare class LogsSubscriptionStream extends SubscriptionStream<LogRecord> {
47
+ constructor(connection: Connection, registration: SubscriptionRegistration);
48
+ }
49
+ export declare class AgentAttachSubscriptionStream extends SubscriptionStream<AgentAttachEvent> {
50
+ constructor(connection: Connection, registration: SubscriptionRegistration);
51
+ }
52
+ type WatchStreamInit = {
53
+ readonly connection: Connection;
54
+ readonly registration: SubscriptionRegistration;
55
+ readonly result: WatchResult;
56
+ readonly params: WatchParams;
57
+ readonly lastSeenRunId?: string;
58
+ readonly lastSeenCursor?: string;
59
+ };
60
+ export declare class WatchSubscriptionStream implements AsyncIterator<WatchSubscriptionItem>, AsyncIterable<WatchSubscriptionItem> {
61
+ #private;
62
+ constructor(init: WatchStreamInit);
63
+ get subscriptionId(): string;
64
+ get retainedCount(): number;
65
+ get lastDeliveredCursor(): string | null | undefined;
66
+ [Symbol.asyncIterator](): this;
67
+ next(): Promise<IteratorResult<WatchSubscriptionItem>>;
68
+ return(): Promise<IteratorResult<WatchSubscriptionItem>>;
69
+ throw(error?: unknown): Promise<IteratorResult<WatchSubscriptionItem>>;
70
+ cancel(): Promise<void>;
71
+ reconnect(freshConnection: Connection): Promise<WatchSubscription>;
72
+ }
73
+ export {};
@@ -24,6 +24,10 @@ export interface Subscription<T> extends AsyncIterator<SubscriptionItem<T>>, Asy
24
24
  readonly retainedCount: number;
25
25
  cancel(): Promise<void>;
26
26
  }
27
+ export interface WatchSubscription {
28
+ readonly result: WatchResult;
29
+ readonly stream: WatchSubscriptionStream;
30
+ }
27
31
  type FrameParser<T> = (frame: FrameRecord) => SubscriptionItem<T>;
28
32
  declare class SubscriptionStream<T> implements Subscription<T> {
29
33
  #private;
@@ -64,6 +68,6 @@ export declare class WatchSubscriptionStream implements AsyncIterator<WatchSubsc
64
68
  return(): Promise<IteratorResult<WatchSubscriptionItem>>;
65
69
  throw(error?: unknown): Promise<IteratorResult<WatchSubscriptionItem>>;
66
70
  cancel(): Promise<void>;
67
- reconnect(freshConnection: Connection): Promise<import('./client.js').WatchSubscription>;
71
+ reconnect(freshConnection: Connection): Promise<WatchSubscription>;
68
72
  }
69
73
  export {};
@@ -54,6 +54,7 @@ function assertRequestDefinition(definition, value, code) {
54
54
  const details = (validate.errors ?? []).map((error) => `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`).join('; ');
55
55
  throw new errors_js_1.ClusterRequestError(`${definition} validation failed: ${details}`, code);
56
56
  }
57
+ /** Validate an execution graph against the frozen cluster protocol schema. */
57
58
  function assertGraphSpec(value) {
58
59
  assertRequestDefinition('GraphSpec', value, 'INVALID_GRAPH');
59
60
  }
@@ -0,0 +1,7 @@
1
+ import type { ClusterMethod, GraphProfile, GraphSpec, ServerCapabilities } from './generated/protocol.js';
2
+ export declare function assertDefinition(definition: string, value: unknown): void;
3
+ export declare function assertMethodResult(method: ClusterMethod, value: unknown): void;
4
+ /** Validate an execution graph against the frozen cluster protocol schema. */
5
+ export declare function assertGraphSpec(value: unknown): asserts value is GraphSpec;
6
+ export declare function assertGraphProfile(value: unknown): asserts value is GraphProfile;
7
+ export declare function assertGraphProfileSupported(profile: GraphProfile, capabilities: ServerCapabilities): void;
@@ -0,0 +1,7 @@
1
+ import type { ClusterMethod, GraphProfile, GraphSpec, ServerCapabilities } from './generated/protocol.js';
2
+ export declare function assertDefinition(definition: string, value: unknown): void;
3
+ export declare function assertMethodResult(method: ClusterMethod, value: unknown): void;
4
+ /** Validate an execution graph against the frozen cluster protocol schema. */
5
+ export declare function assertGraphSpec(value: unknown): asserts value is GraphSpec;
6
+ export declare function assertGraphProfile(value: unknown): asserts value is GraphProfile;
7
+ export declare function assertGraphProfileSupported(profile: GraphProfile, capabilities: ServerCapabilities): void;
@@ -1,6 +1,7 @@
1
1
  import type { ClusterMethod, GraphProfile, GraphSpec, ServerCapabilities } from './generated/protocol.js';
2
2
  export declare function assertDefinition(definition: string, value: unknown): void;
3
3
  export declare function assertMethodResult(method: ClusterMethod, value: unknown): void;
4
+ /** Validate an execution graph against the frozen cluster protocol schema. */
4
5
  export declare function assertGraphSpec(value: unknown): asserts value is GraphSpec;
5
6
  export declare function assertGraphProfile(value: unknown): asserts value is GraphProfile;
6
7
  export declare function assertGraphProfileSupported(profile: GraphProfile, capabilities: ServerCapabilities): void;
@@ -47,6 +47,7 @@ function assertRequestDefinition(definition, value, code) {
47
47
  const details = (validate.errors ?? []).map((error) => `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`).join('; ');
48
48
  throw new ClusterRequestError(`${definition} validation failed: ${details}`, code);
49
49
  }
50
+ /** Validate an execution graph against the frozen cluster protocol schema. */
50
51
  export function assertGraphSpec(value) {
51
52
  assertRequestDefinition('GraphSpec', value, 'INVALID_GRAPH');
52
53
  }
@@ -12,14 +12,9 @@ function messageKey(message) {
12
12
  function terminalEventFromMessage(message) {
13
13
  const data = message.content?.data || {};
14
14
  if (message.topic === 'CLUSTER_COMPLETE') {
15
- let prSummary = null;
16
- if (typeof data.pr_url === 'string' && data.pr_url) {
17
- const number = Number.isSafeInteger(data.pr_number) ? ` #${data.pr_number}` : '';
18
- prSummary = `Pull request${number} created: ${data.pr_url}`;
19
- }
20
15
  return {
21
16
  type: 'complete',
22
- summary: prSummary || data.reason || message.content?.text,
17
+ summary: data.reason || message.content?.text,
23
18
  ...(Object.prototype.hasOwnProperty.call(data, 'result') ? { result: data.result } : {}),
24
19
  ...(Object.prototype.hasOwnProperty.call(data, 'artifacts')
25
20
  ? { artifacts: data.artifacts }
@@ -233,16 +228,16 @@ class CurrentEngineAdapter {
233
228
  this.stopPromise ||= this.stopResource();
234
229
  return this.stopPromise;
235
230
  }
236
-
237
231
  async waitForAllocatedCluster() {
238
232
  let cluster = this.orchestrator.getCluster(this.resource.clusterId);
239
233
  while (!cluster && !this.startSettled && !this.closed) {
240
- await new Promise((resolve) => setTimeout(resolve, 10));
234
+ await new Promise((resolve) => {
235
+ setTimeout(resolve, 10);
236
+ });
241
237
  cluster = this.orchestrator.getCluster(this.resource.clusterId);
242
238
  }
243
239
  return cluster;
244
240
  }
245
-
246
241
  stopAllocatedCluster(cluster = this.orchestrator.getCluster(this.resource.clusterId)) {
247
242
  if (!cluster) return Promise.resolve(false);
248
243
  if (cluster.state === 'stopped' || cluster.state === 'killed') return Promise.resolve(true);
@@ -251,7 +246,6 @@ class CurrentEngineAdapter {
251
246
  .then(() => true);
252
247
  return this.allocatedStopPromise;
253
248
  }
254
-
255
249
  async stopResource() {
256
250
  this.cleanupPromise ||= this.waitForAllocatedCluster()
257
251
  .then((cluster) => this.stopAllocatedCluster(cluster))
@@ -24,44 +24,6 @@ const DEFAULT_PROVIDER_PROFILES = Object.freeze({
24
24
  }),
25
25
  });
26
26
 
27
- const HOSTED_CODEX_OPENROUTER_PROFILE = 'provider.codex-openrouter@1';
28
- const HOSTED_CODEX_OPENROUTER_PR_PROFILE = 'provider.codex-openrouter-pr@1';
29
- const DEFAULT_HOSTED_MODEL = 'openai/gpt-5.4';
30
-
31
- function providerProfilesFromEnvironment(environment = process.env) {
32
- if (environment.ZEROSHOT_HOSTED_CODEX_OPENROUTER !== '1') {
33
- return DEFAULT_PROVIDER_PROFILES;
34
- }
35
- const model = environment.ZEROSHOT_HOSTED_MODEL || DEFAULT_HOSTED_MODEL;
36
- const levelOverrides = Object.freeze({
37
- level1: Object.freeze({ model, reasoningEffort: 'medium' }),
38
- level2: Object.freeze({ model, reasoningEffort: 'high' }),
39
- level3: Object.freeze({ model, reasoningEffort: 'xhigh' }),
40
- });
41
- const hostedSettings = {
42
- templateParams: { task_type: 'TASK' },
43
- providerSettings: {
44
- codex: {
45
- defaultLevel: 'level2',
46
- levelOverrides,
47
- },
48
- },
49
- };
50
- return deepFreeze({
51
- ...DEFAULT_PROVIDER_PROFILES,
52
- [HOSTED_CODEX_OPENROUTER_PROFILE]: {
53
- configName: 'base-templates/single-worker',
54
- providerOverride: 'codex',
55
- settings: hostedSettings,
56
- },
57
- [HOSTED_CODEX_OPENROUTER_PR_PROFILE]: {
58
- configName: 'base-templates/worker-validator',
59
- providerOverride: 'codex',
60
- settings: hostedSettings,
61
- },
62
- });
63
- }
64
-
65
27
  function own(map, key) {
66
28
  return Object.prototype.hasOwnProperty.call(map, key) ? map[key] : null;
67
29
  }
@@ -76,7 +38,7 @@ function validateBounds(bounds) {
76
38
 
77
39
  function createDeploymentProfileRegistry(options = {}) {
78
40
  const isolationProfiles = options.isolationProfiles || DEFAULT_ISOLATION_PROFILES;
79
- const providerProfiles = options.providerProfiles || providerProfilesFromEnvironment();
41
+ const providerProfiles = options.providerProfiles || DEFAULT_PROVIDER_PROFILES;
80
42
  const defaultBounds = { ...DEFAULT_BOUNDS, ...(options.bounds || {}) };
81
43
  validateBounds(defaultBounds);
82
44
  const bounds = deepFreeze(defaultBounds);
@@ -115,8 +77,5 @@ module.exports = {
115
77
  DEFAULT_BOUNDS,
116
78
  DEFAULT_ISOLATION_PROFILES,
117
79
  DEFAULT_PROVIDER_PROFILES,
118
- HOSTED_CODEX_OPENROUTER_PROFILE,
119
- HOSTED_CODEX_OPENROUTER_PR_PROFILE,
120
80
  createDeploymentProfileRegistry,
121
- providerProfilesFromEnvironment,
122
81
  };