@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,339 @@
1
+ /**
2
+ * Host communication lane protocol (P5): strict, bounded codecs for the three
3
+ * non-RPC lanes — `event`, `snapshot`, `stream`.
4
+ *
5
+ * Scope boundary: this module only defines shapes and constants. It opens no
6
+ * transport, keeps no state, and grants no authority: every request/response is
7
+ * authenticated and correlated by the peer link (`peer-rpc-link.ts`), and every
8
+ * authorization decision belongs to the host adapter (`channels.ts`).
9
+ *
10
+ * Design rules:
11
+ * - A lane request rides the link's existing request/response machinery; only the
12
+ * lane payload is lane-specific. Bulk bytes never ride a request envelope: they
13
+ * travel as `emit` frames (stream chunks) or as bounded chunk responses
14
+ * (snapshot bodies), never by enlarging the 64 KiB RPC message.
15
+ * - Every codec is strict: exact key sets, bounded strings/numbers, and a byte
16
+ * bound. A malformed lane payload is refused, never partially trusted.
17
+ * - Every request carries the host-minted `caller` + `callerScope`, so the
18
+ * receiving host correlates an inbound frame to the exact original owner it was
19
+ * authorized for (never to a bare plugin name).
20
+ * - Result bodies are pure JSON `{ ok: true, ... } | { ok: false, code, detail? }`,
21
+ * so a lane can report `gap`/`conflict`/`unauthorized` without widening the
22
+ * link's own fixed wire-error vocabulary.
23
+ */
24
+ import { type RpcCallPurpose, type RpcJson } from './wire-contract';
25
+ import type { PluginPeerRpcRequestExecution } from './peer-rpc-link';
26
+ export declare const PLUGIN_CHANNEL_VERSION: 1;
27
+ /** A lane request context stays far below the 8 KiB peer header cap. */
28
+ export declare const CHANNEL_REQUEST_MAX_BYTES: number;
29
+ /** A JSON result payload (event body / snapshot descriptor) stays below the frame cap. */
30
+ export declare const CHANNEL_RESULT_MAX_BYTES: number;
31
+ /** Largest single chunk body that fits one peer frame with the emit wrapper. */
32
+ export declare const CHANNEL_MAX_CHUNK_BYTES: number;
33
+ export type PluginChannelLane = 'event' | 'snapshot' | 'stream';
34
+ /**
35
+ * The exact transport surface a lane engine needs. `PluginPeerRpcLink` satisfies
36
+ * it structurally; a same-process route uses the hub's in-process loopback port,
37
+ * so local and remote transfers share one implementation and one set of limits.
38
+ */
39
+ export interface PluginChannelLinkPort {
40
+ /**
41
+ * Exact transport admission state. `true` once this link has retired: NEW
42
+ * open/subscribe/read work is refused by the hub, while frames belonging to an
43
+ * already-accepted transfer/subscription/session keep flowing.
44
+ */
45
+ readonly retired?: boolean;
46
+ requestOnLane(lane: PluginChannelLane, context: RpcJson, body: Uint8Array, options: {
47
+ readonly deadlineAt: number;
48
+ readonly signal?: AbortSignal;
49
+ }): PluginPeerRpcRequestExecution;
50
+ emitLane(lane: PluginChannelLane, kind: 'chunk' | 'notification', requestId: string, deadlineAt: number, context: RpcJson, body: Uint8Array, priority?: 'data' | 'control'): boolean;
51
+ }
52
+ export type PluginChannelErrorCode = 'unavailable' | 'ambiguous' | 'unauthorized' | 'invalid' | 'overloaded' | 'expired' | 'conflict' | 'gap' | 'truncated' | 'rejected' | 'cancelled' | 'closed' | 'unknown' | 'failed';
53
+ export declare const PLUGIN_CHANNEL_LANES: readonly PluginChannelLane[];
54
+ /** Fixed-code channel error. It never carries a cause, path, or payload. */
55
+ export declare class PluginChannelError extends Error {
56
+ readonly code: PluginChannelErrorCode;
57
+ readonly name = "PluginChannelError";
58
+ constructor(code: PluginChannelErrorCode, message: string);
59
+ }
60
+ export declare function failChannel(code: PluginChannelErrorCode, message: string): never;
61
+ /** Logical target of one lane request; the physical identity is never a plugin concern. */
62
+ export interface PluginChannelTarget {
63
+ readonly provider: string;
64
+ readonly service: string;
65
+ readonly major: number;
66
+ }
67
+ export declare function encodeChannelResult(value: {
68
+ readonly ok: true;
69
+ readonly [key: string]: unknown;
70
+ } | {
71
+ readonly ok: false;
72
+ readonly code: PluginChannelErrorCode;
73
+ readonly detail?: Record<string, unknown>;
74
+ }): Uint8Array;
75
+ export type PluginChannelResult = {
76
+ readonly ok: true;
77
+ readonly value: Record<string, unknown>;
78
+ } | {
79
+ readonly ok: false;
80
+ readonly code: PluginChannelErrorCode;
81
+ readonly detail?: Record<string, unknown>;
82
+ };
83
+ /** Strict decode of a JSON lane result body; `null` is a protocol failure. */
84
+ export declare function decodeChannelResult(bytes: Uint8Array): PluginChannelResult | null;
85
+ /** Raw chunk response body: bytes carried by a snapshot/stream chunk call. */
86
+ export declare function encodeChannelBytes(bytes: Uint8Array): Uint8Array;
87
+ interface LaneRequestBase {
88
+ readonly v: typeof PLUGIN_CHANNEL_VERSION;
89
+ readonly target: PluginChannelTarget;
90
+ /** Consumer plugin name; host-minted, never payload-claimed. */
91
+ readonly caller: string;
92
+ /** Consumer owner scope key; host-minted (`global` or a binding scope). */
93
+ readonly callerScope: string;
94
+ /**
95
+ * Host-minted invocation purpose shared across the peer boundary, so the
96
+ * providing host can keep the original request/attempt/management context
97
+ * instead of re-interpreting the call as an unauthenticated background task.
98
+ */
99
+ readonly purpose: RpcCallPurpose;
100
+ /**
101
+ * Canonical hash of the consumer's declared lane contract (id + version + the
102
+ * `wire-contract` data schema). The provider refuses a request that does not
103
+ * hash to its own contract, so the two sides cannot silently disagree about
104
+ * the payload type.
105
+ */
106
+ readonly contract: string;
107
+ readonly kind: string;
108
+ }
109
+ export interface ChannelStreamOpenRequest extends LaneRequestBase {
110
+ readonly kind: 'stream.open' | 'stream.open-write';
111
+ readonly request: {
112
+ /** Consumer-minted correlation id; becomes the transfer id for every later frame. */
113
+ readonly clientId: string;
114
+ readonly objectId: string;
115
+ readonly version: number;
116
+ readonly offset: number;
117
+ readonly size: number | null;
118
+ readonly digest: `sha256:${string}` | null;
119
+ readonly creditBytes: number;
120
+ readonly idleMs: number;
121
+ };
122
+ }
123
+ /**
124
+ * One duplex session negotiation: a SINGLE transfer id carries both a provider ->
125
+ * consumer read flow and a consumer -> provider write flow, each with its own
126
+ * independent absolute credit window, over one shared terminal.
127
+ */
128
+ export interface ChannelStreamOpenDuplexRequest extends LaneRequestBase {
129
+ readonly kind: 'stream.open-duplex';
130
+ readonly request: {
131
+ readonly clientId: string;
132
+ readonly objectId: string;
133
+ readonly version: number;
134
+ readonly readOffset: number;
135
+ readonly readSize: number | null;
136
+ readonly readDigest: `sha256:${string}` | null;
137
+ readonly writeSize: number | null;
138
+ readonly writeDigest: `sha256:${string}` | null;
139
+ readonly readCreditBytes: number;
140
+ readonly writeCreditBytes: number;
141
+ readonly idleMs: number;
142
+ };
143
+ }
144
+ export interface ChannelStreamFinishRequest extends LaneRequestBase {
145
+ readonly kind: 'stream.finish';
146
+ readonly request: {
147
+ readonly transferId: string;
148
+ readonly size: number;
149
+ readonly digest: `sha256:${string}`;
150
+ };
151
+ }
152
+ export interface ChannelEventSubscribeRequest extends LaneRequestBase {
153
+ readonly kind: 'event.subscribe';
154
+ readonly request: {
155
+ readonly clientId: string;
156
+ readonly delivery: 'transient' | 'reliable';
157
+ readonly consumerId: string;
158
+ readonly from: number | null;
159
+ };
160
+ }
161
+ export interface ChannelEventAckRequest extends LaneRequestBase {
162
+ readonly kind: 'event.ack';
163
+ readonly request: {
164
+ readonly subscriptionId: string;
165
+ readonly sequence: number;
166
+ };
167
+ }
168
+ export interface ChannelSnapshotDescribeRequest extends LaneRequestBase {
169
+ readonly kind: 'snapshot.describe';
170
+ readonly request: {
171
+ readonly version: number | null;
172
+ };
173
+ }
174
+ /**
175
+ * Pins one immutable version for a WHOLE read: the provider retains the exact
176
+ * source until `snapshot.release` (or its bounded idle expiry), so a refresh or a
177
+ * version eviction can never swap or free the body mid-read.
178
+ */
179
+ export interface ChannelSnapshotOpenRequest extends LaneRequestBase {
180
+ readonly kind: 'snapshot.open';
181
+ readonly request: {
182
+ readonly version: number | null;
183
+ };
184
+ }
185
+ export interface ChannelSnapshotChunkRequest extends LaneRequestBase {
186
+ readonly kind: 'snapshot.chunk';
187
+ readonly request: {
188
+ readonly sessionId: string;
189
+ readonly offset: number;
190
+ readonly length: number;
191
+ };
192
+ }
193
+ export interface ChannelSnapshotReleaseRequest extends LaneRequestBase {
194
+ readonly kind: 'snapshot.release';
195
+ readonly request: {
196
+ readonly sessionId: string;
197
+ };
198
+ }
199
+ export declare function encodeStreamOpenRequest(kind: 'stream.open' | 'stream.open-write', target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamOpenRequest['request'], purpose?: RpcCallPurpose): RpcJson;
200
+ export declare function decodeStreamOpenRequest(payload: unknown): ChannelStreamOpenRequest | null;
201
+ export declare function encodeStreamOpenDuplexRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamOpenDuplexRequest['request'], purpose?: RpcCallPurpose): RpcJson;
202
+ export declare function decodeStreamOpenDuplexRequest(payload: unknown): ChannelStreamOpenDuplexRequest | null;
203
+ export declare function encodeStreamFinishRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelStreamFinishRequest['request'], purpose?: RpcCallPurpose): RpcJson;
204
+ export declare function decodeStreamFinishRequest(payload: unknown): ChannelStreamFinishRequest | null;
205
+ export declare function encodeEventSubscribeRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelEventSubscribeRequest['request'], purpose?: RpcCallPurpose): RpcJson;
206
+ export declare function decodeEventSubscribeRequest(payload: unknown): ChannelEventSubscribeRequest | null;
207
+ export declare function encodeEventAckRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelEventAckRequest['request'], purpose?: RpcCallPurpose): RpcJson;
208
+ export declare function decodeEventAckRequest(payload: unknown): ChannelEventAckRequest | null;
209
+ export declare function encodeSnapshotDescribeRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotDescribeRequest['request'], purpose?: RpcCallPurpose): RpcJson;
210
+ export declare function decodeSnapshotDescribeRequest(payload: unknown): ChannelSnapshotDescribeRequest | null;
211
+ export declare function encodeSnapshotOpenRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotOpenRequest['request'], purpose?: RpcCallPurpose): RpcJson;
212
+ export declare function decodeSnapshotOpenRequest(payload: unknown): ChannelSnapshotOpenRequest | null;
213
+ export declare function encodeSnapshotChunkRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotChunkRequest['request'], purpose?: RpcCallPurpose): RpcJson;
214
+ export declare function decodeSnapshotChunkRequest(payload: unknown): ChannelSnapshotChunkRequest | null;
215
+ export declare function encodeSnapshotReleaseRequest(target: PluginChannelTarget, caller: string, callerScope: string, contract: string, request: ChannelSnapshotReleaseRequest['request'], purpose?: RpcCallPurpose): RpcJson;
216
+ export declare function decodeSnapshotReleaseRequest(payload: unknown): ChannelSnapshotReleaseRequest | null;
217
+ export interface ChannelStreamChunkEmit {
218
+ readonly kind: 'stream.chunk';
219
+ readonly transferId: string;
220
+ readonly offset: number;
221
+ readonly last: boolean;
222
+ }
223
+ export interface ChannelStreamDataEmit {
224
+ readonly kind: 'stream.data';
225
+ readonly transferId: string;
226
+ readonly offset: number;
227
+ readonly last: boolean;
228
+ }
229
+ /**
230
+ * Consumer half-close of the READ direction of a duplex session: it will accept
231
+ * no further read chunks (and stops granting read credit), while the WRITE
232
+ * direction of the same session keeps running.
233
+ */
234
+ export interface ChannelStreamEndReadEmit {
235
+ readonly kind: 'stream.end-read';
236
+ readonly transferId: string;
237
+ }
238
+ /**
239
+ * Provider -> consumer end of the READ direction: the producer has emitted every
240
+ * byte of this immutable version (including a zero-byte body). It is ordered on
241
+ * the same link AFTER the final data frame, so the receiver can settle the read
242
+ * with a real protocol end instead of a timing guess.
243
+ */
244
+ export interface ChannelStreamEndEmit {
245
+ readonly kind: 'stream.end';
246
+ readonly transferId: string;
247
+ }
248
+ export interface ChannelStreamCreditEmit {
249
+ readonly kind: 'stream.credit';
250
+ readonly transferId: string;
251
+ /**
252
+ * Which window this grant governs, so one duplex session can carry two fully
253
+ * independent credit windows on the SAME transfer id:
254
+ * - `read`: the provider -> consumer flow (granted by the consumer);
255
+ * - `write`: the consumer -> provider flow (granted by the provider).
256
+ */
257
+ readonly direction: 'read' | 'write';
258
+ /**
259
+ * ABSOLUTE credit window: the total byte count the receiver currently allows
260
+ * from offset 0. Absolute (never a delta) because a window is idempotent: a
261
+ * retried or repeated grant can never double-count, and a lost frame heals as
262
+ * soon as the sender re-emits the current window.
263
+ */
264
+ readonly window: number;
265
+ }
266
+ export interface ChannelEventNotifyEmit {
267
+ readonly kind: 'event.notify';
268
+ readonly subscriptionId: string;
269
+ readonly sequence: number;
270
+ readonly eventId: string;
271
+ readonly delivery: 'transient' | 'reliable';
272
+ }
273
+ /**
274
+ * Provider -> consumer reliable-event gap/failure notice: the ordered delivery
275
+ * can no longer continue (a refused emit while disconnected, a bounded queue
276
+ * overflow, an unreadable replay). The consumer must observe a REAL failure
277
+ * instead of a silent close, and re-subscribe from its durable checkpoint.
278
+ */
279
+ export interface ChannelEventGapEmit {
280
+ readonly kind: 'event.gap';
281
+ readonly subscriptionId: string;
282
+ readonly code: PluginChannelErrorCode;
283
+ }
284
+ export type ChannelEmitPayload = ChannelStreamChunkEmit | ChannelStreamDataEmit | ChannelStreamCreditEmit | ChannelStreamEndReadEmit | ChannelStreamEndEmit | ChannelEventNotifyEmit | ChannelEventGapEmit;
285
+ export declare function encodeChannelEmit(payload: ChannelEmitPayload): RpcJson;
286
+ export declare function decodeChannelEmit(payload: unknown): ChannelEmitPayload | null;
287
+ export interface ChannelStreamOpenResult {
288
+ readonly transferId: string;
289
+ readonly size: number | null;
290
+ readonly digest: `sha256:${string}` | null;
291
+ readonly frameBytes: number;
292
+ readonly creditBytes: number;
293
+ }
294
+ export declare function decodeStreamOpenResult(result: PluginChannelResult): ChannelStreamOpenResult | null;
295
+ export interface ChannelStreamOpenDuplexResult {
296
+ readonly transferId: string;
297
+ readonly readSize: number | null;
298
+ readonly readDigest: `sha256:${string}` | null;
299
+ readonly readFrameBytes: number;
300
+ readonly readCreditBytes: number;
301
+ readonly writeCreditBytes: number;
302
+ }
303
+ export declare function decodeStreamOpenDuplexResult(result: PluginChannelResult): ChannelStreamOpenDuplexResult | null;
304
+ export interface ChannelSnapshotOpenResult {
305
+ readonly sessionId: string;
306
+ readonly descriptor: ChannelSnapshotDescriptor;
307
+ }
308
+ export declare function decodeSnapshotOpenResult(result: PluginChannelResult): ChannelSnapshotOpenResult | null;
309
+ export interface ChannelEventSubscribeResult {
310
+ readonly subscriptionId: string;
311
+ readonly delivery: 'transient' | 'reliable';
312
+ readonly fromSequence: number;
313
+ readonly oldestSequence: number | null;
314
+ readonly prunedThrough: number;
315
+ }
316
+ export declare function decodeEventSubscribeResult(result: PluginChannelResult): ChannelEventSubscribeResult | null;
317
+ export interface ChannelEventAckResult {
318
+ readonly acked: number;
319
+ }
320
+ export declare function decodeEventAckResult(result: PluginChannelResult): ChannelEventAckResult | null;
321
+ export interface ChannelSnapshotDescriptor {
322
+ readonly owner: string;
323
+ readonly epoch: number;
324
+ readonly version: number;
325
+ readonly schemaVersion: number;
326
+ readonly digest: `sha256:${string}`;
327
+ readonly size: number;
328
+ readonly chunkBytes: number;
329
+ }
330
+ export declare function decodeSnapshotDescriptor(result: PluginChannelResult): ChannelSnapshotDescriptor | null;
331
+ /** Encoding helpers for the lane success/error bodies, kept in one place. */
332
+ export declare function streamOpenResultBody(result: ChannelStreamOpenResult): Uint8Array;
333
+ export declare function streamOpenDuplexResultBody(result: ChannelStreamOpenDuplexResult): Uint8Array;
334
+ export declare function snapshotOpenResultBody(result: ChannelSnapshotOpenResult): Uint8Array;
335
+ export declare function eventSubscribeResultBody(result: ChannelEventSubscribeResult): Uint8Array;
336
+ export declare function eventAckResultBody(result: ChannelEventAckResult): Uint8Array;
337
+ export declare function successBody(value?: Record<string, unknown>): Uint8Array;
338
+ export declare function errorBody(code: PluginChannelErrorCode, detail?: Record<string, unknown>): Uint8Array;
339
+ export {};
@@ -0,0 +1,163 @@
1
+ /**
2
+ * Host-private read-only publication directory exchanged over an already
3
+ * authenticated peer link.
4
+ *
5
+ * It is NOT a second protocol: the query and its answer travel through the
6
+ * existing peer link + the existing native RPC mux (`link.request` on the sender
7
+ * side, the mapped `onRequest` handler on the receiver side), and the answer is
8
+ * a bounded JSON page — the exact metadata a host needs to route to a peer's
9
+ * REAL publication (provider/service/major/scope/scopeKey/ready and the actual
10
+ * kernel binding), never a contract schema (a consumer already owns its DSL) and
11
+ * never a plugin-visible handle.
12
+ *
13
+ * The reserved principal/provider are host-minted constants. A plugin cannot
14
+ * send a peer frame at all, and even a host-built frame carrying them is only
15
+ * admitted by the mux for a directory read, so a plugin can never claim them.
16
+ *
17
+ * Consistency: every page carries a revision derived from the full entry set, so
18
+ * a reader can detect a directory that changed while paging and reload instead
19
+ * of mixing two generations.
20
+ */
21
+ import type { HostRpcPublicationView } from './host-rpc';
22
+ import type { PluginServiceProcess, PluginServiceScope } from './contracts';
23
+ /** Reserved host principal; never a plugin name and never plugin-addressable. */
24
+ export declare const PLUGIN_PEER_DIRECTORY_PRINCIPAL = "!bungee-host";
25
+ /** Reserved directory target; never a published plugin service. */
26
+ export declare const PLUGIN_PEER_DIRECTORY_PROVIDER = "!bungee-host.directory";
27
+ export declare const PLUGIN_PEER_DIRECTORY_SERVICE = "publication-directory";
28
+ export declare const PLUGIN_PEER_DIRECTORY_MAJOR = 1;
29
+ export declare const PLUGIN_PEER_DIRECTORY_METHOD = "page";
30
+ export declare const PLUGIN_PEER_DIRECTORY_VERSION = 1;
31
+ /**
32
+ * One page must stay inside both the canonical RPC JSON envelope (64 KiB) and
33
+ * the frame body cap (64 KiB), so it keeps a real margin below both.
34
+ */
35
+ export declare const PLUGIN_PEER_DIRECTORY_PAGE_MAX_BYTES: number;
36
+ /** Entries per page and pages per load are both bounded. */
37
+ export declare const PLUGIN_PEER_DIRECTORY_PAGE_ENTRIES = 64;
38
+ export declare const PLUGIN_PEER_DIRECTORY_MAX_PAGES = 8;
39
+ export declare const PLUGIN_PEER_DIRECTORY_DEADLINE_MS = 2000;
40
+ export interface PeerDirectoryBinding {
41
+ readonly endpoint: string;
42
+ readonly process: PluginServiceProcess;
43
+ readonly instance: string;
44
+ readonly generation: number;
45
+ readonly catalog: string;
46
+ readonly scope: PluginServiceScope;
47
+ readonly subject: string;
48
+ }
49
+ export interface PeerDirectoryEntry {
50
+ readonly provider: string;
51
+ readonly service: string;
52
+ readonly major: number;
53
+ readonly scope: PluginServiceScope;
54
+ readonly scopeKey: string;
55
+ readonly ready: boolean;
56
+ readonly binding: PeerDirectoryBinding;
57
+ }
58
+ export interface PeerDirectoryPage {
59
+ readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
60
+ readonly revision: string;
61
+ readonly total: number;
62
+ readonly cursor: number;
63
+ readonly more: boolean;
64
+ readonly entries: readonly PeerDirectoryEntry[];
65
+ }
66
+ export interface PeerDirectoryQuery {
67
+ readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
68
+ readonly cursor: number;
69
+ }
70
+ /** True only for the exact reserved host-private read; nothing else may use it. */
71
+ export declare function isHostDirectoryQuery(input: {
72
+ readonly target: {
73
+ readonly provider: string;
74
+ readonly service: string;
75
+ readonly major: number;
76
+ readonly method: string;
77
+ };
78
+ readonly caller: {
79
+ readonly subject: string;
80
+ readonly scope: PluginServiceScope;
81
+ };
82
+ readonly binding: {
83
+ readonly scope: PluginServiceScope;
84
+ };
85
+ }): boolean;
86
+ /** A reserved host name is never accepted as a plugin identity in the normal path. */
87
+ export declare function isReservedHostName(value: string): boolean;
88
+ /** Stable reference of a complete entry set; changes exactly when the set does. */
89
+ export declare function directoryRevision(entries: readonly PeerDirectoryEntry[]): string;
90
+ /** Strict, bounded decode of one directory page; anything else is refused. */
91
+ export declare function decodePeerDirectoryPage(value: unknown): PeerDirectoryPage | null;
92
+ /** Strict decode of one directory query body (its only legal shape). */
93
+ export declare function decodePeerDirectoryQuery(value: unknown): PeerDirectoryQuery | null;
94
+ /**
95
+ * Projects the adapter's real publication view onto the minimal routable
96
+ * directory DTO. Only `global` scope is exposed: a binding-scope publication is
97
+ * never a cross-process routing target, so it is not advertised at all.
98
+ */
99
+ export declare function toDirectoryEntries(view: readonly HostRpcPublicationView[], process: PluginServiceProcess): PeerDirectoryEntry[];
100
+ /** One bounded page of an already sorted entry set. */
101
+ export declare function buildDirectoryPage(entries: readonly PeerDirectoryEntry[], revision: string, cursor: number): {
102
+ readonly page: PeerDirectoryPage;
103
+ readonly encodedBytes: number;
104
+ } | null;
105
+ /**
106
+ * A second, independent page of the SAME host-private directory read: the
107
+ * channel (stream/snapshot/event) publications of this process. It is a separate
108
+ * `method` on the same reserved service so the RPC publication page keeps its
109
+ * exact wire shape and its existing consumers keep working unchanged.
110
+ */
111
+ export declare const PLUGIN_PEER_CHANNEL_DIRECTORY_METHOD = "channel-page";
112
+ export interface PeerChannelDirectoryEntry {
113
+ readonly provider: string;
114
+ readonly service: string;
115
+ readonly major: number;
116
+ readonly scope: PluginServiceScope;
117
+ readonly scopeKey: string;
118
+ readonly ready: boolean;
119
+ readonly kind: 'stream' | 'snapshot' | 'event';
120
+ }
121
+ export interface PeerChannelDirectoryPage {
122
+ readonly version: typeof PLUGIN_PEER_DIRECTORY_VERSION;
123
+ readonly revision: string;
124
+ readonly total: number;
125
+ readonly cursor: number;
126
+ readonly more: boolean;
127
+ readonly entries: readonly PeerChannelDirectoryEntry[];
128
+ }
129
+ /** True only for the exact reserved host-private channel-page read. */
130
+ export declare function isHostChannelDirectoryQuery(input: {
131
+ readonly target: {
132
+ readonly provider: string;
133
+ readonly service: string;
134
+ readonly major: number;
135
+ readonly method: string;
136
+ };
137
+ readonly caller: {
138
+ readonly subject: string;
139
+ readonly scope: PluginServiceScope;
140
+ };
141
+ readonly binding: {
142
+ readonly scope: PluginServiceScope;
143
+ };
144
+ }): boolean;
145
+ /** Strict, bounded decode of one channel directory page; anything else is refused. */
146
+ export declare function decodePeerChannelDirectoryPage(value: unknown): PeerChannelDirectoryPage | null;
147
+ /** Stable reference of a complete channel entry set; changes exactly when it does. */
148
+ export declare function channelDirectoryRevision(entries: readonly PeerChannelDirectoryEntry[]): string;
149
+ /** Projects the channel adapter's real local publication view onto the directory DTO. */
150
+ export declare function toChannelDirectoryEntries(view: readonly {
151
+ readonly provider: string;
152
+ readonly service: string;
153
+ readonly major: number;
154
+ readonly scope: PluginServiceScope;
155
+ readonly scopeKey: string;
156
+ readonly ready: boolean;
157
+ readonly lane: 'stream' | 'snapshot' | 'event';
158
+ }[], process?: PluginServiceProcess): PeerChannelDirectoryEntry[];
159
+ /** One bounded page of an already sorted channel entry set. */
160
+ export declare function buildChannelDirectoryPage(entries: readonly PeerChannelDirectoryEntry[], revision: string, cursor: number): {
161
+ readonly page: PeerChannelDirectoryPage;
162
+ readonly encodedBytes: number;
163
+ } | null;
@@ -0,0 +1,13 @@
1
+ import type { CommandSourceIdentity } from './command-journal';
2
+ import type { CapturedProcessIdentity } from '../master-runtime/process-identity';
3
+ import { type HeldProcessLifetimeGuardFacts } from '../supervision/process-lifetime-guard';
4
+ /** Host-authored, authenticated evidence; PID or controller epoch alone is insufficient. */
5
+ export interface PluginExecutorProof {
6
+ readonly source: CommandSourceIdentity;
7
+ readonly physical: CapturedProcessIdentity;
8
+ readonly boot: string;
9
+ readonly guard: HeldProcessLifetimeGuardFacts | null;
10
+ readonly retired: boolean;
11
+ }
12
+ /** Input has already passed the bounded, accessor-free RPC JSON decoder. */
13
+ export declare function decodePluginExecutorProof(value: unknown): PluginExecutorProof | null;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Plugin peer channel binary frame codec (P4).
3
+ *
4
+ * STRUCTURE ONLY — this module is a pure, deterministic framing codec. It packs
5
+ * an already-authenticated {@link PluginPeerPacket} into one bounded WebSocket
6
+ * binary message and unpacks it again.
7
+ *
8
+ * It does NOT authenticate anything. `decodePluginPeerFrame` proves only that a
9
+ * byte string is structurally a well-formed frame with a syntactic header and a
10
+ * bounded body. It never proves a MAC, a peer identity, a direction, a
11
+ * controller authority, or that a sequence is fresh. A receiver MUST:
12
+ * 1. `decodePluginPeerFrame(frame)`, then
13
+ * 2. `verifyPluginPeerPacket(header, body, credential, expected)`, then
14
+ * 3. `PluginPeerReplayWindow.accept(header.sequence)`,
15
+ * before dispatching. Structure is never admission.
16
+ *
17
+ * Wire format (every integer is unsigned big-endian, 12-byte prefix):
18
+ * offset 0 uint32 magic 0x42504331 ("BPC1")
19
+ * offset 4 uint32 headerLength raw canonical UTF-8 JSON header bytes
20
+ * offset 8 uint32 bodyLength raw body bytes
21
+ * offset 12 headerLength header bytes, then bodyLength body bytes
22
+ *
23
+ * Exactly one frame per WebSocket binary message. Frames are never split across
24
+ * messages and multiple packets are never concatenated into one message. The
25
+ * header budget ({@link PEER_HEADER_MAX_BYTES}) and the body budget
26
+ * ({@link PEER_BODY_MAX_BYTES}) stay independent; a multi-megabyte payload never
27
+ * rides one frame, never rides the old 64 KiB control RPC envelope, and is
28
+ * streamed as a sequence of these same bounded frames by a later layer.
29
+ *
30
+ * The codec allocates nothing before validating every declared length: an
31
+ * oversized `headerLength`/`bodyLength` is rejected before any slice or parse,
32
+ * and the declared lengths must sum to the exact frame length (no truncation,
33
+ * no ignored suffix).
34
+ */
35
+ import { type PluginPeerPacket } from './peer-protocol';
36
+ /** Fixed 12-byte frame prefix: uint32BE magic, headerLength, bodyLength. */
37
+ export declare const PEER_FRAME_PREFIX_BYTES = 12;
38
+ /** Largest legal frame: prefix + max metadata header + max body (73740 bytes). */
39
+ export declare const PEER_FRAME_MAX_BYTES: number;
40
+ /**
41
+ * Frames one packet as a single bounded buffer.
42
+ *
43
+ * The header bytes are the raw canonical UTF-8 JSON — recovered by decoding the
44
+ * canonical base64url that {@link encodePluginPeerHeader} produces — so the 8 KiB
45
+ * budget is measured against the JSON bytes, never against the base64url text.
46
+ * The body is validated against the 64 KiB budget and copied into the frame, so
47
+ * a later caller mutation of the packet body cannot change an encoded frame.
48
+ */
49
+ export declare function encodePluginPeerFrame(packet: PluginPeerPacket): Uint8Array;
50
+ /**
51
+ * Unpacks one bounded frame. Structural only: the returned packet is
52
+ * unauthenticated and MUST be verified by the caller.
53
+ *
54
+ * Every declared length is bounded before any allocation or parsing, and the
55
+ * declared lengths must account for the exact frame length. A `Uint8Array` view
56
+ * is honoured through its `byteOffset`/`byteLength`, and the header is decoded by
57
+ * the peer-protocol codec so its fatal-UTF-8 and canonical-JSON/byte-bound rules
58
+ * are reused rather than re-implemented.
59
+ *
60
+ * The returned packet object is frozen and its body is an independent copy, so
61
+ * mutating the source frame after decoding cannot change the payload that was
62
+ * (or will be) verified. The copy is a defensive boundary, not immutability:
63
+ * the body is a normal `Uint8Array` whose bytes the receiver may still write.
64
+ */
65
+ export declare function decodePluginPeerFrame(frame: Uint8Array | ArrayBuffer): PluginPeerPacket;
@@ -0,0 +1,25 @@
1
+ /** Production resolver: all journal storage and maintenance runs in plugin-state Worker. */
2
+ import type { HostRpcJournalRequest } from './host-rpc';
3
+ import type { PluginStateClient, AsyncCommandJournal, StateRecoveryAuthorizer } from '../plugin-state/client';
4
+ export interface PluginPeerJournalOptions {
5
+ readonly client: PluginStateClient;
6
+ readonly authorizeRecovery?: StateRecoveryAuthorizer;
7
+ }
8
+ export interface PluginPeerJournalMaintenance {
9
+ readonly namespaces: number;
10
+ readonly recovered: number;
11
+ readonly collected: number;
12
+ readonly failures: readonly {
13
+ readonly namespace: string;
14
+ readonly code: string;
15
+ }[];
16
+ }
17
+ export interface PluginPeerJournalResolver {
18
+ resolve(request: HostRpcJournalRequest): AsyncCommandJournal | null;
19
+ maintain(options?: {
20
+ readonly namespaceLimit?: number;
21
+ readonly recordLimit?: number;
22
+ }): Promise<PluginPeerJournalMaintenance>;
23
+ close(): Promise<void>;
24
+ }
25
+ export declare function createPluginPeerJournalResolver(options: PluginPeerJournalOptions): PluginPeerJournalResolver;