@kici-dev/orchestrator 0.4.0 → 0.6.0
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/__test-helpers__/fake-scaler-state-store.d.ts +24 -0
- package/dist/__test-helpers__/mock-db-query.d.ts +130 -0
- package/dist/__test-helpers__/mock-db.d.ts +27 -0
- package/dist/agent/agent-version.d.ts +34 -0
- package/dist/agent/dispatcher.d.ts +151 -13
- package/dist/agent/host-roster.d.ts +37 -5
- package/dist/agent/registry.d.ts +2 -0
- package/dist/app.d.ts +56 -7
- package/dist/approvals/apply-decision.d.ts +67 -19
- package/dist/approvals/held-run-release-wiring.d.ts +45 -0
- package/dist/approvals/independent-wiring.d.ts +55 -0
- package/dist/approvals/resume-router.d.ts +9 -0
- package/dist/approvals/triggerer-subject.d.ts +37 -0
- package/dist/cache/dep-cache.d.ts +54 -10
- package/dist/cache/global-eval-round-cache.d.ts +95 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/pending-global-evals.d.ts +42 -0
- package/dist/cache/pending-inits.d.ts +10 -0
- package/dist/cli/api-client.d.ts +18 -0
- package/dist/cli/commands/cluster-settings.d.ts +52 -3
- package/dist/cli/commands/diagnose.d.ts +6 -0
- package/dist/cli/commands/held-run.d.ts +58 -0
- package/dist/cli/commands/runs.d.ts +1 -0
- package/dist/cli/commands/trust-policy.d.ts +117 -12
- package/dist/cli/kici-admin.d.ts +10 -0
- package/dist/cli.js +2770 -938
- package/dist/cluster/cluster-identity.d.ts +3 -3
- package/dist/cluster/cluster-settings-reader.d.ts +59 -1
- package/dist/cluster/coordinator.d.ts +44 -0
- package/dist/cluster/index.d.ts +4 -0
- package/dist/cluster/peer-handler.d.ts +19 -0
- package/dist/cluster/peer-registry.d.ts +17 -0
- package/dist/cluster/plan-headroom-store.d.ts +26 -0
- package/dist/cluster/worker-eviction.d.ts +69 -0
- package/dist/cold-store/load-event-log-range.d.ts +10 -3
- package/dist/cold-store/load-secret-audit-log-range.d.ts +4 -3
- package/dist/cold-store/tables/secret-audit-log.d.ts +4 -3
- package/dist/config.d.ts +48 -21
- package/dist/content-requirements-cache.d.ts +55 -0
- package/dist/contexts/held-runs.d.ts +123 -16
- package/dist/contexts/protection/aggregate.d.ts +3 -2
- package/dist/contexts/protection/branch-gate.d.ts +15 -0
- package/dist/contexts/protection/concurrency-gate.d.ts +8 -2
- package/dist/contexts/protection/pipeline.d.ts +18 -0
- package/dist/contexts/release-queued-holds.d.ts +35 -0
- package/dist/dashboard/attestation-filters.d.ts +8 -0
- package/dist/dashboard/handler.d.ts +6 -24
- package/dist/db/migrations/109_cluster_settings_cache_knobs.d.ts +4 -0
- package/dist/db/migrations/110_cluster_settings_global_eval_knobs.d.ts +4 -0
- package/dist/db/migrations/111_cluster_settings_global_eval_wait.d.ts +4 -0
- package/dist/db/migrations/112_execution_runs_workflow_repo.d.ts +4 -0
- package/dist/db/migrations/113_execution_runs_workflow_repo_index.d.ts +30 -0
- package/dist/db/migrations/114_ingest_queue_claim.d.ts +4 -0
- package/dist/db/migrations/115_global_workflows_cluster_switch.d.ts +9 -0
- package/dist/db/migrations/116_org_plan_headroom.d.ts +4 -0
- package/dist/db/migrations/117_invoke_gate_proxy_jobs.d.ts +4 -0
- package/dist/db/migrations/118_invoke_gate_scheduling.d.ts +4 -0
- package/dist/db/migrations/119_scaler_ha_ownership.d.ts +4 -0
- package/dist/db/migrations/120_cluster_settings_scaler_reaper.d.ts +4 -0
- package/dist/db/migrations/121_org_settings_allow_untrusted_dockerfile_builds.d.ts +19 -0
- package/dist/db/migrations/122_host_roster_scaler_managed.d.ts +25 -0
- package/dist/db/migrations/123_workflow_registrations_default_branch.d.ts +24 -0
- package/dist/db/migrations/124_cluster_settings_provision_backoff.d.ts +4 -0
- package/dist/db/migrations/125_org_trust_directory.d.ts +30 -0
- package/dist/db/migrations/126_held_runs_posted_pending_check.d.ts +28 -0
- package/dist/db/migrations/127_org_trust_policy_approval_expiry_seconds.d.ts +26 -0
- package/dist/db/migrations/128_execution_runs_global_eval_round.d.ts +23 -0
- package/dist/db/migrations/129_execution_runs_dispatch_routing_key.d.ts +24 -0
- package/dist/db/migrations/130_scaler_provision_outcomes.d.ts +32 -0
- package/dist/db/types.d.ts +428 -12
- package/dist/entry-helpers.d.ts +28 -0
- package/dist/events/event-emitter.d.ts +22 -0
- package/dist/events/event-router.d.ts +87 -1
- package/dist/events/types.d.ts +2 -23
- package/dist/git/credential-broker.d.ts +94 -0
- package/dist/git/inherited-secret.d.ts +24 -0
- package/dist/git/installation-token.d.ts +38 -0
- package/dist/git/job-context.d.ts +13 -0
- package/dist/index.js +324 -84
- package/dist/metrics/agent-metrics-aggregator.d.ts +4 -4
- package/dist/metrics/prometheus.d.ts +170 -3
- package/dist/oidc/oidc-mint-registration.d.ts +7 -3
- package/dist/orchestrator-core.d.ts +91 -24
- package/dist/pipeline/content-filter.d.ts +71 -0
- package/dist/pipeline/direct-ingress-deps.d.ts +100 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +521 -11
- package/dist/pipeline/global-eval-round.d.ts +307 -0
- package/dist/pipeline/internal-event-pipeline.d.ts +140 -0
- package/dist/pipeline/invoke-gate.d.ts +164 -0
- package/dist/pipeline/job-contexts.d.ts +16 -17
- package/dist/pipeline/needs-scheduler.d.ts +13 -0
- package/dist/pipeline/process-webhook.d.ts +126 -31
- package/dist/pipeline/processor.d.ts +282 -23
- package/dist/pipeline/rerun.d.ts +21 -0
- package/dist/pipeline/resume-workflow.d.ts +40 -7
- package/dist/pipeline/route-or-dispatch-jobs.d.ts +15 -0
- package/dist/pipeline/security-hold-check.d.ts +217 -0
- package/dist/pipeline/test-pipeline.d.ts +12 -0
- package/dist/pipeline/undispatched-hold-checks.d.ts +23 -0
- package/dist/pipeline/webhook-payload-store.d.ts +20 -0
- package/dist/policy/dashboard-write-policy-listener.d.ts +62 -0
- package/dist/policy/dashboard-write-policy.d.ts +14 -0
- package/dist/provenance/backfill-run.d.ts +10 -1
- package/dist/provider-registry.d.ts +47 -4
- package/dist/providers/github/check-status-poster.d.ts +33 -3
- package/dist/providers/github/commit-message.d.ts +20 -0
- package/dist/providers/github/file-contents.d.ts +40 -0
- package/dist/providers/github/index.d.ts +2 -2
- package/dist/providers/github/normalizer.d.ts +3 -2
- package/dist/providers/local/normalizer.d.ts +3 -5
- package/dist/providers/universal-git/config.d.ts +2 -0
- package/dist/providers/universal-git/index.d.ts +11 -2
- package/dist/providers/universal-git/normalizer.d.ts +10 -0
- package/dist/queue/cleanup.d.ts +7 -1
- package/dist/queue/job-queue.d.ts +112 -7
- package/dist/queue/terminalize-unroutable.d.ts +13 -0
- package/dist/registration/extractor.d.ts +3 -3
- package/dist/registration/registration-index.d.ts +7 -0
- package/dist/registration/registration-run-match.d.ts +47 -0
- package/dist/registration/registration-store.d.ts +22 -0
- package/dist/reporting/check-run-reporter.d.ts +146 -2
- package/dist/reporting/check-run-summary.d.ts +25 -1
- package/dist/reporting/execution-tracker.d.ts +324 -9
- package/dist/reporting/log-chunk-sink.d.ts +8 -5
- package/dist/reporting/run-aggregator.d.ts +4 -14
- package/dist/reporting/step-display-order.d.ts +43 -0
- package/dist/routes/admin-held-runs.d.ts +142 -0
- package/dist/routes/admin-org-settings.d.ts +5 -0
- package/dist/routes/admin-trust-policy.d.ts +34 -6
- package/dist/routes/admin.d.ts +15 -0
- package/dist/scaler/backend-factory.d.ts +55 -0
- package/dist/scaler/bare-metal-backend.d.ts +43 -5
- package/dist/scaler/claim-store.d.ts +119 -0
- package/dist/scaler/config.d.ts +4 -0
- package/dist/scaler/container-backend.d.ts +18 -4
- package/dist/scaler/container-routing.d.ts +23 -0
- package/dist/scaler/container-spawn.d.ts +28 -0
- package/dist/scaler/event-backend.d.ts +124 -0
- package/dist/scaler/event-provision-reaper.d.ts +350 -0
- package/dist/scaler/failure-tracker.d.ts +1 -1
- package/dist/scaler/firecracker-backend.d.ts +33 -6
- package/dist/scaler/index.d.ts +11 -1
- package/dist/scaler/label-matcher.d.ts +4 -3
- package/dist/scaler/manager.d.ts +905 -76
- package/dist/scaler/resolve-container-auth.d.ts +45 -0
- package/dist/scaler/scaler-events.d.ts +11 -0
- package/dist/scaler/scaler-state-store.d.ts +294 -10
- package/dist/scaler/types.d.ts +131 -13
- package/dist/scaler/warm-pool.d.ts +132 -29
- package/dist/security/comment-handler.d.ts +50 -11
- package/dist/security/global-workflow-policy.d.ts +52 -12
- package/dist/security/identity-link.d.ts +60 -0
- package/dist/security/lock-source.d.ts +11 -13
- package/dist/security/reduced-privilege-note.d.ts +59 -0
- package/dist/security/trust-directory-store.d.ts +233 -0
- package/dist/security/trust-policy-gate.d.ts +94 -59
- package/dist/security/trust-policy-store.d.ts +3 -0
- package/dist/security/trust-resolver.d.ts +14 -98
- package/dist/server.d.ts +11 -1
- package/dist/server.js +56329 -42234
- package/dist/stale-detector/gate-deadline-detector.d.ts +52 -0
- package/dist/stale-detector/stale-run-detector.d.ts +61 -3
- package/dist/standalone.js +37619 -23570
- package/dist/webhook/ingest-accept.d.ts +70 -0
- package/dist/webhook/ingest-overflow-buffer.d.ts +35 -4
- package/dist/webhook/ingest-overflow-replayer.d.ts +50 -6
- package/dist/worker/in-memory-job-queue.d.ts +1 -1
- package/dist/ws/agent-handler.d.ts +31 -4
- package/dist/ws/dashboard-context-handler.d.ts +28 -4
- package/dist/ws/dashboard-global-workflows-handler.d.ts +36 -9
- package/dist/ws/execution-status-frame.d.ts +32 -0
- package/dist/ws/failure-messages.d.ts +2 -0
- package/dist/ws/git-credential-relay.d.ts +39 -0
- package/dist/ws/oidc-token-relay.d.ts +6 -11
- package/dist/ws/platform-client.d.ts +68 -9
- package/dist/ws/test-relay-handlers.d.ts +35 -10
- package/installer-image-digests.json +3 -3
- package/package.json +24 -19
- package/sbom.spdx.json +868 -821
- package/dist/approvals/team-membership-lookup.d.ts +0 -13
- package/dist/pipeline/inline-eval.d.ts +0 -44
- package/dist/providers/github/contributor-resolver.d.ts +0 -30
- package/dist/security/contributor-cache.d.ts +0 -83
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read-only lookup over the team memberships pushed from the Platform via
|
|
3
|
-
* `trust_policy.update`. The orchestrator has no identity store, so this is the
|
|
4
|
-
* only source of "who is in team X" — the approval resolver uses it to satisfy
|
|
5
|
-
* `{team}` approver clauses.
|
|
6
|
-
*/
|
|
7
|
-
export interface TeamMembershipLookup {
|
|
8
|
-
/** Returns the set of member user ids for a team name (empty if unknown). */
|
|
9
|
-
getTeamMembers(name: string): Set<string>;
|
|
10
|
-
}
|
|
11
|
-
/** A lookup backed by no teams — the default before any push arrives. */
|
|
12
|
-
export declare const EMPTY_TEAM_MEMBERSHIP_LOOKUP: TeamMembershipLookup;
|
|
13
|
-
//# sourceMappingURL=team-membership-lookup.d.ts.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Inline expression evaluator for pure dynamic functions.
|
|
3
|
-
*
|
|
4
|
-
* Evaluates serialized arrow functions from the lockfile (LockInlineValue)
|
|
5
|
-
* in a sandboxed VM context at dispatch time, eliminating the init-job
|
|
6
|
-
* round-trip for pure functions.
|
|
7
|
-
*/
|
|
8
|
-
import type { LockJob } from '@kici-dev/engine';
|
|
9
|
-
/**
|
|
10
|
-
* Evaluate an inline expression that returns a string.
|
|
11
|
-
*
|
|
12
|
-
* @param expression - Serialized arrow function, e.g. '(event) => event.ref.split("/").pop()'
|
|
13
|
-
* @param event - Normalized event envelope (SimulatedEvent shape; raw provider payload at event.payload)
|
|
14
|
-
* @returns The string result
|
|
15
|
-
* @throws TypeError if result is not a string
|
|
16
|
-
* @throws Error on timeout or sandbox violation
|
|
17
|
-
*/
|
|
18
|
-
export declare function evaluateInlineString(expression: string, event: object): string;
|
|
19
|
-
/**
|
|
20
|
-
* Evaluate an inline expression that returns a Record<string, string>.
|
|
21
|
-
*
|
|
22
|
-
* @param expression - Serialized arrow function, e.g. '(event) => ({ NODE_ENV: event.env })'
|
|
23
|
-
* @param event - Normalized event envelope (SimulatedEvent shape; raw provider payload at event.payload)
|
|
24
|
-
* @returns The record result
|
|
25
|
-
* @throws TypeError if result is not a plain object
|
|
26
|
-
* @throws Error on timeout or sandbox violation
|
|
27
|
-
*/
|
|
28
|
-
export declare function evaluateInlineRecord(expression: string, event: object): Record<string, string>;
|
|
29
|
-
/**
|
|
30
|
-
* Evaluate a lock job's inline (pure-function) dynamic fields against the
|
|
31
|
-
* normalized event envelope (SimulatedEvent shape: { type, action,
|
|
32
|
-
* targetBranch, sourceBranch, payload, … }). The raw provider webhook body is
|
|
33
|
-
* nested at `event.payload` — the same shape rules and step contexts see.
|
|
34
|
-
*
|
|
35
|
-
* Throws a job-attributed Error when any expression throws; inline evaluation
|
|
36
|
-
* failures are immediate dispatch failures (no init-job fallback).
|
|
37
|
-
*/
|
|
38
|
-
export declare function evaluateInlineFields(lockJob: LockJob, event: object): {
|
|
39
|
-
/** Resolved name per `contexts` element, aligned by index; undefined for static or impure-dynamic elements. */
|
|
40
|
-
inlineContextNames: Array<string | undefined>;
|
|
41
|
-
inlineEnv: Record<string, string> | undefined;
|
|
42
|
-
inlineConcurrencyGroup: string | undefined;
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=inline-eval.d.ts.map
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub ContributorResolver implementation.
|
|
3
|
-
*
|
|
4
|
-
* Resolves contributor permissions by querying the GitHub API for
|
|
5
|
-
* collaborator permission levels on a repository.
|
|
6
|
-
*/
|
|
7
|
-
import type { ContributorResolver, ContributorInfo } from '@kici-dev/engine';
|
|
8
|
-
import { type GitHubAppConfig } from './auth.js';
|
|
9
|
-
/**
|
|
10
|
-
* GitHub-specific implementation of ContributorResolver.
|
|
11
|
-
*
|
|
12
|
-
* Uses the GitHub API to check a user's permission level on a repository.
|
|
13
|
-
* Handles 403 (insufficient app permissions) and 404 (not a collaborator)
|
|
14
|
-
* gracefully by returning 'none' permission.
|
|
15
|
-
*/
|
|
16
|
-
export declare class GitHubContributorResolver implements ContributorResolver {
|
|
17
|
-
private readonly config;
|
|
18
|
-
readonly provider: 'github';
|
|
19
|
-
constructor(config: GitHubAppConfig);
|
|
20
|
-
/**
|
|
21
|
-
* Resolve a contributor's permission level on a GitHub repository.
|
|
22
|
-
*
|
|
23
|
-
* @param repoIdentifier - "owner/repo" format
|
|
24
|
-
* @param username - GitHub username
|
|
25
|
-
* @param credentials - GitHubCredentials with installationId
|
|
26
|
-
* @returns ContributorInfo with mapped permission level
|
|
27
|
-
*/
|
|
28
|
-
resolveContributor(repoIdentifier: string, username: string, credentials: unknown): Promise<ContributorInfo>;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=contributor-resolver.d.ts.map
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LRU cache wrapper for ContributorResolver.
|
|
3
|
-
*
|
|
4
|
-
* Caches contributor permission lookups to prevent redundant API calls.
|
|
5
|
-
* Uses a 15-minute TTL and 10,000 max entries.
|
|
6
|
-
*/
|
|
7
|
-
import type { ContributorResolver, ContributorInfo } from '@kici-dev/engine';
|
|
8
|
-
import type { ClusterSettingsReader } from '../cluster/cluster-settings-reader.js';
|
|
9
|
-
/**
|
|
10
|
-
* Caches ContributorResolver results in an LRU cache.
|
|
11
|
-
*
|
|
12
|
-
* Cache key format: `{provider}:{repoFullName}:{username}`
|
|
13
|
-
* TTL: cluster-configurable (`cluster_settings.contributor_cache_ttl_ms`,
|
|
14
|
-
* default 15 minutes). The TTL is resolved at each `set()` and applied
|
|
15
|
-
* per-entry, so a live override affects newly-cached entries without a restart.
|
|
16
|
-
*/
|
|
17
|
-
export declare class ContributorCache {
|
|
18
|
-
private readonly cache;
|
|
19
|
-
private readonly clusterSettings?;
|
|
20
|
-
private readonly defaultTtlMs;
|
|
21
|
-
constructor(options?: {
|
|
22
|
-
ttlMs?: number;
|
|
23
|
-
maxEntries?: number;
|
|
24
|
-
clusterSettings?: ClusterSettingsReader;
|
|
25
|
-
});
|
|
26
|
-
/** Resolve the fleet-wide contributor-cache TTL (ms), falling back to the config default. */
|
|
27
|
-
private ttlMs;
|
|
28
|
-
/**
|
|
29
|
-
* Build the cache key from provider, repo, and username.
|
|
30
|
-
*/
|
|
31
|
-
private buildKey;
|
|
32
|
-
/**
|
|
33
|
-
* Resolve contributor info, using cache when available.
|
|
34
|
-
*
|
|
35
|
-
* @param provider - Provider identifier (e.g. 'github')
|
|
36
|
-
* @param repoFullName - Full repo identifier (e.g. 'owner/repo')
|
|
37
|
-
* @param username - Contributor username
|
|
38
|
-
* @param resolver - ContributorResolver to call on cache miss
|
|
39
|
-
* @param credentials - Provider credentials for API calls
|
|
40
|
-
* @returns Cached or freshly resolved ContributorInfo
|
|
41
|
-
*/
|
|
42
|
-
resolve(provider: string, repoFullName: string, username: string, resolver: ContributorResolver, credentials: unknown): Promise<ContributorInfo>;
|
|
43
|
-
/**
|
|
44
|
-
* Explicitly invalidate a cached entry.
|
|
45
|
-
*
|
|
46
|
-
* @returns 1 if an entry was present and deleted, 0 otherwise. Symmetric
|
|
47
|
-
* with the bulk invalidators so callers can accumulate a total.
|
|
48
|
-
*/
|
|
49
|
-
invalidate(provider: string, repoFullName: string, username: string): number;
|
|
50
|
-
/**
|
|
51
|
-
* Invalidate every cached entry for a specific repository.
|
|
52
|
-
*
|
|
53
|
-
* Scans the LRU (bounded to `maxEntries`) and deletes entries whose key
|
|
54
|
-
* prefix matches `{provider}:{repoFullName}:`. Used when a webhook event
|
|
55
|
-
* signals a repo-wide permission change (e.g. GitHub `team.added_to_repository`
|
|
56
|
-
* / `team.removed_from_repository`) where every contributor's effective
|
|
57
|
-
* permission on that repo may have shifted.
|
|
58
|
-
*
|
|
59
|
-
* @returns Number of entries deleted.
|
|
60
|
-
*/
|
|
61
|
-
invalidateByRepo(provider: string, repoFullName: string): number;
|
|
62
|
-
/**
|
|
63
|
-
* Invalidate every cached entry for a user across all repositories in an org.
|
|
64
|
-
*
|
|
65
|
-
* Scans the LRU and deletes entries whose key matches
|
|
66
|
-
* `{provider}:{orgLogin}/*:{username}`. Used when a webhook event signals
|
|
67
|
-
* that a user's membership in an org changed (e.g. GitHub `organization`,
|
|
68
|
-
* `membership` events), since any repo under that org could now return a
|
|
69
|
-
* different permission for the user.
|
|
70
|
-
*
|
|
71
|
-
* @returns Number of entries deleted.
|
|
72
|
-
*/
|
|
73
|
-
invalidateByUserInOrg(provider: string, orgLogin: string, username: string): number;
|
|
74
|
-
/**
|
|
75
|
-
* Clear all cached entries. Useful for testing.
|
|
76
|
-
*/
|
|
77
|
-
clear(): void;
|
|
78
|
-
/**
|
|
79
|
-
* Get the current number of cached entries.
|
|
80
|
-
*/
|
|
81
|
-
get size(): number;
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=contributor-cache.d.ts.map
|