@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,93 @@
1
+ import type { Database } from 'bun:sqlite';
2
+ import type { ConfigProcessIdentity } from '../config-publication/types';
3
+ import type { ProcessLifetimeGuardFacts } from '../supervision/process-lifetime-guard';
4
+ export type WorkerLaunchIdentity = ConfigProcessIdentity;
5
+ export type WorkerLaunchAllocation = {
6
+ readonly mutation_id: string;
7
+ readonly worker_slot: number;
8
+ readonly attempt_no: number;
9
+ };
10
+ export type WorkerLaunch = {
11
+ readonly identity: WorkerLaunchIdentity;
12
+ readonly guard: ProcessLifetimeGuardFacts;
13
+ readonly allocation: WorkerLaunchAllocation | null;
14
+ readonly registered_at: number;
15
+ readonly admitted: boolean;
16
+ readonly not_started: boolean;
17
+ readonly exited: boolean;
18
+ readonly cleanup_released: boolean;
19
+ readonly capacity_reclaimed: boolean;
20
+ };
21
+ export type WorkerLaunchExitEvidence = {
22
+ readonly kind: 'not_started';
23
+ } | {
24
+ readonly kind: 'exited';
25
+ readonly cleanup: 'released' | 'unknown';
26
+ };
27
+ export type UnsettledWorkerLaunch = {
28
+ readonly kind: 'launch';
29
+ readonly launch: WorkerLaunch;
30
+ } | {
31
+ readonly kind: 'reservation';
32
+ readonly allocation: WorkerLaunchAllocation;
33
+ };
34
+ /** Exact durable facts for one allocation, including a fence that has no launch intent. */
35
+ export type WorkerLaunchAllocationFacts = Readonly<{
36
+ allocation: WorkerLaunchAllocation;
37
+ launch: WorkerLaunch | null;
38
+ reserved_at: number | null;
39
+ not_started_at: number | null;
40
+ admitted_at: number | null;
41
+ exited_at: number | null;
42
+ cleanup_released_at: number | null;
43
+ settled: boolean;
44
+ }>;
45
+ /** Persists the pre-fork attempt reservation inside the attempt transaction. */
46
+ export declare function writeWorkerLaunchReservation(db: Database, mutationId: string, workerSlot: number, attemptNo: number, updatedAt: number): void;
47
+ /** Bind an already ready process to the publication created by the same CAS. */
48
+ export declare function bindPreparedWorkerLaunch(db: Database, identity: WorkerLaunchIdentity, guard: ProcessLifetimeGuardFacts | null, allocation: WorkerLaunchAllocation): void;
49
+ /**
50
+ * Closes the window "attempt persisted, intent not registered". A registered intent means a
51
+ * fork may have happened, so it can only be closed with exit evidence instead.
52
+ */
53
+ export declare function fenceWorkerLaunchNotStarted(db: Database, mutationId: string, workerSlot: number, attemptNo: number, updatedAt: number): void;
54
+ /**
55
+ * Immutable intent for the real pre-fork identity and original guard facts. The allocation is
56
+ * optional so a publication-less currentStartup can be recorded without inventing an owner.
57
+ */
58
+ export declare function registerWorkerLaunch(db: Database, identity: WorkerLaunchIdentity, guard: ProcessLifetimeGuardFacts, allocation: WorkerLaunchAllocation | null, updatedAt: number): WorkerLaunch;
59
+ /** Only the trusted controller records this after real admission/handoff confirmation. */
60
+ export declare function recordWorkerLaunchAdmitted(db: Database, workerInstanceId: string, updatedAt: number): WorkerLaunch;
61
+ /** Explicit exit and resource-release proof. A free guard is never accepted as cleanup proof. */
62
+ export declare function recordWorkerLaunchExit(db: Database, workerInstanceId: string, evidence: WorkerLaunchExitEvidence, updatedAt: number): WorkerLaunch;
63
+ export declare function readWorkerLaunch(db: Database, workerInstanceId: string): WorkerLaunch | null;
64
+ /** The trusted controller has authenticated failed cleanup and proved the exact original guard free. */
65
+ export declare function recordWorkerLaunchCapacityReclaimed(db: Database, workerInstanceId: string, guard: ProcessLifetimeGuardFacts, updatedAt: number): void;
66
+ /**
67
+ * Authoritative settled/unsettled view for one exact allocation. A fence (not_started)
68
+ * has no intent, so callers must not infer absence from getUnsettledWorkerLaunches().
69
+ */
70
+ export declare function readWorkerLaunchAllocationFacts(db: Database, allocation: WorkerLaunchAllocation): WorkerLaunchAllocationFacts | null;
71
+ /**
72
+ * Old attempts must not be replaced while their launch has no exit+cleanup proof.
73
+ * Attempts without a reservation belong to the pre-ledger schema and are not blocked.
74
+ */
75
+ export declare function assertWorkerAttemptLaunchSettled(db: Database, mutationId: string, workerSlot: number, attemptNo: number): void;
76
+ /**
77
+ * A degraded terminal may release its owner only when every launch of this publication is
78
+ * either admitted (retirement owns it) or proven not started / exited+cleaned.
79
+ */
80
+ export declare function assertPublicationLaunchDebtSettled(db: Database, mutationId: string): void;
81
+ /**
82
+ * Authoritative global inventory of launches without actual settlement proof. It includes
83
+ * admitted launches: historical admission is not proof that a process is still a fresh signed
84
+ * serving member, and a publication-less currentStartup has no owner or retirement to pay it.
85
+ * An empty result is not proof for a specific allocation; use
86
+ * readWorkerLaunchAllocationFacts for that exact allocation.
87
+ */
88
+ export declare function readWorkerLaunchInventory(db: Database): readonly UnsettledWorkerLaunch[];
89
+ /**
90
+ * Claim-scoped view that leaves admitted occupancy to the runtime's fresh serving-set check.
91
+ * Use readWorkerLaunchInventory for the complete budget inventory.
92
+ */
93
+ export declare function readUnsettledWorkerLaunches(db: Database): readonly UnsettledWorkerLaunch[];
@@ -0,0 +1,6 @@
1
+ import type { BoundControlClientProvider } from './runtime-dependencies';
2
+ /** Existing bound-client call shape, transported by the canonical peer Host RPC. */
3
+ export declare function createWorkerPluginControlPeerProvider(beforeCall?: (signal: AbortSignal) => Promise<void>): {
4
+ provider: BoundControlClientProvider;
5
+ dispose(): void;
6
+ };
@@ -0,0 +1,84 @@
1
+ import { type WebSocketBridge, type WebSocketBridgeData } from '../websocket';
2
+ import type { AppConfig } from '@jeffusion/bungee-types';
3
+ import type { Server } from 'bun';
4
+ import { type ConfigWorkerLifecycle } from '../config-publication/worker-runtime-contract';
5
+ import type { StartWorkerCommand } from '../config-publication/types';
6
+ import type { PluginRuntimeOrchestratorStatusReport } from '../plugin-runtime-orchestrator';
7
+ import type { RequestLoggerDependencies } from '../logger/request-logger';
8
+ import type { PluginServiceHost } from '../plugin-services';
9
+ type LifecycleServer = Pick<Server<unknown>, 'port' | 'stop'>;
10
+ export type ConfigWorkerServingHandle = {
11
+ readonly server: LifecycleServer;
12
+ readonly websocket?: WebSocketBridge;
13
+ readonly sessions?: Set<Promise<void>>;
14
+ closeTimer?: ReturnType<typeof setTimeout>;
15
+ readonly cleanup: (observationEnded?: boolean) => Promise<void>;
16
+ drainPromise: Promise<void> | null;
17
+ drainComplete: boolean;
18
+ stopped: boolean;
19
+ forceStopped: boolean;
20
+ stopPromise: Promise<void> | null;
21
+ };
22
+ type LifecycleFetch = (request: Request) => Response | Promise<Response>;
23
+ type WebSocketFetch = (request: Request, server?: Bun.Server<WebSocketBridgeData>) => Response | undefined | Promise<Response | undefined>;
24
+ export type ServingRequestContext = {
25
+ readonly servingRevision: number;
26
+ readonly accessId?: string;
27
+ readonly logging?: RequestLoggerDependencies;
28
+ };
29
+ export type ProductionResources = {
30
+ configureBodyStorage(config: AppConfig): void;
31
+ initializeRuntimeState(config: AppConfig): void;
32
+ cleanupRuntimeState(): void;
33
+ readonly requestLogging?: RequestLoggerDependencies;
34
+ initializeRequestLogging?(): Promise<void>;
35
+ initializePluginContext(): void;
36
+ cleanupPluginContexts(): Promise<void>;
37
+ initializePluginRuntime(config: AppConfig, activatedPluginNames: readonly string[], services?: PluginServiceHost, beforeBootstrap?: (signal: AbortSignal) => Promise<void>, signal?: AbortSignal): Promise<{
38
+ generation: number;
39
+ status: PluginRuntimeOrchestratorStatusReport;
40
+ }>;
41
+ cleanupPluginRuntime(): Promise<void>;
42
+ handleRequest(request: Request, config: AppConfig, context: ServingRequestContext): Promise<Response>;
43
+ serve(fetch: LifecycleFetch): LifecycleServer;
44
+ serveWebSocket?(fetch: WebSocketFetch, websocket: Bun.WebSocketHandler<WebSocketBridgeData>): LifecycleServer;
45
+ closeAccessLog(observationEnded?: boolean): Promise<void>;
46
+ };
47
+ export type ConfigWorkerLifecycleOptions = {
48
+ readonly transportSecret: string;
49
+ /** Exact worker process UUID:boot_nonce, supplied by the supervised process entry. */
50
+ readonly ownerId?: string;
51
+ readonly loadResources?: () => Promise<ProductionResources>;
52
+ /**
53
+ * Canonical worker-process service host (peer-communication enabled) shared
54
+ * with the plugin runtime, so worker plugins reach control services through
55
+ * the same owner/lifecycle/lease registry as every other consumer.
56
+ */
57
+ readonly services?: PluginServiceHost;
58
+ /**
59
+ * Observed before plugin initialization, so a peer/routing layer can pin the
60
+ * exact applied start target (catalog hash) before any plugin runs.
61
+ */
62
+ readonly onStartTarget?: (command: StartWorkerCommand) => void;
63
+ /**
64
+ * Real, bounded startup gate awaited BEFORE plugin initialization: the peer
65
+ * transport must be authenticated and attached, instead of relying on a scan
66
+ * delay that happened to be enough.
67
+ */
68
+ readonly awaitPeerReady?: (signal: AbortSignal) => Promise<void>;
69
+ /**
70
+ * Host gate awaited by the plugin registry itself: after the dependency graph
71
+ * is updated and before any plugin handler is created. The worker runtime
72
+ * wires it to the real publication-directory load.
73
+ */
74
+ readonly beforeBootstrap?: (signal: AbortSignal) => Promise<void>;
75
+ /**
76
+ * Wired to the real drain admission point: no new peer/bootstrap/background
77
+ * work is admitted from here on, while every already-accepted lease and
78
+ * terminal keeps draining.
79
+ */
80
+ readonly onDrainStart?: () => void;
81
+ };
82
+ export declare function createConfigWorkerLifecycle(options: ConfigWorkerLifecycleOptions): ConfigWorkerLifecycle<ConfigWorkerServingHandle>;
83
+ export declare function loadProductionResources(ownerId: string): Promise<ProductionResources>;
84
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { DataPrincipal } from '../plugin-extensions';
2
+ export declare const INTERNAL_TRANSPORT_TOKEN_HEADER = "x-bungee-internal-transport-token";
3
+ export declare const INTERNAL_TRANSPORT_ORIGINAL_URL_HEADER = "x-bungee-internal-original-url";
4
+ export declare const INTERNAL_TRUSTED_PEER_HEADER = "x-bungee-internal-trusted-peer";
5
+ export declare const INTERNAL_TRUSTED_PEER_MAC_HEADER = "x-bungee-internal-trusted-peer-mac";
6
+ export type WorkerTransportRestoreResult = {
7
+ readonly ok: true;
8
+ readonly request: Request;
9
+ } | {
10
+ readonly ok: false;
11
+ readonly status: 400 | 403;
12
+ };
13
+ export interface TrustedDataIdentity {
14
+ readonly principal: DataPrincipal;
15
+ readonly requestId: string;
16
+ requestLog?: {
17
+ readonly ownerId: string;
18
+ readonly observationOwnerId: string;
19
+ };
20
+ }
21
+ export declare const INTERNAL_DATA_IDENTITY_HEADER = "x-bungee-internal-data-identity";
22
+ export declare const INTERNAL_DATA_IDENTITY_MAC_HEADER = "x-bungee-internal-data-identity-mac";
23
+ export declare function getTrustedDataIdentity(request: Request): TrustedDataIdentity | null;
24
+ /** Core-only derivation: external headers cannot mint a logical generation identity. */
25
+ export declare function deriveWorkerRequestIdentity(source: Request, derived: Request, requestId: string): void;
26
+ export declare function signDataIdentity(identity: string, method: string, url: string, secret: string): string;
27
+ export declare function generateWorkerTransportSecret(): string;
28
+ export declare function parseWorkerTransportSecret(value: unknown): string;
29
+ export declare function signWorkerTransportPeer(peer: string, method: string, originalUrl: string, secret: string): string;
30
+ export declare function getTrustedWorkerPeer(request: Request): string | null;
31
+ export declare function restoreWorkerTransportRequest(request: Request, transportSecret: string): WorkerTransportRestoreResult;
@@ -0,0 +1,38 @@
1
+ import type { ConfigProcessIdentity } from '../config-publication/types';
2
+ import { type WorkerSupervisionSeed } from '../supervision';
3
+ export type SupervisedWorkerRateLimitSession = {
4
+ readonly supervisionPort: number;
5
+ readonly expectedIngress: {
6
+ readonly process_instance_id: string;
7
+ readonly boot_nonce: string;
8
+ };
9
+ };
10
+ export declare const CONFIG_WORKER_ENV_NAMES: {
11
+ readonly masterGeneration: "BUNGEE_MASTER_GENERATION";
12
+ readonly workerInstanceId: "BUNGEE_WORKER_INSTANCE_ID";
13
+ readonly workerSlot: "BUNGEE_WORKER_SLOT";
14
+ readonly transportSecret: "BUNGEE_INTERNAL_TRANSPORT_SECRET";
15
+ readonly accessLogDbPath: "BUNGEE_ACCESS_DB_PATH";
16
+ readonly supervisionSeed: "BUNGEE_WORKER_SUPERVISION_SEED";
17
+ readonly controlPort: "BUNGEE_WORKER_CONTROL_PORT";
18
+ readonly masterControlPort: "BUNGEE_MASTER_CONTROL_PORT";
19
+ readonly descriptorPath: "BUNGEE_WORKER_DESCRIPTOR_PATH";
20
+ readonly startupWatchdogMs: "BUNGEE_WORKER_STARTUP_WATCHDOG_MS";
21
+ readonly attachGraceMs: "BUNGEE_WORKER_ATTACH_GRACE_MS";
22
+ readonly ingressSupervisionPort: "BUNGEE_INGRESS_SUPERVISION_PORT";
23
+ readonly ingressProcessInstanceId: "BUNGEE_INGRESS_PROCESS_INSTANCE_ID";
24
+ readonly ingressBootNonce: "BUNGEE_INGRESS_BOOT_NONCE";
25
+ };
26
+ export type SupervisedWorkerEnvironment = {
27
+ readonly identity: ConfigProcessIdentity;
28
+ readonly transportSecret: string;
29
+ readonly accessLogDbPath: string;
30
+ readonly supervisionSeed: WorkerSupervisionSeed;
31
+ readonly controlPort: number;
32
+ readonly masterControlPort: number;
33
+ readonly descriptorPath: string;
34
+ readonly startupWatchdogMs: number;
35
+ readonly attachGraceMs: number;
36
+ readonly rateLimitSession?: SupervisedWorkerRateLimitSession;
37
+ };
38
+ export declare function parseSupervisedWorkerEnvironment(env: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>): SupervisedWorkerEnvironment;
@@ -0,0 +1,31 @@
1
+ import { type RateLimitHttpClient, type RateLimitDebitResponseBody, type RateLimitIngressIdentity, type RateLimitNormalizedKey, type RateLimitWorkerIdentity, type RateLimitFailureReason, type RateLimitFailureStage, type RateLimitFailureInput, type RateLimitObserver } from '../rate-limit';
2
+ export type WorkerRateLimitHttpProvider = {
3
+ readonly client: RateLimitHttpClient;
4
+ reportFailure?(failure: {
5
+ readonly reason: RateLimitFailureReason;
6
+ readonly stage: RateLimitFailureStage;
7
+ readonly protocolCode?: string;
8
+ readonly remoteStatus?: number;
9
+ readonly attempts?: number;
10
+ }): void;
11
+ debit(input: {
12
+ readonly routeId: string;
13
+ readonly keyExpression: string;
14
+ readonly key: RateLimitNormalizedKey;
15
+ readonly revision: number;
16
+ readonly rps: number;
17
+ readonly burst: number;
18
+ }, signal: AbortSignal): Promise<RateLimitDebitResponseBody>;
19
+ dispose(): void;
20
+ };
21
+ export declare function setWorkerRateLimitFailureObserver(next: RateLimitObserver | null): void;
22
+ export declare function reportWorkerRateLimitFailure(failure: RateLimitFailureInput): void;
23
+ export declare function setWorkerRateLimitClient(next: WorkerRateLimitHttpProvider | null): void;
24
+ export declare function getWorkerRateLimitClient(): WorkerRateLimitHttpProvider | null;
25
+ export declare function createWorkerRateLimitHttpProvider(options: {
26
+ readonly transportSecret: string;
27
+ readonly worker: RateLimitWorkerIdentity;
28
+ readonly expectedIngress: RateLimitIngressIdentity;
29
+ readonly supervisionPort: number;
30
+ readonly observer?: RateLimitObserver;
31
+ }): WorkerRateLimitHttpProvider;
@@ -0,0 +1,12 @@
1
+ import type { BoundControlClient, ControlBindingIdentity } from '../plugin-control/contracts';
2
+ export type BoundControlAttemptIdentity = {
3
+ readonly revision: number;
4
+ readonly endpointId: string;
5
+ readonly attemptId: string;
6
+ };
7
+ export type BoundControlClientProvider = (binding: ControlBindingIdentity, attempt?: BoundControlAttemptIdentity) => BoundControlClient;
8
+ export declare function setBoundControlClientProvider(next: BoundControlClientProvider | null): void;
9
+ export declare function getBoundControlClient(binding: ControlBindingIdentity, attempt?: BoundControlAttemptIdentity): BoundControlClient;
10
+ export declare function hasBoundControlClientProvider(): boolean;
11
+ export declare function setWorkerPluginStorageFactory(factory: import('../plugin-control').PluginStorageFactory | null): void;
12
+ export declare function getWorkerPluginStorageFactory(): import('../plugin-control').PluginStorageFactory;
@@ -0,0 +1,5 @@
1
+ import type { CommittedConfigurationSnapshot } from '@jeffusion/bungee-types';
2
+ import { type RuntimeConfigSnapshot } from '../config-storage/runtime-config';
3
+ import type { StartWorkerCommand } from '../config-publication/types';
4
+ import type { PluginManifestCatalog } from '../plugin-manifest-catalog';
5
+ export declare function createCatalogSnapshotCompiler(loadCatalog: () => Promise<PluginManifestCatalog>): (snapshot: CommittedConfigurationSnapshot, command: StartWorkerCommand) => Promise<RuntimeConfigSnapshot>;
@@ -0,0 +1,8 @@
1
+ import { PluginManifestCatalog } from '../plugin-manifest-catalog';
2
+ export type SupervisedWorkerProcessDependencies = {
3
+ readonly env?: NodeJS.ProcessEnv | Readonly<Record<string, string | undefined>>;
4
+ readonly loadCatalog?: () => Promise<PluginManifestCatalog>;
5
+ readonly kernelBootId?: () => Promise<string>;
6
+ readonly exitProcess?: (code: number) => void;
7
+ };
8
+ export declare function runSupervisedWorkerProcess(dependencies?: SupervisedWorkerProcessDependencies): Promise<void>;
@@ -0,0 +1 @@
1
+ export declare const CORE_HOST_VERSION: string;
@@ -0,0 +1,41 @@
1
+ import { type DaemonMetadataV1 } from '@jeffusion/bungee-types';
2
+ import { readDaemonMetadataFile, transitionDaemonMetadataFile, deleteDaemonMetadataForMaster, type DaemonFileOptions } from '@jeffusion/bungee-types/daemon-file';
3
+ import { type LaunchIdentity } from './launch-identity';
4
+ export declare const DAEMON_BOOTSTRAP_ENV_NAMES: Readonly<{
5
+ metadataPath: "BUNGEE_DAEMON_METADATA_PATH";
6
+ bootNonce: "BUNGEE_DAEMON_BOOT_NONCE";
7
+ shutdownSecret: "BUNGEE_DAEMON_SHUTDOWN_SECRET";
8
+ }>;
9
+ export type DaemonBootstrapEnvironment = Readonly<Record<string, string | undefined>>;
10
+ export type DaemonBootstrap = {
11
+ readonly metadataPath: string;
12
+ readonly bootNonce: string;
13
+ readonly shutdownSecret: string;
14
+ readonly pid: number;
15
+ readonly metadata: DaemonMetadataV1;
16
+ readonly store: {
17
+ readonly file: DaemonFileOptions;
18
+ readonly read: typeof readDaemonMetadataFile;
19
+ readonly transition: typeof transitionDaemonMetadataFile;
20
+ readonly deleteForMaster: typeof deleteDaemonMetadataForMaster;
21
+ };
22
+ };
23
+ export type DaemonBootstrapTakeoverOptions = {
24
+ readonly env?: NodeJS.ProcessEnv | DaemonBootstrapEnvironment;
25
+ readonly marker: string | null;
26
+ readonly pid?: number;
27
+ readonly identity?: LaunchIdentity;
28
+ readonly file?: DaemonFileOptions;
29
+ readonly readMetadata?: typeof readDaemonMetadataFile;
30
+ readonly transitionMetadata?: typeof transitionDaemonMetadataFile;
31
+ readonly deleteMetadata?: typeof deleteDaemonMetadataForMaster;
32
+ readonly runtimeDirectory?: string;
33
+ };
34
+ export declare class DaemonBootstrapError extends Error {
35
+ readonly code: 'environment' | 'identity' | 'metadata' | 'secret' | 'transition';
36
+ readonly name = "DaemonBootstrapError";
37
+ constructor(code: 'environment' | 'identity' | 'metadata' | 'secret' | 'transition', message: string);
38
+ }
39
+ export declare function clearDaemonBootstrapEnvironment(env?: NodeJS.ProcessEnv | Record<string, string | undefined>): void;
40
+ export declare function takeOverDaemonBootstrap(options: DaemonBootstrapTakeoverOptions): Promise<DaemonBootstrap | null>;
41
+ export declare const bootstrapDaemonMaster: typeof takeOverDaemonBootstrap;
@@ -0,0 +1 @@
1
+ export { createDaemonShutdownHandler, DAEMON_AUTHORIZATION_HEADER, DAEMON_BOOT_HEADER, DAEMON_INSTANCE_HEADER, DAEMON_PID_HEADER, DAEMON_CONTROL_HTTP_PREFIX, DAEMON_SHUTDOWN_PATH, type ConstantTimeComparator, type DaemonControlRequestContext, type DaemonShutdownControl, type DaemonShutdownHandler, type DaemonShutdownHandlerOptions, } from './shutdown';
@@ -0,0 +1,26 @@
1
+ export declare const DAEMON_BOOT_MARKER_PREFIX = "--bungee-daemon-boot=";
2
+ export declare class LaunchIdentityError extends Error {
3
+ readonly code: 'marker' | 'entrypoint' | 'identity';
4
+ readonly name = "LaunchIdentityError";
5
+ constructor(code: 'marker' | 'entrypoint' | 'identity', message: string);
6
+ }
7
+ export type ParsedDaemonBootMarker = {
8
+ readonly bootNonce: string | null;
9
+ readonly argv: readonly string[];
10
+ };
11
+ export declare function parseDaemonBootMarker(argv: readonly string[]): ParsedDaemonBootMarker;
12
+ export type LaunchIdentity = {
13
+ readonly executable: string;
14
+ readonly entrypoint: string | null;
15
+ };
16
+ export type LaunchIdentityInput = {
17
+ readonly execPath: string;
18
+ readonly argv: readonly string[];
19
+ readonly platform?: NodeJS.Platform;
20
+ readonly realpath?: (path: string) => string;
21
+ };
22
+ export declare function resolveLaunchIdentity(input: LaunchIdentityInput): LaunchIdentity;
23
+ export declare function launchIdentityMatches(expected: LaunchIdentity, actual: LaunchIdentity, platform?: NodeJS.Platform): boolean;
24
+ export declare function currentLaunchIdentity(argv?: readonly string[]): LaunchIdentity;
25
+ export declare const parseDaemonLaunchIdentity: typeof parseDaemonBootMarker;
26
+ export declare const resolveCurrentLaunchIdentity: typeof currentLaunchIdentity;
@@ -0,0 +1,22 @@
1
+ import { type DaemonMetadataV1 } from '@jeffusion/bungee-types';
2
+ export { DAEMON_AUTHORIZATION_HEADER, DAEMON_BOOT_HEADER, DAEMON_CONTROL_HTTP_PREFIX, DAEMON_INSTANCE_HEADER, DAEMON_PID_HEADER, DAEMON_SHUTDOWN_PATH, } from '@jeffusion/bungee-types';
3
+ export type ConstantTimeComparator = (left: Uint8Array, right: Uint8Array) => boolean;
4
+ export type DaemonControlRequestContext = {
5
+ readonly onResponseSettled: (callback: () => void, onError?: (error: unknown) => void) => void;
6
+ };
7
+ export type DaemonShutdownHandler = {
8
+ readonly handle: (request: Request, context?: DaemonControlRequestContext) => Promise<Response>;
9
+ readonly accepted: boolean;
10
+ };
11
+ export type DaemonShutdownHandlerOptions = {
12
+ readonly updates?: {
13
+ handle(request: Request, privateControl: boolean): Promise<Response>;
14
+ };
15
+ readonly metadata: DaemonMetadataV1 | (() => DaemonMetadataV1);
16
+ readonly isReady?: () => boolean;
17
+ readonly onShutdownRequested: () => void | Promise<void>;
18
+ readonly onShutdownError?: (error: unknown) => void;
19
+ readonly comparator?: ConstantTimeComparator;
20
+ };
21
+ export declare function createDaemonShutdownHandler(options: DaemonShutdownHandlerOptions): DaemonShutdownHandler;
22
+ export type DaemonShutdownControl = DaemonShutdownHandler;
@@ -0,0 +1,16 @@
1
+ export declare const WORKER_RPC_ATTEMPT_TIMEOUT_MS = 1000;
2
+ export interface DataAdmissionErrorDetails {
3
+ message?: string;
4
+ param?: string;
5
+ }
6
+ /** Shared inert error contract; importing it never loads admission runtime modules. */
7
+ export declare class DataAdmissionError extends Error {
8
+ readonly status: number;
9
+ readonly code: string;
10
+ readonly retryAfter?: number | undefined;
11
+ readonly name = "DataAdmissionError";
12
+ readonly details?: DataAdmissionErrorDetails;
13
+ constructor(status: number, code: string, retryAfter?: number | undefined, details?: DataAdmissionErrorDetails);
14
+ }
15
+ /** Plugin bundles have their own class identity; normalize their explicit error contract. */
16
+ export declare function normalizeAdmissionError(error: unknown): DataAdmissionError | null;
@@ -0,0 +1,92 @@
1
+ import { type DataPrincipal, type AdmissionRequirement, type AdmissionTarget, type IngressPlugin } from '../plugin-extensions';
2
+ import type { DurableJson } from '../plugin-durable-state';
3
+ import type { RateLimitWorkerIdentity } from '../rate-limit';
4
+ export { DataAdmissionError } from './errors';
5
+ export interface AdmissionPluginPublication {
6
+ readonly name: string;
7
+ readonly entry: string;
8
+ readonly catalogHash: string;
9
+ readonly policy: DurableJson;
10
+ }
11
+ export interface DataAdmissionPublication {
12
+ readonly version: number;
13
+ readonly admissionSequence?: number;
14
+ readonly routeRequirements?: readonly AdmissionRequirement[];
15
+ readonly plugins: readonly AdmissionPluginPublication[];
16
+ readonly unblock?: readonly {
17
+ readonly plugin: string;
18
+ readonly keyId: string;
19
+ }[];
20
+ }
21
+ export interface AdmissionGrant {
22
+ readonly requestId: string;
23
+ readonly principal: DataPrincipal;
24
+ readonly version: number;
25
+ readonly snapshots: Readonly<Record<string, DurableJson>>;
26
+ }
27
+ export interface PreparedDataAdmission {
28
+ commit(): () => void;
29
+ abort(): void;
30
+ }
31
+ export type CandidateDataAdmission = Pick<DataAdmissionPublication, 'plugins'> & {
32
+ readonly routeRequirements: NonNullable<DataAdmissionPublication['routeRequirements']>;
33
+ };
34
+ /** All plans and the grant are committed synchronously, after every participant accepts. */
35
+ export declare class DataAdmissionHost {
36
+ private readonly options;
37
+ private publicationAdmissionSequence;
38
+ private blocked;
39
+ private readonly blockedScopes;
40
+ private version;
41
+ private routeRequirements;
42
+ private plugins;
43
+ private preparing;
44
+ private grants;
45
+ private publication;
46
+ private previews;
47
+ private disposed;
48
+ private cleanupTimer;
49
+ constructor(options: {
50
+ authorizeWorker(worker: RateLimitWorkerIdentity): 'active' | 'retired' | 'prepared' | 'unknown';
51
+ catalogHash(admissionSequence?: number): string | null;
52
+ admissionSequence?(): number | null;
53
+ loadPlugin?(entry: string): Promise<{
54
+ createIngress(): IngressPlugin;
55
+ }>;
56
+ clock?(): number;
57
+ });
58
+ publish(input: DataAdmissionPublication, assertAuthority?: () => void): Promise<{
59
+ version: number;
60
+ }>;
61
+ preparePublication(input: DataAdmissionPublication, candidate: boolean, assertAuthority?: () => void, preparedCatalogHash?: string): Promise<PreparedDataAdmission>;
62
+ private reconcileKey;
63
+ private reconcile;
64
+ private activate;
65
+ private sweepRuntime;
66
+ sweepKeyedState(): void;
67
+ dispose(): void;
68
+ freeze(): void;
69
+ freezePluginKey(plugin: string, keyId: string): void;
70
+ private now;
71
+ status(): {
72
+ version: number;
73
+ blocked: boolean;
74
+ };
75
+ authenticate(request: Request): DataPrincipal;
76
+ /** Policy inspection performs identity/protection checks without planning or debiting. */
77
+ inspect(target: AdmissionTarget, worker: RateLimitWorkerIdentity): {
78
+ policyVersion: number;
79
+ requirements: Record<string, {
80
+ request: 'none' | 'json-read';
81
+ }>;
82
+ };
83
+ /** Access-only stage: no plan, preview ticket, state write or model reservation. */
84
+ authorize(target: AdmissionTarget, worker: RateLimitWorkerIdentity, expectedVersion: number): {
85
+ policyVersion: number;
86
+ };
87
+ private resolveTargetIdentity;
88
+ admit(target: AdmissionTarget, worker: RateLimitWorkerIdentity, preview?: boolean, expectedVersion?: number): AdmissionGrant;
89
+ beforeAttempt(target: AdmissionTarget, worker: RateLimitWorkerIdentity): AdmissionGrant;
90
+ release(requestId: string, worker: RateLimitWorkerIdentity): void;
91
+ private assertGrant;
92
+ }
@@ -0,0 +1,21 @@
1
+ import type { DurableJson } from '../plugin-durable-state';
2
+ /** One indexed heap entry per key: updates cannot accumulate stale expiry tickets. */
3
+ export declare class KeyedAdmissionState {
4
+ readonly capacity: number;
5
+ private entries;
6
+ private heap;
7
+ constructor(capacity: number);
8
+ get size(): number;
9
+ get(key: string): DurableJson;
10
+ hasRoom(key: string): boolean;
11
+ private swap;
12
+ private repair;
13
+ set(key: string, value: DurableJson, expires: number): void;
14
+ delete(key: string): void;
15
+ sweep(now: number, limit?: number, removedKey?: (key: string) => void): number;
16
+ /** Rebuild off the request path; callers swap only after every publication validates. */
17
+ reconcile(transform: (key: string, value: DurableJson) => {
18
+ value: DurableJson;
19
+ expires: number;
20
+ }, now?: number, capacity?: number): KeyedAdmissionState;
21
+ }
@@ -0,0 +1,40 @@
1
+ import { type RateLimitWorkerIdentity, type RateLimitIngressIdentity } from '../rate-limit';
2
+ import type { AdmissionTarget } from '../plugin-extensions';
3
+ import { type AdmissionGrant, type DataAdmissionHost } from './host';
4
+ import { type RequestLogAdmissionTrace } from './worker';
5
+ export declare const PLUGIN_STORAGE_RPC_PATH = "/__bungee/internal/plugin-storage/v1";
6
+ export declare const DATA_ADMISSION_RPC_PATH = "/__bungee/internal/data-admission/v1";
7
+ export declare const REQUEST_LOG_RPC_PATH = "/__bungee/internal/request-log/v1";
8
+ export declare function parseAdmissionTarget(value: unknown): AdmissionTarget;
9
+ export interface WorkerStateRpcCall {
10
+ readonly plugin: string;
11
+ readonly method: string;
12
+ readonly payload: unknown;
13
+ readonly target: AdmissionTarget;
14
+ }
15
+ export declare function createSignedWorkerRpcServer(options: {
16
+ transportSecret: string;
17
+ identity: RateLimitIngressIdentity;
18
+ authorizeWorker(worker: RateLimitWorkerIdentity, operation?: string): string;
19
+ handle(operation: string, payload: unknown, worker: RateLimitWorkerIdentity): Promise<unknown> | unknown;
20
+ }): (request: Request) => Promise<Response>;
21
+ export declare function createDataAdmissionRpcServer(options: {
22
+ host: DataAdmissionHost;
23
+ transportSecret: string;
24
+ identity: RateLimitIngressIdentity;
25
+ authorizeWorker(worker: RateLimitWorkerIdentity): string;
26
+ }): (request: Request) => Promise<Response>;
27
+ export declare function createSignedWorkerRpcClient(options: {
28
+ transportSecret: string;
29
+ worker: RateLimitWorkerIdentity;
30
+ expectedServer: RateLimitIngressIdentity;
31
+ url: string;
32
+ retry?: boolean;
33
+ fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
34
+ }): (operation: string, payload: unknown, signal?: AbortSignal, requestLogTrace?: RequestLogAdmissionTrace) => Promise<unknown>;
35
+ export type DataAdmissionRpc = (operation: 'inspect' | 'authorize' | 'preview' | 'admit' | 'attempt' | 'release', payload: AdmissionTarget | {
36
+ requestId: string;
37
+ } | {
38
+ target: AdmissionTarget;
39
+ version: number;
40
+ }, signal?: AbortSignal) => Promise<AdmissionGrant | unknown>;