@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
@@ -1,43 +0,0 @@
1
- import { EnvGateRejectReason, type Environment } from '@kici-dev/engine';
2
- import type { JobDispatchContext } from './pipeline.js';
3
- /** A single environment's rejection under all-must-pass aggregation. */
4
- export interface EnvGateRejection {
5
- environment: string;
6
- reason: EnvGateRejectReason;
7
- detail: string;
8
- }
9
- /** Effective protection parameters after most-restrictive aggregation. */
10
- export interface EffectiveProtection {
11
- minimumTrust?: 'known' | 'trusted';
12
- requiredReviewers: string[];
13
- waitTimerSeconds: number | null;
14
- holdExpirySeconds: number;
15
- concurrencyLimit: number | null;
16
- concurrencyStrategy: 'queue' | 'cancel-pending';
17
- }
18
- /**
19
- * Evaluate each environment's hard reject gates against the run context. A name
20
- * with no `Environment` record yields an `env_not_found` rejection. Returns all
21
- * rejections (empty = every environment passed the reject gates).
22
- */
23
- export declare function evaluateMultiEnvGates(envs: ReadonlyArray<{
24
- name: string;
25
- env: Environment | undefined;
26
- }>, ctx: JobDispatchContext): EnvGateRejection[];
27
- /**
28
- * Aggregate hold/wait/queue parameters across all bound environments, most
29
- * restrictive wins: trust = max tier, reviewers = sorted dedup union, wait timer
30
- * = max, hold expiry = min, concurrency limit = min (tightest). The concurrency
31
- * strategy follows the primary (first) environment.
32
- */
33
- export declare function aggregateProtectionParams(envs: ReadonlyArray<Environment>): EffectiveProtection;
34
- /**
35
- * Build a synthetic `Environment` carrying the aggregated protection parameters,
36
- * so the existing per-rule gate functions (trust/concurrency/reviewer/wait) can
37
- * evaluate the all-must-pass holds in one pass. Branch/trigger/repo/enabled are
38
- * already handled by `evaluateMultiEnvGates`, so they are neutralized here.
39
- */
40
- export declare function buildEffectiveEnvironment(primary: Environment, eff: EffectiveProtection): Environment;
41
- /** Format a human-readable rejection reason naming the env(s) and rule(s). */
42
- export declare function formatMultiEnvRejection(rejections: ReadonlyArray<EnvGateRejection>): string;
43
- //# sourceMappingURL=aggregate.d.ts.map
@@ -1,5 +0,0 @@
1
- import type { Environment, ProtectionGateResult } from '@kici-dev/engine';
2
- import type { JobDispatchContext } from './pipeline.js';
3
- /** Evaluate branch restrictions, trigger type filters, and repo patterns. */
4
- export declare function evaluateBranchGate(env: Environment, ctx: JobDispatchContext): ProtectionGateResult;
5
- //# sourceMappingURL=branch-gate.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Concurrency gate -- checks concurrency limits.
3
- */
4
- import type { Environment, ProtectionGateResult } from '@kici-dev/engine';
5
- /** Evaluate concurrency limits for the environment. */
6
- export declare function evaluateConcurrencyGate(env: Environment, currentRunningCount: number, _concurrencyGroup: string): ProtectionGateResult;
7
- //# sourceMappingURL=concurrency-gate.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Reviewer gate -- checks required reviewers.
3
- */
4
- import type { Environment, ProtectionGateResult } from '@kici-dev/engine';
5
- /** Evaluate reviewer requirements for the environment. */
6
- export declare function evaluateReviewerGate(env: Environment): ProtectionGateResult;
7
- //# sourceMappingURL=reviewer-gate.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Trust gate -- checks contributor trust tier against environment minimumTrust.
3
- */
4
- import type { Environment, ProtectionGateResult, TrustTier } from '@kici-dev/engine';
5
- /** Evaluate minimumTrust requirements for the environment. */
6
- export declare function evaluateTrustGate(env: Environment, trustTier: TrustTier | undefined): ProtectionGateResult;
7
- //# sourceMappingURL=trust-gate.d.ts.map
@@ -1,7 +0,0 @@
1
- /**
2
- * Wait timer gate -- checks wait timer configuration.
3
- */
4
- import type { Environment, ProtectionGateResult } from '@kici-dev/engine';
5
- /** Evaluate wait timer for the environment. */
6
- export declare function evaluateWaitTimerGate(env: Environment): ProtectionGateResult;
7
- //# sourceMappingURL=wait-timer-gate.d.ts.map
@@ -1,39 +0,0 @@
1
- /**
2
- * Variable store -- environment variable CRUD with lock enforcement.
3
- *
4
- * Manages org-level environment variables and per-source overrides.
5
- * Lock enforcement: locked org vars cannot be overridden by source overrides.
6
- */
7
- import { type Kysely } from 'kysely';
8
- import type { Database, EnvironmentVariable, EnvironmentSourceOverride } from '../db/types.js';
9
- /**
10
- * Data access layer for environment variables and source overrides.
11
- */
12
- export declare class VariableStore {
13
- private readonly db;
14
- constructor(db: Kysely<Database>);
15
- /** List all org-level variables for an environment. */
16
- listVars(orgId: string, environmentId: string): Promise<EnvironmentVariable[]>;
17
- /** Upsert an org-level variable. */
18
- setVar(orgId: string, environmentId: string, key: string, value: string, locked?: boolean): Promise<void>;
19
- /** Delete an org-level variable. */
20
- deleteVar(orgId: string, environmentId: string, key: string): Promise<void>;
21
- /** List source overrides for a specific source (routing key). */
22
- listSourceOverrides(orgId: string, environmentId: string, routingKey: string): Promise<EnvironmentSourceOverride[]>;
23
- /** Upsert a source override. */
24
- setSourceOverride(orgId: string, environmentId: string, routingKey: string, key: string, value: string): Promise<void>;
25
- /** Delete a source override. */
26
- deleteSourceOverride(orgId: string, environmentId: string, routingKey: string, key: string): Promise<void>;
27
- /**
28
- * Get resolved variables for an environment, optionally merged with source overrides.
29
- *
30
- * Merge rules:
31
- * - Org-level vars form the base
32
- * - Source overrides can add new keys and override unlocked org vars
33
- * - Locked org vars are NOT overridden by source overrides
34
- *
35
- * @param routingKey - If provided, source overrides are merged in
36
- */
37
- getResolvedVars(orgId: string, environmentId: string, routingKey?: string): Promise<Record<string, string>>;
38
- }
39
- //# sourceMappingURL=variable-store.d.ts.map
@@ -1,47 +0,0 @@
1
- /**
2
- * Admin API routes for environment management.
3
- *
4
- * POST /api/v1/admin/environments — create (upsert)
5
- * POST /api/v1/admin/environments/:name/bind — bind a scope pattern
6
- * PATCH /api/v1/admin/environments/:name/policy — update policy fields
7
- * GET /api/v1/admin/environments?orgId=<id> — list environments
8
- * GET /api/v1/admin/environments/:name?orgId=<id> — show env + vars + bindings
9
- * DELETE /api/v1/admin/environments/:name?orgId=<id> — delete env (cascades bindings/variables/overrides; pending held runs block with 409)
10
- * POST /api/v1/admin/environments/templates — create/update a template
11
- * GET /api/v1/admin/environments/:name/variables?orgId=<id> — list org-level variables
12
- * PUT /api/v1/admin/environments/:name/variables/:key?orgId=<id> — upsert variable
13
- * DELETE /api/v1/admin/environments/:name/variables/:key?orgId=<id> — delete variable
14
- *
15
- * Backs the `kici-admin environment` dual-mode CLI. Offline (direct-DB) mode
16
- * bypasses this router entirely — the CLI calls `*Direct` helpers from
17
- * @kici-dev/shared. This HTTP surface exists so tooling with only an admin
18
- * token (no DB reach) can do the same operations.
19
- *
20
- * All routes are protected by the admin auth middleware mounted in admin.ts
21
- * (at `/api/v1/admin/*`). That middleware sets `role` + `userId` on the
22
- * context, which we use for RBAC gating here.
23
- */
24
- import { Hono } from 'hono';
25
- import { type Kysely } from 'kysely';
26
- import type { RbacEnforcer, Role } from '../secrets/rbac.js';
27
- export interface AdminEnvironmentRoutesDeps {
28
- db: Kysely<any>;
29
- rbac: RbacEnforcer;
30
- }
31
- /** Hono env type for admin-environments routes with context variables. */
32
- type AdminEnvEnv = {
33
- Variables: {
34
- role: Role;
35
- userId: string;
36
- routingKey: string | null;
37
- };
38
- };
39
- /**
40
- * Create admin API routes for environment management.
41
- *
42
- * @param deps - db (Kysely) + rbac enforcer
43
- * @returns Hono app mounted at /api/v1/admin
44
- */
45
- export declare function createAdminEnvironmentRoutes(deps: AdminEnvironmentRoutesDeps): Hono<AdminEnvEnv>;
46
- export {};
47
- //# sourceMappingURL=admin-environments.d.ts.map