@kici-dev/orchestrator 0.17.0 → 0.18.0

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 (589) hide show
  1. package/dist/agent/agent-version.d.ts +12 -21
  2. package/dist/agent/dispatcher.d.ts +283 -437
  3. package/dist/agent/host-roster-reaper.d.ts +8 -10
  4. package/dist/agent/host-roster.d.ts +77 -100
  5. package/dist/agent/ownership-refusal.d.ts +3 -5
  6. package/dist/agent/ownership-tracker.d.ts +42 -76
  7. package/dist/agent/registry.d.ts +121 -233
  8. package/dist/agent/token-store.d.ts +34 -77
  9. package/dist/agent-packaging/availability.d.ts +6 -9
  10. package/dist/agent-packaging/download.d.ts +6 -9
  11. package/dist/agent-packaging/install-closure.d.ts +9 -12
  12. package/dist/agent-packaging/node-binary.d.ts +6 -10
  13. package/dist/agent-packaging/node-runtime-members.d.ts +3 -5
  14. package/dist/agent-packaging/refresh.d.ts +12 -16
  15. package/dist/agent-packaging/store.d.ts +5 -6
  16. package/dist/agent-packaging/upload.d.ts +3 -4
  17. package/dist/app.d.ts +0 -3
  18. package/dist/approvals/apply-decision.d.ts +35 -52
  19. package/dist/approvals/approval-resolver.d.ts +11 -23
  20. package/dist/approvals/held-run-release-wiring.d.ts +14 -21
  21. package/dist/approvals/independent-wiring.d.ts +13 -20
  22. package/dist/approvals/resume-router.d.ts +1 -1
  23. package/dist/approvals/step-approval-bridge.d.ts +11 -21
  24. package/dist/approvals/triggerer-subject.d.ts +8 -10
  25. package/dist/artifacts/artifact-store.d.ts +55 -95
  26. package/dist/artifacts/failure-messages.d.ts +15 -20
  27. package/dist/audit/access-log.d.ts +27 -45
  28. package/dist/audit/sampling-rate-limiter.d.ts +11 -23
  29. package/dist/cache/agent-job-failed-error.d.ts +2 -3
  30. package/dist/cache/build-coordinator.d.ts +5 -28
  31. package/dist/cache/cache-upload-settle.d.ts +11 -11
  32. package/dist/cache/dep-cache.d.ts +32 -60
  33. package/dist/cache/dispatch-cache-ref-tracker.d.ts +15 -23
  34. package/dist/cache/global-eval-round-cache.d.ts +33 -41
  35. package/dist/cache/pending-builds.d.ts +2 -6
  36. package/dist/cache/pending-dynamics.d.ts +2 -7
  37. package/dist/cache/pending-global-evals.d.ts +9 -12
  38. package/dist/cache/pending-inits.d.ts +11 -22
  39. package/dist/cache/pending-precursor-db-watcher.d.ts +24 -32
  40. package/dist/cache/pending-tracker.d.ts +17 -45
  41. package/dist/cache/precursor-result.d.ts +17 -30
  42. package/dist/cache/source-cache.d.ts +36 -65
  43. package/dist/cache/user-cache.d.ts +21 -25
  44. package/dist/cancel/cancel-held-run.d.ts +13 -16
  45. package/dist/cancel/cancel-route-answer.d.ts +1 -2
  46. package/dist/cancel/cancel-run.d.ts +26 -50
  47. package/dist/cancel/dashboard-cancel-handler.d.ts +2 -2
  48. package/dist/cancel/peer-job-cancel.d.ts +11 -14
  49. package/dist/cancel/sweep-stuck-cancelling.d.ts +9 -13
  50. package/dist/cli/api-client.d.ts +25 -76
  51. package/dist/cli/commands/access-log.d.ts +4 -24
  52. package/dist/cli/commands/agent-package.d.ts +7 -15
  53. package/dist/cli/commands/agent-service/agent-env.d.ts +3 -6
  54. package/dist/cli/commands/agent-service/index.d.ts +4 -10
  55. package/dist/cli/commands/agent-service/install.d.ts +4 -11
  56. package/dist/cli/commands/agent-service/status.d.ts +4 -9
  57. package/dist/cli/commands/agent-service/upgrade.d.ts +4 -16
  58. package/dist/cli/commands/agent.d.ts +12 -25
  59. package/dist/cli/commands/api-key.d.ts +5 -12
  60. package/dist/cli/commands/attestations-list.d.ts +7 -17
  61. package/dist/cli/commands/attestations-retry.d.ts +5 -11
  62. package/dist/cli/commands/attestations-reverify.d.ts +4 -5
  63. package/dist/cli/commands/attestations.d.ts +3 -8
  64. package/dist/cli/commands/audit.d.ts +1 -5
  65. package/dist/cli/commands/backend.d.ts +2 -11
  66. package/dist/cli/commands/check-run.d.ts +7 -18
  67. package/dist/cli/commands/cluster-name.d.ts +5 -12
  68. package/dist/cli/commands/cluster-settings.d.ts +28 -53
  69. package/dist/cli/commands/cold-store.d.ts +7 -15
  70. package/dist/cli/commands/config.d.ts +9 -20
  71. package/dist/cli/commands/context.d.ts +8 -20
  72. package/dist/cli/commands/dashboard-encryption-key.d.ts +9 -14
  73. package/dist/cli/commands/db-backup.d.ts +17 -32
  74. package/dist/cli/commands/db.d.ts +3 -4
  75. package/dist/cli/commands/debug-bundle.d.ts +3 -10
  76. package/dist/cli/commands/diagnose.d.ts +3 -14
  77. package/dist/cli/commands/event-dlq.d.ts +4 -12
  78. package/dist/cli/commands/event-log.d.ts +2 -20
  79. package/dist/cli/commands/execution.d.ts +3 -9
  80. package/dist/cli/commands/firecracker/index.d.ts +3 -6
  81. package/dist/cli/commands/held-run.d.ts +23 -37
  82. package/dist/cli/commands/host.d.ts +4 -11
  83. package/dist/cli/commands/inspect-bundle.d.ts +3 -11
  84. package/dist/cli/commands/local-hook.d.ts +2 -10
  85. package/dist/cli/commands/local-trigger.d.ts +2 -2
  86. package/dist/cli/commands/orchestrator-service/drain.d.ts +3 -6
  87. package/dist/cli/commands/orchestrator-service/index.d.ts +6 -14
  88. package/dist/cli/commands/orchestrator-service/install-env.d.ts +25 -49
  89. package/dist/cli/commands/orchestrator-service/install.d.ts +2 -5
  90. package/dist/cli/commands/orchestrator-service/status.d.ts +10 -22
  91. package/dist/cli/commands/orchestrator-service/upgrade.d.ts +6 -15
  92. package/dist/cli/commands/org-settings.d.ts +5 -11
  93. package/dist/cli/commands/peer.d.ts +5 -10
  94. package/dist/cli/commands/queue.d.ts +3 -9
  95. package/dist/cli/commands/registration.d.ts +4 -8
  96. package/dist/cli/commands/remote-source.d.ts +6 -12
  97. package/dist/cli/commands/rotate.d.ts +1 -5
  98. package/dist/cli/commands/runs.d.ts +1 -30
  99. package/dist/cli/commands/scaler.d.ts +5 -12
  100. package/dist/cli/commands/secret.d.ts +1 -9
  101. package/dist/cli/commands/service-health.d.ts +5 -10
  102. package/dist/cli/commands/shared/admin-cli-access-log.d.ts +10 -19
  103. package/dist/cli/commands/shared/bare-metal-binary-check.d.ts +86 -0
  104. package/dist/cli/commands/shared/cli-action.d.ts +1 -4
  105. package/dist/cli/commands/shared/confirm.d.ts +5 -10
  106. package/dist/cli/commands/shared/db.d.ts +1 -12
  107. package/dist/cli/commands/shared/env-file-mode.d.ts +6 -9
  108. package/dist/cli/commands/shared/secret-input.d.ts +7 -21
  109. package/dist/cli/commands/shared/service-verbs.d.ts +6 -12
  110. package/dist/cli/commands/shared/unbound-context-warning.d.ts +2 -4
  111. package/dist/cli/commands/shared/upgrade-hooks.d.ts +7 -16
  112. package/dist/cli/commands/shared/upgrade-safety.d.ts +20 -31
  113. package/dist/cli/commands/shared/versioned-upgrade.d.ts +83 -161
  114. package/dist/cli/commands/signing-key.d.ts +4 -9
  115. package/dist/cli/commands/source-manifest.d.ts +11 -14
  116. package/dist/cli/commands/source.d.ts +7 -32
  117. package/dist/cli/commands/token.d.ts +4 -15
  118. package/dist/cli/commands/trust-policy.d.ts +35 -88
  119. package/dist/cli/commands/variable.d.ts +3 -5
  120. package/dist/cli/commands/workflow.d.ts +3 -24
  121. package/dist/cli/join.d.ts +3 -6
  122. package/dist/cli/kici-admin.d.ts +11 -29
  123. package/dist/cli/lazy-deps/cache.d.ts +1 -14
  124. package/dist/cli/lazy-deps/downloader.d.ts +4 -27
  125. package/dist/cli/lazy-deps/registry.d.ts +5 -25
  126. package/dist/cli/local-github-ingress-url.d.ts +5 -7
  127. package/dist/cli/loopback-callback.d.ts +6 -7
  128. package/dist/cli/open-browser.d.ts +4 -8
  129. package/dist/cli/root-option-routing.d.ts +17 -29
  130. package/dist/cli/service/backup-timer.d.ts +16 -39
  131. package/dist/cli/service/compose-path.d.ts +3 -7
  132. package/dist/cli/service/compose.d.ts +12 -30
  133. package/dist/cli/service/deploy-env.d.ts +6 -18
  134. package/dist/cli/service/entrypoint.d.ts +14 -25
  135. package/dist/cli/service/env-assignment.d.ts +6 -17
  136. package/dist/cli/service/image-digests.d.ts +6 -15
  137. package/dist/cli/service/index.d.ts +2 -18
  138. package/dist/cli/service/instance/index-file.d.ts +9 -16
  139. package/dist/cli/service/instance/manifest.d.ts +33 -59
  140. package/dist/cli/service/instance/resolve.d.ts +32 -68
  141. package/dist/cli/service/instance/types.d.ts +12 -29
  142. package/dist/cli/service/launchd.d.ts +29 -60
  143. package/dist/cli/service/platform-detect.d.ts +13 -68
  144. package/dist/cli/service/privilege.d.ts +12 -25
  145. package/dist/cli/service/shutdown-grace.d.ts +11 -20
  146. package/dist/cli/service/systemd.d.ts +7 -20
  147. package/dist/cli/service/types.d.ts +63 -114
  148. package/dist/cli/service/windows-acl.d.ts +14 -21
  149. package/dist/cli/service/windows-env-file.d.ts +10 -28
  150. package/dist/cli/service/windows.d.ts +15 -31
  151. package/dist/cli/webhook-url-notes.d.ts +4 -6
  152. package/dist/cli/wizard/agent-wizard.d.ts +3 -14
  153. package/dist/cli/wizard/orchestrator-wizard.d.ts +12 -37
  154. package/dist/cli/wizard/prompts.d.ts +6 -16
  155. package/dist/cli.js +4568 -6571
  156. package/dist/cluster/cluster-identity.d.ts +20 -32
  157. package/dist/cluster/cluster-settings-reader.d.ts +50 -77
  158. package/dist/cluster/coordinator-credential.d.ts +4 -5
  159. package/dist/cluster/coordinator.d.ts +76 -148
  160. package/dist/cluster/health-api.d.ts +2 -10
  161. package/dist/cluster/index.d.ts +1 -6
  162. package/dist/cluster/instance-heartbeat.d.ts +26 -42
  163. package/dist/cluster/join-client.d.ts +4 -7
  164. package/dist/cluster/join-handler.d.ts +3 -7
  165. package/dist/cluster/join-token.d.ts +13 -27
  166. package/dist/cluster/leader-gated-scheduler.d.ts +8 -17
  167. package/dist/cluster/orphan-recovery.d.ts +13 -35
  168. package/dist/cluster/peer-auth-coordinator.d.ts +2 -8
  169. package/dist/cluster/peer-client.d.ts +46 -76
  170. package/dist/cluster/peer-credentials.d.ts +24 -70
  171. package/dist/cluster/peer-crypto.d.ts +5 -26
  172. package/dist/cluster/peer-forget.d.ts +3 -3
  173. package/dist/cluster/peer-handler.d.ts +47 -71
  174. package/dist/cluster/peer-registry.d.ts +37 -106
  175. package/dist/cluster/plan-headroom-store.d.ts +4 -6
  176. package/dist/cluster/raft-state.d.ts +4 -13
  177. package/dist/cluster/raft.d.ts +18 -53
  178. package/dist/cluster/reconcile-identity.d.ts +8 -11
  179. package/dist/cluster/rerouted-job-guard.d.ts +7 -11
  180. package/dist/cluster/verified-issuer.d.ts +2 -3
  181. package/dist/cluster/worker-cluster-settings.d.ts +7 -10
  182. package/dist/cluster/worker-eviction.d.ts +16 -26
  183. package/dist/cold-store/load-access-log-range.d.ts +15 -31
  184. package/dist/cold-store/load-event-log-range.d.ts +13 -27
  185. package/dist/cold-store/load-secret-audit-log-range.d.ts +8 -12
  186. package/dist/cold-store/orchestrator-cold-store.d.ts +8 -28
  187. package/dist/cold-store/tables/access-log.d.ts +12 -14
  188. package/dist/cold-store/tables/event-log.d.ts +4 -8
  189. package/dist/cold-store/tables/execution-runs.d.ts +6 -11
  190. package/dist/cold-store/tables/secret-audit-log.d.ts +5 -12
  191. package/dist/concurrency/dispatch-next-queued.d.ts +13 -25
  192. package/dist/concurrency/queue-manager.d.ts +22 -54
  193. package/dist/concurrency/waiters.d.ts +15 -31
  194. package/dist/config/encryption.d.ts +0 -2
  195. package/dist/config/loader.d.ts +0 -1
  196. package/dist/config/reload.d.ts +0 -6
  197. package/dist/config/resolver.d.ts +0 -4
  198. package/dist/config/shared-store.d.ts +0 -2
  199. package/dist/config/types.d.ts +0 -3
  200. package/dist/content-requirements-cache.d.ts +0 -1
  201. package/dist/contexts/context-store.d.ts +0 -2
  202. package/dist/contexts/held-runs.d.ts +0 -2
  203. package/dist/contexts/variable-store.d.ts +0 -2
  204. package/dist/dashboard/attestation-filters.d.ts +13 -18
  205. package/dist/dashboard/handler.d.ts +143 -307
  206. package/dist/db/client.d.ts +2 -6
  207. package/dist/db/deferred-index-build.d.ts +8 -10
  208. package/dist/db/deferred-indexes.d.ts +15 -22
  209. package/dist/db/migration-provider.d.ts +2 -4
  210. package/dist/db/migration-test-harness.d.ts +26 -44
  211. package/dist/db/migrations/001_initial.d.ts +1 -4
  212. package/dist/db/migrations/002_config_versions_key_version.d.ts +5 -8
  213. package/dist/db/migrations/003_access_log.d.ts +10 -15
  214. package/dist/db/migrations/004_rename_bundle_to_source.d.ts +7 -9
  215. package/dist/db/migrations/005_cold_store_chunk_counter.d.ts +4 -10
  216. package/dist/db/migrations/006_runs_jobs_steps_archived_at.d.ts +9 -29
  217. package/dist/db/migrations/007_audit_logs_archived_at.d.ts +11 -30
  218. package/dist/db/migrations/008_event_log_archived_at.d.ts +14 -29
  219. package/dist/db/migrations/009_access_log_trigram.d.ts +4 -8
  220. package/dist/db/migrations/010_cold_store_chunks.d.ts +16 -26
  221. package/dist/db/migrations/011_drop_source_secrets_notify.d.ts +6 -14
  222. package/dist/db/migrations/012_peer_credentials_active_uniq.d.ts +9 -14
  223. package/dist/db/migrations/013_execution_log_bytes.d.ts +5 -13
  224. package/dist/db/migrations/014_kici_events_lease_retry.d.ts +14 -27
  225. package/dist/db/migrations/015_org_settings_customer_scoped.d.ts +12 -17
  226. package/dist/db/migrations/016_org_settings_allow_http_npm.d.ts +4 -6
  227. package/dist/db/migrations/019_generic_sources_change_notify.d.ts +13 -17
  228. package/dist/db/migrations/020_org_settings_dashboard_write_policy.d.ts +5 -8
  229. package/dist/db/migrations/021_check_run_tracking.d.ts +5 -17
  230. package/dist/db/migrations/022_scaler_manager_state.d.ts +10 -20
  231. package/dist/db/migrations/023_dispatch_queue_recovery_deadline.d.ts +7 -18
  232. package/dist/db/migrations/024_dispatch_queue_provisioning_error.d.ts +5 -11
  233. package/dist/db/migrations/025_init_failure.d.ts +5 -9
  234. package/dist/db/migrations/027_workflow_timeout.d.ts +5 -13
  235. package/dist/db/migrations/029_dispatch_queue_attempts.d.ts +4 -10
  236. package/dist/db/migrations/030_held_runs_env_set_null.d.ts +5 -6
  237. package/dist/db/migrations/031_dispatch_queue_ack_deadline.d.ts +6 -12
  238. package/dist/db/migrations/033_org_settings_approval.d.ts +7 -10
  239. package/dist/db/migrations/034_held_runs_generalize.d.ts +10 -18
  240. package/dist/db/migrations/035_pending_workflow_contexts.d.ts +4 -5
  241. package/dist/db/migrations/037_generic_sources_provider_type_local.d.ts +5 -6
  242. package/dist/db/migrations/038_remote_sources.d.ts +5 -7
  243. package/dist/db/migrations/045_host_properties.d.ts +5 -9
  244. package/dist/db/migrations/046_join_token_consumed_by_instance.d.ts +5 -10
  245. package/dist/db/migrations/048_host_reboot_pending.d.ts +6 -12
  246. package/dist/db/migrations/049_held_runs_payload.d.ts +3 -8
  247. package/dist/db/migrations/050_sources_slug.d.ts +4 -5
  248. package/dist/db/migrations/051_binding_host_pattern.d.ts +7 -10
  249. package/dist/db/migrations/052_host_reach_metadata.d.ts +8 -11
  250. package/dist/db/migrations/053_agent_token_single_use.d.ts +6 -10
  251. package/dist/db/migrations/054_local_working_tree.d.ts +4 -6
  252. package/dist/db/migrations/055_agent_token_mandatory_labels.d.ts +6 -11
  253. package/dist/db/migrations/056_execution_jobs_environments.d.ts +4 -11
  254. package/dist/db/migrations/064_execution_jobs_skipped_environments.d.ts +6 -9
  255. package/dist/db/migrations/065_pending_attestations.d.ts +9 -12
  256. package/dist/db/migrations/066_pending_attestations_rejected.d.ts +4 -7
  257. package/dist/db/migrations/068_request_idempotency.d.ts +7 -9
  258. package/dist/db/migrations/069_reroute_tunables.d.ts +6 -14
  259. package/dist/db/migrations/071_batch_accumulation.d.ts +8 -16
  260. package/dist/db/migrations/072_dispatch_queue_run_id_index.d.ts +3 -9
  261. package/dist/db/migrations/074_normalize_zero_concurrency_limit.d.ts +4 -7
  262. package/dist/db/migrations/076_artifacts.d.ts +7 -8
  263. package/dist/db/migrations/078_org_settings_backup_staleness.d.ts +3 -6
  264. package/dist/db/migrations/079_org_settings_scaler_spawn_timeout.d.ts +4 -8
  265. package/dist/db/migrations/080_cluster_settings.d.ts +6 -10
  266. package/dist/db/migrations/081_org_settings_queue_timeout.d.ts +7 -11
  267. package/dist/db/migrations/082_host_s3_reachable.d.ts +5 -10
  268. package/dist/db/migrations/083_org_settings_artifact_caps.d.ts +6 -8
  269. package/dist/db/migrations/084_orchestrator_signing_keys.d.ts +8 -13
  270. package/dist/db/migrations/085_cluster_settings_reroute_flap_grace_ms.d.ts +4 -5
  271. package/dist/db/migrations/086_cluster_settings_max_fanout_hosts.d.ts +3 -3
  272. package/dist/db/migrations/087_cluster_settings_event_router_rate_limit.d.ts +5 -3
  273. package/dist/db/migrations/088_cluster_settings_cache_max_tarball_bytes.d.ts +3 -3
  274. package/dist/db/migrations/089_cluster_settings_cache_ttl_days.d.ts +3 -5
  275. package/dist/db/migrations/090_cluster_settings_concurrency_wait_timeout_ms.d.ts +3 -6
  276. package/dist/db/migrations/091_cluster_settings_agent_token_ttl_ms.d.ts +3 -6
  277. package/dist/db/migrations/092_cluster_settings_version.d.ts +5 -9
  278. package/dist/db/migrations/094_dashboard_encryption_keys.d.ts +9 -14
  279. package/dist/db/migrations/095_dashboard_write_policy_tristate.d.ts +2 -6
  280. package/dist/db/migrations/099_cluster_settings_dashboard_verified_issuer.d.ts +8 -11
  281. package/dist/db/migrations/101_contexts_hold_expiry_drop_default.d.ts +9 -15
  282. package/dist/db/migrations/102_dispatch_queue_agent_id.d.ts +6 -11
  283. package/dist/db/migrations/103_cluster_settings_ownership_db_check_timeout_ms.d.ts +6 -12
  284. package/dist/db/migrations/104_check_run_terminal_sent.d.ts +8 -14
  285. package/dist/db/migrations/105_org_trust_policy.d.ts +5 -7
  286. package/dist/db/migrations/106_cluster_settings_check_run_tracking_ttl_days.d.ts +4 -12
  287. package/dist/db/migrations/107_check_run_tracking_updated_at_index.d.ts +8 -14
  288. package/dist/db/migrations/113_execution_runs_workflow_repo_index.d.ts +10 -19
  289. package/dist/db/migrations/115_global_workflows_cluster_switch.d.ts +2 -3
  290. package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +7 -8
  291. package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +9 -16
  292. package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +8 -16
  293. package/dist/db/migrations/125_org_trust_directory.d.ts +13 -21
  294. package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +10 -16
  295. package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +8 -16
  296. package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +6 -11
  297. package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +8 -11
  298. package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +13 -20
  299. package/dist/db/migrations/131_execution_jobs_git_credentials.d.ts +12 -22
  300. package/dist/db/migrations/132_execution_runs_trigger_event.d.ts +6 -16
  301. package/dist/db/migrations/133_dispatch_queue_source_tar_digest.d.ts +6 -9
  302. package/dist/db/migrations/140_dispatch_queue_canonical_labels.d.ts +22 -40
  303. package/dist/db/migrations/143_execution_jobs_precursor_result.d.ts +9 -18
  304. package/dist/db/migrations/144_execution_runs_registration_window.d.ts +12 -20
  305. package/dist/db/migrations/147_sealed_job_secrets.d.ts +5 -9
  306. package/dist/db/migrations/148_cluster_settings_sealed_secrets_retry_backoff_ms.d.ts +7 -13
  307. package/dist/db/migrations/150_execution_runs_status_epoch.d.ts +6 -11
  308. package/dist/db/migrations/152_org_settings_cache_upload_settle_timeout.d.ts +5 -8
  309. package/dist/db/migrations/157_host_roster_identity_source.d.ts +9 -13
  310. package/dist/db/migrations/159_org_id_widen_to_source_width.d.ts +5 -0
  311. package/dist/db/migrator.d.ts +17 -25
  312. package/dist/db/notify-listener.d.ts +8 -11
  313. package/dist/db/repos/dashboard-encryption-keys-repo.d.ts +9 -10
  314. package/dist/db/synthetic-job-ids.d.ts +6 -8
  315. package/dist/db/types.d.ts +531 -1058
  316. package/dist/deployment/deployment-identity.d.ts +42 -60
  317. package/dist/diagnostics/bundle-reader.d.ts +3 -15
  318. package/dist/diagnostics/bundle-writer.d.ts +5 -12
  319. package/dist/diagnostics/checks/agents.d.ts +1 -7
  320. package/dist/diagnostics/checks/backup.d.ts +7 -10
  321. package/dist/diagnostics/checks/certs.d.ts +1 -6
  322. package/dist/diagnostics/checks/config.d.ts +2 -5
  323. package/dist/diagnostics/checks/db.d.ts +1 -1
  324. package/dist/diagnostics/checks/disk.d.ts +1 -6
  325. package/dist/diagnostics/checks/firecracker-network.d.ts +3 -3
  326. package/dist/diagnostics/checks/index.d.ts +0 -6
  327. package/dist/diagnostics/checks/retention.d.ts +3 -6
  328. package/dist/diagnostics/checks/scaler.d.ts +3 -7
  329. package/dist/diagnostics/checks/ws.d.ts +1 -6
  330. package/dist/diagnostics/fleet-collector.d.ts +11 -14
  331. package/dist/diagnostics/fleet-constants.d.ts +1 -3
  332. package/dist/diagnostics/fleet-selection.d.ts +3 -7
  333. package/dist/diagnostics/fleet-topology.d.ts +2 -6
  334. package/dist/diagnostics/fleet-wiring.d.ts +6 -12
  335. package/dist/diagnostics/index.d.ts +0 -5
  336. package/dist/diagnostics/runner.d.ts +4 -8
  337. package/dist/diagnostics/types.d.ts +10 -21
  338. package/dist/drain/drain-controller.d.ts +16 -22
  339. package/dist/entry-helpers.d.ts +0 -2
  340. package/dist/events/circuit-breaker.d.ts +0 -3
  341. package/dist/events/event-router.d.ts +1 -2
  342. package/dist/events/event-store.d.ts +0 -9
  343. package/dist/events/trust-store.d.ts +0 -3
  344. package/dist/events/types.d.ts +0 -9
  345. package/dist/firecracker/host-network.d.ts +24 -30
  346. package/dist/firecracker/net-interfaces.d.ts +4 -7
  347. package/dist/helpers/rate-limiter.d.ts +0 -1
  348. package/dist/index.js +240 -482
  349. package/dist/metrics/agent-metrics-aggregator.d.ts +24 -67
  350. package/dist/metrics/metrics-reporter.d.ts +4 -13
  351. package/dist/metrics/prometheus.d.ts +47 -81
  352. package/dist/orchestrator-core.d.ts +3 -7
  353. package/dist/pipeline/content-filter.d.ts +20 -30
  354. package/dist/pipeline/cross-source-tally.d.ts +7 -8
  355. package/dist/pipeline/decorating-secret-resolver.d.ts +4 -8
  356. package/dist/pipeline/degraded-reason.d.ts +3 -4
  357. package/dist/pipeline/direct-ingress-deps.d.ts +15 -24
  358. package/dist/pipeline/dispatch-matched-workflow.d.ts +289 -525
  359. package/dist/pipeline/flatten-lock-steps.d.ts +4 -6
  360. package/dist/pipeline/global-dispatch-identity.d.ts +5 -10
  361. package/dist/pipeline/global-eval-round.d.ts +65 -151
  362. package/dist/pipeline/global-round-hold.d.ts +5 -7
  363. package/dist/pipeline/held-context-data.d.ts +5 -8
  364. package/dist/pipeline/held-round-registrations.d.ts +8 -11
  365. package/dist/pipeline/install-gate.d.ts +15 -25
  366. package/dist/pipeline/install-secrets-resolver.d.ts +24 -34
  367. package/dist/pipeline/internal-event-pipeline.d.ts +45 -62
  368. package/dist/pipeline/invoke-gate.d.ts +27 -40
  369. package/dist/pipeline/job-contexts.d.ts +19 -36
  370. package/dist/pipeline/manual-schedule.d.ts +7 -13
  371. package/dist/pipeline/needs-scheduler.d.ts +29 -46
  372. package/dist/pipeline/pending-workflow-context.d.ts +14 -28
  373. package/dist/pipeline/process-webhook.d.ts +88 -123
  374. package/dist/pipeline/processor.d.ts +209 -355
  375. package/dist/pipeline/remote-source-store.d.ts +5 -8
  376. package/dist/pipeline/request-idempotency.d.ts +10 -13
  377. package/dist/pipeline/rerun-global.d.ts +6 -7
  378. package/dist/pipeline/rerun-inputs.d.ts +23 -37
  379. package/dist/pipeline/rerun.d.ts +34 -57
  380. package/dist/pipeline/resolve-sandbox-grant.d.ts +5 -10
  381. package/dist/pipeline/resume-workflow.d.ts +28 -34
  382. package/dist/pipeline/route-or-dispatch-jobs.d.ts +19 -30
  383. package/dist/pipeline/run-event-context.d.ts +16 -21
  384. package/dist/pipeline/sandbox-allowlist-reader.d.ts +7 -11
  385. package/dist/pipeline/security-hold-check.d.ts +56 -80
  386. package/dist/pipeline/test-pipeline.d.ts +20 -46
  387. package/dist/pipeline/unbound-job-context.d.ts +6 -9
  388. package/dist/pipeline/undispatched-hold-checks.d.ts +4 -6
  389. package/dist/pipeline/wave-scheduler.d.ts +15 -22
  390. package/dist/pipeline/webhook-payload-store.d.ts +3 -10
  391. package/dist/pipeline/workflow-lock-at-sha.d.ts +14 -20
  392. package/dist/policy/dashboard-write-policy.d.ts +1 -1
  393. package/dist/provider-registry.d.ts +0 -19
  394. package/dist/providers/generic/index.d.ts +0 -2
  395. package/dist/providers/generic/normalizer.d.ts +0 -1
  396. package/dist/providers/generic/verification.d.ts +0 -8
  397. package/dist/providers/github/auth.d.ts +0 -1
  398. package/dist/providers/github/changed-files.d.ts +2 -1
  399. package/dist/providers/github/file-contents.d.ts +0 -4
  400. package/dist/providers/github/lock-file.d.ts +0 -4
  401. package/dist/providers/github/normalizer.d.ts +1 -9
  402. package/dist/providers/local/index.d.ts +1 -2
  403. package/dist/providers/local/lock-file-fetcher.d.ts +0 -4
  404. package/dist/providers/local/normalizer.d.ts +0 -10
  405. package/dist/providers/local/repo-url-builder.d.ts +0 -2
  406. package/dist/providers/universal-git/clone-token.d.ts +0 -2
  407. package/dist/providers/universal-git/lock-file.d.ts +0 -2
  408. package/dist/providers/universal-git/normalizer.d.ts +0 -2
  409. package/dist/queue/bootstrap.d.ts +3 -15
  410. package/dist/queue/cleanup.d.ts +29 -50
  411. package/dist/queue/depth-refresher.d.ts +21 -39
  412. package/dist/queue/job-queue.d.ts +112 -163
  413. package/dist/queue/retention.d.ts +23 -36
  414. package/dist/queue/scheduled-job.d.ts +17 -39
  415. package/dist/queue/terminalize-unroutable.d.ts +16 -18
  416. package/dist/queue/unroutable-probe.d.ts +15 -22
  417. package/dist/registration/extractor.d.ts +0 -6
  418. package/dist/registration/registration-index.d.ts +0 -6
  419. package/dist/registration/registration-store.d.ts +0 -9
  420. package/dist/reporting/agent-failure-category.d.ts +3 -5
  421. package/dist/reporting/check-run-reporter.d.ts +142 -316
  422. package/dist/reporting/check-run-summary.d.ts +16 -35
  423. package/dist/reporting/check-run-tracking-store.d.ts +54 -107
  424. package/dist/reporting/execution-tracker.d.ts +356 -526
  425. package/dist/reporting/fs-log-storage.d.ts +31 -33
  426. package/dist/reporting/job-check-run-completion.d.ts +14 -22
  427. package/dist/reporting/log-chunk-sink.d.ts +11 -16
  428. package/dist/reporting/log-pull-handler.d.ts +4 -13
  429. package/dist/reporting/log-retention.d.ts +3 -4
  430. package/dist/reporting/log-storage.d.ts +24 -52
  431. package/dist/reporting/log-writer.d.ts +28 -56
  432. package/dist/reporting/peer-log-normalize.d.ts +4 -8
  433. package/dist/reporting/run-aggregator.d.ts +6 -11
  434. package/dist/reporting/run-summary-fields.d.ts +5 -8
  435. package/dist/reporting/s3-log-storage.d.ts +31 -50
  436. package/dist/reporting/step-display-order.d.ts +11 -21
  437. package/dist/reporting/step-log-buffer.d.ts +7 -28
  438. package/dist/reporting/step-log-reader.d.ts +11 -19
  439. package/dist/routes/admin-access-log.d.ts +4 -6
  440. package/dist/routes/admin-auth.d.ts +17 -38
  441. package/dist/routes/admin-backends.d.ts +3 -14
  442. package/dist/routes/admin-cluster-name.d.ts +13 -21
  443. package/dist/routes/admin-cluster-settings.d.ts +6 -9
  444. package/dist/routes/admin-config.d.ts +7 -19
  445. package/dist/routes/admin-contexts.d.ts +6 -13
  446. package/dist/routes/admin-db.d.ts +5 -10
  447. package/dist/routes/admin-event-dlq.d.ts +3 -5
  448. package/dist/routes/admin-event-inspect.d.ts +3 -4
  449. package/dist/routes/admin-event-log.d.ts +3 -7
  450. package/dist/routes/admin-events.d.ts +16 -30
  451. package/dist/routes/admin-held-runs.d.ts +52 -76
  452. package/dist/routes/admin-maintenance.d.ts +3 -6
  453. package/dist/routes/admin-orchestrator-drain.d.ts +0 -2
  454. package/dist/routes/admin-org-settings.d.ts +8 -14
  455. package/dist/routes/admin-peer-forget.d.ts +0 -1
  456. package/dist/routes/admin-queue-execution.d.ts +3 -3
  457. package/dist/routes/admin-registrations.d.ts +3 -12
  458. package/dist/routes/admin-runs.d.ts +16 -29
  459. package/dist/routes/admin-scaler-orphans.d.ts +4 -4
  460. package/dist/routes/admin-scaler-reload.d.ts +5 -8
  461. package/dist/routes/admin-scheduled-jobs.d.ts +3 -4
  462. package/dist/routes/admin-sources.d.ts +20 -29
  463. package/dist/routes/admin-trust-policy.d.ts +31 -48
  464. package/dist/routes/admin.d.ts +67 -94
  465. package/dist/routes/caller-identity.d.ts +5 -12
  466. package/dist/routes/capabilities.d.ts +8 -13
  467. package/dist/routes/diagnostics.d.ts +2 -10
  468. package/dist/routes/fleet.d.ts +1 -2
  469. package/dist/routes/github-webhook.d.ts +2 -5
  470. package/dist/routes/health.d.ts +6 -19
  471. package/dist/routes/provenance-oidc.d.ts +3 -3
  472. package/dist/routes/uploads.d.ts +5 -11
  473. package/dist/routes/webhooks.d.ts +2 -24
  474. package/dist/scaler/agent-binary-location.d.ts +77 -0
  475. package/dist/scaler/agent-fit.d.ts +2 -2
  476. package/dist/scaler/backend-factory.d.ts +10 -18
  477. package/dist/scaler/bare-metal-backend.d.ts +28 -45
  478. package/dist/scaler/claim-store.d.ts +20 -43
  479. package/dist/scaler/config.d.ts +10 -37
  480. package/dist/scaler/container-backend.d.ts +22 -35
  481. package/dist/scaler/container-hostconfig.d.ts +10 -16
  482. package/dist/scaler/container-routing.d.ts +10 -13
  483. package/dist/scaler/disk-guard.d.ts +2 -3
  484. package/dist/scaler/event-backend.d.ts +33 -58
  485. package/dist/scaler/event-provision-reaper.d.ts +61 -84
  486. package/dist/scaler/failure-tracker.d.ts +6 -13
  487. package/dist/scaler/file-tail.d.ts +6 -19
  488. package/dist/scaler/firecracker-api.d.ts +19 -63
  489. package/dist/scaler/firecracker-backend.d.ts +142 -258
  490. package/dist/scaler/host-access.d.ts +7 -10
  491. package/dist/scaler/index.d.ts +3 -6
  492. package/dist/scaler/ip-allocator.d.ts +30 -82
  493. package/dist/scaler/label-matcher.d.ts +14 -35
  494. package/dist/scaler/log-forwarder.d.ts +6 -25
  495. package/dist/scaler/machine-ledger.d.ts +39 -86
  496. package/dist/scaler/manager.d.ts +517 -787
  497. package/dist/scaler/pending-scale-sweeper.d.ts +8 -11
  498. package/dist/scaler/reap-orphans.d.ts +8 -12
  499. package/dist/scaler/resolve-container-auth.d.ts +12 -21
  500. package/dist/scaler/scaler-events.d.ts +2 -5
  501. package/dist/scaler/scaler-state-store.d.ts +127 -189
  502. package/dist/scaler/spawn-errors.d.ts +1 -4
  503. package/dist/scaler/startup-orphan-sweep.d.ts +3 -4
  504. package/dist/scaler/startup-tools-check.d.ts +21 -0
  505. package/dist/scaler/types.d.ts +142 -255
  506. package/dist/scaler/vm-job-bindings.d.ts +5 -9
  507. package/dist/scaler/warm-pool.d.ts +46 -93
  508. package/dist/secrets/audit-logger.d.ts +0 -3
  509. package/dist/secrets/backend-health.d.ts +0 -9
  510. package/dist/secrets/backend-registry.d.ts +0 -9
  511. package/dist/secrets/cleanup.d.ts +0 -1
  512. package/dist/secrets/config.d.ts +0 -3
  513. package/dist/secrets/ephemeral-keys.d.ts +0 -3
  514. package/dist/secrets/pg-secret-store.d.ts +0 -3
  515. package/dist/secrets/rbac.d.ts +0 -6
  516. package/dist/secrets/secret-output-store.d.ts +0 -6
  517. package/dist/secrets/secret-resolver.d.ts +2 -6
  518. package/dist/secrets/token-manager.d.ts +0 -4
  519. package/dist/secrets/vault-secret-store.d.ts +0 -13
  520. package/dist/security/comment-handler.d.ts +0 -2
  521. package/dist/security/workflow-diff.d.ts +1 -1
  522. package/dist/server.js +7500 -12629
  523. package/dist/sources/source-manager.d.ts +0 -3
  524. package/dist/sources/source-store.d.ts +0 -9
  525. package/dist/sources/source-validator.d.ts +0 -3
  526. package/dist/stale-detector/all-terminal-runs.d.ts +8 -11
  527. package/dist/stale-detector/gate-deadline-detector.d.ts +14 -19
  528. package/dist/stale-detector/reboot-deadline-sweep.d.ts +7 -11
  529. package/dist/stale-detector/stale-dispatch-candidates.d.ts +13 -20
  530. package/dist/stale-detector/stale-run-detector.d.ts +74 -121
  531. package/dist/stale-detector/workflow-deadline-detector.d.ts +15 -43
  532. package/dist/standalone.js +7141 -11957
  533. package/dist/storage/blob-routes.d.ts +10 -19
  534. package/dist/storage/filesystem.d.ts +19 -29
  535. package/dist/storage/index.d.ts +2 -10
  536. package/dist/storage/key-discriminator.d.ts +8 -10
  537. package/dist/storage/loopback-guard.d.ts +27 -45
  538. package/dist/storage/s3.d.ts +25 -52
  539. package/dist/storage/sign-url.d.ts +7 -22
  540. package/dist/storage/types.d.ts +44 -70
  541. package/dist/webhook/event-log.d.ts +0 -2
  542. package/dist/webhook/generic-sources.d.ts +0 -21
  543. package/dist/webhook/ingest-admission.d.ts +0 -1
  544. package/dist/webhook/relay-buffer.d.ts +2 -2
  545. package/dist/webhook/verify-inbound.d.ts +0 -1
  546. package/dist/worker/in-memory-execution-tracker.d.ts +9 -31
  547. package/dist/worker/in-memory-job-queue.d.ts +32 -72
  548. package/dist/worker/peer-outbox.d.ts +5 -8
  549. package/dist/worker/reroute-dispatch.d.ts +4 -6
  550. package/dist/worker/static-agent-token-store.d.ts +6 -27
  551. package/dist/worker/worker-outbox-relay.d.ts +2 -2
  552. package/dist/worker/worker-status.d.ts +3 -20
  553. package/dist/ws/agent-api-registry.d.ts +8 -27
  554. package/dist/ws/agent-handler.d.ts +63 -110
  555. package/dist/ws/agent-heartbeat.d.ts +5 -12
  556. package/dist/ws/bringup-api.d.ts +31 -38
  557. package/dist/ws/dashboard-backends-handler.d.ts +12 -22
  558. package/dist/ws/dashboard-context-handler.d.ts +37 -80
  559. package/dist/ws/dashboard-diagnostics-handler.d.ts +8 -25
  560. package/dist/ws/dashboard-dispatch-guard.d.ts +3 -4
  561. package/dist/ws/dashboard-fleet-handler.d.ts +9 -13
  562. package/dist/ws/dashboard-fleet-write-handler.d.ts +7 -21
  563. package/dist/ws/dashboard-global-workflows-handler.d.ts +22 -44
  564. package/dist/ws/dashboard-registrations-handler.d.ts +10 -27
  565. package/dist/ws/dashboard-run-state-handler.d.ts +10 -13
  566. package/dist/ws/event-buffer.d.ts +3 -6
  567. package/dist/ws/execution-status-frame.d.ts +7 -10
  568. package/dist/ws/failure-messages.d.ts +9 -14
  569. package/dist/ws/fleet-agent-collector.d.ts +6 -12
  570. package/dist/ws/fleet-runs-on-all.d.ts +1 -6
  571. package/dist/ws/git-credential-relay.d.ts +12 -20
  572. package/dist/ws/inventory-api.d.ts +4 -5
  573. package/dist/ws/observer-registry.d.ts +14 -59
  574. package/dist/ws/ownership-gate.d.ts +1 -1
  575. package/dist/ws/platform-client.d.ts +21 -30
  576. package/dist/ws/replay-chunker.d.ts +7 -10
  577. package/dist/ws/server-options.d.ts +5 -9
  578. package/dist/ws/test-relay-handlers.d.ts +36 -60
  579. package/installer-image-digests.json +3 -3
  580. package/package.json +6 -5
  581. package/sbom.spdx.json +53 -53
  582. package/dist/__test-helpers__/fake-scaler-state-store.d.ts +0 -24
  583. package/dist/__test-helpers__/mock-db-query.d.ts +0 -129
  584. package/dist/__test-helpers__/mock-db.d.ts +0 -134
  585. package/dist/__test-helpers__/mock-ws.d.ts +0 -13
  586. package/dist/__test-helpers__/peer-mutual-auth.d.ts +0 -42
  587. package/dist/__test-helpers__/scratch-db.d.ts +0 -16
  588. package/dist/__test-helpers__/test-db.d.ts +0 -34
  589. package/dist/pipeline/dispatch-matched-workflow.test-helpers.d.ts +0 -121
@@ -3,12 +3,11 @@
3
3
  *
4
4
  * The receiving orchestrator becomes the run coordinator: it claims jobs
5
5
  * it can dispatch locally and reroutes others to peers based on agent
6
- * inventory. Per locked decisions:
7
- * - "One orchestrator coordinates per webhook run"
8
- * - "Claim-based splitting"
9
- * - "Coordinator handles ALL check run reporting"
10
- * - "Peers report step-by-step progress back to coordinator"
11
- * - "Cancel mode: graceful -- finish current step, cancel remaining"
6
+ * inventory.
7
+ * - One orchestrator coordinates per webhook run.
8
+ * - The coordinator handles ALL check run reporting.
9
+ * - Peers report step-by-step progress back to the coordinator.
10
+ * - Cancel is graceful: finish the current step, cancel the remaining ones.
12
11
  */
13
12
  import type { JobReroute, JobProgress, JobProgressAck, PeerScalerEvent, PeerToPeerMessage, RerouteSpawnRetry, ResourceRequest, LabelMatcher } from '@kici-dev/engine';
14
13
  import type { PeerRegistry } from './peer-registry.js';
@@ -54,10 +53,9 @@ export interface JobToRoute {
54
53
  /** Labels that the dispatched agent must NOT have. */
55
54
  excludeLabels?: string[];
56
55
  /**
57
- * Per-job resource request and limit (K8s-style). Forwarded to
58
- * `Dispatcher.dispatch()` so the scaler's per-scaler / per-orchestrator /
59
- * per-machine cap accounting sees the typed value rather than relying on
60
- * the `jobConfig.resources` JSON blob (which the dispatcher does not parse).
56
+ * Per-job resource request and limit (K8s-style), forwarded typed to
57
+ * `Dispatcher.dispatch()` for the scaler's cap accounting: the dispatcher does
58
+ * not parse the `jobConfig.resources` JSON blob.
61
59
  */
62
60
  resources?: ResourceRequest;
63
61
  }
@@ -66,11 +64,7 @@ export interface RouteResult {
66
64
  jobName: string;
67
65
  jobId: string;
68
66
  }>;
69
- /**
70
- * Rerouted jobs include the pre-allocated jobId so the caller can
71
- * register the execution_runs / execution_jobs rows under the same id
72
- * the worker will report progress against.
73
- */
67
+ /** The pre-allocated jobId, so the caller's execution rows match the worker's reports. */
74
68
  reroutedJobs: Array<{
75
69
  jobName: string;
76
70
  peerId: string;
@@ -98,28 +92,20 @@ export interface RunCoordinatorDeps {
98
92
  /** Stale peer timeout in ms. Default: 60000 (60s). */
99
93
  staleTimeoutMs?: number;
100
94
  /**
101
- * Per-job reroute spawn window (ms): the post-ACK re-dispatch backstop
102
- * window. Resolves the job's org override from
103
- * `org_settings.reroute_spawn_window_ms`, else the cluster default. When
104
- * absent, {@link DEFAULT_REROUTE_SPAWN_WINDOW_MS} is used.
95
+ * Post-ACK re-dispatch backstop window (ms): the job's org override from
96
+ * `org_settings.reroute_spawn_window_ms`, else the cluster default. Absent:
97
+ * {@link DEFAULT_REROUTE_SPAWN_WINDOW_MS}.
105
98
  */
106
99
  getRerouteSpawnWindowMs?: (job: JobToRoute) => Promise<number>;
107
- /**
108
- * Per-job reroute ACK timeout (ms) for the `sendAndWaitAck` deadline. When
109
- * absent, falls back to `ackTimeoutMs` / {@link DEFAULT_ACK_TIMEOUT_MS}.
110
- */
100
+ /** `sendAndWaitAck` deadline (ms). Absent: `ackTimeoutMs` / {@link DEFAULT_ACK_TIMEOUT_MS}. */
111
101
  getRerouteAckTimeoutMs?: (job: JobToRoute) => Promise<number>;
112
- /**
113
- * Per-job maximum peer hops for a rerouted job. When absent, falls back to
114
- * {@link DEFAULT_MAX_HOPS}.
115
- */
102
+ /** Absent: {@link DEFAULT_MAX_HOPS}. */
116
103
  getRerouteMaxHops?: (job: JobToRoute) => Promise<number>;
117
104
  /**
118
- * Per-job spawn-retry budget sent to the receiving peer on `job.reroute` and
119
- * enforced here on the peer's relayed spawn failures. Resolves the job's org
120
- * overrides from `org_settings.reroute_spawn_max_attempts` /
121
- * `reroute_spawn_retry_backoff_ms`, else the cluster defaults. When absent,
122
- * {@link DEFAULT_REROUTE_SPAWN_RETRY} is used.
105
+ * Spawn-retry budget sent to the receiving peer on `job.reroute` and enforced
106
+ * here on its relayed spawn failures: the job's org overrides from
107
+ * `org_settings.reroute_spawn_max_attempts` / `reroute_spawn_retry_backoff_ms`,
108
+ * else the cluster defaults. Absent: {@link DEFAULT_REROUTE_SPAWN_RETRY}.
123
109
  */
124
110
  getRerouteSpawnRetry?: (job: JobToRoute) => Promise<RerouteSpawnRetry>;
125
111
  }
@@ -137,18 +123,10 @@ export declare class RunCoordinator {
137
123
  private readonly getRerouteAckTimeoutMs;
138
124
  private readonly getRerouteMaxHops;
139
125
  private readonly getRerouteSpawnRetry;
140
- /**
141
- * Tracks which jobs have been rerouted to which peers, keyed by runId.
142
- * Used for cancel propagation, progress tracking, and the post-ACK spawn
143
- * re-dispatch backstop.
144
- */
126
+ /** runId → jobId → reroute target: cancel propagation, progress, and the spawn backstop. */
145
127
  private readonly reroutedJobs;
146
- /**
147
- * NAK tracking per peer: count of consecutive NAKs and backoff-until timestamp.
148
- * Peers that repeatedly NAK are deprioritized via exponential backoff.
149
- */
128
+ /** Consecutive NAKs per peer; a repeatedly NAKing peer is skipped under exponential backoff. */
150
129
  private readonly nakTracker;
151
- /** Stale eviction timer handle. */
152
130
  private staleEvictionTimer;
153
131
  /** Plan-ceiling worker eviction (drain-then-disconnect). */
154
132
  private readonly workerEviction;
@@ -168,44 +146,31 @@ export declare class RunCoordinator {
168
146
  */
169
147
  reconcileWorkerEviction(ceiling: number, evictExcess: boolean): void;
170
148
  /**
171
- * Route jobs for a webhook run. Claims jobs that local agents can handle,
172
- * reroutes the rest to peers with matching capacity.
173
- *
174
- * Parallel fan-out: jobs targeting different peers are rerouted concurrently.
149
+ * Claim the jobs local agents can handle and reroute the rest, concurrently,
150
+ * to peers with matching capacity.
175
151
  */
176
152
  routeJobs(runContext: RunContext, jobs: JobToRoute[]): Promise<RouteResult>;
177
- /**
178
- * Handle a job reroute request received from a peer (this instance is the worker).
179
- * Checks loop prevention, then attempts to dispatch locally.
180
- */
153
+ /** Accept a peer's job reroute (this instance is the worker) by dispatching it locally. */
181
154
  handleIncomingReroute(msg: JobReroute): Promise<{
182
155
  accepted: boolean;
183
156
  reason?: string;
184
157
  }>;
185
158
  /**
186
- * Handle peer job/step progress updates from a worker (or coord) peer.
187
- *
188
- * The discriminator `msg.kind` decides which downstream tracker call to
189
- * make: 'job' updates feed `onJobStatus` (the path that drives run-level
190
- * state transitions and the rerouted-job cleanup); 'step' updates feed
191
- * `onStepStatus` (which only persists `execution_steps` rows). Without
192
- * this split, every job-level event was silently funnelled into
193
- * `onStepStatus` and the run stayed in `running` forever.
159
+ * Apply a worker (or coord) peer's job/step progress. `msg.kind` picks the
160
+ * tracker call: 'job' feeds `onJobStatus` (run-level state transitions and
161
+ * rerouted-job cleanup); 'step' feeds `onStepStatus` (only `execution_steps`
162
+ * rows). A job-level event sent to `onStepStatus` leaves the run in `running`
163
+ * forever.
194
164
  */
195
165
  onPeerJobProgress(msg: JobProgress, fromPeerId: string, reply?: (m: JobProgressAck) => void): void;
196
166
  /**
197
- * Handle a scaler provisioning event forwarded by a worker peer.
198
- *
199
- * Workers have no database, so they relay scaler events for jobs the
200
- * worker is provisioning to the coordinator that owns the run. The
201
- * coordinator's ExecutionTracker persists the event (provisioning log
202
- * line + dispatch-queue last-error column) just as it would for a
203
- * locally-emitted scaler event.
167
+ * Persist a scaler event a worker peer relayed (workers have no database):
168
+ * provisioning log line + dispatch-queue last-error column, as for a local one.
204
169
  *
205
170
  * Layer B: a `scaler.failed` for a tracked rerouted job whose spawn window is
206
- * still armed is the worker reporting that an agent spawn failed after it
207
- * accepted the reroute. The worker retries within the spawn-retry budget sent on
208
- * `job.reroute`, and the relay carries its verdict:
171
+ * still armed is an agent spawn failing after the worker accepted the reroute.
172
+ * The worker retries within the spawn-retry budget sent on `job.reroute`, and
173
+ * the relay carries its verdict:
209
174
  *
210
175
  * - `final: true` — the worker gave the job back. Re-dispatch immediately (the
211
176
  * same routine the spawn-window timer runs). Idempotent with the Layer A
@@ -230,87 +195,58 @@ export declare class RunCoordinator {
230
195
  * A worker's verdict on a failed spawn for a job it holds. `final: true` means it
231
196
  * gave the job back, so re-dispatch now. `final: false` means it is retrying, so
232
197
  * restart the window for one more attempt plus the backoff this coordinator told it
233
- * to wait. No verdict means a worker that retries without a bound, so leave the
234
- * window as it is. The count caps a worker that never says `final`.
198
+ * to wait. No verdict means a repeated report of one failed spawn, or a failure
199
+ * the worker holds no retry budget for, so leave the window as it is. The count
200
+ * caps a worker that never says `final`.
235
201
  */
236
202
  private onRelayedSpawnFailure;
237
203
  /** Restart a rerouted job's spawn window for one more worker attempt plus its backoff. */
238
204
  private rearmAfterSpawnRetry;
239
205
  /**
240
- * Handle peer job completion. Updates ExecutionTracker.
241
- * The execution tracker's onJobStatus fires the needs-aware scheduler hook,
242
- * which evaluates downstream jobs and dispatches newly-ready ones via onJobReadyCallback.
243
- * The data parameter carries droppedJobs for drift reporting.
206
+ * Apply a peer's job completion. onJobStatus fires the needs-aware scheduler
207
+ * hook, which dispatches newly-ready downstream jobs via onJobReadyCallback.
208
+ * `data` carries droppedJobs for drift reporting.
244
209
  */
245
210
  onPeerJobComplete(runId: string, jobId: string, status: string, timestamp: number, data?: Record<string, unknown>): void;
246
211
  /**
247
- * Cancel all rerouted jobs for a run. Sends peer.job.cancel to all
248
- * peers that have jobs for this run.
249
- *
250
- * Per locked decision: "graceful -- finish current step, cancel remaining."
212
+ * Send peer.job.cancel for every rerouted job of a run. Graceful: the peer
213
+ * finishes the current step and cancels the remaining ones.
251
214
  */
252
215
  cancelRun(runId: string, reason: string): void;
253
- /**
254
- * Check if the peer registry has any connected peers.
255
- */
256
216
  hasConnectedPeers(): boolean;
257
- /**
258
- * Start the stale eviction timer. Calls peerRegistry.evictStalePeers()
259
- * every staleTimeoutMs/2 to detect and remove stale peers.
260
- */
217
+ /** Evict stale peers every staleTimeoutMs/2. */
261
218
  startStaleEvictionTimer(staleTimeoutMs: number): void;
262
- /**
263
- * Stop the stale eviction timer.
264
- */
265
219
  stopStaleEvictionTimer(): void;
266
- /**
267
- * Get the NAK count for a peer (used in tests).
268
- */
220
+ /** Used in tests. */
269
221
  getNakCount(peerId: string): number;
270
- /**
271
- * Get the backoff-until timestamp for a peer (used in tests).
272
- */
222
+ /** Used in tests. */
273
223
  getBackoffUntil(peerId: string): number;
274
- /**
275
- * Attempt to reroute a job to a peer with matching capacity. Allocates the
276
- * sender-side jobId (so the caller can register execution rows under the id
277
- * the worker reports back against) and delegates to {@link attemptPeerRoute}.
278
- */
224
+ /** Allocate the sender-side jobId and delegate to {@link attemptPeerRoute}. */
279
225
  private rerouteJob;
280
226
  /**
281
- * Try each peer with matching capacity (most capacity first) for a single
282
- * job under a fixed `jobId`, returning on the first ACK. Reused by initial
283
- * routing and by the post-ACK spawn re-dispatch backstop — the caller passes
284
- * the accumulated `triedConnections` (this instance + any failed peers) so a
285
- * re-dispatch never re-selects a peer that already failed and the receiving
286
- * peer's loop-prevention stays correct.
227
+ * Try each peer with matching capacity (most first) for one job under a fixed
228
+ * `jobId`, returning on the first ACK. Used by initial routing and the spawn
229
+ * backstop; the caller passes the accumulated `triedConnections` (this
230
+ * instance + any failed peers) so a re-dispatch never re-selects a failed peer
231
+ * and the receiving peer's loop-prevention stays correct.
287
232
  */
288
233
  private attemptPeerRoute;
289
- /** Build the failure result when no peer has matching capacity (with debug log). */
234
+ /** Tell "no peer handles this label" from "peers exist but at capacity". */
290
235
  private noCapacityResult;
291
236
  /** Assemble the `job.reroute` wire message for a single routing attempt. */
292
237
  private buildRerouteMessage;
293
- /**
294
- * Sort peers by available capacity for the given label sets.
295
- * Peers with more available capacity come first.
296
- */
297
238
  private sortPeersByCapacity;
298
239
  /**
299
- * Compute total available capacity across matching agents on a peer.
300
- *
301
- * Applies the same `mandatoryLabels` gate the local label matcher
302
- * applies — a gated agent only contributes capacity for label sets that
303
- * include every gate label. Without it, the coordinator would route a
304
- * job to a peer based on a gated agent's labels, and the peer would
305
- * then refuse the dispatch in `AgentRegistry.findAvailable` because the
306
- * agent's gate is not satisfied.
240
+ * Free capacity across a peer's matching agents. A gated agent counts only for
241
+ * label sets that include every `mandatoryLabels` gate label, as the local
242
+ * matcher does; otherwise the peer refuses the dispatch in
243
+ * `AgentRegistry.findAvailable`.
307
244
  */
308
245
  private computeAvailableCapacity;
309
246
  /**
310
- * Track a rerouted job for cancel propagation, arm the post-ACK spawn-window
311
- * backstop timer, and durably tag the projected `execution_jobs` row with the
312
- * owning worker peer so run-recovery sweepers do not force-fail the job while
313
- * its worker is connected.
247
+ * Track a rerouted job, arm its spawn-window backstop, and durably tag its
248
+ * `execution_jobs` row with the owning worker peer so run-recovery sweepers do
249
+ * not force-fail the job while its worker is connected.
314
250
  */
315
251
  private trackReroutedJob;
316
252
  /** Arm a spawn-window / reap timer that fires {@link handleRerouteSpawnTimeout}. */
@@ -320,10 +256,9 @@ export declare class RunCoordinator {
320
256
  * shared `execution_jobs` row.
321
257
  *
322
258
  * A read failure answers "not running" so a transient database fault cannot
323
- * silently disable the backstop — the re-dispatch it then performs is the
324
- * behavior that shipped before this check existed, and it is idempotent.
325
- * Only the FIRST observation goes through this path: once `peerStarted`
326
- * latches, a read fault can no longer bounce a running job.
259
+ * silently disable the backstop; the re-dispatch it then performs is
260
+ * idempotent. Only the FIRST observation goes through this path: once
261
+ * `peerStarted` latches, a read fault can no longer bounce a running job.
327
262
  */
328
263
  private rerouteTargetIsRunning;
329
264
  /**
@@ -331,24 +266,21 @@ export declare class RunCoordinator {
331
266
  * tracking entry once the shared row is terminal, otherwise re-arm the window
332
267
  * as a reap poll.
333
268
  *
334
- * The entry cannot be dropped here: cancel propagation still needs it
335
- * while the job runs. It also cannot be kept, because a peer
336
- * COORDINATOR relays no terminal `job.progress` — the shared row IS its
337
- * report — so nothing else would ever release it and `reroutedJobs` would
338
- * grow for the lifetime of the process. A read fault re-arms (never releases),
269
+ * The entry cannot be dropped: cancel propagation needs it while the job runs.
270
+ * It cannot be kept: a peer COORDINATOR relays no terminal `job.progress` (the
271
+ * shared row IS its report), so nothing else releases it and `reroutedJobs`
272
+ * would grow for the process lifetime. A read fault re-arms (never releases),
339
273
  * so a transient fault costs one more poll rather than tracking.
340
274
  */
341
275
  private reapOrDeferRerouteTracking;
342
276
  /**
343
277
  * Post-ACK spawn-window backstop. Fires when a rerouted job's peer accepted
344
- * but produced no progress within the window (Layer A), or immediately when a
345
- * worker relays its final spawn-failure verdict for the job (Layer B, via
346
- * onPeerScalerEvent).
278
+ * but produced no progress within the window (Layer A), or when a worker
279
+ * relays its final spawn-failure verdict (Layer B, via onPeerScalerEvent).
347
280
  * Best-effort cancels the original peer (double-execution guard against a
348
- * slow-but-healthy spawn), then re-runs routing to another peer, then a local
349
- * fallback, and finally records the job failed rather than leaving it pending.
350
- * Idempotent: whichever trigger fires first removes the tracking entry, so the
351
- * other no-ops.
281
+ * slow-but-healthy spawn), then re-routes to another peer, then local, and
282
+ * finally records the job failed rather than leaving it pending. Idempotent:
283
+ * whichever trigger fires first removes the tracking entry.
352
284
  */
353
285
  private handleRerouteSpawnTimeout;
354
286
  /** Best-effort cancel a single job on a peer (double-execution guard). */
@@ -365,12 +297,11 @@ export declare class RunCoordinator {
365
297
  */
366
298
  cancelJobOnPeer(peerId: string, runId: string, jobId: string, reason: string, force?: boolean): boolean;
367
299
  /**
368
- * Send a fire-and-forget message to a peer. The outbound client carries it
369
- * when connected; otherwise the peer's own connection to this process does.
370
- * The outbound client is down while it reconnects, and for good on a
371
- * coordinator whose credential an operator revoked.
372
- * `PeerClient.send` returns false only when it sent nothing, so the fallback
373
- * never delivers a message twice.
300
+ * Fire-and-forget to a peer: over the outbound client when connected, else
301
+ * over the peer's own connection to this process. The outbound client is down
302
+ * while it reconnects, and for good on a coordinator whose credential an
303
+ * operator revoked. `PeerClient.send` returns false only when it sent nothing,
304
+ * so the fallback never delivers a message twice.
374
305
  */
375
306
  private sendToPeer;
376
307
  /**
@@ -379,10 +310,7 @@ export declare class RunCoordinator {
379
310
  * timeout, and resending would deliver the job twice.
380
311
  */
381
312
  private rerouteTransport;
382
- /**
383
- * Local fallback for a re-dispatch: dispatch the job on this coordinator under
384
- * the existing jobId. Returns true when the local dispatcher accepts it.
385
- */
313
+ /** Re-dispatch locally under the existing jobId; true when the dispatcher accepts it. */
386
314
  private tryLocalRedispatch;
387
315
  /** Mark a job failed when no backend (peer or local) can run it after re-dispatch. */
388
316
  private failUnroutableJob;
@@ -1,12 +1,10 @@
1
1
  /**
2
- * Cluster health HTTP endpoints.
3
- *
4
- * Provides visibility into cluster state for monitoring and debugging:
2
+ * Cluster health HTTP endpoints:
5
3
  * - GET /cluster/health -- overall cluster health status
6
4
  * - GET /cluster/peers -- per-peer details including connectivity
7
5
  * - GET /cluster/runs -- active execution runs with job counts
8
6
  *
9
- * Follows the existing Hono route factory pattern from routes/health.ts.
7
+ * Follows the Hono route factory pattern of routes/health.ts.
10
8
  */
11
9
  import { Hono } from 'hono';
12
10
  import type { RaftNode } from './raft.js';
@@ -20,11 +18,5 @@ export interface ClusterHealthRoutesDeps {
20
18
  executionTracker: ExecutionTracker;
21
19
  agentRegistry: AgentRegistry;
22
20
  }
23
- /**
24
- * Create cluster health routes.
25
- *
26
- * @param deps - Dependencies for cluster state introspection
27
- * @returns Hono app with /cluster/health, /cluster/peers, /cluster/runs endpoints
28
- */
29
21
  export declare function createClusterHealthRoutes(deps: ClusterHealthRoutesDeps): Hono;
30
22
  //# sourceMappingURL=health-api.d.ts.map
@@ -1,9 +1,4 @@
1
- /**
2
- * Barrel export for the cluster coordination module.
3
- *
4
- * All cluster-related functionality is exported from this single entry point
5
- * for clean imports in server.ts and standalone.ts.
6
- */
1
+ /** Barrel export for the cluster coordination module. */
7
2
  export { PeerRegistry } from './peer-registry.js';
8
3
  export type { PeerInfo, PeerAgentInfo, PeerRegistryOptions } from './peer-registry.js';
9
4
  export { PeerClient, PeerDialOrigin } from './peer-client.js';
@@ -3,24 +3,20 @@ import type { Database } from '../db/types.js';
3
3
  /** Default interval between `cluster_instances` heartbeat writes. */
4
4
  export declare const DEFAULT_INSTANCE_HEARTBEAT_MS = 10000;
5
5
  /**
6
- * How many missed ticks a coordinator gets before it reads as dead. Six ticks
7
- * (60 s at the default interval) is wide enough that a GC pause, a slow DB or a
8
- * brief network stall does not evict a healthy coordinator — the cost of a
9
- * false "dead" verdict is another coordinator recovering jobs it is watching.
6
+ * Missed ticks before a coordinator reads as dead. Six (60 s at the default
7
+ * interval) survives a GC pause, slow DB or brief network stall; a false "dead"
8
+ * verdict makes another coordinator recover jobs this one is watching.
10
9
  */
11
10
  export declare const HEARTBEAT_MISSES_BEFORE_DEAD = 6;
12
11
  /**
13
- * The dispatcher's recovery grace period at the default config: twice
14
- * `agentMaxReconnectDelayMs` (60 s). Used as the fallback floor when a caller
15
- * has no configured grace period to hand in.
12
+ * The dispatcher's default recovery grace: twice `agentMaxReconnectDelayMs` (60 s).
13
+ * The fallback floor when a caller has no configured grace period.
16
14
  */
17
15
  export declare const DEFAULT_RECOVERY_GRACE_MS = 120000;
18
16
  /**
19
- * The window inside which a `cluster_instances` row counts as live.
20
- *
21
- * Deliberately the larger of the recovery grace period and six heartbeat ticks:
22
- * the ownership predicate must never call a coordinator dead sooner than the
23
- * recovery machinery would have given it to reconnect.
17
+ * Window inside which a `cluster_instances` row counts as live: the larger of the
18
+ * recovery grace and six ticks, so the ownership predicate never calls a
19
+ * coordinator dead sooner than recovery would have let it reconnect.
24
20
  */
25
21
  export declare function instanceLivenessGraceMs(gracePeriodMs: number, heartbeatMs?: number): number;
26
22
  /**
@@ -41,18 +37,15 @@ export interface InstanceHeartbeatOptions {
41
37
  /**
42
38
  * Writes this coordinator's liveness into `cluster_instances` on a fixed tick.
43
39
  *
44
- * Every ownership predicate in the dispatch plane asks "is the coordinator that
45
- * owns this row still alive?", and the answer has to come from the database.
46
- * The in-memory peer registry cannot answer it: it is empty at exactly the
47
- * moment startup recovery runs, because a freshly booted process has not
48
- * handshaken with any peer yet, so it reads every live sibling as dead — which
49
- * is the boot-time bug the predicate exists to fix. Raft membership is worse:
50
- * a partitioned coordinator self-elects and reads the other half as gone.
40
+ * Dispatch-plane ownership predicates ("is this row's owner alive?") must read the
41
+ * DB. The in-memory peer registry is empty when startup recovery runs (no peer
42
+ * handshakes yet), so it reads every live sibling as dead — the boot-time bug the
43
+ * predicate exists to fix. Raft membership is worse: a partitioned coordinator
44
+ * self-elects and reads the other half as gone.
51
45
  *
52
- * A DB heartbeat needs no peer connectivity, so it behaves the same in a
53
- * Raft cluster, a plain multi-coordinator deployment and a standalone one.
54
- * `host_roster` already derives agent liveness this way; this is the same
55
- * mechanism pointed at coordinators.
46
+ * A DB heartbeat needs no peer connectivity, so it behaves the same in Raft,
47
+ * plain multi-coordinator and standalone deployments — the mechanism
48
+ * `host_roster` uses for agent liveness.
56
49
  */
57
50
  export declare class InstanceHeartbeat {
58
51
  private readonly db;
@@ -63,39 +56,30 @@ export declare class InstanceHeartbeat {
63
56
  private timer;
64
57
  constructor(opts: InstanceHeartbeatOptions);
65
58
  /**
66
- * Write one heartbeat immediately, then every `intervalMs`.
67
- *
68
- * The immediate write matters: startup recovery runs moments after boot and
69
- * reads this table, so a coordinator that had not yet written a row would be
70
- * invisible to its own siblings' predicates.
59
+ * Write one heartbeat immediately, then every `intervalMs`. The immediate write
60
+ * matters: startup recovery reads this table moments after boot, and a
61
+ * coordinator with no row yet is invisible to its siblings' predicates.
71
62
  */
72
63
  start(): Promise<void>;
73
64
  stop(): void;
74
65
  /**
75
- * Remove this instance's row on a clean shutdown, so a coordinator that
76
- * stopped on purpose is dead to its siblings immediately rather than after
77
- * the grace window. Best-effort: a crash leaves the row to expire.
66
+ * Delete this row on clean shutdown so siblings see it dead immediately, not
67
+ * after the grace window. Best-effort: a crash leaves the row to expire.
78
68
  */
79
69
  retire(): Promise<void>;
80
70
  /**
81
71
  * One heartbeat write. Best-effort: a failed tick is retried on the next.
82
- *
83
- * `processStart` is set for the write `start()` makes, and is the only one
84
- * that rewrites `started_at` — the column records when THIS process came up,
85
- * so a restart under the same instance id must move it while an ordinary tick
86
- * must not.
72
+ * Only `start()`'s write (`processStart`) rewrites `started_at`, which records
73
+ * when THIS process came up: a restart under the same id moves it, a tick does not.
87
74
  */
88
75
  beat(opts?: {
89
76
  processStart?: boolean;
90
77
  }): Promise<void>;
91
78
  }
92
79
  /**
93
- * Which of the given coordinator instance ids are alive right now.
94
- *
95
- * Reads `cluster_instances` directly rather than the peer registry, for the
96
- * reason the class above documents: the peer registry is empty during boot and
97
- * blind under a partition, and a wrong "dead" verdict here means acting on a
98
- * row a working coordinator owns.
80
+ * Which of the given coordinator ids are alive now. Reads `cluster_instances`, not
81
+ * the peer registry (empty at boot, blind under a partition — see the class above):
82
+ * a wrong "dead" verdict means acting on a row a working coordinator owns.
99
83
  */
100
84
  export declare function liveInstanceIds(db: Kysely<Database>, instanceIds: readonly string[], graceMs: number): Promise<Set<string>>;
101
85
  //# sourceMappingURL=instance-heartbeat.d.ts.map
@@ -38,10 +38,9 @@ export declare function describeJoinRefusal(response: JoinResponse): string;
38
38
  * through.
39
39
  *
40
40
  * The `satisfies` clause makes a bundle storage field with no entry here a
41
- * compile error, so the projection cannot silently drop one — which is the
42
- * whole defect this artifact exists to avoid. The companion test pins the
43
- * other half: every field `sharedConfigSchema.storage` accepts, and every
44
- * variable named here, resolves in the startup env definition.
41
+ * compile error, so the projection cannot silently drop one. The companion test
42
+ * pins the other half: every field `sharedConfigSchema.storage` accepts, and
43
+ * every variable named here, resolves in the startup env definition.
45
44
  */
46
45
  export declare const STORAGE_ENV_VARS: {
47
46
  readonly type: 'KICI_STORAGE_TYPE';
@@ -61,9 +60,7 @@ export declare const STORAGE_ENV_VARS: {
61
60
  * rejected by name rather than written.
62
61
  */
63
62
  export declare function buildEnvFile(bundle: ConfigBundle): string;
64
- /**
65
- * Write the env file the orchestrator boots from.
66
- */
63
+ /** Write the env file the orchestrator boots from. */
67
64
  export declare function writeEnvFile(path: string, bundle: ConfigBundle): Promise<void>;
68
65
  export declare class JoinClient {
69
66
  private readonly options;
@@ -23,10 +23,7 @@ interface JoinHandlerDeps {
23
23
  */
24
24
  secretKey?: string;
25
25
  }
26
- /**
27
- * Config bundle distributed to new orchestrators via join token.
28
- * Contains everything needed to configure and start an orchestrator instance.
29
- */
26
+ /** Config bundle a join seals to a new orchestrator: everything it needs to start. */
30
27
  export interface ConfigBundle {
31
28
  databaseUrl: string;
32
29
  storage?: {
@@ -57,9 +54,8 @@ export declare class JoinHandler {
57
54
  handleJoinRequest(raw: unknown): Promise<JoinResponse>;
58
55
  private answer;
59
56
  /**
60
- * Build the config bundle from SharedConfig + local config. The secrets key is
61
- * the shared configuration's `secrets.key`, else this orchestrator's own key, so
62
- * a joined orchestrator decrypts what the cluster encrypted.
57
+ * The secrets key is the shared configuration's `secrets.key`, else this
58
+ * orchestrator's own key, so a joined orchestrator decrypts what the cluster encrypted.
63
59
  */
64
60
  buildConfigBundle(): Promise<ConfigBundle>;
65
61
  }
@@ -14,10 +14,7 @@
14
14
  import { OrchRole } from '@kici-dev/engine';
15
15
  import { Kysely } from 'kysely';
16
16
  import { z } from 'zod';
17
- /**
18
- * Silence the module-level logger (e.g. when a CLI is emitting JSON on stdout
19
- * and a stray log line would break the contract).
20
- */
17
+ /** Silence the module logger, e.g. while a CLI emits JSON on stdout. */
21
18
  export declare function silenceJoinTokenLogger(): void;
22
19
  export declare const TOKEN_ALREADY_USED_MESSAGE = "Join token has already been used. Create a new token with: kici-admin peer create-token";
23
20
  export declare const TOKEN_EXPIRED_MESSAGE = "Join token has expired. Create a new token with: kici-admin peer create-token";
@@ -62,10 +59,7 @@ interface JoinTokenManagerDeps {
62
59
  export declare class JoinTokenManager {
63
60
  private readonly deps;
64
61
  constructor(deps: JoinTokenManagerDeps);
65
- /**
66
- * Create a new join token.
67
- * Returns the full token string (only available at creation time).
68
- */
62
+ /** Returns the full token string, available only at creation time. */
69
63
  createToken(opts: {
70
64
  orgId: string;
71
65
  routingKey: string;
@@ -77,12 +71,11 @@ export declare class JoinTokenManager {
77
71
  * Peer token mode: claim the row the presented token's secret hashes to. Role and
78
72
  * routing come from the row (`claimByHash`), never from the token's routing part.
79
73
  *
80
- * Self-healing reuse: a join token is re-consumable by the same joining peer
81
- * (`peerInstanceId`) until its `expires_at`. A peer that lost its credential
82
- * re-presents the still-valid join token already in its env, and the coordinator
83
- * issues a fresh credential without an operator action. Reuse is bounded by both
84
- * `expires_at` and the consuming instanceId, so it never widens a leaked token's
85
- * usefulness beyond the instance that first consumed it.
74
+ * Self-healing reuse: the same joining peer (`peerInstanceId`) can re-consume
75
+ * the token until `expires_at`, so a peer that lost its credential re-presents
76
+ * the token in its env and gets a fresh credential without an operator action.
77
+ * Bounding reuse by `expires_at` and the consuming instanceId keeps a leaked
78
+ * token useless beyond the instance that first consumed it.
86
79
  */
87
80
  validateAndConsumeToken(token: string, consumedBy: string, peerInstanceId: string): Promise<ClaimedJoinToken>;
88
81
  /**
@@ -110,10 +103,8 @@ export declare class JoinTokenManager {
110
103
  } | null>;
111
104
  }
112
105
  /**
113
- * Build a JoinTokenManager backed by its own connection pool to the given
114
- * orchestrator database URL. Mirrors `createPeerCredentialStoreFromUrl`;
115
- * used by tests that need to exercise token validation/reuse against a real
116
- * cluster DB.
106
+ * A JoinTokenManager with its own connection pool, for tests against a real
107
+ * cluster DB. Mirrors `createPeerCredentialStoreFromUrl`.
117
108
  */
118
109
  export declare function createJoinTokenManagerFromUrl(databaseUrl: string, opts?: {
119
110
  maxConnections?: number;
@@ -122,17 +113,12 @@ export declare function createJoinTokenManagerFromUrl(databaseUrl: string, opts?
122
113
  dispose: () => Promise<void>;
123
114
  };
124
115
  /**
125
- * Narrow detector for the "already been used" error thrown by
126
- * validateAndConsumeToken(). Used by peer-handler.ts to branch into the
127
- * idempotent recovery path on legitimate mesh-join races (sibling
128
- * peer-clients on the same peer identity racing on a shared join token
129
- * across a multi-coordinator shared-DB mesh). Other validation failures
130
- * (expired, not found, bad parse) MUST NOT be treated as recoverable.
116
+ * Detects the "already been used" error from validateAndConsumeToken(), which
117
+ * peer-handler.ts treats as recoverable: sibling peer-clients of one peer
118
+ * identity race on a shared token across a shared-DB mesh. Other validation
119
+ * failures (expired, not found, bad parse) MUST NOT be treated as recoverable.
131
120
  */
132
121
  export declare function isTokenAlreadyUsedError(err: unknown): boolean;
133
- /**
134
- * Parse a join token string into routing info and secret hex.
135
- */
136
122
  export declare function parseToken(token: string): {
137
123
  routing: TokenRouting;
138
124
  routingB64: string;