@kici-dev/orchestrator 0.1.16 → 0.1.18

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 (83) hide show
  1. package/dist/agent/dispatcher.d.ts +27 -1
  2. package/dist/agent/host-roster-reaper.d.ts +42 -0
  3. package/dist/agent/host-roster.d.ts +110 -0
  4. package/dist/agent/registry.d.ts +65 -2
  5. package/dist/app.d.ts +3 -0
  6. package/dist/approvals/apply-decision.d.ts +11 -1
  7. package/dist/cache/pending-inits.d.ts +5 -0
  8. package/dist/cli/api-client.d.ts +11 -0
  9. package/dist/cli/commands/host.d.ts +13 -0
  10. package/dist/cli/commands/local-hook.d.ts +15 -0
  11. package/dist/cli/commands/local-trigger.d.ts +24 -0
  12. package/dist/cli/commands/remote-source.d.ts +17 -0
  13. package/dist/cli/commands/shared/versioned-upgrade.d.ts +37 -0
  14. package/dist/cli/kici-admin.d.ts +13 -0
  15. package/dist/cli/service/compose.d.ts +2 -1
  16. package/dist/cli/service/index.d.ts +2 -2
  17. package/dist/cli/service/instance/manifest.d.ts +12 -0
  18. package/dist/cli/service/instance/resolve.d.ts +12 -2
  19. package/dist/cli/service/launchd.d.ts +4 -1
  20. package/dist/cli/service/platform-detect.d.ts +5 -0
  21. package/dist/cli/service/systemd.d.ts +2 -1
  22. package/dist/cli/service/types.d.ts +37 -0
  23. package/dist/cli/service/windows.d.ts +2 -1
  24. package/dist/cli.js +1340 -198
  25. package/dist/cluster/coordinator.d.ts +5 -1
  26. package/dist/config/schema.d.ts +4 -0
  27. package/dist/config/types.d.ts +9 -0
  28. package/dist/config.d.ts +6 -4
  29. package/dist/dashboard/handler.d.ts +26 -2
  30. package/dist/dashboard/needs-edges.d.ts +13 -0
  31. package/dist/db/migrations/035_pending_workflow_contexts.d.ts +11 -0
  32. package/dist/db/migrations/036_attestations.d.ts +15 -0
  33. package/dist/db/migrations/037_generic_sources_provider_type_local.d.ts +19 -0
  34. package/dist/db/migrations/038_remote_sources.d.ts +14 -0
  35. package/dist/db/migrations/039_host_roster.d.ts +19 -0
  36. package/dist/db/migrations/040_runsonall_pin.d.ts +4 -0
  37. package/dist/db/migrations/041_wave_gated.d.ts +4 -0
  38. package/dist/db/migrations/042_dispatch_queue_patterns.d.ts +4 -0
  39. package/dist/db/types.d.ts +144 -10
  40. package/dist/diagnostics/fleet-collector.d.ts +1 -1
  41. package/dist/entry-helpers.d.ts +7 -29
  42. package/dist/environments/held-runs.d.ts +33 -0
  43. package/dist/index.js +1 -0
  44. package/dist/lockfile-redos-guard.d.ts +19 -0
  45. package/dist/metrics/prometheus.d.ts +17 -2
  46. package/dist/metrics/scheduled-jobs.d.ts +2 -2
  47. package/dist/orchestrator-core.d.ts +94 -1
  48. package/dist/pipeline/dispatch-matched-workflow.d.ts +60 -2
  49. package/dist/pipeline/install-secrets-resolver.d.ts +32 -5
  50. package/dist/pipeline/needs-scheduler.d.ts +12 -10
  51. package/dist/pipeline/pending-workflow-context.d.ts +44 -0
  52. package/dist/pipeline/processor.d.ts +31 -4
  53. package/dist/pipeline/remote-source-store.d.ts +21 -0
  54. package/dist/pipeline/resume-workflow.d.ts +26 -0
  55. package/dist/pipeline/wave-scheduler.d.ts +60 -0
  56. package/dist/providers/local/index.d.ts +33 -0
  57. package/dist/providers/local/local-source-config.d.ts +17 -0
  58. package/dist/providers/{internal → local}/lock-file-fetcher.d.ts +6 -6
  59. package/dist/providers/{internal → local}/normalizer.d.ts +28 -28
  60. package/dist/providers/{internal → local}/repo-url-builder.d.ts +6 -6
  61. package/dist/queue/job-queue.d.ts +61 -2
  62. package/dist/reporting/execution-tracker.d.ts +61 -0
  63. package/dist/routes/admin-events.d.ts +3 -4
  64. package/dist/routes/uploads.d.ts +36 -26
  65. package/dist/server.js +53755 -50888
  66. package/dist/sources/build-platform-sources.d.ts +4 -2
  67. package/dist/stale-detector/stale-run-detector.d.ts +14 -1
  68. package/dist/standalone.js +17234 -15725
  69. package/dist/webhook/generic-sources-listener.d.ts +4 -0
  70. package/dist/webhook/generic-sources.d.ts +37 -11
  71. package/dist/webhook/register-source-bundle.d.ts +14 -4
  72. package/dist/ws/agent-handler.d.ts +17 -0
  73. package/dist/ws/dashboard-dispatch-guard.d.ts +21 -0
  74. package/dist/ws/dashboard-env-handler.d.ts +13 -1
  75. package/dist/ws/oidc-token-relay.d.ts +59 -0
  76. package/dist/ws/platform-client.d.ts +30 -1
  77. package/dist/ws/test-relay-handlers.d.ts +112 -0
  78. package/installer-image-digests.json +3 -3
  79. package/package.json +22 -22
  80. package/sbom.spdx.json +3228 -6633
  81. package/dist/providers/internal/index.d.ts +0 -32
  82. package/dist/routes/test-trigger.d.ts +0 -41
  83. package/dist/ws/observer-handler.d.ts +0 -42
@@ -37,6 +37,11 @@ export declare function isRoot(): boolean;
37
37
  *
38
38
  * Used by the instance index (`<kiciRoot>/instances.json`) which lives
39
39
  * outside any per-instance subdir, and as the base for {@link getConfigDir}.
40
+ *
41
+ * `KICI_CONFIG_ROOT` overrides the platform default for both privilege scopes.
42
+ * It exists so a test harness (or a sandboxed run) can point the instance index
43
+ * at an isolated directory instead of sharing the host's `~/.config/kici/` —
44
+ * which otherwise lets concurrent installs clobber each other's index.
40
45
  */
41
46
  export declare function kiciConfigRoot(isUserLevel: boolean): string;
42
47
  /**
@@ -5,7 +5,7 @@
5
5
  * journalctl, and loginctl commands. Supports both system-level
6
6
  * (/etc/systemd/system/) and user-level (~/.config/systemd/user/) services.
7
7
  */
8
- import type { DiscoveredInstance, ServiceConfig, ServiceManager, ServiceStatus, LogOptions } from './types.js';
8
+ import type { DiscoveredInstance, ServiceConfig, ServiceManager, ServiceStatus, LogOptions, LaunchSpec } from './types.js';
9
9
  /**
10
10
  * Check whether linger is already enabled for a user.
11
11
  *
@@ -37,6 +37,7 @@ export declare class SystemdServiceManager implements ServiceManager {
37
37
  status(config: ServiceConfig): Promise<ServiceStatus>;
38
38
  logs(config: ServiceConfig, options: LogOptions): Promise<void>;
39
39
  isInstalled(config: ServiceConfig): Promise<boolean>;
40
+ readLaunchSpec(config: ServiceConfig): Promise<LaunchSpec | null>;
40
41
  list(isUserLevel: boolean): Promise<DiscoveredInstance[]>;
41
42
  }
42
43
  //# sourceMappingURL=systemd.d.ts.map
@@ -68,6 +68,28 @@ export interface ServiceConfig {
68
68
  * Optional during lifecycle ops that don't regenerate the unit; required on install.
69
69
  */
70
70
  component?: 'orchestrator' | 'agent';
71
+ /**
72
+ * The deploy folder that holds this instance's manifest. Embedded in the unit
73
+ * (X-KiCI-InstanceDir for systemd, KiCIInstanceDir for launchd,
74
+ * dev.kici.instance-dir for compose, a description suffix for Windows) so
75
+ * per-driver `list()` scans can recover the deploy folder straight from the
76
+ * init system — making the instance index a true rebuildable cache rather
77
+ * than the sole source of the name→folder mapping.
78
+ *
79
+ * Optional during lifecycle ops that don't regenerate the unit; set on install.
80
+ */
81
+ instanceDir?: string;
82
+ }
83
+ /**
84
+ * The launch command an installed init unit will actually execute, parsed
85
+ * back out of the unit/plist/service registration. `execPath` is the binary
86
+ * the init system runs (for a Node-launched server, the node binary); `args`
87
+ * are everything after it (for a Node-launched server, the resolved entry
88
+ * script path). Returned by {@link ServiceManager.readLaunchSpec}.
89
+ */
90
+ export interface LaunchSpec {
91
+ execPath: string;
92
+ args: string[];
71
93
  }
72
94
  /** Current state of a service. */
73
95
  export type ServiceState = 'running' | 'stopped' | 'failed' | 'unknown';
@@ -101,6 +123,12 @@ export interface DiscoveredInstance {
101
123
  isUserLevel: boolean;
102
124
  /** The component this unit belongs to, decoded from the unit's KiCI marker. */
103
125
  component: 'orchestrator' | 'agent';
126
+ /**
127
+ * The deploy folder recovered from the unit's KiCI instance-dir marker, when
128
+ * the unit carries one. Undefined for units installed before the marker
129
+ * existed (the index cache remains the fallback for those).
130
+ */
131
+ instanceDir?: string;
104
132
  }
105
133
  /**
106
134
  * Interface that all platform-specific service managers must implement.
@@ -134,5 +162,14 @@ export interface ServiceManager {
134
162
  * (systemd, launchd); ignored on Windows/compose.
135
163
  */
136
164
  list(isUserLevel: boolean): Promise<DiscoveredInstance[]>;
165
+ /**
166
+ * Read the launch command the installed unit will actually execute, parsed
167
+ * back out of the init system's own record (systemd ExecStart, launchd
168
+ * ProgramArguments, windows service binPath). Returns null when the unit is
169
+ * not installed, its launch spec can't be parsed, or the platform has no
170
+ * node-launched entry to resolve (compose). Used by the npm-source upgrade to
171
+ * verify the version that will run before reporting success.
172
+ */
173
+ readLaunchSpec(config: ServiceConfig): Promise<LaunchSpec | null>;
137
174
  }
138
175
  //# sourceMappingURL=types.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * dependency on first use. Service configuration (auto-start, recovery)
7
7
  * is handled via sc.exe.
8
8
  */
9
- import type { ServiceManager, ServiceConfig, ServiceStatus, LogOptions, DiscoveredInstance } from './types.js';
9
+ import type { ServiceManager, ServiceConfig, ServiceStatus, LogOptions, DiscoveredInstance, LaunchSpec } from './types.js';
10
10
  export declare class WindowsServiceManager implements ServiceManager {
11
11
  install(config: ServiceConfig): Promise<void>;
12
12
  uninstall(config: ServiceConfig): Promise<void>;
@@ -17,5 +17,6 @@ export declare class WindowsServiceManager implements ServiceManager {
17
17
  logs(config: ServiceConfig, _options: LogOptions): Promise<void>;
18
18
  isInstalled(config: ServiceConfig): Promise<boolean>;
19
19
  list(isUserLevel: boolean): Promise<DiscoveredInstance[]>;
20
+ readLaunchSpec(config: ServiceConfig): Promise<LaunchSpec | null>;
20
21
  }
21
22
  //# sourceMappingURL=windows.d.ts.map