@kici-dev/engine 0.7.0 → 0.9.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/context/hold-reason.d.ts +6 -11
- package/dist/context/hold-reason.js +1 -8
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +3 -3
- package/dist/context/types.d.ts +12 -10
- package/dist/context/types.js +12 -14
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7 -6
- package/dist/metrics/catalog-policy.js +2 -2
- package/dist/protocol/dashboard-write-operations.d.ts +8 -18
- package/dist/protocol/dashboard-write-operations.js +5 -26
- package/dist/protocol/messages/agent-run-result.d.ts +0 -1
- package/dist/protocol/messages/auth.d.ts +3 -3
- package/dist/protocol/messages/capabilities.d.ts +3 -5
- package/dist/protocol/messages/capabilities.js +4 -10
- package/dist/protocol/messages/dashboard-global-workflows.d.ts +10 -24
- package/dist/protocol/messages/dashboard-global-workflows.js +9 -15
- package/dist/protocol/messages/dashboard.d.ts +4 -23
- package/dist/protocol/messages/dashboard.js +4 -22
- package/dist/protocol/messages/oidc-token-relay.d.ts +2 -13
- package/dist/protocol/messages/oidc-token-relay.js +3 -10
- package/dist/protocol/messages/orchestrator-agent.d.ts +24 -9
- package/dist/protocol/messages/orchestrator-agent.js +24 -28
- package/dist/protocol/messages/peer.d.ts +26 -31
- package/dist/protocol/messages/peer.js +18 -38
- package/dist/protocol/messages/platform-orchestrator.d.ts +17 -79
- package/dist/protocol/messages/platform-orchestrator.js +6 -24
- package/dist/protocol/version.d.ts +10 -18
- package/dist/protocol/version.js +11 -19
- package/dist/provenance/id-token-claim-names.d.ts +13 -0
- package/dist/provenance/id-token-claim-names.js +44 -0
- package/dist/provenance/id-token-event-claims.d.ts +1 -8
- package/dist/provenance/id-token-event-claims.js +2 -7
- package/dist/provider/index.d.ts +1 -2
- package/dist/provider/index.test-d.d.ts +2 -0
- package/dist/provider/index.test-d.js +31 -0
- package/dist/provider/lock-file-fetcher.d.ts +8 -0
- package/dist/provider/webhook-normalizer.d.ts +0 -42
- package/dist/trigger/types.d.ts +8 -38
- package/dist/trigger/types.js +2 -12
- package/dist/trigger/types.test-d.d.ts +2 -0
- package/dist/trigger/types.test-d.js +63 -0
- package/package.json +7 -11
- package/sbom.spdx.json +20 -20
- package/dist/protocol/messages/oidc-mint.d.ts +0 -58
- package/dist/protocol/messages/oidc-mint.js +0 -62
- package/dist/provider/contributor-resolver.d.ts +0 -30
- package/dist/provider/contributor-resolver.js +0 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every claim a KiCI provenance ID token carries, in a stable order.
|
|
3
|
+
*
|
|
4
|
+
* Both OIDC discovery documents render `claims_supported` from this list — the
|
|
5
|
+
* orchestrator issuer that mints tokens today and the legacy Platform issuer
|
|
6
|
+
* whose already-issued tokens carried the same shape — so a relying party
|
|
7
|
+
* configuring a trust policy reads the same names under either `iss`. The
|
|
8
|
+
* orchestrator binds the list to its `IdTokenClaims` type at compile time and
|
|
9
|
+
* a drift test checks it against the claims its builder actually emits.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ID_TOKEN_CLAIM_NAMES: readonly ['iss', 'sub', 'aud', 'iat', 'nbf', 'exp', 'jti', 'kici_run_id', 'kici_job_id', 'repository', 'ref', 'base_ref', 'head_ref', 'head_repository', 'is_fork', 'event_name', 'trust_tier', 'actor', 'sha', 'workflow_ref', 'orchestrator_id', 'org_id', 'source_origin', 'provider', 'statement_hash', 'attestation_origin'];
|
|
12
|
+
export type IdTokenClaimName = (typeof ID_TOKEN_CLAIM_NAMES)[number];
|
|
13
|
+
//# sourceMappingURL=id-token-claim-names.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/provenance/id-token-claim-names.ts
|
|
3
|
+
/**
|
|
4
|
+
* Every claim a KiCI provenance ID token carries, in a stable order.
|
|
5
|
+
*
|
|
6
|
+
* Both OIDC discovery documents render `claims_supported` from this list — the
|
|
7
|
+
* orchestrator issuer that mints tokens today and the legacy Platform issuer
|
|
8
|
+
* whose already-issued tokens carried the same shape — so a relying party
|
|
9
|
+
* configuring a trust policy reads the same names under either `iss`. The
|
|
10
|
+
* orchestrator binds the list to its `IdTokenClaims` type at compile time and
|
|
11
|
+
* a drift test checks it against the claims its builder actually emits.
|
|
12
|
+
*/
|
|
13
|
+
const ID_TOKEN_CLAIM_NAMES = [
|
|
14
|
+
"iss",
|
|
15
|
+
"sub",
|
|
16
|
+
"aud",
|
|
17
|
+
"iat",
|
|
18
|
+
"nbf",
|
|
19
|
+
"exp",
|
|
20
|
+
"jti",
|
|
21
|
+
"kici_run_id",
|
|
22
|
+
"kici_job_id",
|
|
23
|
+
"repository",
|
|
24
|
+
"ref",
|
|
25
|
+
"base_ref",
|
|
26
|
+
"head_ref",
|
|
27
|
+
"head_repository",
|
|
28
|
+
"is_fork",
|
|
29
|
+
"event_name",
|
|
30
|
+
"trust_tier",
|
|
31
|
+
"actor",
|
|
32
|
+
"sha",
|
|
33
|
+
"workflow_ref",
|
|
34
|
+
"orchestrator_id",
|
|
35
|
+
"org_id",
|
|
36
|
+
"source_origin",
|
|
37
|
+
"provider",
|
|
38
|
+
"statement_hash",
|
|
39
|
+
"attestation_origin"
|
|
40
|
+
];
|
|
41
|
+
//#endregion
|
|
42
|
+
export { ID_TOKEN_CLAIM_NAMES };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=id-token-claim-names.js.map
|
|
@@ -104,15 +104,8 @@ export declare function buildEventClaims(run: EventClaimSource): EventClaims;
|
|
|
104
104
|
* `trigger_event` itself is left alone because two other readers depend on it:
|
|
105
105
|
* the dashboard's trigger-type filter and the git credential relay's
|
|
106
106
|
* `triggerTypeFilters`, both of which must keep seeing `'rerun'`.
|
|
107
|
-
*
|
|
108
|
-
* `legacyPullRequestSubject` restores the old, colliding form for one release —
|
|
109
|
-
* see `KICI_OIDC_LEGACY_PR_SUB`. It is deprecated on arrival.
|
|
110
|
-
*
|
|
111
|
-
* @deprecated `legacyPullRequestSubject` is removed at v1.0.0.
|
|
112
107
|
*/
|
|
113
|
-
export declare function buildIdTokenSubject(run: Pick<EventClaimSource, 'repo_identifier' | 'ref' | 'workflow_name' | 'trigger_event' | 'subject_trigger_event'
|
|
114
|
-
legacyPullRequestSubject?: boolean;
|
|
115
|
-
}): string;
|
|
108
|
+
export declare function buildIdTokenSubject(run: Pick<EventClaimSource, 'repo_identifier' | 'ref' | 'workflow_name' | 'trigger_event' | 'subject_trigger_event'>): string;
|
|
116
109
|
/**
|
|
117
110
|
* The orchestrator's own view of a build, sent with the job so the agent can
|
|
118
111
|
* freeze a provenance statement that matches what a live mint would say.
|
|
@@ -57,16 +57,11 @@ function buildEventClaims(run) {
|
|
|
57
57
|
* `trigger_event` itself is left alone because two other readers depend on it:
|
|
58
58
|
* the dashboard's trigger-type filter and the git credential relay's
|
|
59
59
|
* `triggerTypeFilters`, both of which must keep seeing `'rerun'`.
|
|
60
|
-
*
|
|
61
|
-
* `legacyPullRequestSubject` restores the old, colliding form for one release —
|
|
62
|
-
* see `KICI_OIDC_LEGACY_PR_SUB`. It is deprecated on arrival.
|
|
63
|
-
*
|
|
64
|
-
* @deprecated `legacyPullRequestSubject` is removed at v1.0.0.
|
|
65
60
|
*/
|
|
66
|
-
function buildIdTokenSubject(run
|
|
61
|
+
function buildIdTokenSubject(run) {
|
|
67
62
|
const repository = run.repo_identifier ?? "unknown";
|
|
68
63
|
const subjectEvent = run.subject_trigger_event ?? run.trigger_event;
|
|
69
|
-
if (
|
|
64
|
+
if (isPullRequestFamilyTriggerEvent(subjectEvent)) return `repo:${repository}:pull_request`;
|
|
70
65
|
return `repo:${repository}:ref:${run.ref ?? "unknown"}:workflow:${run.workflow_name ?? "unknown"}`;
|
|
71
66
|
}
|
|
72
67
|
/**
|
package/dist/provider/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* - RepoUrlBuilder: Provider-specific URL construction
|
|
14
14
|
*/
|
|
15
15
|
export type { ProviderType } from './types.js';
|
|
16
|
-
export type { WebhookNormalizer
|
|
16
|
+
export type { WebhookNormalizer } from './webhook-normalizer.js';
|
|
17
17
|
export type { LockFileFetcher } from './lock-file-fetcher.js';
|
|
18
18
|
export { LockFileParseError } from './lock-file-parse-error.js';
|
|
19
19
|
export type { ChangedFilesFetcher, ChangedFilesResult } from './changed-files-fetcher.js';
|
|
@@ -22,7 +22,6 @@ export type { CloneTokenProvider, ProviderGitAuth } from './clone-token-provider
|
|
|
22
22
|
export type { ForgeName, Sourced, GitCredentialRef, GitCredentialGrant, GitCredentialRequest, GitCredentialResult, } from './git-credential.js';
|
|
23
23
|
export { isMintedRef } from './git-credential.js';
|
|
24
24
|
export type { RepoUrlBuilder } from './repo-url-builder.js';
|
|
25
|
-
export type { ContributorResolver, ContributorInfo, ContributorPermission, } from './contributor-resolver.js';
|
|
26
25
|
export type { CheckStatusPoster, CheckStatus, WorkflowModificationInfo, } from './check-status-poster.js';
|
|
27
26
|
export * from './check-run-conclusion.js';
|
|
28
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { describe, expectTypeOf, it } from "vitest";
|
|
3
|
+
//#region src/provider/index.test-d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The contributor-resolution surface is gone from the provider abstraction.
|
|
6
|
+
* `ContributorResolver` and its companions were type-only, so no runtime probe
|
|
7
|
+
* can see them return; only the compiler can.
|
|
8
|
+
*/
|
|
9
|
+
describe("provider barrel", () => {
|
|
10
|
+
it("exports no ContributorResolver", () => {
|
|
11
|
+
expectTypeOf().toBeObject();
|
|
12
|
+
});
|
|
13
|
+
it("exports none of the contributor-resolution companions from the root", () => {
|
|
14
|
+
expectTypeOf().toBeObject();
|
|
15
|
+
expectTypeOf().toBeString();
|
|
16
|
+
expectTypeOf().toBeObject();
|
|
17
|
+
});
|
|
18
|
+
it("gives WebhookNormalizer no access-cache invalidation hook", () => {
|
|
19
|
+
expectTypeOf().not.toHaveProperty("getAccessCacheInvalidations");
|
|
20
|
+
});
|
|
21
|
+
it("keeps the live normalizer contract", () => {
|
|
22
|
+
expectTypeOf().toHaveProperty("provider");
|
|
23
|
+
expectTypeOf().toHaveProperty("normalizeEvent");
|
|
24
|
+
expectTypeOf().toHaveProperty("verifySignature");
|
|
25
|
+
expectTypeOf().toEqualTypeOf();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export {};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.test-d.js.map
|
|
@@ -8,6 +8,14 @@ import type { LockFile } from '../trigger/types.js';
|
|
|
8
8
|
import type { ProviderType } from './types.js';
|
|
9
9
|
export interface LockFileFetcher {
|
|
10
10
|
readonly provider: ProviderType;
|
|
11
|
+
/**
|
|
12
|
+
* Whether a fetched lock file may be cached under `{repoIdentifier}:{ref}`.
|
|
13
|
+
* Omitted means yes. A fetcher whose backing store can change under a fixed
|
|
14
|
+
* ref — a local working tree read straight from disk, where `ref` carries no
|
|
15
|
+
* information about the file's content — sets this to `false`, so every
|
|
16
|
+
* lookup reads the current file instead of the first one cached.
|
|
17
|
+
*/
|
|
18
|
+
readonly cacheable?: boolean;
|
|
11
19
|
/**
|
|
12
20
|
* Fetch the lock file content for a repo at a specific ref.
|
|
13
21
|
*
|
|
@@ -7,35 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { SimulatedEvent } from '../trigger/types.js';
|
|
9
9
|
import type { ProviderType } from './types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Discriminated union describing which cached provider-permission entries a
|
|
12
|
-
* webhook event invalidates. Returned by
|
|
13
|
-
* `WebhookNormalizer.getAccessCacheInvalidations`.
|
|
14
|
-
*
|
|
15
|
-
* @deprecated Trust is derived from the git ref, so the orchestrator holds no
|
|
16
|
-
* contributor-permission cache and nothing consumes these entries. Removed at
|
|
17
|
-
* v1.0.0.
|
|
18
|
-
*
|
|
19
|
-
* Three scopes:
|
|
20
|
-
* - `repo-user`: a single `{repo, user}` permission changed (e.g. GitHub
|
|
21
|
-
* `member` event on a specific collaborator).
|
|
22
|
-
* - `repo`: every contributor's effective permission on a repo may have
|
|
23
|
-
* shifted (e.g. a team was added/removed from the repo).
|
|
24
|
-
* - `user-in-org`: a user's org membership changed, so any repo under that
|
|
25
|
-
* org may now return a different permission for them.
|
|
26
|
-
*/
|
|
27
|
-
export type AccessCacheInvalidation = {
|
|
28
|
-
kind: 'repo-user';
|
|
29
|
-
repoFullName: string;
|
|
30
|
-
username: string;
|
|
31
|
-
} | {
|
|
32
|
-
kind: 'repo';
|
|
33
|
-
repoFullName: string;
|
|
34
|
-
} | {
|
|
35
|
-
kind: 'user-in-org';
|
|
36
|
-
orgLogin: string;
|
|
37
|
-
username: string;
|
|
38
|
-
};
|
|
39
10
|
export interface WebhookNormalizer {
|
|
40
11
|
readonly provider: ProviderType;
|
|
41
12
|
/**
|
|
@@ -146,18 +117,5 @@ export interface WebhookNormalizer {
|
|
|
146
117
|
* Returns null when the field is missing or cannot be resolved.
|
|
147
118
|
*/
|
|
148
119
|
extractDefaultBranch?(payload: unknown): string | null;
|
|
149
|
-
/**
|
|
150
|
-
* Map a webhook event to the cached provider-permission entries it implies a
|
|
151
|
-
* shift in. Events that do not imply a permission shift (most events,
|
|
152
|
-
* including `push` / `pull_request` / etc.) return `[]`.
|
|
153
|
-
*
|
|
154
|
-
* @deprecated Trust is derived from the git ref, so the orchestrator holds no
|
|
155
|
-
* contributor-permission cache and never calls this. Removed at v1.0.0.
|
|
156
|
-
*
|
|
157
|
-
* @param eventType Provider-specific event type (from extractEventType).
|
|
158
|
-
* @param action Event action/sub-type, if applicable.
|
|
159
|
-
* @param payload Raw webhook payload.
|
|
160
|
-
*/
|
|
161
|
-
getAccessCacheInvalidations?(eventType: string, action: string | null, payload: unknown): AccessCacheInvalidation[];
|
|
162
120
|
}
|
|
163
121
|
//# sourceMappingURL=webhook-normalizer.d.ts.map
|
package/dist/trigger/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Schema version 8 (additive): adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
|
|
14
14
|
* Schema version 9 (additive): adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
|
|
15
15
|
* Schema version 10 (BREAKING): removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
|
|
16
|
-
* Schema version 11 (additive):
|
|
16
|
+
* Schema version 11 (additive): added an inline-expression value shape for dynamic fields, which is no longer parsed.
|
|
17
17
|
* Schema version 14 (additive): adds declarative cache specs to LockJob and LockStep.
|
|
18
18
|
* Schema version 15 (additive): adds per-job init config(s) to LockJob.
|
|
19
19
|
* Schema version 16 (additive): adds normalized approval config to LockWorkflow/LockJob/LockStep.
|
|
@@ -565,29 +565,6 @@ export interface LockParallelStep {
|
|
|
565
565
|
export type LockStepEntry = LockStep | LockParallelStep;
|
|
566
566
|
/** Type guard distinguishing a parallel group from an ordinary lock step. */
|
|
567
567
|
export declare function isLockParallelStep(entry: LockStepEntry): entry is LockParallelStep;
|
|
568
|
-
/**
|
|
569
|
-
* Serialized inline expression for a dynamic env/context/concurrencyGroup
|
|
570
|
-
* field, shaped as `{ _type: 'inline', expression: '(event) => ...' }`
|
|
571
|
-
* alongside the existing 'static' and 'dynamic' discriminants.
|
|
572
|
-
*
|
|
573
|
-
* @deprecated Schema v11 inline expressions are no longer evaluated in the
|
|
574
|
-
* orchestrator. Dynamic env/context/concurrencyGroup fields are resolved on the
|
|
575
|
-
* eval agent's init-runner. The compiler no longer emits this type; readers keep
|
|
576
|
-
* recognizing it only to defer an old lock's field to the init round. Removed at
|
|
577
|
-
* the next major (v1.0.0).
|
|
578
|
-
*/
|
|
579
|
-
export interface LockInlineValue {
|
|
580
|
-
readonly _type: 'inline';
|
|
581
|
-
readonly expression: string;
|
|
582
|
-
}
|
|
583
|
-
/**
|
|
584
|
-
* Type guard for inline expression values.
|
|
585
|
-
*
|
|
586
|
-
* @deprecated See {@link LockInlineValue}. Retained only so a reader can
|
|
587
|
-
* recognize an old lock's inline field and defer it to the eval agent's
|
|
588
|
-
* init-runner. Removed at the next major (v1.0.0).
|
|
589
|
-
*/
|
|
590
|
-
export declare function isLockInlineValue(value: unknown): value is LockInlineValue;
|
|
591
568
|
/**
|
|
592
569
|
* Author-facing keyword sugar for a `needs` edge's run condition. Each keyword
|
|
593
570
|
* resolves (at compile time) to a set of upstream terminal statuses; the
|
|
@@ -832,25 +809,18 @@ export interface LockJob {
|
|
|
832
809
|
/**
|
|
833
810
|
* Bound contexts in merge order. Each entry is a static name; `dynamic` is set
|
|
834
811
|
* when it is a function resolved on the eval agent's init-runner. Later entries
|
|
835
|
-
* override earlier ones on name collisions.
|
|
836
|
-
* deprecated form still accepted from old locks (see {@link LockInlineValue}).
|
|
812
|
+
* override earlier ones on name collisions.
|
|
837
813
|
*/
|
|
838
814
|
readonly contexts?: ReadonlyArray<{
|
|
839
|
-
value: string
|
|
815
|
+
value: string;
|
|
840
816
|
dynamic: boolean;
|
|
841
817
|
}>;
|
|
842
|
-
/**
|
|
843
|
-
|
|
844
|
-
* accepted from old locks (see {@link LockInlineValue}).
|
|
845
|
-
*/
|
|
846
|
-
readonly env?: Record<string, string> | LockInlineValue;
|
|
818
|
+
/** Static environment variables. */
|
|
819
|
+
readonly env?: Record<string, string>;
|
|
847
820
|
/** When true, env is dynamic (function) -- resolved on the eval agent's init-runner. */
|
|
848
821
|
readonly dynamicEnv?: boolean;
|
|
849
|
-
/**
|
|
850
|
-
|
|
851
|
-
* is still accepted from old locks (see {@link LockInlineValue}).
|
|
852
|
-
*/
|
|
853
|
-
readonly concurrencyGroup?: string | LockInlineValue;
|
|
822
|
+
/** Concurrency group name (static string). */
|
|
823
|
+
readonly concurrencyGroup?: string;
|
|
854
824
|
/** When true, concurrencyGroup is dynamic (function) -- resolved on the eval agent's init-runner. */
|
|
855
825
|
readonly dynamicConcurrencyGroup?: boolean;
|
|
856
826
|
/** Total job wall-clock timeout in milliseconds (init + all steps + hooks). Threaded to the agent via jobConfig. */
|
|
@@ -1039,7 +1009,7 @@ export interface LockWorkflow {
|
|
|
1039
1009
|
* v8 adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
|
|
1040
1010
|
* v9 adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
|
|
1041
1011
|
* v10 removes notRepos/notPaths fields; negative patterns use ! prefix in repos/paths arrays.
|
|
1042
|
-
* v11
|
|
1012
|
+
* v11 added an inline-expression value shape for dynamic fields, which is no longer parsed.
|
|
1043
1013
|
* v12 adds workflow-level registries and installEnv for private npm registry auth.
|
|
1044
1014
|
* v13 adds job-level and workflow-level timeout.
|
|
1045
1015
|
* v40 adds siblingsDigest — the in-repo `workspace:` sibling closure the deps
|
package/dist/trigger/types.js
CHANGED
|
@@ -18,7 +18,7 @@ import { z } from "zod";
|
|
|
18
18
|
* Schema version 8 (additive): adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
|
|
19
19
|
* Schema version 9 (additive): adds repos/notRepos repo pattern fields to git-event triggers for global workflow matching.
|
|
20
20
|
* Schema version 10 (BREAKING): removes notRepos/notPaths fields, negative patterns use ! prefix in repos/paths arrays.
|
|
21
|
-
* Schema version 11 (additive):
|
|
21
|
+
* Schema version 11 (additive): added an inline-expression value shape for dynamic fields, which is no longer parsed.
|
|
22
22
|
* Schema version 14 (additive): adds declarative cache specs to LockJob and LockStep.
|
|
23
23
|
* Schema version 15 (additive): adds per-job init config(s) to LockJob.
|
|
24
24
|
* Schema version 16 (additive): adds normalized approval config to LockWorkflow/LockJob/LockStep.
|
|
@@ -92,16 +92,6 @@ function isLockParallelStep(entry) {
|
|
|
92
92
|
return entry.kind === "parallel";
|
|
93
93
|
}
|
|
94
94
|
/**
|
|
95
|
-
* Type guard for inline expression values.
|
|
96
|
-
*
|
|
97
|
-
* @deprecated See {@link LockInlineValue}. Retained only so a reader can
|
|
98
|
-
* recognize an old lock's inline field and defer it to the eval agent's
|
|
99
|
-
* init-runner. Removed at the next major (v1.0.0).
|
|
100
|
-
*/
|
|
101
|
-
function isLockInlineValue(value) {
|
|
102
|
-
return typeof value === "object" && value !== null && value._type === "inline";
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
95
|
* Author-facing keyword sugar for a `needs` edge's run condition. Each keyword
|
|
106
96
|
* resolves (at compile time) to a set of upstream terminal statuses; the
|
|
107
97
|
* downstream edge is dispatch-satisfied when the upstream's terminal status is
|
|
@@ -214,6 +204,6 @@ const changedFilesStatusSchema = z.enum([
|
|
|
214
204
|
"skipped"
|
|
215
205
|
]);
|
|
216
206
|
//#endregion
|
|
217
|
-
export { BREAKING_FLOOR, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SANDBOX_NETWORK_MODES, SCHEMA_VERSION, changedFilesStatusSchema, isLockDynamicJobFn,
|
|
207
|
+
export { BREAKING_FLOOR, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SANDBOX_NETWORK_MODES, SCHEMA_VERSION, changedFilesStatusSchema, isLockDynamicJobFn, isLockParallelStep, isLockStaticJob, resolveContentFormat, resolveWhenToRunOn };
|
|
218
208
|
|
|
219
209
|
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { describe, expectTypeOf, it } from "vitest";
|
|
3
|
+
//#region src/trigger/types.test-d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The lock-file dynamic fields no longer admit the schema-v11 inline
|
|
6
|
+
* expression `{ _type: 'inline', expression }`. That object is itself a
|
|
7
|
+
* `Record<string, string>`, so the `env` axis is pinned by type identity rather
|
|
8
|
+
* than by an assignment the compiler would accept either way; the two string
|
|
9
|
+
* fields refuse the object outright.
|
|
10
|
+
*/
|
|
11
|
+
describe("LockJob dynamic fields", () => {
|
|
12
|
+
it("refuses an inline expression as the concurrency group", () => {
|
|
13
|
+
expectTypeOf({
|
|
14
|
+
_type: "static",
|
|
15
|
+
name: "build",
|
|
16
|
+
steps: [],
|
|
17
|
+
needs: [],
|
|
18
|
+
concurrencyGroup: {
|
|
19
|
+
_type: "inline",
|
|
20
|
+
expression: "() => \"deploy\""
|
|
21
|
+
}
|
|
22
|
+
}).toBeObject();
|
|
23
|
+
});
|
|
24
|
+
it("refuses an inline expression as a context name", () => {
|
|
25
|
+
expectTypeOf({
|
|
26
|
+
_type: "static",
|
|
27
|
+
name: "build",
|
|
28
|
+
steps: [],
|
|
29
|
+
needs: [],
|
|
30
|
+
contexts: [{
|
|
31
|
+
value: {
|
|
32
|
+
_type: "inline",
|
|
33
|
+
expression: "() => \"prod\""
|
|
34
|
+
},
|
|
35
|
+
dynamic: false
|
|
36
|
+
}]
|
|
37
|
+
}).toBeObject();
|
|
38
|
+
});
|
|
39
|
+
it("types env as exactly a plain record", () => {
|
|
40
|
+
expectTypeOf().toEqualTypeOf();
|
|
41
|
+
});
|
|
42
|
+
it("accepts the static shapes", () => {
|
|
43
|
+
const job = {
|
|
44
|
+
_type: "static",
|
|
45
|
+
name: "build",
|
|
46
|
+
steps: [],
|
|
47
|
+
needs: [],
|
|
48
|
+
env: { NODE_ENV: "test" },
|
|
49
|
+
dynamicEnv: true,
|
|
50
|
+
concurrencyGroup: "deploy",
|
|
51
|
+
contexts: [{
|
|
52
|
+
value: "production",
|
|
53
|
+
dynamic: false
|
|
54
|
+
}]
|
|
55
|
+
};
|
|
56
|
+
expectTypeOf(job.env).toEqualTypeOf();
|
|
57
|
+
expectTypeOf(job.concurrencyGroup).toEqualTypeOf();
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
export {};
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=types.test-d.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -105,10 +105,6 @@
|
|
|
105
105
|
"import": "./dist/protocol/messages/dashboard-sealed-write.js",
|
|
106
106
|
"types": "./dist/protocol/messages/dashboard-sealed-write.d.ts"
|
|
107
107
|
},
|
|
108
|
-
"./protocol/messages/oidc-mint": {
|
|
109
|
-
"import": "./dist/protocol/messages/oidc-mint.js",
|
|
110
|
-
"types": "./dist/protocol/messages/oidc-mint.d.ts"
|
|
111
|
-
},
|
|
112
108
|
"./protocol/messages/git-credential-relay": {
|
|
113
109
|
"import": "./dist/protocol/messages/git-credential-relay.js",
|
|
114
110
|
"types": "./dist/protocol/messages/git-credential-relay.d.ts"
|
|
@@ -147,20 +143,20 @@
|
|
|
147
143
|
}
|
|
148
144
|
},
|
|
149
145
|
"dependencies": {
|
|
150
|
-
"jose": "^6.2.
|
|
146
|
+
"jose": "^6.2.12",
|
|
151
147
|
"jsonpath-plus": "^10.4.0",
|
|
152
148
|
"picomatch": "^4.0.7",
|
|
153
149
|
"safe-regex": "^2.1.1",
|
|
154
|
-
"yaml": "^2.9.
|
|
155
|
-
"zod": "^4.
|
|
150
|
+
"yaml": "^2.9.1",
|
|
151
|
+
"zod": "^4.6.5"
|
|
156
152
|
},
|
|
157
153
|
"devDependencies": {
|
|
158
|
-
"@types/node": "^24.
|
|
154
|
+
"@types/node": "^24.13.4",
|
|
159
155
|
"@types/safe-regex": "^1.1.6"
|
|
160
156
|
},
|
|
161
157
|
"scripts": {
|
|
162
|
-
"build": "node ../../scripts/build-ts.mjs &&
|
|
163
|
-
"typecheck": "
|
|
158
|
+
"build": "node ../../scripts/build-ts.mjs && tsc --emitDeclarationOnly",
|
|
159
|
+
"typecheck": "tsc --noEmit",
|
|
164
160
|
"test": "vitest run"
|
|
165
161
|
}
|
|
166
162
|
}
|
package/sbom.spdx.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "@kici-dev/engine@0.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.
|
|
5
|
+
"name": "@kici-dev/engine@0.9.0",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.9.0/f3f7d339-811b-47f4-b915-f74a4aa03eb0",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-09-
|
|
8
|
+
"created": "2026-09-21T08:49:21Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
{
|
|
55
55
|
"SPDXID": "SPDXRef-RootPackage",
|
|
56
56
|
"name": "@kici-dev/engine",
|
|
57
|
-
"versionInfo": "0.
|
|
57
|
+
"versionInfo": "0.9.0",
|
|
58
58
|
"downloadLocation": "NOASSERTION",
|
|
59
59
|
"filesAnalyzed": false,
|
|
60
60
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -65,17 +65,17 @@
|
|
|
65
65
|
{
|
|
66
66
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
67
67
|
"referenceType": "purl",
|
|
68
|
-
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.
|
|
68
|
+
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.9.0"
|
|
69
69
|
}
|
|
70
70
|
],
|
|
71
71
|
"description": "Shared business logic for the KiCI CI/CD stack: protocol, triggers, state machine, and provider interfaces used by the Platform relay, orchestrator, and compiler.",
|
|
72
72
|
"homepage": "https://kici.dev"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
"SPDXID": "SPDXRef-Package-jose-6.2.
|
|
75
|
+
"SPDXID": "SPDXRef-Package-jose-6.2.12",
|
|
76
76
|
"name": "jose",
|
|
77
|
-
"versionInfo": "6.2.
|
|
78
|
-
"downloadLocation": "https://registry.npmjs.org/jose/-/jose-6.2.
|
|
77
|
+
"versionInfo": "6.2.12",
|
|
78
|
+
"downloadLocation": "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz",
|
|
79
79
|
"filesAnalyzed": false,
|
|
80
80
|
"licenseConcluded": "NOASSERTION",
|
|
81
81
|
"licenseDeclared": "MIT",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
{
|
|
86
86
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
87
87
|
"referenceType": "purl",
|
|
88
|
-
"referenceLocator": "pkg:npm/jose@6.2.
|
|
88
|
+
"referenceLocator": "pkg:npm/jose@6.2.12"
|
|
89
89
|
}
|
|
90
90
|
],
|
|
91
91
|
"description": "JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes",
|
|
@@ -192,10 +192,10 @@
|
|
|
192
192
|
"homepage": "https://github.com/davisjam/safe-regex"
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
|
-
"SPDXID": "SPDXRef-Package-yaml-2.9.
|
|
195
|
+
"SPDXID": "SPDXRef-Package-yaml-2.9.1",
|
|
196
196
|
"name": "yaml",
|
|
197
|
-
"versionInfo": "2.9.
|
|
198
|
-
"downloadLocation": "https://registry.npmjs.org/yaml/-/yaml-2.9.
|
|
197
|
+
"versionInfo": "2.9.1",
|
|
198
|
+
"downloadLocation": "https://registry.npmjs.org/yaml/-/yaml-2.9.1.tgz",
|
|
199
199
|
"filesAnalyzed": false,
|
|
200
200
|
"licenseConcluded": "NOASSERTION",
|
|
201
201
|
"licenseDeclared": "ISC",
|
|
@@ -205,17 +205,17 @@
|
|
|
205
205
|
{
|
|
206
206
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
207
207
|
"referenceType": "purl",
|
|
208
|
-
"referenceLocator": "pkg:npm/yaml@2.9.
|
|
208
|
+
"referenceLocator": "pkg:npm/yaml@2.9.1"
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
211
|
"description": "JavaScript parser and stringifier for YAML",
|
|
212
212
|
"homepage": "https://eemeli.org/yaml/"
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
|
-
"SPDXID": "SPDXRef-Package-zod-4.
|
|
215
|
+
"SPDXID": "SPDXRef-Package-zod-4.6.5",
|
|
216
216
|
"name": "zod",
|
|
217
|
-
"versionInfo": "4.
|
|
218
|
-
"downloadLocation": "https://registry.npmjs.org/zod/-/zod-4.
|
|
217
|
+
"versionInfo": "4.6.5",
|
|
218
|
+
"downloadLocation": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz",
|
|
219
219
|
"filesAnalyzed": false,
|
|
220
220
|
"licenseConcluded": "NOASSERTION",
|
|
221
221
|
"licenseDeclared": "MIT",
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
{
|
|
226
226
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
227
227
|
"referenceType": "purl",
|
|
228
|
-
"referenceLocator": "pkg:npm/zod@4.
|
|
228
|
+
"referenceLocator": "pkg:npm/zod@4.6.5"
|
|
229
229
|
}
|
|
230
230
|
],
|
|
231
231
|
"description": "TypeScript-first schema declaration and validation library with static type inference",
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
},
|
|
251
251
|
{
|
|
252
252
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
253
|
-
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.
|
|
253
|
+
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.12",
|
|
254
254
|
"relationshipType": "DEPENDS_ON"
|
|
255
255
|
},
|
|
256
256
|
{
|
|
@@ -270,12 +270,12 @@
|
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
272
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
273
|
-
"relatedSpdxElement": "SPDXRef-Package-yaml-2.9.
|
|
273
|
+
"relatedSpdxElement": "SPDXRef-Package-yaml-2.9.1",
|
|
274
274
|
"relationshipType": "DEPENDS_ON"
|
|
275
275
|
},
|
|
276
276
|
{
|
|
277
277
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
278
|
-
"relatedSpdxElement": "SPDXRef-Package-zod-4.
|
|
278
|
+
"relatedSpdxElement": "SPDXRef-Package-zod-4.6.5",
|
|
279
279
|
"relationshipType": "DEPENDS_ON"
|
|
280
280
|
},
|
|
281
281
|
{
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated The `oidc.mint.*` RPC pair (Platform-rooted identity mint) is
|
|
4
|
-
* hard-deprecated in favor of orchestrator-owned signing. It is kept
|
|
5
|
-
* wire-compatible for the mixed-version rollout window and removed at v1.0; a
|
|
6
|
-
* fresh orchestrator with its own signer never sends it. See
|
|
7
|
-
* docs/user/deprecations.md.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Error discriminator for a failed provenance mint, carried on
|
|
11
|
-
* `oidc.mint.response.error.code`. Mirrors the three orchestrator-side error
|
|
12
|
-
* classes that consume it:
|
|
13
|
-
* rejected -> run/job missing or job terminal (MintRejectedError)
|
|
14
|
-
* unavailable -> the Platform signer/issuer is not configured (MintUnavailableError)
|
|
15
|
-
* failed -> any other Platform-side failure (MintRelayError)
|
|
16
|
-
*/
|
|
17
|
-
export declare const OidcMintErrorCode: z.ZodEnum<{
|
|
18
|
-
failed: "failed";
|
|
19
|
-
rejected: "rejected";
|
|
20
|
-
unavailable: "unavailable";
|
|
21
|
-
}>;
|
|
22
|
-
export type OidcMintErrorCode = z.infer<typeof OidcMintErrorCode>;
|
|
23
|
-
/** orchestrator -> Platform: request a short-lived OIDC ID token for a job. */
|
|
24
|
-
export declare const oidcMintRequestSchema: z.ZodObject<{
|
|
25
|
-
type: z.ZodLiteral<"oidc.mint.request">;
|
|
26
|
-
requestId: z.ZodString;
|
|
27
|
-
orchestratorId: z.ZodString;
|
|
28
|
-
runId: z.ZodString;
|
|
29
|
-
jobId: z.ZodString;
|
|
30
|
-
audience: z.ZodString;
|
|
31
|
-
deferred: z.ZodOptional<z.ZodLiteral<true>>;
|
|
32
|
-
statementHash: z.ZodOptional<z.ZodString>;
|
|
33
|
-
origin: z.ZodOptional<z.ZodEnum<{
|
|
34
|
-
deferred: "deferred";
|
|
35
|
-
"offline-backfill": "offline-backfill";
|
|
36
|
-
}>>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
export type OidcMintRequest = z.infer<typeof oidcMintRequestSchema>;
|
|
39
|
-
/** Platform -> orchestrator: the minted token or a typed error (exactly one). */
|
|
40
|
-
export declare const oidcMintResponseSchema: z.ZodObject<{
|
|
41
|
-
type: z.ZodLiteral<"oidc.mint.response">;
|
|
42
|
-
requestId: z.ZodString;
|
|
43
|
-
result: z.ZodOptional<z.ZodObject<{
|
|
44
|
-
token: z.ZodString;
|
|
45
|
-
expiresIn: z.ZodNumber;
|
|
46
|
-
jti: z.ZodString;
|
|
47
|
-
}, z.core.$strip>>;
|
|
48
|
-
error: z.ZodOptional<z.ZodObject<{
|
|
49
|
-
code: z.ZodEnum<{
|
|
50
|
-
failed: "failed";
|
|
51
|
-
rejected: "rejected";
|
|
52
|
-
unavailable: "unavailable";
|
|
53
|
-
}>;
|
|
54
|
-
message: z.ZodString;
|
|
55
|
-
}, z.core.$strip>>;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
|
-
export type OidcMintResponse = z.infer<typeof oidcMintResponseSchema>;
|
|
58
|
-
//# sourceMappingURL=oidc-mint.d.ts.map
|