@kici-dev/orchestrator 0.1.26 → 0.1.27

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/app.d.ts +13 -4
  2. package/dist/approvals/apply-decision.d.ts +1 -1
  3. package/dist/approvals/step-approval-bridge.d.ts +1 -1
  4. package/dist/cache/pending-inits.d.ts +4 -4
  5. package/dist/cli/api-client.d.ts +29 -4
  6. package/dist/cli/commands/context.d.ts +25 -0
  7. package/dist/cli/commands/debug-bundle.d.ts +1 -1
  8. package/dist/cli/commands/variable.d.ts +6 -6
  9. package/dist/cli/service/windows.d.ts +6 -0
  10. package/dist/cli.js +526 -340
  11. package/dist/config.d.ts +16 -0
  12. package/dist/contexts/binding-store.d.ts +36 -0
  13. package/dist/contexts/context-store.d.ts +87 -0
  14. package/dist/{environments → contexts}/held-runs.d.ts +15 -15
  15. package/dist/{environments → contexts}/index.d.ts +1 -1
  16. package/dist/contexts/protection/aggregate.d.ts +43 -0
  17. package/dist/contexts/protection/branch-gate.d.ts +5 -0
  18. package/dist/contexts/protection/concurrency-gate.d.ts +7 -0
  19. package/dist/{environments → contexts}/protection/pipeline.d.ts +3 -3
  20. package/dist/contexts/protection/reviewer-gate.d.ts +7 -0
  21. package/dist/{environments → contexts}/protection/satisfiability.d.ts +21 -21
  22. package/dist/contexts/protection/trust-gate.d.ts +7 -0
  23. package/dist/contexts/protection/wait-timer-gate.d.ts +7 -0
  24. package/dist/contexts/variable-store.d.ts +39 -0
  25. package/dist/dashboard/attestation-filters.d.ts +10 -8
  26. package/dist/dashboard/handler.d.ts +28 -2
  27. package/dist/db/migrations/067_environments_to_contexts.d.ts +36 -0
  28. package/dist/db/migrations/068_request_idempotency.d.ts +17 -0
  29. package/dist/db/types.d.ts +78 -59
  30. package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +1 -1
  31. package/dist/index.js +21 -6
  32. package/dist/metrics/prometheus.d.ts +2 -0
  33. package/dist/oidc/id-token-claims.d.ts +63 -0
  34. package/dist/oidc/jwt.d.ts +15 -0
  35. package/dist/oidc/local-dev-signer.d.ts +31 -0
  36. package/dist/oidc/local-mint.d.ts +77 -0
  37. package/dist/oidc/oidc-mint-registration.d.ts +49 -0
  38. package/dist/pipeline/decorating-secret-resolver.d.ts +4 -4
  39. package/dist/pipeline/dispatch-matched-workflow.d.ts +3 -3
  40. package/dist/pipeline/inline-eval.d.ts +2 -2
  41. package/dist/pipeline/install-secrets-resolver.d.ts +13 -13
  42. package/dist/pipeline/{job-environments.d.ts → job-contexts.d.ts} +23 -23
  43. package/dist/pipeline/manual-schedule.d.ts +8 -1
  44. package/dist/pipeline/processor.d.ts +6 -6
  45. package/dist/pipeline/request-idempotency.d.ts +28 -0
  46. package/dist/pipeline/rerun.d.ts +8 -0
  47. package/dist/pipeline/resume-workflow.d.ts +1 -1
  48. package/dist/pipeline/test-pipeline.d.ts +2 -2
  49. package/dist/provenance/trust-root.d.ts +7 -0
  50. package/dist/provider-registry.d.ts +8 -0
  51. package/dist/providers/local/index.d.ts +1 -0
  52. package/dist/providers/local/local-source-config.d.ts +1 -0
  53. package/dist/reporting/execution-tracker.d.ts +17 -7
  54. package/dist/reporting/run-aggregator.d.ts +5 -5
  55. package/dist/routes/admin-contexts.d.ts +47 -0
  56. package/dist/routes/admin-registrations.d.ts +2 -2
  57. package/dist/routes/github-webhook.d.ts +2 -2
  58. package/dist/secrets/context-secret-resolver.d.ts +30 -0
  59. package/dist/secrets/index.d.ts +1 -1
  60. package/dist/secrets/pg-secret-store.d.ts +3 -3
  61. package/dist/secrets/rbac.d.ts +1 -1
  62. package/dist/secrets/secret-resolver.d.ts +19 -19
  63. package/dist/security/comment-handler.d.ts +1 -1
  64. package/dist/server.js +1770 -1196
  65. package/dist/stale-detector/stale-run-detector.d.ts +1 -1
  66. package/dist/standalone.js +1649 -747
  67. package/dist/storage/blob-routes.d.ts +16 -0
  68. package/dist/ws/{dashboard-env-handler.d.ts → dashboard-context-handler.d.ts} +15 -15
  69. package/dist/ws/oidc-token-relay.d.ts +6 -0
  70. package/installer-image-digests.json +3 -3
  71. package/package.json +4 -4
  72. package/sbom.spdx.json +50 -50
  73. package/dist/cli/commands/environment.d.ts +0 -25
  74. package/dist/environments/binding-store.d.ts +0 -36
  75. package/dist/environments/environment-store.d.ts +0 -87
  76. package/dist/environments/protection/aggregate.d.ts +0 -43
  77. package/dist/environments/protection/branch-gate.d.ts +0 -5
  78. package/dist/environments/protection/concurrency-gate.d.ts +0 -7
  79. package/dist/environments/protection/reviewer-gate.d.ts +0 -7
  80. package/dist/environments/protection/trust-gate.d.ts +0 -7
  81. package/dist/environments/protection/wait-timer-gate.d.ts +0 -7
  82. package/dist/environments/variable-store.d.ts +0 -39
  83. package/dist/routes/admin-environments.d.ts +0 -47
@@ -13,7 +13,7 @@ export type Role = 'owner' | 'admin' | 'auditor';
13
13
  /**
14
14
  * Permissions for the secrets management admin API.
15
15
  */
16
- export type Permission = 'context.create' | 'context.read' | 'context.update' | 'context.delete' | 'secret.read' | 'secret.write' | 'secret.delete' | 'secret.reveal' | 'audit.read' | 'token.manage' | 'key.rotate' | 'run.read' | 'run.cancel' | 'event_log.read' | 'event_log.read_payload' | 'access_log.read' | 'scheduled_job.trigger' | 'event_dlq.read' | 'event_dlq.manage';
16
+ export type Permission = 'context.create' | 'context.read' | 'context.update' | 'context.delete' | 'secret.read' | 'secret.write' | 'secret.delete' | 'secret.reveal' | 'audit.read' | 'token.manage' | 'key.rotate' | 'run.read' | 'run.cancel' | 'event_log.read' | 'event_log.read_payload' | 'access_log.read' | 'scheduled_job.trigger' | 'attestation.retry' | 'event_dlq.read' | 'event_dlq.manage';
17
17
  /**
18
18
  * Error thrown when a role lacks the required permission.
19
19
  */
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Secret resolver for dispatch-time secret resolution.
3
3
  *
4
- * Uses environment bindings + scope resolver to match secrets from multiple backends.
5
- * When a job dispatches with an environment name, the resolver:
6
- * 1. Looks up the environment by name
7
- * 2. Gets bindings for that environment
4
+ * Uses context bindings + scope resolver to match secrets from multiple backends.
5
+ * When a job dispatches with a context name, the resolver:
6
+ * 1. Looks up the context by name
7
+ * 2. Gets bindings for that context
8
8
  * 3. Queries ALL registered backend stores for secrets
9
9
  * 4. Prefixes each secret's scope with the backend name (e.g., pg:aws/prod)
10
- * 5. Uses resolveSecretsForEnvironment to match bindings against prefixed secrets
10
+ * 5. Uses resolveSecretsForContext to match bindings against prefixed secrets
11
11
  * 6. Returns a flat decrypted key-value map
12
12
  *
13
13
  * unreachable backends cause job failure (not silent skip).
@@ -15,13 +15,13 @@
15
15
  * longest-path-wins uses scope path after stripping backend prefix.
16
16
  * audit log includes backend name.
17
17
  */
18
- import { type EnvironmentBinding, type HostFacts, type ScopedSecret } from '@kici-dev/engine';
18
+ import { type ContextBinding, type HostFacts, type ScopedSecret } from '@kici-dev/engine';
19
19
  import type { Logger } from '@kici-dev/shared';
20
20
  import type { AuditLogger } from './audit-logger.js';
21
21
  /**
22
- * Minimal environment store interface (subset needed by resolver).
22
+ * Minimal context store interface (subset needed by resolver).
23
23
  */
24
- export interface EnvironmentStoreLike {
24
+ export interface ContextStoreLike {
25
25
  getByName(orgId: string, name: string): Promise<{
26
26
  id: string;
27
27
  name: string;
@@ -32,7 +32,7 @@ export interface EnvironmentStoreLike {
32
32
  * Minimal binding store interface (subset needed by resolver).
33
33
  */
34
34
  export interface BindingStoreLike {
35
- getByEnvironmentId(environmentId: string): Promise<EnvironmentBinding[]>;
35
+ getByContextId(contextId: string): Promise<ContextBinding[]>;
36
36
  }
37
37
  /**
38
38
  * Minimal secret store interface (subset needed by resolver).
@@ -49,7 +49,7 @@ export interface SecretStoreLike {
49
49
  * Dependencies for the SecretResolver.
50
50
  */
51
51
  export interface SecretResolverDeps {
52
- environmentStore: EnvironmentStoreLike;
52
+ contextStore: ContextStoreLike;
53
53
  bindingStore: BindingStoreLike;
54
54
  /** Map of backend name to store. Replaces single secretStore. */
55
55
  backendStores: Map<string, SecretStoreLike>;
@@ -69,16 +69,16 @@ export interface ResolvedSecretMeta {
69
69
  * can flow through `ProcessingDeps.secretResolver`.
70
70
  */
71
71
  export interface SecretResolverApi {
72
- resolveForJob(orgId: string, environmentName: string, hostCtx?: HostFacts): Promise<Record<string, string>>;
72
+ resolveForJob(orgId: string, contextName: string, hostCtx?: HostFacts): Promise<Record<string, string>>;
73
73
  resolveNamed(orgId: string, scope: string, key: string, opts?: {
74
74
  store?: string;
75
75
  runId?: string;
76
76
  jobId?: string;
77
77
  }): Promise<string | null>;
78
- resolveForJobWithMeta(orgId: string, environmentName: string, hostCtx?: HostFacts): Promise<Record<string, ResolvedSecretMeta>>;
78
+ resolveForJobWithMeta(orgId: string, contextName: string, hostCtx?: HostFacts): Promise<Record<string, ResolvedSecretMeta>>;
79
79
  }
80
80
  /**
81
- * Resolves secrets for a job by matching environment bindings against scoped secrets
81
+ * Resolves secrets for a job by matching context bindings against scoped secrets
82
82
  * from multiple backends.
83
83
  *
84
84
  * All backend stores are queried. Each secret's scope is prefixed with the backend
@@ -87,7 +87,7 @@ export interface SecretResolverApi {
87
87
  * stripping the backend prefix.
88
88
  */
89
89
  export declare class SecretResolver implements SecretResolverApi {
90
- private readonly environmentStore;
90
+ private readonly contextStore;
91
91
  private readonly bindingStore;
92
92
  private readonly backendStores;
93
93
  private readonly auditLogger;
@@ -97,17 +97,17 @@ export declare class SecretResolver implements SecretResolverApi {
97
97
  * Resolve secrets for a job dispatch.
98
98
  *
99
99
  * @param orgId - Organization ID
100
- * @param environmentName - Environment name to resolve secrets for
100
+ * @param contextName - Context name to resolve secrets for
101
101
  * @param hostCtx - Optional fan-out child identity for per-host resolution.
102
102
  * When supplied, each binding is gated by its `host_pattern` and its
103
103
  * `scope_pattern` is templated per-child; when omitted, only fleet-wide
104
104
  * (`'**'`) non-templated bindings contribute.
105
105
  * @returns Flat map of decrypted secret key-value pairs
106
106
  */
107
- resolveForJob(orgId: string, environmentName: string, hostCtx?: HostFacts): Promise<Record<string, string>>;
107
+ resolveForJob(orgId: string, contextName: string, hostCtx?: HostFacts): Promise<Record<string, string>>;
108
108
  /**
109
109
  * Resolve a single named secret by (orgId, scope, key), optionally scoped to
110
- * a specific backend. Bypasses environment bindings — this is a direct
110
+ * a specific backend. Bypasses context bindings — this is a direct
111
111
  * lookup used for source-scoped credentials (e.g. universal-git PAT/SSH
112
112
  * keys stored under `__source__/<sourceId>`).
113
113
  *
@@ -130,7 +130,7 @@ export declare class SecretResolver implements SecretResolverApi {
130
130
  *
131
131
  * Returns the secret value along with which backend and scope provided it.
132
132
  */
133
- resolveForJobWithMeta(orgId: string, environmentName: string, hostCtx?: HostFacts): Promise<Record<string, ResolvedSecretMeta>>;
133
+ resolveForJobWithMeta(orgId: string, contextName: string, hostCtx?: HostFacts): Promise<Record<string, ResolvedSecretMeta>>;
134
134
  /**
135
135
  * Collect all secrets from all backend stores, prefixing scopes.
136
136
  * Per /: unreachable backends are tracked but not fatal here.
@@ -142,7 +142,7 @@ export declare class SecretResolver implements SecretResolverApi {
142
142
  */
143
143
  private buildDecryptFn;
144
144
  /**
145
- * Check if any failed backend could affect the job's environment bindings.
145
+ * Check if any failed backend could affect the job's context bindings.
146
146
  * throw when a failed backend's scopes could match a binding and
147
147
  * no healthy backend already satisfies that binding.
148
148
  * jobs referencing only healthy backends succeed normally.
@@ -5,7 +5,7 @@
5
5
  * approval/rejection of security holds. Verifies commenter identity
6
6
  * via the trust policy cache and checks ci_trust:write+ before acting.
7
7
  */
8
- import type { HeldRunStore } from '../environments/held-runs.js';
8
+ import type { HeldRunStore } from '../contexts/held-runs.js';
9
9
  import { type IdentityLink, type PermissionLevel } from './trust-resolver.js';
10
10
  import type { CheckStatusPoster as EngineCheckStatusPoster } from '@kici-dev/engine';
11
11
  /** Parsed /kici command from a comment body. */