@jeffusion/bungee-core 6.19.3 → 6.19.4

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 (445) hide show
  1. package/dist/access-database.d.ts +22 -0
  2. package/dist/api/handlers/logs.d.ts +66 -0
  3. package/dist/api/handlers/stats.d.ts +50 -0
  4. package/dist/api/logs.d.ts +145 -0
  5. package/dist/api/types.d.ts +21 -0
  6. package/dist/{chunk-assets-swq50rh3.js → chunk-assets-vsan7gav.js} +11 -11
  7. package/dist/{chunk-body-capture-gtta9q26.js → chunk-body-capture-sbk6cdf9.js} +2 -2
  8. package/dist/{chunk-handler-ehkkxpnq.js → chunk-handler-9k6b95w4.js} +2 -2
  9. package/dist/{chunk-main-rcw37zhd.js → chunk-main-1p15rgq5.js} +1 -1
  10. package/dist/{chunk-main-10pgdbgn.js → chunk-main-2efrk1nt.js} +1 -1
  11. package/dist/{chunk-main-a4eygw79.js → chunk-main-d74e7qxc.js} +1 -1
  12. package/dist/{chunk-main-p5rpfk7t.js → chunk-main-gwaw6pxp.js} +1 -1
  13. package/dist/{chunk-main-25kbhd4n.js → chunk-main-mqgkewnx.js} +1 -1
  14. package/dist/{chunk-main-0w3jk2x4.js → chunk-main-qm1tgaka.js} +2 -2
  15. package/dist/{chunk-master-276v10xm.js → chunk-master-wtcfwd6g.js} +6 -6
  16. package/dist/{chunk-plugin-context-manager-nexyp0jb.js → chunk-plugin-context-manager-kabrbg0s.js} +1 -1
  17. package/dist/{chunk-plugin-manager-dvxc5w6p.js → chunk-plugin-manager-q1bt6xnw.js} +2 -2
  18. package/dist/{chunk-runtime-upgrade-sjxsa2r6.js → chunk-runtime-upgrade-rvm3d096.js} +3 -3
  19. package/dist/{chunk-runtime-qbfd9z3p.js → chunk-runtime-xmp308t7.js} +2 -2
  20. package/dist/{chunk-worker-5mdsmhte.js → chunk-worker-99q8qnj9.js} +9 -9
  21. package/dist/config-publication/admission-handoff.d.ts +13 -0
  22. package/dist/config-publication/coordinator-types.d.ts +176 -0
  23. package/dist/config-publication/current-startup.d.ts +26 -0
  24. package/dist/config-publication/drain-workers.d.ts +15 -0
  25. package/dist/config-publication/index.d.ts +6 -0
  26. package/dist/config-publication/master-coordinator.d.ts +45 -0
  27. package/dist/config-publication/master-messages.d.ts +2 -0
  28. package/dist/config-publication/message-fields.d.ts +20 -0
  29. package/dist/config-publication/messages.d.ts +3 -0
  30. package/dist/config-publication/process-cleanup.d.ts +30 -0
  31. package/dist/config-publication/process-identity.d.ts +14 -0
  32. package/dist/config-publication/process-termination.d.ts +7 -0
  33. package/dist/config-publication/publication-runner.d.ts +50 -0
  34. package/dist/config-publication/recovery-disposition.d.ts +17 -0
  35. package/dist/config-publication/types.d.ts +137 -0
  36. package/dist/config-publication/waiter-safety.d.ts +2 -0
  37. package/dist/config-publication/worker-messages.d.ts +2 -0
  38. package/dist/config-publication/worker-runtime-contract.d.ts +76 -0
  39. package/dist/config-publication/worker-runtime-plugins.d.ts +8 -0
  40. package/dist/config-publication/worker-runtime.d.ts +22 -0
  41. package/dist/config-publication/worker-wait.d.ts +44 -0
  42. package/dist/config-storage/active-publication.d.ts +37 -0
  43. package/dist/config-storage/aggregate.d.ts +4 -0
  44. package/dist/config-storage/async-config-repository.d.ts +125 -0
  45. package/dist/config-storage/commit-transaction.d.ts +13 -0
  46. package/dist/config-storage/compiler.d.ts +4 -0
  47. package/dist/config-storage/config-repository.d.ts +118 -0
  48. package/dist/config-storage/consistent-read.d.ts +2 -0
  49. package/dist/config-storage/content-hash.d.ts +17 -0
  50. package/dist/config-storage/cross-table-audit.d.ts +20 -0
  51. package/dist/config-storage/current-revision.d.ts +2 -0
  52. package/dist/config-storage/domain-validation.d.ts +5 -0
  53. package/dist/config-storage/expression-ast.d.ts +2 -0
  54. package/dist/config-storage/expression-call-policy.d.ts +2 -0
  55. package/dist/config-storage/expression-syntax.d.ts +2 -0
  56. package/dist/config-storage/gateway-target-validation.d.ts +5 -0
  57. package/dist/config-storage/global-scalars.d.ts +6 -0
  58. package/dist/config-storage/global-validation.d.ts +2 -0
  59. package/dist/config-storage/immutable-snapshot.d.ts +4 -0
  60. package/dist/config-storage/index.d.ts +21 -0
  61. package/dist/config-storage/json-preflight.d.ts +15 -0
  62. package/dist/config-storage/management-protection.d.ts +10 -0
  63. package/dist/config-storage/materialize.d.ts +3 -0
  64. package/dist/config-storage/menu-store.d.ts +12 -0
  65. package/dist/config-storage/migrations/baseline.d.ts +8 -0
  66. package/dist/config-storage/migrations/index.d.ts +8 -0
  67. package/dist/config-storage/migrations/management-protection.d.ts +2 -0
  68. package/dist/config-storage/migrations/plan.d.ts +9 -0
  69. package/dist/config-storage/migrations/prepared-worker-allocation.d.ts +2 -0
  70. package/dist/config-storage/migrations/publication-retirement.d.ts +3 -0
  71. package/dist/config-storage/migrations/publication-targets.d.ts +3 -0
  72. package/dist/config-storage/migrations/request-logs-default.d.ts +2 -0
  73. package/dist/config-storage/migrations/runtime-cutover.d.ts +2 -0
  74. package/dist/config-storage/migrations/service-references.d.ts +3 -0
  75. package/dist/config-storage/migrations/ui-menus.d.ts +2 -0
  76. package/dist/config-storage/migrations/websocket-connections.d.ts +2 -0
  77. package/dist/config-storage/migrations/websocket-message-size.d.ts +2 -0
  78. package/dist/config-storage/migrations/worker-launch-capacity.d.ts +2 -0
  79. package/dist/config-storage/modification-validation.d.ts +4 -0
  80. package/dist/config-storage/operation-records.d.ts +42 -0
  81. package/dist/config-storage/operation-relations.d.ts +6 -0
  82. package/dist/config-storage/operation-store.d.ts +12 -0
  83. package/dist/config-storage/persisted-json.d.ts +2 -0
  84. package/dist/config-storage/persisted-validation.d.ts +7 -0
  85. package/dist/config-storage/plugin-name.d.ts +2 -0
  86. package/dist/config-storage/plugin-schema.d.ts +16 -0
  87. package/dist/config-storage/policy-fields.d.ts +15 -0
  88. package/dist/config-storage/prepared-command.d.ts +14 -0
  89. package/dist/config-storage/read-materialization.d.ts +4 -0
  90. package/dist/config-storage/recovery-store.d.ts +21 -0
  91. package/dist/config-storage/relation-materialization.d.ts +30 -0
  92. package/dist/config-storage/repository-snapshot.d.ts +5 -0
  93. package/dist/config-storage/repository-types.d.ts +216 -0
  94. package/dist/config-storage/repository-validation.d.ts +6 -0
  95. package/dist/config-storage/request-logs-default.d.ts +5 -0
  96. package/dist/config-storage/retirement-store.d.ts +78 -0
  97. package/dist/config-storage/route-policy-validation.d.ts +2 -0
  98. package/dist/config-storage/runtime-config.d.ts +14 -0
  99. package/dist/config-storage/runtime-cutover.d.ts +13 -0
  100. package/dist/config-storage/runtime-recovery-budget.d.ts +35 -0
  101. package/dist/config-storage/schema-fingerprint.d.ts +5 -0
  102. package/dist/config-storage/schema.d.ts +2 -0
  103. package/dist/config-storage/service-policy-validation.d.ts +4 -0
  104. package/dist/config-storage/service-reference-upgrade.d.ts +4 -0
  105. package/dist/config-storage/serving-snapshot.d.ts +9 -0
  106. package/dist/config-storage/snapshot-validation.d.ts +3 -0
  107. package/dist/config-storage/sqlite-errors.d.ts +3 -0
  108. package/dist/config-storage/sqlite-query.d.ts +3 -0
  109. package/dist/config-storage/sqlite-version.d.ts +10 -0
  110. package/dist/config-storage/storage-protocol.d.ts +52 -0
  111. package/dist/config-storage/utf16.d.ts +2 -0
  112. package/dist/config-storage/validation.d.ts +31 -0
  113. package/dist/config-storage/worker-launch-store.d.ts +93 -0
  114. package/dist/config-worker/http-provider.d.ts +6 -0
  115. package/dist/config-worker/lifecycle.d.ts +84 -0
  116. package/dist/config-worker/private-transport.d.ts +31 -0
  117. package/dist/config-worker/process-environment.d.ts +38 -0
  118. package/dist/config-worker/rate-limit-provider.d.ts +31 -0
  119. package/dist/config-worker/runtime-dependencies.d.ts +12 -0
  120. package/dist/config-worker/snapshot-compiler.d.ts +5 -0
  121. package/dist/config-worker/supervised-process-entry.d.ts +8 -0
  122. package/dist/core-version.d.ts +1 -0
  123. package/dist/daemon-control/bootstrap.d.ts +41 -0
  124. package/dist/daemon-control/index.d.ts +1 -0
  125. package/dist/daemon-control/launch-identity.d.ts +26 -0
  126. package/dist/daemon-control/shutdown.d.ts +22 -0
  127. package/dist/data-admission/errors.d.ts +16 -0
  128. package/dist/data-admission/host.d.ts +92 -0
  129. package/dist/data-admission/keyed-state.d.ts +21 -0
  130. package/dist/data-admission/rpc.d.ts +40 -0
  131. package/dist/data-admission/worker.d.ts +66 -0
  132. package/dist/database-schema.d.ts +2 -0
  133. package/dist/expression-engine.d.ts +33 -0
  134. package/dist/gateway/admission-plugin.d.ts +7 -0
  135. package/dist/gateway/auxiliary-request.d.ts +7 -0
  136. package/dist/gateway/body-contracts.d.ts +39 -0
  137. package/dist/gateway/body-events.d.ts +58 -0
  138. package/dist/gateway/body-factory.d.ts +4 -0
  139. package/dist/gateway/body-observation-stream.d.ts +6 -0
  140. package/dist/gateway/body-plugin.d.ts +8 -0
  141. package/dist/gateway/body-resources.d.ts +37 -0
  142. package/dist/gateway/body-service.d.ts +116 -0
  143. package/dist/gateway/contracts.d.ts +196 -0
  144. package/dist/gateway/controlled-views.d.ts +5 -0
  145. package/dist/gateway/dispatch-plugin.d.ts +11 -0
  146. package/dist/gateway/dispatch-targets.d.ts +4 -0
  147. package/dist/gateway/forward-plugin.d.ts +136 -0
  148. package/dist/gateway/plugin.d.ts +23 -0
  149. package/dist/gateway/plugin.js +18 -18
  150. package/dist/gateway/request-log-contracts.d.ts +346 -0
  151. package/dist/gateway/request-log.d.ts +105 -0
  152. package/dist/gateway/request-plugin.d.ts +98 -0
  153. package/dist/gateway/request-rules-plugin.d.ts +61 -0
  154. package/dist/gateway/response-plugin.d.ts +34 -0
  155. package/dist/gateway/response-views.d.ts +33 -0
  156. package/dist/gateway/responses-websocket-session.d.ts +24 -0
  157. package/dist/gateway/retry-action.d.ts +7 -0
  158. package/dist/gateway/retry-plugin.d.ts +7 -0
  159. package/dist/gateway/routing-plugin.d.ts +11 -0
  160. package/dist/gateway/runtime.d.ts +15 -0
  161. package/dist/gateway/selection-plugin.d.ts +7 -0
  162. package/dist/gateway/sse-response.d.ts +6 -0
  163. package/dist/gateway/websocket-contracts.d.ts +71 -0
  164. package/dist/gateway/websocket-credential.d.ts +3 -0
  165. package/dist/gateway/websocket-plugin.d.ts +9 -0
  166. package/dist/hooks/impl.d.ts +119 -0
  167. package/dist/hooks/index.d.ts +7 -0
  168. package/dist/hooks/plugin-hooks.d.ts +308 -0
  169. package/dist/hooks/types.d.ts +130 -0
  170. package/dist/ingress/admission-registry.d.ts +56 -0
  171. package/dist/ingress/admission-set.d.ts +29 -0
  172. package/dist/ingress/index.d.ts +4 -0
  173. package/dist/ingress/master-controller.d.ts +278 -0
  174. package/dist/ingress/runtime.d.ts +29 -0
  175. package/dist/ingress/supervision-http.d.ts +118 -0
  176. package/dist/ingress.d.ts +5 -0
  177. package/dist/instance-lock.d.ts +2 -0
  178. package/dist/logger/access-log-writer.d.ts +120 -0
  179. package/dist/logger/body-capture.d.ts +21 -0
  180. package/dist/logger/body-log-redaction.d.ts +6 -0
  181. package/dist/logger/body-storage.d.ts +71 -0
  182. package/dist/logger/content-capture.d.ts +47 -0
  183. package/dist/logger/dated-log-files.d.ts +5 -0
  184. package/dist/logger/header-storage.d.ts +54 -0
  185. package/dist/logger/log-cleanup.d.ts +69 -0
  186. package/dist/logger/log-url.d.ts +2 -0
  187. package/dist/logger/request-logger.d.ts +308 -0
  188. package/dist/logger/transport-outcome.d.ts +25 -0
  189. package/dist/logger/websocket-body-capture.d.ts +26 -0
  190. package/dist/logger.d.ts +16 -0
  191. package/dist/main.d.ts +19 -0
  192. package/dist/main.js +8 -8
  193. package/dist/management-listener/index.d.ts +2 -0
  194. package/dist/management-listener/listener.d.ts +48 -0
  195. package/dist/management-listener/request-source.d.ts +4 -0
  196. package/dist/master-runtime/component-recovery.d.ts +40 -0
  197. package/dist/master-runtime/composition.d.ts +129 -0
  198. package/dist/master-runtime/configuration-recovery.d.ts +80 -0
  199. package/dist/master-runtime/control-api-body.d.ts +9 -0
  200. package/dist/master-runtime/control-api.d.ts +122 -0
  201. package/dist/master-runtime/error-chain.d.ts +9 -0
  202. package/dist/master-runtime/initialize-configuration.d.ts +4 -0
  203. package/dist/master-runtime/instance-lock.d.ts +25 -0
  204. package/dist/master-runtime/kernel-exit-timer.d.ts +7 -0
  205. package/dist/master-runtime/kernel-monotonic-clock.d.ts +15 -0
  206. package/dist/master-runtime/management-auth.d.ts +43 -0
  207. package/dist/master-runtime/master-plugin-catalog-api.d.ts +18 -0
  208. package/dist/master-runtime/master-stats.d.ts +52 -0
  209. package/dist/master-runtime/menu-api.d.ts +19 -0
  210. package/dist/master-runtime/observability-client.d.ts +49 -0
  211. package/dist/master-runtime/offline-recovery.d.ts +9 -0
  212. package/dist/master-runtime/offline-storage-session.d.ts +8 -0
  213. package/dist/master-runtime/plugin-journal-recovery.d.ts +28 -0
  214. package/dist/master-runtime/process-identity.d.ts +48 -0
  215. package/dist/master-runtime/process-options.d.ts +59 -0
  216. package/dist/master-runtime/publication-task-manager.d.ts +47 -0
  217. package/dist/master-runtime/reconcile-plugin-dependencies.d.ts +7 -0
  218. package/dist/master-runtime/recovery-prompt.d.ts +9 -0
  219. package/dist/master-runtime/route-body-plan.d.ts +31 -0
  220. package/dist/master-runtime/runtime-cleanup.d.ts +3 -0
  221. package/dist/master-runtime/runtime-contracts.d.ts +101 -0
  222. package/dist/master-runtime/runtime-evidence.d.ts +8 -0
  223. package/dist/master-runtime/runtime-status.d.ts +36 -0
  224. package/dist/master-runtime/runtime-supervisor.d.ts +30 -0
  225. package/dist/master-runtime/runtime-upgrade.d.ts +11 -0
  226. package/dist/master-runtime/runtime-upstreams.d.ts +14 -0
  227. package/dist/master-runtime/runtime.d.ts +23 -0
  228. package/dist/master-runtime/shutdown-diagnostics.d.ts +28 -0
  229. package/dist/master-runtime/signal-handlers.d.ts +18 -0
  230. package/dist/master-runtime/stopped-instance-lock.d.ts +6 -0
  231. package/dist/master-runtime/stopped-process.d.ts +2 -0
  232. package/dist/master-runtime/supervised-worker-client.d.ts +108 -0
  233. package/dist/master-runtime/supervised-worker-discovery.d.ts +41 -0
  234. package/dist/master-runtime/supervised-worker-factory.d.ts +298 -0
  235. package/dist/master-runtime/supervised-worker-process-adapter.d.ts +146 -0
  236. package/dist/master-runtime/worker-initialization-diagnostics.d.ts +18 -0
  237. package/dist/master.d.ts +2 -0
  238. package/dist/oauth-callback.d.ts +8 -0
  239. package/dist/plugin-artifact-contract.d.ts +4 -0
  240. package/dist/plugin-artifact-negotiation.d.ts +12 -0
  241. package/dist/plugin-artifact-types.d.ts +61 -0
  242. package/dist/plugin-context-manager.d.ts +91 -0
  243. package/dist/plugin-control/artifact-loader.d.ts +3 -0
  244. package/dist/plugin-control/contracts.d.ts +180 -0
  245. package/dist/plugin-control/host.d.ts +90 -0
  246. package/dist/plugin-control/index.d.ts +3 -0
  247. package/dist/plugin-control/master-invocation-projector.d.ts +52 -0
  248. package/dist/plugin-control/request-service-authority.d.ts +33 -0
  249. package/dist/plugin-control/secret-crypto.d.ts +13 -0
  250. package/dist/plugin-control/secret-store.d.ts +15 -0
  251. package/dist/plugin-dependencies.d.ts +30 -0
  252. package/dist/plugin-durable-state.d.ts +62 -0
  253. package/dist/plugin-extensions.d.ts +99 -0
  254. package/dist/plugin-logger.d.ts +17 -0
  255. package/dist/plugin-manifest-catalog/catalog.d.ts +28 -0
  256. package/dist/plugin-manifest-catalog/config-constraint-parser.d.ts +3 -0
  257. package/dist/plugin-manifest-catalog/config-default-validator.d.ts +3 -0
  258. package/dist/plugin-manifest-catalog/config-field-parser.d.ts +3 -0
  259. package/dist/plugin-manifest-catalog/config-field-references.d.ts +2 -0
  260. package/dist/plugin-manifest-catalog/index.d.ts +6 -0
  261. package/dist/plugin-manifest-catalog/manifest-filesystem.d.ts +9 -0
  262. package/dist/plugin-manifest-catalog/manifest-json.d.ts +1 -0
  263. package/dist/plugin-manifest-catalog/manifest-nested-parser.d.ts +11 -0
  264. package/dist/plugin-manifest-catalog/manifest-parser.d.ts +2 -0
  265. package/dist/plugin-manifest-catalog/manifest-semver.d.ts +4 -0
  266. package/dist/plugin-manifest-catalog/manifest-values.d.ts +6 -0
  267. package/dist/plugin-manifest-catalog/parse-utils.d.ts +19 -0
  268. package/dist/plugin-manifest-catalog/plugin-field-value.d.ts +3 -0
  269. package/dist/plugin-manifest-catalog/runtime-identity.d.ts +12 -0
  270. package/dist/plugin-manifest-catalog/types.d.ts +187 -0
  271. package/dist/plugin-path-resolver.d.ts +17 -0
  272. package/dist/plugin-registry.d.ts +165 -0
  273. package/dist/plugin-runtime-config.d.ts +10 -0
  274. package/dist/plugin-runtime-diff.d.ts +15 -0
  275. package/dist/plugin-runtime-orchestrator.d.ts +69 -0
  276. package/dist/plugin-runtime-state-machine.d.ts +78 -0
  277. package/dist/plugin-runtime-status.d.ts +29 -0
  278. package/dist/plugin-services/channels.d.ts +391 -0
  279. package/dist/plugin-services/command-journal.d.ts +234 -0
  280. package/dist/plugin-services/contracts.d.ts +23 -0
  281. package/dist/plugin-services/host-rpc.d.ts +268 -0
  282. package/dist/plugin-services/peer-broker.d.ts +351 -0
  283. package/dist/plugin-services/peer-channel-hub.d.ts +457 -0
  284. package/dist/plugin-services/peer-channel-protocol.d.ts +339 -0
  285. package/dist/plugin-services/peer-directory.d.ts +163 -0
  286. package/dist/plugin-services/peer-executor-proof.d.ts +13 -0
  287. package/dist/plugin-services/peer-frame.d.ts +65 -0
  288. package/dist/plugin-services/peer-journal.d.ts +25 -0
  289. package/dist/plugin-services/peer-protocol.d.ts +128 -0
  290. package/dist/plugin-services/peer-rpc-link.d.ts +218 -0
  291. package/dist/plugin-services/peer-rpc-mapping.d.ts +133 -0
  292. package/dist/plugin-services/peer-websocket.d.ts +146 -0
  293. package/dist/plugin-services/persistence.d.ts +166 -0
  294. package/dist/plugin-services/rpc-runtime.d.ts +227 -0
  295. package/dist/plugin-services/snapshot-store.d.ts +77 -0
  296. package/dist/plugin-services/wire-contract.d.ts +158 -0
  297. package/dist/plugin-services.d.ts +237 -0
  298. package/dist/plugin-state/client.d.ts +160 -0
  299. package/dist/plugin-state/message-size.d.ts +2 -0
  300. package/dist/plugin-state/operations.d.ts +4 -0
  301. package/dist/plugin-state/protocol.d.ts +40 -0
  302. package/dist/plugin-state/storage-rpc.d.ts +7 -0
  303. package/dist/plugin.types.d.ts +999 -0
  304. package/dist/plugins/anthropic-request-sanitizer/index.js +17 -17
  305. package/dist/plugins/anthropic-request-sanitizer/index.js.map +1 -1
  306. package/dist/plugins/anthropic-tool-name-transformer/index.js +17 -17
  307. package/dist/plugins/anthropic-tool-name-transformer/index.js.map +1 -1
  308. package/dist/plugins/chatgpt-oauth/control.js +24 -24
  309. package/dist/plugins/chatgpt-oauth/control.js.map +1 -1
  310. package/dist/plugins/chatgpt-oauth/index.js +23 -23
  311. package/dist/plugins/chatgpt-oauth/index.js.map +1 -1
  312. package/dist/plugins/codex-router/control.js +19 -19
  313. package/dist/plugins/codex-router/control.js.map +1 -1
  314. package/dist/plugins/codex-router/index.js +31 -31
  315. package/dist/plugins/codex-router/index.js.map +1 -1
  316. package/dist/plugins/deepseek-reasoning-fix/index.js +17 -17
  317. package/dist/plugins/deepseek-reasoning-fix/index.js.map +1 -1
  318. package/dist/plugins/key-access/control.js +18 -18
  319. package/dist/plugins/key-access/control.js.map +1 -1
  320. package/dist/plugins/key-access/index.js +19 -19
  321. package/dist/plugins/key-access/index.js.map +1 -1
  322. package/dist/plugins/key-access/ingress.js +18 -18
  323. package/dist/plugins/key-access/ingress.js.map +1 -1
  324. package/dist/plugins/key-rate-limit/control.js +3 -3
  325. package/dist/plugins/key-rate-limit/control.js.map +1 -1
  326. package/dist/plugins/key-rate-limit/index.js +18 -18
  327. package/dist/plugins/key-rate-limit/index.js.map +1 -1
  328. package/dist/plugins/key-rate-limit/ingress.js +2 -2
  329. package/dist/plugins/key-rate-limit/ingress.js.map +1 -1
  330. package/dist/plugins/llm-protocol-adapter/control.js +48 -48
  331. package/dist/plugins/llm-protocol-adapter/control.js.map +1 -1
  332. package/dist/plugins/llm-protocol-adapter/index.js +53 -53
  333. package/dist/plugins/llm-protocol-adapter/index.js.map +1 -1
  334. package/dist/plugins/llm-tps/control.js +5 -5
  335. package/dist/plugins/llm-tps/control.js.map +1 -1
  336. package/dist/plugins/llm-tps/index.js +20 -20
  337. package/dist/plugins/llm-tps/index.js.map +1 -1
  338. package/dist/plugins/model-mapping/control.js +4 -4
  339. package/dist/plugins/model-mapping/control.js.map +1 -1
  340. package/dist/plugins/model-mapping/index.js +19 -19
  341. package/dist/plugins/model-mapping/index.js.map +1 -1
  342. package/dist/plugins/models-dev/control.js +10 -10
  343. package/dist/plugins/models-dev/control.js.map +1 -1
  344. package/dist/plugins/models-dev/index.js +23 -23
  345. package/dist/plugins/models-dev/index.js.map +1 -1
  346. package/dist/plugins/request-body-redaction/control.js +2 -2
  347. package/dist/plugins/request-body-redaction/control.js.map +1 -1
  348. package/dist/plugins/request-body-redaction/index.js +21 -21
  349. package/dist/plugins/request-body-redaction/index.js.map +1 -1
  350. package/dist/plugins/request-logs/index.js +27 -27
  351. package/dist/plugins/request-logs/index.js.map +1 -1
  352. package/dist/plugins/request-logs/ingress.js +2 -2
  353. package/dist/plugins/request-logs/ingress.js.map +1 -1
  354. package/dist/plugins/signature-repair/index.js +17 -17
  355. package/dist/plugins/signature-repair/index.js.map +1 -1
  356. package/dist/plugins/sse-envelope.d.ts +3 -0
  357. package/dist/plugins/token-budget/control.js +19 -19
  358. package/dist/plugins/token-budget/control.js.map +1 -1
  359. package/dist/plugins/token-budget/index.js +19 -19
  360. package/dist/plugins/token-budget/index.js.map +1 -1
  361. package/dist/plugins/token-budget/ingress.js +2 -2
  362. package/dist/plugins/token-budget/ingress.js.map +1 -1
  363. package/dist/plugins/token-metering/index.js +30 -30
  364. package/dist/plugins/token-metering/index.js.map +1 -1
  365. package/dist/plugins/token-stats/control.js +22 -22
  366. package/dist/plugins/token-stats/control.js.map +1 -1
  367. package/dist/plugins/token-stats/index.js +22 -22
  368. package/dist/plugins/token-stats/index.js.map +1 -1
  369. package/dist/plugins/user-auth/control.js +21 -21
  370. package/dist/plugins/user-auth/control.js.map +1 -1
  371. package/dist/plugins/user-auth/index.js +17 -17
  372. package/dist/plugins/user-auth/index.js.map +1 -1
  373. package/dist/public-listener/admission-registry.d.ts +15 -0
  374. package/dist/public-listener/forwarding.d.ts +24 -0
  375. package/dist/public-listener/headers.d.ts +5 -0
  376. package/dist/public-listener/index.d.ts +4 -0
  377. package/dist/public-listener/listener.d.ts +21 -0
  378. package/dist/public-listener/websocket.d.ts +4 -0
  379. package/dist/rate-limit/http.d.ts +80 -0
  380. package/dist/rate-limit/index.d.ts +7 -0
  381. package/dist/rate-limit/json.d.ts +8 -0
  382. package/dist/rate-limit/profile.d.ts +46 -0
  383. package/dist/rate-limit/protocol.d.ts +104 -0
  384. package/dist/rate-limit/store.d.ts +61 -0
  385. package/dist/scoped-plugin-registry.d.ts +645 -0
  386. package/dist/supervision/index.d.ts +12 -0
  387. package/dist/supervision/process-lifetime-guard.d.ts +54 -0
  388. package/dist/supervision/protocol.d.ts +173 -0
  389. package/dist/supervision/state-repository.d.ts +15 -0
  390. package/dist/supervision/strict-json.d.ts +2 -0
  391. package/dist/supervision/worker-descriptor.d.ts +77 -0
  392. package/dist/supervision/worker-http.d.ts +135 -0
  393. package/dist/supervision/worker-runtime-snapshot.d.ts +64 -0
  394. package/dist/token-stats-window.d.ts +23 -0
  395. package/dist/ui/assets.d.ts +8 -0
  396. package/dist/ui/icon-resources.d.ts +28 -0
  397. package/dist/ui/menu-icons.d.ts +15 -0
  398. package/dist/ui/menu-layout.d.ts +10 -0
  399. package/dist/ui/plugin-sandbox-policy.d.ts +11 -0
  400. package/dist/ui/server.d.ts +10 -0
  401. package/dist/updates/archive-installer.d.ts +8 -0
  402. package/dist/updates/controller.d.ts +50 -0
  403. package/dist/updates/download.d.ts +8 -0
  404. package/dist/updates/installation.d.ts +26 -0
  405. package/dist/updates/names.d.ts +3 -0
  406. package/dist/updates/release.d.ts +23 -0
  407. package/dist/updates/restart.d.ts +13 -0
  408. package/dist/utils/config-validator.d.ts +40 -0
  409. package/dist/utils/endpoint-resolver.d.ts +20 -0
  410. package/dist/utils/expression-dependencies.d.ts +10 -0
  411. package/dist/utils/plugin-helpers.d.ts +46 -0
  412. package/dist/websocket/headers.d.ts +9 -0
  413. package/dist/websocket/index.d.ts +3 -0
  414. package/dist/websocket/message.d.ts +3 -0
  415. package/dist/websocket/observation.d.ts +36 -0
  416. package/dist/websocket/transport.d.ts +197 -0
  417. package/dist/worker/health/checker.d.ts +54 -0
  418. package/dist/worker/health/scheduler.d.ts +27 -0
  419. package/dist/worker/request/body-source.d.ts +1 -0
  420. package/dist/worker/request/context-builder.d.ts +78 -0
  421. package/dist/worker/request/context.d.ts +55 -0
  422. package/dist/worker/request/credential.d.ts +10 -0
  423. package/dist/worker/request/handler.d.ts +3 -0
  424. package/dist/worker/request/proxy.d.ts +4 -0
  425. package/dist/worker/request/response-detector.d.ts +9 -0
  426. package/dist/worker/request/snapshot.d.ts +18 -0
  427. package/dist/worker/response/attempt-observation.d.ts +24 -0
  428. package/dist/worker/response/processor.d.ts +4 -0
  429. package/dist/worker/response/streaming-response.d.ts +1 -0
  430. package/dist/worker/rules/deep-merge.d.ts +2 -0
  431. package/dist/worker/rules/modifier.d.ts +3 -0
  432. package/dist/worker/state/plugin-manager.d.ts +95 -0
  433. package/dist/worker/state/runtime-state.d.ts +90 -0
  434. package/dist/worker/types.d.ts +44 -0
  435. package/dist/worker/upstream/condition-filter.d.ts +31 -0
  436. package/dist/worker/upstream/failover-coordinator.d.ts +93 -0
  437. package/dist/worker/upstream/filter.d.ts +37 -0
  438. package/dist/worker/upstream/priority-group.d.ts +66 -0
  439. package/dist/worker/upstream/selector.d.ts +10 -0
  440. package/dist/worker/upstream/service-execution.d.ts +17 -0
  441. package/dist/worker/utils/jitter.d.ts +81 -0
  442. package/dist/worker/utils/slow-start.d.ts +67 -0
  443. package/dist/worker/utils/status-code-matcher.d.ts +10 -0
  444. package/dist/worker.d.ts +1 -0
  445. package/package.json +2 -2
@@ -0,0 +1,108 @@
1
+ import type { ConfigMasterMessage } from '../config-publication/types';
2
+ import { type ControllerAuthority, type SupervisionProcessCredential, type WorkerRuntimeSnapshot } from '../supervision';
3
+ import { type WorkerDescriptorEvidence } from '../supervision/worker-descriptor';
4
+ export type WorkerStatusPayload = {
5
+ readonly schema: 'bungee-worker-status-v1';
6
+ readonly role: 'worker';
7
+ readonly master_generation: string;
8
+ readonly worker_instance_id: string;
9
+ readonly worker_slot: number;
10
+ readonly boot_nonce: string;
11
+ readonly pid: number;
12
+ readonly control_port: number;
13
+ readonly master_control_port?: number;
14
+ readonly phase: 'candidate' | 'serving' | 'draining' | 'stopped';
15
+ readonly frozen: boolean;
16
+ readonly private_port: number | null;
17
+ readonly revision: number | null;
18
+ readonly content_hash: `sha256:${string}` | null;
19
+ readonly plugin_catalog_hash: `sha256:${string}` | null;
20
+ readonly started_at: number;
21
+ readonly snapshot_hash: `sha256:${string}`;
22
+ readonly authority: ControllerAuthority;
23
+ readonly request_correlation: string;
24
+ readonly replay: {
25
+ readonly sequence: number;
26
+ readonly request_id: string;
27
+ };
28
+ readonly evidence: WorkerDescriptorEvidence;
29
+ };
30
+ export type WorkerControllerClientOptions = {
31
+ readonly baseUrl: string;
32
+ readonly credential: SupervisionProcessCredential;
33
+ readonly authority: ControllerAuthority;
34
+ readonly timeoutMs?: number;
35
+ readonly leaseDurationMs?: number;
36
+ readonly renewBeforeMs?: number;
37
+ readonly maxResponseBytes?: number;
38
+ readonly fetch?: typeof globalThis.fetch;
39
+ readonly timers?: WorkerControllerClientTimers;
40
+ };
41
+ export type WorkerControllerClientTimers = {
42
+ readonly setTimeout: (callback: () => void, delayMs: number) => ReturnType<typeof setTimeout>;
43
+ readonly clearTimeout: (timer: ReturnType<typeof setTimeout>) => void;
44
+ };
45
+ export declare class WorkerControllerClientError extends Error {
46
+ readonly code: 'timeout' | 'http' | 'network' | 'response_too_large' | 'protocol' | 'recovering';
47
+ readonly name = "WorkerControllerClientError";
48
+ constructor(code: 'timeout' | 'http' | 'network' | 'response_too_large' | 'protocol' | 'recovering', message: string, cause?: unknown);
49
+ }
50
+ export declare class WorkerControllerClient {
51
+ private readonly options;
52
+ private readonly fetcher;
53
+ private readonly timeoutMs;
54
+ private readonly leaseDurationMs;
55
+ private readonly renewBeforeMs;
56
+ private readonly maxResponseBytes;
57
+ private readonly timers;
58
+ private sequence;
59
+ private statusSequence;
60
+ private statusRequestId;
61
+ private queue;
62
+ private renewTimer;
63
+ private renewController;
64
+ private renewalGeneration;
65
+ private pendingDrains;
66
+ private stopped;
67
+ private terminating;
68
+ private leaseDeadlineAt;
69
+ private shutdownPromise;
70
+ private readonly ordinaryAbort;
71
+ private recoveryDelayMs;
72
+ private lastStatus;
73
+ state: 'detached' | 'attached' | 'recovering' | 'unavailable' | 'disconnected';
74
+ private readonly controlStateListeners;
75
+ private readonly runtimeControllers;
76
+ constructor(options: WorkerControllerClientOptions);
77
+ subscribeControlState(listener: (state: WorkerControllerClient['state']) => void): () => void;
78
+ get credential(): SupervisionProcessCredential;
79
+ get authority(): ControllerAuthority;
80
+ get cachedStatus(): WorkerStatusPayload | null;
81
+ private setState;
82
+ private enqueue;
83
+ private enqueueRuntime;
84
+ private nextSequence;
85
+ private cancelRenewal;
86
+ private enqueueRenewal;
87
+ private fetchJson;
88
+ private verifyProcessMessage;
89
+ private acceptStatus;
90
+ private acceptRuntimeSnapshot;
91
+ private fetchRuntimeJson;
92
+ runtimeSnapshot(signal?: AbortSignal, deadline?: number): Promise<WorkerRuntimeSnapshot>;
93
+ private challenge;
94
+ private attachOnce;
95
+ attach(): Promise<WorkerStatusPayload>;
96
+ private scheduleRenewal;
97
+ private renewOnce;
98
+ private scheduleRecovery;
99
+ lease(): Promise<WorkerStatusPayload>;
100
+ status(timeoutMs?: number): Promise<WorkerStatusPayload>;
101
+ private statusOnce;
102
+ command(message: ConfigMasterMessage, deadlineOverride?: number): Promise<WorkerStatusPayload>;
103
+ private commandOnce;
104
+ start(message: ConfigMasterMessage): Promise<WorkerStatusPayload>;
105
+ drain(message: ConfigMasterMessage, deadline?: number): Promise<WorkerStatusPayload>;
106
+ shutdown(timeoutMs?: number): Promise<WorkerStatusPayload>;
107
+ disconnect(expireLease?: boolean): void;
108
+ }
@@ -0,0 +1,41 @@
1
+ import type { ConfigProcessIdentity } from '../config-publication/types';
2
+ import { type SupervisionRootKeyMaterial, type SupervisionProcessCredential, type WorkerDescriptor } from '../supervision';
3
+ import { WorkerControllerClient, type WorkerControllerClientOptions, type WorkerStatusPayload } from './supervised-worker-client';
4
+ import type { AdmissionSet } from '../ingress';
5
+ export type WorkerDescriptorHint = {
6
+ readonly master_generation: string;
7
+ readonly worker_instance_id: string;
8
+ readonly worker_slot: number;
9
+ readonly boot_nonce: string;
10
+ readonly control_port: number;
11
+ };
12
+ export type WorkerDiscoveryIssue = {
13
+ readonly file: string;
14
+ readonly kind: 'malformed' | 'tampered' | 'stale' | 'unreachable' | 'duplicate' | 'master_control_mismatch';
15
+ readonly detail: string;
16
+ };
17
+ export type DiscoveredSupervisedWorker = {
18
+ readonly file: string;
19
+ readonly hint: WorkerDescriptorHint;
20
+ readonly descriptor: WorkerDescriptor;
21
+ readonly credential: SupervisionProcessCredential;
22
+ readonly client: WorkerControllerClient;
23
+ readonly status: WorkerStatusPayload;
24
+ };
25
+ export type WorkerDiscoveryOptions = {
26
+ readonly runtimeWorkersDirectory: string;
27
+ readonly rootKey: SupervisionRootKeyMaterial;
28
+ readonly authority: WorkerControllerClientOptions['authority'];
29
+ readonly masterControlPort: number;
30
+ readonly client?: Omit<WorkerControllerClientOptions, 'baseUrl' | 'credential' | 'authority'>;
31
+ readonly fetch?: typeof globalThis.fetch;
32
+ readonly mode: 'exact-admission' | 'orphan-inventory';
33
+ readonly expectedAdmission?: AdmissionSet;
34
+ readonly clientFor: (identity: ConfigProcessIdentity, authority: WorkerControllerClientOptions['authority'], options: WorkerControllerClientOptions) => WorkerControllerClient;
35
+ };
36
+ /** Deliberately unauthenticated: this only selects the key and endpoint to authenticate next. */
37
+ export declare function parseWorkerDescriptorHint(value: unknown): WorkerDescriptorHint;
38
+ export declare function discoverSupervisedWorkers(options: WorkerDiscoveryOptions): Promise<{
39
+ readonly workers: readonly DiscoveredSupervisedWorker[];
40
+ readonly issues: readonly WorkerDiscoveryIssue[];
41
+ }>;
@@ -0,0 +1,298 @@
1
+ import type { AsyncConfigRepository } from '../config-storage/async-config-repository';
2
+ import type { ConfirmedLogOwnerEnd } from '../gateway/request-log-contracts';
3
+ import type { PublicationRetirement } from '../config-storage/retirement-store';
4
+ import { type ProcessLifetimeGuardFacts } from '../supervision/process-lifetime-guard';
5
+ import type { UnsettledWorkerLaunch, WorkerLaunch as DurableWorkerLaunch, WorkerLaunchAllocation, WorkerLaunchAllocationFacts, WorkerLaunchExitEvidence } from '../config-storage';
6
+ import { type ChildProcess, type SpawnOptions } from 'node:child_process';
7
+ import type { ConfigProcessIdentity } from '../config-publication/types';
8
+ import type { ConfigPublicationWorkerFactory, ConfigPublicationWorkerProcess, ServingConfigWorker, WorkerExitEvidence } from '../config-publication/coordinator-types';
9
+ import type { ProcessCleanupResult } from '../config-publication/process-cleanup';
10
+ import { type AdmissionRegistryStatus, type AdmissionSet } from '../ingress';
11
+ import type { WorkerLaunch } from './process-options';
12
+ import { type SupervisedWorkerRateLimitSession } from '../config-worker/process-environment';
13
+ import { type SupervisionRootKeyMaterial } from '../supervision';
14
+ import { type WorkerDiscoveryIssue } from './supervised-worker-discovery';
15
+ import { type CapturedProcessIdentity } from './process-identity';
16
+ import { SupervisedConfigWorkerProcessAdapter, type ProcessIdentityControl, type SupervisedWorkerConfigurationTarget, type WorkerUnavailableEvidence } from './supervised-worker-process-adapter';
17
+ import { WorkerControllerClient, type WorkerControllerClientOptions, type WorkerStatusPayload } from './supervised-worker-client';
18
+ import type { SupervisionProcessCredential } from '../supervision';
19
+ import type { WorkerRuntimeSnapshot } from '../supervision';
20
+ import { type Sha256Digest } from '@jeffusion/bungee-types';
21
+ export type SupervisedControlPortAllocator = (identity: ConfigProcessIdentity) => number;
22
+ export type SupervisedConfigWorkerSpawn = (executable: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
23
+ /** Durable pre-fork launch ledger. Registration must succeed before the native fork. */
24
+ export type WorkerLaunchRepository = {
25
+ registerWorkerLaunch(identity: ConfigProcessIdentity, guard: ProcessLifetimeGuardFacts, allocation: WorkerLaunchAllocation | null, updatedAt: number): Promise<DurableWorkerLaunch>;
26
+ recordWorkerLaunchExit(workerInstanceId: string, evidence: WorkerLaunchExitEvidence, updatedAt: number): Promise<DurableWorkerLaunch>;
27
+ recordWorkerLaunchCapacityReclaimed(workerInstanceId: string, guard: ProcessLifetimeGuardFacts, updatedAt: number): Promise<void>;
28
+ recordWorkerLaunchAdmitted(workerInstanceId: string, updatedAt: number): Promise<DurableWorkerLaunch>;
29
+ fenceWorkerLaunchNotStarted(mutationId: string, workerSlot: number, attemptNo: number, updatedAt: number): Promise<void>;
30
+ getWorkerLaunch(workerInstanceId: string): Promise<DurableWorkerLaunch | null>;
31
+ /** Authoritative per-allocation facts; `settled` covers fences and exit+cleanup proofs. */
32
+ getWorkerLaunchAllocationFacts(allocation: WorkerLaunchAllocation): Promise<WorkerLaunchAllocationFacts | null>;
33
+ /**
34
+ * Global unsettled inventory: every reservation without a fence/candidate proof and
35
+ * every intent without `exited + cleanup_released`, including admitted workers, old
36
+ * owners and `allocation: null` startup launches.
37
+ */
38
+ getWorkerLaunchInventory(): Promise<readonly UnsettledWorkerLaunch[]>;
39
+ };
40
+ export type WorkerLaunchCommand = {
41
+ readonly mutation_id: string;
42
+ readonly committed_revision: number;
43
+ readonly attempt_no: number;
44
+ };
45
+ export type WorkerLaunchDebtSettlement = {
46
+ readonly released: readonly ConfigProcessIdentity[];
47
+ readonly fenced: readonly WorkerLaunchAllocation[];
48
+ readonly unknown: readonly (DurableWorkerLaunch | WorkerLaunchAllocation)[];
49
+ };
50
+ export type SupervisedConfigWorkerFactoryOptions = {
51
+ readonly launch: WorkerLaunch;
52
+ readonly rootKey: SupervisionRootKeyMaterial;
53
+ readonly runtimeWorkersDirectory: string;
54
+ readonly authority: WorkerControllerClientOptions['authority'];
55
+ readonly masterControlPort: number;
56
+ readonly cwd?: string;
57
+ readonly env?: Readonly<NodeJS.ProcessEnv>;
58
+ readonly accessLogDbPath: string;
59
+ readonly transportSecret: string;
60
+ readonly rateLimitSession?: SupervisedWorkerRateLimitSession;
61
+ readonly shutdownTimeoutMs: number;
62
+ readonly configDbPath?: string;
63
+ readonly client?: Omit<WorkerControllerClientOptions, 'baseUrl' | 'credential' | 'authority'>;
64
+ readonly allocateControlPort?: SupervisedControlPortAllocator;
65
+ readonly descriptorPathFor?: (identity: ConfigProcessIdentity) => string;
66
+ readonly spawn?: SupervisedConfigWorkerSpawn;
67
+ readonly initializationTimeoutMs?: number;
68
+ /** Injectable exact-process OS operations; defaults to the real capture/probe/terminate. */
69
+ readonly processIdentity?: ProcessIdentityControl;
70
+ /** Injectable host boot identity; production always defaults to native OS evidence. */
71
+ readonly kernelBootId?: () => Promise<string>;
72
+ /** Re-checks signed ingress registry membership immediately before orphan cleanup. */
73
+ readonly retirementRepository?: Pick<AsyncConfigRepository, 'getPublicationServingSet' | 'confirmPublicationServingMemberExit' | 'getRetirementDescriptorCleanupState' | 'getRetiredWorkerInstanceIds' | 'getPublicationRetirement' | 'recordPublicationRetirementEvidence' | 'stopPublicationRetirement' | 'getOutstandingPublicationCandidates' | 'recordPublicationCandidateExit'>;
74
+ /** Durable launch ledger; required for real native forks on guard-backed platforms. */
75
+ readonly launchRepository?: WorkerLaunchRepository;
76
+ readonly confirmOrphan?: () => Promise<AdmissionRegistryStatus>;
77
+ /** Best-effort bounded enqueue; recovery proofs need no live process adapter. */
78
+ readonly onRequestLogOwnerEnd?: (fact: ConfirmedLogOwnerEnd) => void;
79
+ };
80
+ export declare const STRIPPED_ROOT_ENV_NAMES: readonly ["BUNGEE_PLUGIN_SECRETS_KEY", "BUNGEE_SUPERVISION_ROOT_KEY", "BUNGEE_ROOT_KEY", "BUNGEE_MASTER_ROOT_KEY", "BUNGEE_MANAGEMENT_HOST", "BUNGEE_MANAGEMENT_PORT", "BUNGEE_INGRESS_CREDENTIAL", "BUNGEE_INGRESS_TRANSPORT_SECRET", "BUNGEE_INGRESS_SUPERVISION_PORT", "BUNGEE_INGRESS_PROCESS_INSTANCE_ID", "BUNGEE_INGRESS_BOOT_NONCE", "BUNGEE_PLUGIN_BINDING", "BUNGEE_PLUGIN_BINDING_ID", "BUNGEE_PLUGIN_BINDING_OPTIONS", "BUNGEE_PLUGIN_OPTIONS", "BUNGEE_CONTROL_BINDING", "BUNGEE_CONTROL_OPTIONS", "BUNGEE_PROCESS_LIFETIME_GUARD", "BUNGEE_DAEMON_METADATA_PATH", "BUNGEE_DAEMON_BOOT_NONCE", "BUNGEE_DAEMON_SHUTDOWN_SECRET"];
81
+ export type SupervisedAdoptionResult = {
82
+ readonly kind: 'adopted';
83
+ readonly workers: readonly SupervisedConfigWorkerProcessAdapter[];
84
+ readonly serving: readonly ServingConfigWorker[];
85
+ readonly issues: readonly WorkerDiscoveryIssue[];
86
+ } | {
87
+ readonly kind: 'recovering';
88
+ readonly code: 'admission_mismatch';
89
+ readonly workers: readonly [];
90
+ readonly issues: readonly WorkerDiscoveryIssue[];
91
+ } | {
92
+ readonly kind: 'rejected';
93
+ readonly code: 'master_control_mismatch';
94
+ readonly workers: readonly [];
95
+ readonly issues: readonly WorkerDiscoveryIssue[];
96
+ };
97
+ export type AuthenticatedOrphanCleanupResult = {
98
+ readonly cleaned: readonly ConfigProcessIdentity[];
99
+ readonly exitUnknown: readonly ConfigProcessIdentity[];
100
+ readonly issues: readonly WorkerDiscoveryIssue[];
101
+ };
102
+ export type IngressBootWorkerCleanupResult = {
103
+ readonly kind: 'cleaned' | 'cleanup_debt' | 'retryable';
104
+ readonly exited: readonly ConfigProcessIdentity[];
105
+ /** Spawned children without OS exit proof; retry is required. */
106
+ readonly spawnedExitUnconfirmed: readonly ConfigProcessIdentity[];
107
+ /** Adopted workers received authenticated shutdown, but exit remains unproven. */
108
+ readonly adoptedExitUnknown: readonly ConfigProcessIdentity[];
109
+ /** Compatibility aggregate; callers must use the two fields above to choose recovery. */
110
+ readonly exitUnknown: readonly ConfigProcessIdentity[];
111
+ } & ({
112
+ readonly kind: 'cleaned' | 'cleanup_debt';
113
+ } | {
114
+ readonly kind: 'retryable';
115
+ readonly code: 'registry_unavailable' | 'registry_changed' | 'worker_facts_unavailable' | 'spawned_exit_unconfirmed';
116
+ });
117
+ export type IngressBootWorkerCleanupRequest = {
118
+ /** Trusted current registry snapshot; every role is an exact protection set. */
119
+ readonly registry: AdmissionRegistryStatus;
120
+ /** Reads the same fenced registry again immediately before each signal/RPC. */
121
+ readonly getFreshRegistry: () => Promise<AdmissionRegistryStatus>;
122
+ };
123
+ export type SupervisedWorkerAdmissionIdentity = {
124
+ readonly master_generation: string;
125
+ readonly worker_instance_id: string;
126
+ readonly worker_slot: number;
127
+ readonly boot_nonce: string;
128
+ readonly private_port: number;
129
+ readonly revision: number;
130
+ readonly content_hash: string;
131
+ readonly plugin_catalog_hash: string;
132
+ };
133
+ export type SupervisedWorkerControlSession = {
134
+ readonly process: SupervisedConfigWorkerProcessAdapter;
135
+ readonly credential: SupervisionProcessCredential;
136
+ readonly controlState: WorkerControllerClient['state'];
137
+ readonly status: () => Promise<WorkerStatusPayload>;
138
+ readonly runtimeSnapshot?: (signal?: AbortSignal) => Promise<WorkerRuntimeSnapshot>;
139
+ };
140
+ /**
141
+ * Host-private, read-only physical-session facts for one exact supervised worker identity.
142
+ *
143
+ * This is a plain snapshot for master-side decision making. It performs no database read,
144
+ * network call, status RPC, or OS probe, it adds no second registry or permission layer,
145
+ * and it is not an authorization grant: the returned values are the real local facts, not
146
+ * a claim that the worker is ready to serve.
147
+ *
148
+ * `configurationTarget` is the first validated intended start target, pinned before wire dispatch, and may be present
149
+ * while `status.phase` is still `candidate`; it must never be treated as the served
150
+ * snapshot. `status` is an independent deep-frozen copy of the latest worker-signed
151
+ * snapshot observed from the bound control client; `phase`, `frozen`, `revision`,
152
+ * `content_hash` and `plugin_catalog_hash` mirror it for convenience.
153
+ */
154
+ export type SupervisedWorkerPhysicalSession = Readonly<{
155
+ readonly process: SupervisedConfigWorkerProcessAdapter;
156
+ /** Host-private credential; not for SDK or plugin surfaces. */
157
+ readonly credential: SupervisionProcessCredential;
158
+ readonly origin: 'spawned' | 'adopted';
159
+ readonly pid: number;
160
+ readonly controlState: WorkerControllerClient['state'];
161
+ readonly committed: boolean;
162
+ readonly captured: CapturedProcessIdentity;
163
+ readonly status: WorkerStatusPayload;
164
+ readonly phase: WorkerStatusPayload['phase'];
165
+ readonly frozen: boolean;
166
+ readonly revision: number | null;
167
+ readonly content_hash: Sha256Digest | null;
168
+ readonly plugin_catalog_hash: Sha256Digest | null;
169
+ readonly configurationTarget: SupervisedWorkerConfigurationTarget | null;
170
+ }>;
171
+ export declare class SupervisedConfigWorkerFactoryError extends Error {
172
+ readonly code: 'already_owned' | 'worker_exit_unconfirmed';
173
+ readonly name = "SupervisedConfigWorkerFactoryError";
174
+ constructor(code: 'already_owned' | 'worker_exit_unconfirmed', message: string);
175
+ }
176
+ export declare class SupervisedConfigWorkerFactory implements ConfigPublicationWorkerFactory {
177
+ private readonly options;
178
+ private readonly spawnWorker;
179
+ private readonly kernelBootId;
180
+ private rateLimitSession;
181
+ private readonly owned;
182
+ private readonly identities;
183
+ private readonly retiredInstanceIds;
184
+ private readonly retirementProofFences;
185
+ private readonly clients;
186
+ private readonly adapters;
187
+ private readonly committed;
188
+ /** Exit proofs are keyed by process object: two adapters sharing a PID never consume each other's proof. */
189
+ private readonly exitHistory;
190
+ /** Memoized deep-frozen copies of signed status snapshots, keyed by source identity. */
191
+ private readonly frozenStatusCopies;
192
+ private readonly unavailableListeners;
193
+ private readonly exitListeners;
194
+ private readonly eligibilityListeners;
195
+ /** Last durable launch-exit state written per instance; keeps a later signed cleanup upgrade. */
196
+ private readonly launchExitStates;
197
+ /** First durable write failure per instance; it survives entry replacement and later success. */
198
+ private readonly launchExitFailures;
199
+ constructor(options: SupervisedConfigWorkerFactoryOptions);
200
+ private endRequestLogOwner;
201
+ private endLaunchRequestLogOwner;
202
+ spawn(identity: ConfigProcessIdentity, publication?: WorkerLaunchCommand): Promise<SupervisedConfigWorkerProcessAdapter>;
203
+ /** Changes only the session captured by workers spawned after this call. */
204
+ setRateLimitSession(session: SupervisedWorkerRateLimitSession): void;
205
+ discoverAndAdopt(expectedAdmissionSet: AdmissionSet): Promise<SupervisedAdoptionResult>;
206
+ snapshot(): readonly ConfigPublicationWorkerProcess[];
207
+ /** Retired members may already be draining; they never enter serving admission. */
208
+ recoverRetiredWorkers(retirement: PublicationRetirement): Promise<readonly ServingConfigWorker[]>;
209
+ /** A missing RPC endpoint is not exit proof: authenticate persisted identities and probe the OS. */
210
+ confirmPreviousWorkersExited(registry: AdmissionRegistryStatus, replacements: readonly ServingConfigWorker[]): Promise<boolean>;
211
+ /**
212
+ * A new attempt is allowed only after every prior target has a durable exact exit fence.
213
+ * This covers both a frozen serving set and pre-ready allocations that never wrote one.
214
+ */
215
+ confirmActivePublicationExited(active: import('../config-storage/repository-types').ActiveConfigurationPublication): Promise<boolean>;
216
+ /**
217
+ * Debt-only pass for the serialized recovery/publication queue: settle durable launch
218
+ * debt from fresh signed evidence without forking or terminating anything. Legal
219
+ * members of the freshly read admission registry are skipped, never released.
220
+ */
221
+ settleWorkerLaunchDebt(registry: AdmissionRegistryStatus): Promise<WorkerLaunchDebtSettlement>;
222
+ /** Physical capacity only; a terminal cleanup failure remains a failure. */
223
+ reclaimExitedWorkerLaunchCapacity(launch: DurableWorkerLaunch): Promise<boolean>;
224
+ private descriptorMatchesWorkerLaunch;
225
+ /** Unlike publication-attempt proof this does not need a live active snapshot. */
226
+ private proveStandaloneWorkerLaunchExit;
227
+ /**
228
+ * Proves one durable launch intent exited with signed cleanup for this publication
229
+ * attempt. A freed guard is physical exit only; the signed stopped descriptor is the
230
+ * cleanup proof, and both must match the intent's identity before recording `released`.
231
+ */
232
+ private proveWorkerLaunchExit;
233
+ /** Authority is the frozen durable members, never every historical JSON file. */
234
+ provePublicationRetirement(registry: AdmissionRegistryStatus, retirement: PublicationRetirement): Promise<{
235
+ readonly kind: 'confirmed' | 'stopped';
236
+ readonly retirement: PublicationRetirement;
237
+ }>;
238
+ owns(process: ConfigPublicationWorkerProcess): boolean;
239
+ lookupExactControlSession(identity: SupervisedWorkerAdmissionIdentity): SupervisedWorkerControlSession | null;
240
+ /**
241
+ * Independent deep-frozen copy of a worker-signed status, memoized by the source object
242
+ * identity so repeated facts reuse one clone instead of re-copying a whole status on
243
+ * every read. The source snapshot is never frozen or exposed directly.
244
+ */
245
+ private frozenStatusCopy;
246
+ /**
247
+ * Host-private, read-only physical-session facts for one exact supervised worker.
248
+ *
249
+ * Returns null unless the exact identity is owned and every physical fact matches: the
250
+ * boot nonce, the Host-private credential role/instance/nonce, the captured OS identity
251
+ * (pid + processInstanceId) and the latest worker-signed status identity. It deliberately
252
+ * does not require `committed` or a serving phase, so an uncommitted candidate stays
253
+ * readable; the existing `lookupExactControlSession` gate is untouched. A real physical
254
+ * exit recorded in `exitHistory` returns null even though the caller's retirement
255
+ * settlement rules are unchanged. No database, network, status RPC, or OS probe is
256
+ * performed and no ownership is mutated.
257
+ *
258
+ * The returned `credential`, `captured` and `status` are independent copies (the status
259
+ * is deep-frozen) so mutating either the fact or the worker's own base state cannot
260
+ * corrupt the other; only the `process` reference and the already-frozen
261
+ * `configurationTarget` are shared.
262
+ */
263
+ lookupPhysicalSession(input: ConfigProcessIdentity & {
264
+ readonly boot_nonce: string;
265
+ }): SupervisedWorkerPhysicalSession | null;
266
+ pids(): readonly number[];
267
+ subscribeExit(listener: (process: ConfigPublicationWorkerProcess, evidence: WorkerExitEvidence) => void): () => void;
268
+ shutdownAll(): Promise<readonly ProcessCleanupResult[]>;
269
+ disconnectAll(): void;
270
+ markCommitted(processes: readonly ConfigPublicationWorkerProcess[]): Promise<void>;
271
+ disconnectProcesses(processes: readonly ConfigPublicationWorkerProcess[]): void;
272
+ discardConfirmedUncommitted(target: AdmissionSet): Promise<void>;
273
+ /** Old ingress identities must never be re-admitted after an ingress boot change. */
274
+ retireForIngressBootChange(request?: IngressBootWorkerCleanupRequest): Promise<IngressBootWorkerCleanupResult>;
275
+ cleanupAuthenticatedOrphans(registryStatus: AdmissionRegistryStatus): Promise<AuthenticatedOrphanCleanupResult>;
276
+ private admissionIdentityKeys;
277
+ private admissionRegistrySnapshot;
278
+ private confirmUnchangedRegistry;
279
+ private ownedAdmissionWorkerKey;
280
+ private ingressBootCleanupResult;
281
+ private admissionWorkerKey;
282
+ private exitEvidenceIsUsable;
283
+ private waitForExactExit;
284
+ subscribeUnavailable(listener: (process: SupervisedConfigWorkerProcessAdapter, evidence: WorkerUnavailableEvidence) => void): () => void;
285
+ subscribeEligibilityChange(listener: () => void): () => void;
286
+ onUnavailable(listener: (process: SupervisedConfigWorkerProcessAdapter, evidence: WorkerUnavailableEvidence) => void): () => void;
287
+ disconnect(): void;
288
+ private clientFor;
289
+ private bindUnavailable;
290
+ private notifyEligibilityChange;
291
+ private bindExit;
292
+ /**
293
+ * Best-effort durable exit fact for a registered launch. Physical exit is not cleanup
294
+ * proof: only a signed worker cleanup report may upgrade the ledger to `released`.
295
+ */
296
+ private recordLaunchExit;
297
+ shutdownOwned(): Promise<readonly WorkerExitEvidence[]>;
298
+ }
@@ -0,0 +1,146 @@
1
+ import { type HeldProcessLifetimeGuardFacts, type armProcessLifetimeGuard } from '../supervision/process-lifetime-guard';
2
+ import type { ChildProcess } from 'node:child_process';
3
+ import type { Sha256Digest } from '@jeffusion/bungee-types';
4
+ import type { ConfigMasterMessage, ConfigProcessIdentity, WorkerDrainedMessage, WorkerDrainFailedMessage, WorkerDrainStartedMessage, WorkerExitDeadlineEvidence } from '../config-publication/types';
5
+ import type { ConfigPublicationWorkerProcess, WorkerExitEvidence } from '../config-publication/coordinator-types';
6
+ import { type WorkerSupervisionSeed, type SupervisionProcessCredential } from '../supervision';
7
+ import { WorkerControllerClient, type WorkerControllerClientOptions, type WorkerStatusPayload } from './supervised-worker-client';
8
+ import { type CapturedProcessIdentity, type ProcessIdentityProbe } from './process-identity';
9
+ import type { WorkerRuntimeSnapshot } from '../supervision';
10
+ export type WorkerUnavailableEvidence = {
11
+ readonly kind: 'unavailable';
12
+ readonly pid: number;
13
+ };
14
+ /**
15
+ * Host-private, immutable first configuration target observed for one physical worker
16
+ * instance. It intentionally carries only the three routing-critical fields and is
17
+ * pinned from the first start command so a bootstrap observer can associate a strict,
18
+ * immutable target while the worker's signed status is still a candidate. It is not a
19
+ * serving snapshot and never proves that the target was applied.
20
+ */
21
+ export type SupervisedWorkerConfigurationTarget = Readonly<{
22
+ readonly revision: number;
23
+ readonly content_hash: Sha256Digest;
24
+ readonly plugin_catalog_hash: Sha256Digest;
25
+ }>;
26
+ /**
27
+ * Injectable OS-level exact-process operations. Production uses the real
28
+ * capture/probe from ./process-identity; unit tests replace these so fake
29
+ * children never touch the operating system. There is deliberately no
30
+ * terminate: registered workers are never OS-force-signaled.
31
+ */
32
+ export type ProcessIdentityControl = Readonly<{
33
+ readonly capture: (pid: number, processInstanceId: string) => Promise<CapturedProcessIdentity>;
34
+ readonly probe: (expected: CapturedProcessIdentity) => Promise<ProcessIdentityProbe>;
35
+ readonly probeInstance?: (pid: number, processInstanceId: string) => Promise<ProcessIdentityProbe>;
36
+ }>;
37
+ export type SupervisedConfigWorkerProcessAdapterOptions = {
38
+ readonly identity: ConfigProcessIdentity;
39
+ readonly descriptorPath: string;
40
+ readonly supervisionSeed: WorkerSupervisionSeed;
41
+ readonly client: Omit<WorkerControllerClientOptions, 'baseUrl' | 'credential'>;
42
+ readonly child?: ChildProcess;
43
+ readonly pid?: number;
44
+ readonly readyClient?: WorkerControllerClient;
45
+ readonly clientFor?: (options: WorkerControllerClientOptions) => WorkerControllerClient;
46
+ readonly initializationTimeoutMs?: number;
47
+ readonly processIdentity?: ProcessIdentityControl;
48
+ readonly kernelBootId?: () => Promise<string>;
49
+ readonly readDescriptor?: () => Promise<unknown>;
50
+ readonly lifetimeGuard?: ReturnType<typeof armProcessLifetimeGuard>;
51
+ };
52
+ export declare class SupervisedConfigWorkerProcessAdapter implements ConfigPublicationWorkerProcess {
53
+ private readonly options;
54
+ readonly slot: number;
55
+ readonly identity: ConfigProcessIdentity;
56
+ readonly pid: number;
57
+ readonly origin: 'spawned' | 'adopted';
58
+ readonly initialization: Promise<void>;
59
+ private readonly messageListeners;
60
+ private readonly exitListeners;
61
+ private readonly unavailableListeners;
62
+ private client;
63
+ private lastStatus;
64
+ private configurationTargetFact;
65
+ private configurationPublication;
66
+ bootNonce: string | null;
67
+ private clientStateUnsubscribe;
68
+ private exitEvidence;
69
+ private capturedIdentity;
70
+ private readonly identityControl;
71
+ private stopped;
72
+ private drainPoll;
73
+ private drainCommand;
74
+ private drainStatusFailureReported;
75
+ private exitPublication;
76
+ kernelBootId: string | undefined;
77
+ private heldGuard;
78
+ private retirementFence;
79
+ get lifetimeGuardFacts(): HeldProcessLifetimeGuardFacts | null;
80
+ releaseLifetimeRetirementFence(): void;
81
+ constructor(options: SupervisedConfigWorkerProcessAdapterOptions);
82
+ private initialize;
83
+ private loadHeldGuard;
84
+ private publishExitEvidence;
85
+ private emitExit;
86
+ /**
87
+ * Reads one signed descriptor snapshot. Only evidence matching this exact boot,
88
+ * OS identity and (once a start was dispatched) target/internal publication is
89
+ * returned; anything unreadable or foreign stays unknown. A candidate that never
90
+ * reached `config-ready` has no drain message, so its release proof is the
91
+ * signed terminal cleanup record, never the `/shutdown` acknowledgement.
92
+ */
93
+ private readExitRecord;
94
+ /** The signed cleanup must belong to this boot attempt's exact target and publication. */
95
+ private cleanupMatches;
96
+ /** Exact OS identity captured during initialization; null until capture succeeds. */
97
+ get capturedProcessIdentity(): CapturedProcessIdentity | null;
98
+ /**
99
+ * OS-level exit proof. A child exit event still counts as spawned proof; otherwise the
100
+ * saved exact identity is probed: dead or mismatch proves the owned instance is gone
101
+ * (evidence is published to exit listeners), exact means the process is still alive,
102
+ * and unknown throws a sanitized error while the caller retains ownership.
103
+ */
104
+ verifyExactExit(): Promise<WorkerExitEvidence | null>;
105
+ private readyClient;
106
+ get controlState(): WorkerControllerClient['state'];
107
+ get supervisionCredential(): SupervisionProcessCredential | null;
108
+ get cachedStatus(): WorkerStatusPayload | null;
109
+ /**
110
+ * Latest worker-signed status from the currently bound control client, falling back to
111
+ * the last status recorded here. The client updates its own cached snapshot on lease
112
+ * renewal and recovery, so this is fresher than `cachedStatus`; it is a read-only
113
+ * observation and does not change the existing exact-session gate.
114
+ */
115
+ get latestSignedStatus(): WorkerStatusPayload | null;
116
+ /**
117
+ * Host-private, frozen first start target for this physical instance. The command is
118
+ * first routed through the existing safe snapshot/parse (`parseConfigMasterMessage`),
119
+ * which rejects getters/Proxies and fully validates the aggregate, hashes, activated
120
+ * names and publication; the parsed DTO is deep-frozen and only then pinned, before the
121
+ * ready client is awaited and before any command is dispatched. A later start for a
122
+ * different target is rejected, as is a start whose identity does not match this
123
+ * adapter; an adopted worker that never received a start command reports null.
124
+ */
125
+ get configurationTarget(): SupervisedWorkerConfigurationTarget | null;
126
+ get hasDrainTask(): boolean;
127
+ /**
128
+ * Pins the first start target from an already validated, deep-frozen command. A foreign
129
+ * identity never pins and is rejected without dispatch. The same target may be retried
130
+ * (idempotent), while a second, different target for the same physical instance is
131
+ * rejected.
132
+ */
133
+ private pinStartTarget;
134
+ status(timeoutMs?: number): Promise<WorkerStatusPayload>;
135
+ drainStatus(timeoutMs?: number): Promise<WorkerDrainStartedMessage | WorkerDrainedMessage | WorkerDrainFailedMessage | null>;
136
+ runtimeSnapshot(signal?: AbortSignal): Promise<WorkerRuntimeSnapshot>;
137
+ private publish;
138
+ send(input: ConfigMasterMessage): Promise<void>;
139
+ private followDrain;
140
+ subscribeMessage(listener: (message: unknown) => void): () => void;
141
+ subscribeExit(listener: (evidence: WorkerExitEvidence) => void): () => void;
142
+ subscribeUnavailable(listener: (evidence: WorkerUnavailableEvidence) => void): () => void;
143
+ onUnavailable(listener: (evidence: WorkerUnavailableEvidence) => void): () => void;
144
+ terminate(mode: 'graceful' | 'force', timeoutMs?: number, exitDeadline?: WorkerExitDeadlineEvidence): Promise<void>;
145
+ disconnect(): void;
146
+ }
@@ -0,0 +1,18 @@
1
+ export declare const WORKER_INITIALIZATION_DIAGNOSTIC_MESSAGE = "Worker initialization failed";
2
+ declare const PHASES: readonly ["kernel_clock", "descriptor_read", "descriptor_validation", "os_identity_capture", "control_attach", "adapter_stopped"];
3
+ export type WorkerInitializationPhase = typeof PHASES[number];
4
+ declare const ERROR_TYPES: readonly ["Error", "TypeError", "SyntaxError", "AbortError", "ProcessIdentityUnavailableError", "ProcessIdentityMissingError", "SupervisionProtocolError", "unknown"];
5
+ declare const ERROR_CODES: readonly ["ENOENT", "EACCES", "EPERM", "ESRCH", "EIO", "ECONNREFUSED", "ECONNRESET", "ETIMEDOUT", "ERR_CHILD_PROCESS_STDIO_MAXBUFFER", "timeout", "cancelled", "invalid_mac", "identity_mismatch", "malformed_message", "unattached_controller", "stale_controller", "sequence_replay", "challenge_expired", "status_correlation_mismatch", "unknown"];
6
+ export type WorkerInitializationDiagnostic = Readonly<{
7
+ phase: WorkerInitializationPhase;
8
+ pid: number;
9
+ reporterPid: number;
10
+ origin: 'spawned' | 'adopted';
11
+ elapsedMs: number;
12
+ errorType: typeof ERROR_TYPES[number];
13
+ errorCode: typeof ERROR_CODES[number];
14
+ }>;
15
+ /** One best-effort record on final initialization failure, never on retries. */
16
+ export declare function recordWorkerInitializationFailure(evidence: Omit<WorkerInitializationDiagnostic, 'reporterPid' | 'errorType' | 'errorCode'>, error: unknown): void;
17
+ export declare function readWorkerInitializationDiagnostic(value: unknown): WorkerInitializationDiagnostic | null;
18
+ export {};
@@ -0,0 +1,2 @@
1
+ import { type MasterProcessDependencies, type MasterProcessHandle } from './master-runtime/composition';
2
+ export declare function startMasterProcess(dependencies?: MasterProcessDependencies, bootNonce?: string | null): Promise<MasterProcessHandle>;
@@ -0,0 +1,8 @@
1
+ /** A browser-local companion. It captures a code, never exchanges or stores tokens. */
2
+ export declare function captureOAuthCallback(options?: {
3
+ port?: number;
4
+ timeoutMs?: number;
5
+ signal?: AbortSignal;
6
+ onListening?: (port: number) => void;
7
+ }): Promise<string>;
8
+ export declare function oauthCallbackCommand(): Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { type LoadedPluginArtifactManifest, type PluginManifestNegotiationOptions } from './plugin-artifact-types';
2
+ export * from './plugin-artifact-types';
3
+ export { toPluginManifestContractSnapshot } from './plugin-artifact-negotiation';
4
+ export declare function loadPluginArtifactManifest(pluginDir: string, options?: PluginManifestNegotiationOptions): Promise<LoadedPluginArtifactManifest>;
@@ -0,0 +1,12 @@
1
+ import type { PluginManifest } from './plugin.types';
2
+ import { type PluginArtifactKind, type PluginCapability, type PluginManifestContractSnapshot, type PluginUiExtensionMode } from './plugin-artifact-types';
3
+ export declare function validateRequiredString(value: unknown, fieldName: string): string;
4
+ export declare function validateArtifactKind(value: unknown): PluginArtifactKind;
5
+ export declare function validateCapabilities(value: unknown): PluginCapability[];
6
+ export declare function validateSchemaVersion(value: unknown): number | string;
7
+ export declare function negotiateSchemaVersion(schemaVersion: number | string, supportedSchemaVersions: ReadonlyArray<number | string>): number | string;
8
+ export declare function validateUiExtensionMode(value: unknown): PluginUiExtensionMode;
9
+ export declare function validateBungeeEngineRange(value: unknown): string;
10
+ export declare function negotiateCapabilities(capabilities: PluginCapability[], hostCapabilities: readonly string[]): PluginCapability[];
11
+ export declare function toPluginManifestContractSnapshot(manifest?: Partial<PluginManifest> | null, overrides?: Partial<PluginManifestContractSnapshot>): PluginManifestContractSnapshot;
12
+ export declare function throwManifestValidationError(message: string, details: PluginManifestContractSnapshot): never;