@kici-dev/orchestrator 0.1.20 → 0.1.22

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 (71) hide show
  1. package/dist/agent/dispatcher.d.ts +44 -0
  2. package/dist/agent/host-roster-reaper.d.ts +2 -1
  3. package/dist/agent/host-roster.d.ts +54 -1
  4. package/dist/agent/registry.d.ts +22 -0
  5. package/dist/app.d.ts +5 -0
  6. package/dist/approvals/step-approval-bridge.d.ts +5 -0
  7. package/dist/cli/commands/source-manifest.d.ts +42 -0
  8. package/dist/cli/loopback-callback.d.ts +24 -0
  9. package/dist/cli/open-browser.d.ts +12 -0
  10. package/dist/cli/service/compose.d.ts +13 -0
  11. package/dist/cli/service/deploy-env.d.ts +31 -0
  12. package/dist/cli.js +1204 -256
  13. package/dist/cluster/coordinator.d.ts +5 -3
  14. package/dist/cluster/index.d.ts +2 -0
  15. package/dist/cluster/join-token.d.ts +27 -5
  16. package/dist/cluster/peer-auth-coordinator.d.ts +36 -0
  17. package/dist/cluster/peer-client.d.ts +34 -14
  18. package/dist/cluster/peer-credentials.d.ts +14 -2
  19. package/dist/cluster/peer-handler.d.ts +2 -2
  20. package/dist/cluster/rerouted-job-guard.d.ts +39 -0
  21. package/dist/config.d.ts +6 -0
  22. package/dist/dashboard/needs-edges.d.ts +4 -3
  23. package/dist/db/migrations/043_rerouted_to_peer.d.ts +4 -0
  24. package/dist/db/migrations/044_check_mode.d.ts +4 -0
  25. package/dist/db/migrations/045_host_properties.d.ts +16 -0
  26. package/dist/db/migrations/046_join_token_consumed_by_instance.d.ts +17 -0
  27. package/dist/db/migrations/047_needs_run_on.d.ts +4 -0
  28. package/dist/db/migrations/048_host_reboot_pending.d.ts +19 -0
  29. package/dist/db/migrations/049_held_runs_payload.d.ts +14 -0
  30. package/dist/db/migrations/050_sources_slug.d.ts +17 -0
  31. package/dist/db/types.d.ts +60 -5
  32. package/dist/deployment/deployment-identity.d.ts +9 -0
  33. package/dist/entry-helpers.d.ts +7 -0
  34. package/dist/environments/held-runs.d.ts +7 -1
  35. package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +77 -0
  36. package/dist/index.d.ts +5 -1
  37. package/dist/index.js +1187 -33
  38. package/dist/lockfile-validate.d.ts +24 -0
  39. package/dist/orchestrator-core.d.ts +13 -1
  40. package/dist/pipeline/decorating-secret-resolver.d.ts +32 -0
  41. package/dist/pipeline/dispatch-matched-workflow.d.ts +127 -3
  42. package/dist/pipeline/install-secrets-resolver.d.ts +2 -2
  43. package/dist/pipeline/needs-scheduler.d.ts +22 -13
  44. package/dist/pipeline/processor.d.ts +2 -2
  45. package/dist/pipeline/test-pipeline.d.ts +37 -58
  46. package/dist/providers/github/manifest-form.d.ts +15 -0
  47. package/dist/providers/github/manifest.d.ts +103 -0
  48. package/dist/reporting/execution-tracker.d.ts +10 -1
  49. package/dist/routes/admin-sources.d.ts +18 -0
  50. package/dist/routes/admin.d.ts +8 -0
  51. package/dist/secrets/pg-secret-store.d.ts +9 -0
  52. package/dist/secrets/secret-resolver.d.ts +16 -1
  53. package/dist/server.js +4373 -2322
  54. package/dist/sources/source-store.d.ts +4 -0
  55. package/dist/sources/source-validator.d.ts +2 -0
  56. package/dist/stale-detector/reboot-deadline-sweep.d.ts +29 -0
  57. package/dist/stale-detector/stale-run-detector.d.ts +8 -0
  58. package/dist/standalone.js +3582 -1932
  59. package/dist/worker/in-memory-job-queue.d.ts +17 -0
  60. package/dist/worker/peer-outbox.d.ts +36 -0
  61. package/dist/worker/worker-outbox-relay.d.ts +13 -0
  62. package/dist/ws/agent-handler.d.ts +11 -6
  63. package/dist/ws/dashboard-fleet-handler.d.ts +33 -0
  64. package/dist/ws/dashboard-fleet-write-handler.d.ts +60 -0
  65. package/dist/ws/fleet-runs-on-all.d.ts +16 -0
  66. package/dist/ws/inventory-api.d.ts +17 -0
  67. package/dist/ws/platform-client.d.ts +13 -1
  68. package/dist/ws/test-relay-handlers.d.ts +4 -2
  69. package/installer-image-digests.json +3 -3
  70. package/package.json +4 -4
  71. package/sbom.spdx.json +77 -128
@@ -17,6 +17,8 @@ export interface AddSourceParams {
17
17
  provider: string;
18
18
  /** Human-readable source name */
19
19
  name: string;
20
+ /** GitHub App slug (the authoritative URL-safe identifier). Optional. */
21
+ slug?: string;
20
22
  /** App ID for the provider (used to build routing key) */
21
23
  appId: string;
22
24
  /** Private key (PEM format for GitHub Apps) */
@@ -65,6 +67,8 @@ export declare class SourceStore {
65
67
  */
66
68
  updateSource(routingKey: string, updates: {
67
69
  name?: string;
70
+ /** New GitHub App slug. `null` clears it; `undefined` leaves it unchanged. */
71
+ slug?: string | null;
68
72
  privateKey?: string;
69
73
  webhookSecret?: string;
70
74
  config?: Record<string, unknown>;
@@ -4,6 +4,8 @@
4
4
  export interface ValidationResult {
5
5
  valid: boolean;
6
6
  appName?: string;
7
+ /** GitHub App slug (URL-safe identifier) returned by `GET /app`. */
8
+ slug?: string;
7
9
  error?: string;
8
10
  }
9
11
  /**
@@ -0,0 +1,29 @@
1
+ /**
2
+ * RebootDeadlineSweep: clears expired host-reboot-pending flags.
3
+ *
4
+ * When a workflow's `restartHost()` step runs, the orchestrator sets a
5
+ * `host_roster.reboot_pending_until` deadline and holds the pinned post-restart
6
+ * job until the host completes a reboot cycle. If the host never returns by the
7
+ * deadline, this sweep clears the stale flag. With the flag cleared and the
8
+ * agent still gone, the held post-restart job hits the existing dispatch-queue
9
+ * timeout and the run fails — the "host did not return after reboot" outcome.
10
+ *
11
+ * Driven by the leader-only host-roster reaper's tick (one timer, one leader),
12
+ * so this class owns no timer of its own — just a testable `scan()`.
13
+ */
14
+ /** Narrow roster slice the sweep needs (set on the full HostRosterStore). */
15
+ export interface RebootDeadlineRosterStore {
16
+ /** Agent ids whose reboot-pending deadline has passed at `nowMs`. */
17
+ listExpiredRebootPending(nowMs: number): Promise<string[]>;
18
+ /** Clear the reboot-pending flag for an agent. */
19
+ clearRebootPending(agentId: string): Promise<void>;
20
+ }
21
+ export declare class RebootDeadlineSweep {
22
+ private readonly rosterStore;
23
+ constructor(deps: {
24
+ rosterStore: RebootDeadlineRosterStore;
25
+ });
26
+ /** Clear every reboot-pending flag whose deadline has passed. */
27
+ scan(): Promise<void>;
28
+ }
29
+ //# sourceMappingURL=reboot-deadline-sweep.d.ts.map
@@ -25,6 +25,7 @@ import type { AgentRegistry } from '../agent/registry.js';
25
25
  import type { HeldRunStore, ReleaseSignal } from '../environments/held-runs.js';
26
26
  import type { StepApprovalBridge } from '../approvals/step-approval-bridge.js';
27
27
  import type { AccessLogWriter } from '../audit/access-log.js';
28
+ import type { PeerRegistry } from '../cluster/peer-registry.js';
28
29
  export interface StaleRunDetectorDeps {
29
30
  db: Kysely<Database>;
30
31
  executionTracker: ExecutionTracker;
@@ -32,6 +33,12 @@ export interface StaleRunDetectorDeps {
32
33
  scalerManager?: ScalerManager;
33
34
  dispatcher: Dispatcher;
34
35
  registry: AgentRegistry;
36
+ /**
37
+ * Peer registry used to defer failing a job that was rerouted to a remote
38
+ * worker peer while that peer is still connected — its terminal status may
39
+ * still be replayed from the worker's durable outbox.
40
+ */
41
+ peerRegistry: PeerRegistry;
35
42
  /** Threshold in ms after which a job is considered stale. Default: heartbeatIntervalMs * multiplier */
36
43
  staleThresholdMs: number;
37
44
  /** How often to scan for stale jobs in ms. Default: 60_000 */
@@ -58,6 +65,7 @@ export declare class StaleRunDetector {
58
65
  private readonly scalerManager?;
59
66
  private readonly dispatcher;
60
67
  private readonly registry;
68
+ private readonly peerRegistry;
61
69
  private readonly staleThresholdMs;
62
70
  private readonly scanIntervalMs;
63
71
  private readonly heldRunStore?;