@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.
- package/dist/app.d.ts +13 -4
- package/dist/approvals/apply-decision.d.ts +1 -1
- package/dist/approvals/step-approval-bridge.d.ts +1 -1
- package/dist/cache/pending-inits.d.ts +4 -4
- package/dist/cli/api-client.d.ts +29 -4
- package/dist/cli/commands/context.d.ts +25 -0
- package/dist/cli/commands/debug-bundle.d.ts +1 -1
- package/dist/cli/commands/variable.d.ts +6 -6
- package/dist/cli/service/windows.d.ts +6 -0
- package/dist/cli.js +526 -340
- package/dist/config.d.ts +16 -0
- package/dist/contexts/binding-store.d.ts +36 -0
- package/dist/contexts/context-store.d.ts +87 -0
- package/dist/{environments → contexts}/held-runs.d.ts +15 -15
- package/dist/{environments → contexts}/index.d.ts +1 -1
- package/dist/contexts/protection/aggregate.d.ts +43 -0
- package/dist/contexts/protection/branch-gate.d.ts +5 -0
- package/dist/contexts/protection/concurrency-gate.d.ts +7 -0
- package/dist/{environments → contexts}/protection/pipeline.d.ts +3 -3
- package/dist/contexts/protection/reviewer-gate.d.ts +7 -0
- package/dist/{environments → contexts}/protection/satisfiability.d.ts +21 -21
- package/dist/contexts/protection/trust-gate.d.ts +7 -0
- package/dist/contexts/protection/wait-timer-gate.d.ts +7 -0
- package/dist/contexts/variable-store.d.ts +39 -0
- package/dist/dashboard/attestation-filters.d.ts +10 -8
- package/dist/dashboard/handler.d.ts +28 -2
- package/dist/db/migrations/067_environments_to_contexts.d.ts +36 -0
- package/dist/db/migrations/068_request_idempotency.d.ts +17 -0
- package/dist/db/types.d.ts +78 -59
- package/dist/github-app-name-refresher/github-app-name-refresher.d.ts +1 -1
- package/dist/index.js +21 -6
- package/dist/metrics/prometheus.d.ts +2 -0
- package/dist/oidc/id-token-claims.d.ts +63 -0
- package/dist/oidc/jwt.d.ts +15 -0
- package/dist/oidc/local-dev-signer.d.ts +31 -0
- package/dist/oidc/local-mint.d.ts +77 -0
- package/dist/oidc/oidc-mint-registration.d.ts +49 -0
- package/dist/pipeline/decorating-secret-resolver.d.ts +4 -4
- package/dist/pipeline/dispatch-matched-workflow.d.ts +3 -3
- package/dist/pipeline/inline-eval.d.ts +2 -2
- package/dist/pipeline/install-secrets-resolver.d.ts +13 -13
- package/dist/pipeline/{job-environments.d.ts → job-contexts.d.ts} +23 -23
- package/dist/pipeline/manual-schedule.d.ts +8 -1
- package/dist/pipeline/processor.d.ts +6 -6
- package/dist/pipeline/request-idempotency.d.ts +28 -0
- package/dist/pipeline/rerun.d.ts +8 -0
- package/dist/pipeline/resume-workflow.d.ts +1 -1
- package/dist/pipeline/test-pipeline.d.ts +2 -2
- package/dist/provenance/trust-root.d.ts +7 -0
- package/dist/provider-registry.d.ts +8 -0
- package/dist/providers/local/index.d.ts +1 -0
- package/dist/providers/local/local-source-config.d.ts +1 -0
- package/dist/reporting/execution-tracker.d.ts +17 -7
- package/dist/reporting/run-aggregator.d.ts +5 -5
- package/dist/routes/admin-contexts.d.ts +47 -0
- package/dist/routes/admin-registrations.d.ts +2 -2
- package/dist/routes/github-webhook.d.ts +2 -2
- package/dist/secrets/context-secret-resolver.d.ts +30 -0
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/pg-secret-store.d.ts +3 -3
- package/dist/secrets/rbac.d.ts +1 -1
- package/dist/secrets/secret-resolver.d.ts +19 -19
- package/dist/security/comment-handler.d.ts +1 -1
- package/dist/server.js +1770 -1196
- package/dist/stale-detector/stale-run-detector.d.ts +1 -1
- package/dist/standalone.js +1649 -747
- package/dist/storage/blob-routes.d.ts +16 -0
- package/dist/ws/{dashboard-env-handler.d.ts → dashboard-context-handler.d.ts} +15 -15
- package/dist/ws/oidc-token-relay.d.ts +6 -0
- package/installer-image-digests.json +3 -3
- package/package.json +4 -4
- package/sbom.spdx.json +50 -50
- package/dist/cli/commands/environment.d.ts +0 -25
- package/dist/environments/binding-store.d.ts +0 -36
- package/dist/environments/environment-store.d.ts +0 -87
- package/dist/environments/protection/aggregate.d.ts +0 -43
- package/dist/environments/protection/branch-gate.d.ts +0 -5
- package/dist/environments/protection/concurrency-gate.d.ts +0 -7
- package/dist/environments/protection/reviewer-gate.d.ts +0 -7
- package/dist/environments/protection/trust-gate.d.ts +0 -7
- package/dist/environments/protection/wait-timer-gate.d.ts +0 -7
- package/dist/environments/variable-store.d.ts +0 -39
- 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
|