@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
@@ -11,6 +11,7 @@
11
11
  import { Hono } from 'hono';
12
12
  import type { SourceStore } from '../sources/source-store.js';
13
13
  import type { Role } from '../secrets/rbac.js';
14
+ import { type FetchGithubAppIdentity } from '../github-app-name-refresher/github-app-name-refresher.js';
14
15
  interface SourceRouteDeps {
15
16
  sourceStore: SourceStore;
16
17
  /**
@@ -28,6 +29,23 @@ interface SourceRouteDeps {
28
29
  webhookUrl: string | null;
29
30
  webhookNote?: string;
30
31
  }>;
32
+ /**
33
+ * Resolve the org-scoped GitHub webhook URL for the manifest setup flow
34
+ * BEFORE any App exists. The GitHub webhook URL is org-scoped
35
+ * (`<base>/webhook/<orgId>/github`), not app-scoped, so it can be computed
36
+ * up front and baked into the App manifest. Returns null + a note when the
37
+ * orchestrator cannot yet resolve a public base or its org id.
38
+ */
39
+ resolveGithubWebhookUrl?: () => Promise<{
40
+ webhookUrl: string | null;
41
+ webhookNote?: string;
42
+ }>;
43
+ /**
44
+ * Fetch a GitHub App's authoritative `{ name, slug }` from GitHub. Injectable
45
+ * for tests; defaults to the real `fetchGithubAppIdentity`. Used by the
46
+ * `source refresh` route.
47
+ */
48
+ fetchAppIdentity?: FetchGithubAppIdentity;
31
49
  }
32
50
  type AdminSourcesEnv = {
33
51
  Variables: {
@@ -77,6 +77,14 @@ export interface AdminRouteDeps {
77
77
  webhookUrl: string | null;
78
78
  webhookNote?: string;
79
79
  }>;
80
+ /**
81
+ * Optional -- resolves the org-scoped GitHub webhook URL for the manifest
82
+ * setup pre-flight (before any App exists). Wired in platform/hybrid mode.
83
+ */
84
+ resolveGithubWebhookUrl?: () => Promise<{
85
+ webhookUrl: string | null;
86
+ webhookNote?: string;
87
+ }>;
80
88
  /** Optional -- for DB migration endpoints. */
81
89
  db?: Kysely<any>;
82
90
  /** Optional -- for DB migration endpoints. */
@@ -10,6 +10,15 @@ import { type Kysely } from 'kysely';
10
10
  import type { Database } from '../db/types.js';
11
11
  import type { SecretStore } from '@kici-dev/engine';
12
12
  import type { AuditLogger } from './audit-logger.js';
13
+ /**
14
+ * Thrown by `renameScope` when the named scope has no secret rows and no
15
+ * environment binding — i.e. there is nothing to rename. Consumers map this to
16
+ * a 404 (admin HTTP route) or a structured not-found response (dashboard path).
17
+ */
18
+ export declare class SecretScopeNotFoundError extends Error {
19
+ readonly scope: string;
20
+ constructor(scope: string);
21
+ }
13
22
  /**
14
23
  * PostgreSQL secret store with AES-256-GCM encryption.
15
24
  * Uses scoped_secrets table keyed by (org_id, scope, key).
@@ -62,6 +62,21 @@ export interface ResolvedSecretMeta {
62
62
  backend: string;
63
63
  scope: string;
64
64
  }
65
+ /**
66
+ * The public secret-resolution surface consumed by the dispatch path and the
67
+ * universal-git provider. `SecretResolver` implements this; the test adapter's
68
+ * `DecoratingSecretResolver` (CLI-secret overlay) implements it too, so either
69
+ * can flow through `ProcessingDeps.secretResolver`.
70
+ */
71
+ export interface SecretResolverApi {
72
+ resolveForJob(orgId: string, environmentName: string): Promise<Record<string, string>>;
73
+ resolveNamed(orgId: string, scope: string, key: string, opts?: {
74
+ store?: string;
75
+ runId?: string;
76
+ jobId?: string;
77
+ }): Promise<string | null>;
78
+ resolveForJobWithMeta(orgId: string, environmentName: string): Promise<Record<string, ResolvedSecretMeta>>;
79
+ }
65
80
  /**
66
81
  * Resolves secrets for a job by matching environment bindings against scoped secrets
67
82
  * from multiple backends.
@@ -71,7 +86,7 @@ export interface ResolvedSecretMeta {
71
86
  * are matched against binding patterns, and longest-path-wins uses the path AFTER
72
87
  * stripping the backend prefix.
73
88
  */
74
- export declare class SecretResolver {
89
+ export declare class SecretResolver implements SecretResolverApi {
75
90
  private readonly environmentStore;
76
91
  private readonly bindingStore;
77
92
  private readonly backendStores;