@kici-dev/engine 0.6.0 → 0.7.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/audit/access-log-policy.js +1 -0
- package/dist/audit/retention-policy.js +2 -0
- package/dist/billing/subscription-status.d.ts +38 -0
- package/dist/billing/subscription-status.js +63 -0
- package/dist/context/host-match.d.ts +25 -2
- package/dist/context/host-match.js +29 -7
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -5
- package/dist/labels/compile.d.ts +3 -1
- package/dist/labels/compile.js +10 -5
- package/dist/labels-canonical.d.ts +36 -0
- package/dist/labels-canonical.js +21 -0
- package/dist/labels-match.d.ts +38 -7
- package/dist/labels-match.js +45 -9
- package/dist/metrics/catalog-policy.js +6 -1
- package/dist/metrics/metric-catalog.generated.d.ts +97 -2
- package/dist/metrics/metric-catalog.generated.js +116 -2
- package/dist/protocol/dashboard-write-operations.d.ts +17 -0
- package/dist/protocol/dashboard-write-operations.js +20 -3
- package/dist/protocol/messages/access-log.d.ts +5 -0
- package/dist/protocol/messages/access-log.js +1 -0
- package/dist/protocol/messages/config-paths.d.ts +20 -0
- package/dist/protocol/messages/config-paths.js +27 -0
- package/dist/protocol/messages/dashboard.d.ts +137 -0
- package/dist/protocol/messages/dashboard.js +80 -2
- package/dist/protocol/messages/event-log.d.ts +6 -0
- package/dist/protocol/messages/event-log.js +6 -0
- package/dist/protocol/messages/orchestrator-agent.d.ts +32 -0
- package/dist/protocol/messages/orchestrator-agent.js +52 -5
- package/dist/protocol/messages/peer.d.ts +3 -0
- package/dist/protocol/messages/peer.js +6 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +36 -0
- package/dist/protocol/messages/source-registration.d.ts +5 -0
- package/dist/protocol/messages/source-registration.js +8 -0
- package/dist/provenance/id-token-event-claims.d.ts +142 -0
- package/dist/provenance/id-token-event-claims.js +113 -0
- package/dist/provenance/statement-hash.d.ts +14 -5
- package/dist/provenance/statement-hash.js +14 -5
- package/dist/provenance/verify.d.ts +21 -0
- package/dist/provenance/verify.js +26 -16
- package/dist/regex-flags.d.ts +32 -0
- package/dist/regex-flags.js +43 -0
- package/dist/trigger/compiled-matchers.d.ts +9 -2
- package/dist/trigger/compiled-matchers.js +14 -5
- package/dist/trigger/decision-trace.d.ts +1 -1
- package/dist/trigger/decision-trace.js +1 -1
- package/dist/trigger/text-match.d.ts +8 -3
- package/dist/trigger/text-match.js +11 -5
- package/dist/trigger/trigger-event-type.d.ts +16 -0
- package/dist/trigger/trigger-event-type.js +25 -1
- package/dist/trigger/types.d.ts +55 -4
- package/dist/trigger/types.js +5 -1
- package/dist/ws/close-codes.d.ts +8 -0
- package/dist/ws/close-codes.js +9 -1
- package/package.json +1 -1
- package/sbom.spdx.json +5 -5
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one definition of which regex flags may survive into a compiled matcher.
|
|
3
|
+
*
|
|
4
|
+
* `g` and `y` make a `RegExp` stateful: the instance carries `lastIndex` across
|
|
5
|
+
* `.test()` calls, so a memoized one returns alternating verdicts for the same
|
|
6
|
+
* input, and a loop over a set of candidates resumes mid-string on the second
|
|
7
|
+
* element. Every matcher this repo compiles is either memoized
|
|
8
|
+
* (`trigger/compiled-matchers.ts`, `labels-match.ts`) or applied to a set
|
|
9
|
+
* (`matcherSatisfiedBy`), and none of them wants sticky or global semantics —
|
|
10
|
+
* they all ask a single yes/no question about one whole string.
|
|
11
|
+
*
|
|
12
|
+
* So the two stateful flags are dropped at every boundary: the SDK producers
|
|
13
|
+
* that read an author's `RegExp`, the compiler that serializes one into the
|
|
14
|
+
* lock file, and the two readers that compile one back. Stripping at the
|
|
15
|
+
* readers too is what makes a lock written by an older compiler safe, since the
|
|
16
|
+
* lock-file format is compat-protected and a `flags: 'g'` entry keeps arriving
|
|
17
|
+
* for the whole 0.x line.
|
|
18
|
+
*
|
|
19
|
+
* Pure string logic with no imports, so it is safe for the browser barrel.
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Drop `g` and `y` from a flag string. Every other ECMAScript flag —
|
|
23
|
+
* `d` (hasIndices), `i`, `m`, `s`, `u`, `v` — is meaningful to a single
|
|
24
|
+
* `.test()` and is preserved.
|
|
25
|
+
*/
|
|
26
|
+
export declare function stripStatefulRegexFlags(flags: string | undefined): string;
|
|
27
|
+
/**
|
|
28
|
+
* Same, but collapsing an empty result to `undefined` — the shape the SDK's
|
|
29
|
+
* pattern types and the lock file use for "no flags".
|
|
30
|
+
*/
|
|
31
|
+
export declare function normalizeRegexFlags(flags: string | undefined): string | undefined;
|
|
32
|
+
//# sourceMappingURL=regex-flags.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
//#region src/regex-flags.ts
|
|
3
|
+
/**
|
|
4
|
+
* The one definition of which regex flags may survive into a compiled matcher.
|
|
5
|
+
*
|
|
6
|
+
* `g` and `y` make a `RegExp` stateful: the instance carries `lastIndex` across
|
|
7
|
+
* `.test()` calls, so a memoized one returns alternating verdicts for the same
|
|
8
|
+
* input, and a loop over a set of candidates resumes mid-string on the second
|
|
9
|
+
* element. Every matcher this repo compiles is either memoized
|
|
10
|
+
* (`trigger/compiled-matchers.ts`, `labels-match.ts`) or applied to a set
|
|
11
|
+
* (`matcherSatisfiedBy`), and none of them wants sticky or global semantics —
|
|
12
|
+
* they all ask a single yes/no question about one whole string.
|
|
13
|
+
*
|
|
14
|
+
* So the two stateful flags are dropped at every boundary: the SDK producers
|
|
15
|
+
* that read an author's `RegExp`, the compiler that serializes one into the
|
|
16
|
+
* lock file, and the two readers that compile one back. Stripping at the
|
|
17
|
+
* readers too is what makes a lock written by an older compiler safe, since the
|
|
18
|
+
* lock-file format is compat-protected and a `flags: 'g'` entry keeps arriving
|
|
19
|
+
* for the whole 0.x line.
|
|
20
|
+
*
|
|
21
|
+
* Pure string logic with no imports, so it is safe for the browser barrel.
|
|
22
|
+
*/
|
|
23
|
+
/** Flags that make a `RegExp` carry `lastIndex` between calls. */
|
|
24
|
+
const STATEFUL_FLAGS = /[gy]/g;
|
|
25
|
+
/**
|
|
26
|
+
* Drop `g` and `y` from a flag string. Every other ECMAScript flag —
|
|
27
|
+
* `d` (hasIndices), `i`, `m`, `s`, `u`, `v` — is meaningful to a single
|
|
28
|
+
* `.test()` and is preserved.
|
|
29
|
+
*/
|
|
30
|
+
function stripStatefulRegexFlags(flags) {
|
|
31
|
+
return (flags ?? "").replace(STATEFUL_FLAGS, "");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Same, but collapsing an empty result to `undefined` — the shape the SDK's
|
|
35
|
+
* pattern types and the lock file use for "no flags".
|
|
36
|
+
*/
|
|
37
|
+
function normalizeRegexFlags(flags) {
|
|
38
|
+
return stripStatefulRegexFlags(flags) || void 0;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
export { normalizeRegexFlags, stripStatefulRegexFlags };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=regex-flags.js.map
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Return a memoized RegExp for the given pattern + flags. The key encodes the
|
|
3
3
|
* flags first with a space separator; regex flags are restricted to
|
|
4
|
-
* `[
|
|
5
|
-
* with a space.
|
|
4
|
+
* `[dimsuv]` once the stateful ones are stripped, so the separator can never
|
|
5
|
+
* collide with a pattern that starts with a space.
|
|
6
|
+
*
|
|
7
|
+
* `g` and `y` are dropped before compiling AND before building the memo key
|
|
8
|
+
* (`stripStatefulRegexFlags`): they make the instance carry `lastIndex` between
|
|
9
|
+
* calls, which turns a memoized `.test()` into alternating verdicts. Stripping
|
|
10
|
+
* here rather than only at the producers is what makes a lock file written by an
|
|
11
|
+
* older compiler safe — that format is compat-protected, so `flags: 'g'` entries
|
|
12
|
+
* keep arriving for the whole 0.x line.
|
|
6
13
|
*
|
|
7
14
|
* Every pattern reaching here is author-supplied (branch/tag/repo patterns and
|
|
8
15
|
* comment `bodyMatch`), so it is ReDoS-checked before compiling. The guard runs
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { stripStatefulRegexFlags } from "../regex-flags.js";
|
|
2
3
|
import { assertSafeRegex } from "../safe-regex.js";
|
|
3
4
|
import picomatch from "picomatch";
|
|
4
5
|
//#region src/trigger/compiled-matchers.ts
|
|
@@ -27,8 +28,15 @@ const repoGlobCache = /* @__PURE__ */ new Map();
|
|
|
27
28
|
/**
|
|
28
29
|
* Return a memoized RegExp for the given pattern + flags. The key encodes the
|
|
29
30
|
* flags first with a space separator; regex flags are restricted to
|
|
30
|
-
* `[
|
|
31
|
-
* with a space.
|
|
31
|
+
* `[dimsuv]` once the stateful ones are stripped, so the separator can never
|
|
32
|
+
* collide with a pattern that starts with a space.
|
|
33
|
+
*
|
|
34
|
+
* `g` and `y` are dropped before compiling AND before building the memo key
|
|
35
|
+
* (`stripStatefulRegexFlags`): they make the instance carry `lastIndex` between
|
|
36
|
+
* calls, which turns a memoized `.test()` into alternating verdicts. Stripping
|
|
37
|
+
* here rather than only at the producers is what makes a lock file written by an
|
|
38
|
+
* older compiler safe — that format is compat-protected, so `flags: 'g'` entries
|
|
39
|
+
* keep arriving for the whole 0.x line.
|
|
32
40
|
*
|
|
33
41
|
* Every pattern reaching here is author-supplied (branch/tag/repo patterns and
|
|
34
42
|
* comment `bodyMatch`), so it is ReDoS-checked before compiling. The guard runs
|
|
@@ -37,9 +45,10 @@ const repoGlobCache = /* @__PURE__ */ new Map();
|
|
|
37
45
|
* it is rejected on every attempt. `ctx` names the dialect in the thrown error.
|
|
38
46
|
*/
|
|
39
47
|
function getCompiledRegex(pattern, flags, ctx = "trigger pattern") {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
const safeFlags = stripStatefulRegexFlags(flags);
|
|
49
|
+
return boundedGet(regexCache, `${safeFlags} ${pattern}`, () => {
|
|
50
|
+
assertSafeRegex(pattern, safeFlags, ctx);
|
|
51
|
+
return new RegExp(pattern, safeFlags);
|
|
43
52
|
});
|
|
44
53
|
}
|
|
45
54
|
/**
|
|
@@ -108,7 +108,7 @@ export declare function createContentRequirementsTraceEntry(args: {
|
|
|
108
108
|
* Record the Tier-2 `filter` predicate's verdict for one workflow.
|
|
109
109
|
*
|
|
110
110
|
* Without this entry a `filter` exclusion is invisible: the predicate runs on an
|
|
111
|
-
* agent, returns `false`, and the workflow
|
|
111
|
+
* agent, returns `false`, and the workflow never appears — leaving its
|
|
112
112
|
* author nothing to inspect. The entry is the answer to "why did nothing run?".
|
|
113
113
|
*/
|
|
114
114
|
export declare function createGlobalFilterTraceEntry(args: {
|
|
@@ -91,7 +91,7 @@ function createContentRequirementsTraceEntry(args) {
|
|
|
91
91
|
* Record the Tier-2 `filter` predicate's verdict for one workflow.
|
|
92
92
|
*
|
|
93
93
|
* Without this entry a `filter` exclusion is invisible: the predicate runs on an
|
|
94
|
-
* agent, returns `false`, and the workflow
|
|
94
|
+
* agent, returns `false`, and the workflow never appears — leaving its
|
|
95
95
|
* author nothing to inspect. The entry is the answer to "why did nothing run?".
|
|
96
96
|
*/
|
|
97
97
|
function createGlobalFilterTraceEntry(args) {
|
|
@@ -10,9 +10,14 @@ export interface TextMatchResult {
|
|
|
10
10
|
* pattern. Returns `null` when the pattern is syntactically invalid or fails the
|
|
11
11
|
* `safe-regex` star-height heuristic — callers treat `null` as indeterminate.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* the
|
|
13
|
+
* The flag class names every ECMAScript flag. When it read `[gimsuy]`, a `d`-
|
|
14
|
+
* or `v`-flagged pattern failed to unwrap and the whole `/pattern/flags` string
|
|
15
|
+
* became the pattern — a regex matching literal slashes, which compiles green
|
|
16
|
+
* and never matches what the author wrote.
|
|
17
|
+
*
|
|
18
|
+
* `g` and `y` are then stripped: they make the instance carry `lastIndex`
|
|
19
|
+
* between `.test()` calls, which is meaningless for the single yes/no question
|
|
20
|
+
* this asks and actively wrong for any caller that reuses the instance.
|
|
16
21
|
*/
|
|
17
22
|
export declare function compileSafeRegex(source: string): RegExp | null;
|
|
18
23
|
/** True when the matcher carries at least one populated query key. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
|
+
import { stripStatefulRegexFlags } from "../regex-flags.js";
|
|
2
3
|
import safeRegex from "safe-regex";
|
|
3
4
|
//#region src/trigger/text-match.ts
|
|
4
5
|
/**
|
|
@@ -18,14 +19,19 @@ import safeRegex from "safe-regex";
|
|
|
18
19
|
* pattern. Returns `null` when the pattern is syntactically invalid or fails the
|
|
19
20
|
* `safe-regex` star-height heuristic — callers treat `null` as indeterminate.
|
|
20
21
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* the
|
|
22
|
+
* The flag class names every ECMAScript flag. When it read `[gimsuy]`, a `d`-
|
|
23
|
+
* or `v`-flagged pattern failed to unwrap and the whole `/pattern/flags` string
|
|
24
|
+
* became the pattern — a regex matching literal slashes, which compiles green
|
|
25
|
+
* and never matches what the author wrote.
|
|
26
|
+
*
|
|
27
|
+
* `g` and `y` are then stripped: they make the instance carry `lastIndex`
|
|
28
|
+
* between `.test()` calls, which is meaningless for the single yes/no question
|
|
29
|
+
* this asks and actively wrong for any caller that reuses the instance.
|
|
24
30
|
*/
|
|
25
31
|
function compileSafeRegex(source) {
|
|
26
|
-
const wrapped = /^\/(.+)\/([
|
|
32
|
+
const wrapped = /^\/(.+)\/([dgimsuvy]*)$/.exec(source);
|
|
27
33
|
const pattern = wrapped ? wrapped[1] : source;
|
|
28
|
-
const flags = wrapped ? wrapped[2] : "";
|
|
34
|
+
const flags = stripStatefulRegexFlags(wrapped ? wrapped[2] : "");
|
|
29
35
|
let re;
|
|
30
36
|
try {
|
|
31
37
|
re = new RegExp(pattern, flags);
|
|
@@ -11,4 +11,20 @@ export type TriggerEventType = (typeof TRIGGER_EVENT_TYPES)[number];
|
|
|
11
11
|
export declare const TRIGGER_EVENT_META: Record<TriggerEventType, {
|
|
12
12
|
label: string;
|
|
13
13
|
}>;
|
|
14
|
+
/**
|
|
15
|
+
* The event types that carry a pull request: the PR itself plus the two review
|
|
16
|
+
* events that hang off one. Each has a HEAD that a contributor controls and a
|
|
17
|
+
* BASE that the repository owner does, so an identity derived from the base
|
|
18
|
+
* alone cannot tell one from a push to that same base branch.
|
|
19
|
+
*/
|
|
20
|
+
export declare const PULL_REQUEST_FAMILY_TRIGGER_EVENTS: readonly ["pull_request", "review", "review_comment"];
|
|
21
|
+
/**
|
|
22
|
+
* True when a persisted `trigger_event` names a pull-request-family event.
|
|
23
|
+
*
|
|
24
|
+
* The stored value is `<type>` or `<type>:<action>` (`buildTriggerEvent`), so
|
|
25
|
+
* the action is stripped before the comparison. A null or unrecognised value
|
|
26
|
+
* reads as NOT PR-family, which is the conservative direction: it keeps the
|
|
27
|
+
* branch-shaped identity, which a trust policy can still constrain by ref.
|
|
28
|
+
*/
|
|
29
|
+
export declare function isPullRequestFamilyTriggerEvent(triggerEvent: string | null | undefined): boolean;
|
|
14
30
|
//# sourceMappingURL=trigger-event-type.d.ts.map
|
|
@@ -62,7 +62,31 @@ const TRIGGER_EVENT_META = {
|
|
|
62
62
|
rerun: { label: "Re-run" },
|
|
63
63
|
manual_schedule: { label: "Manual schedule" }
|
|
64
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* The event types that carry a pull request: the PR itself plus the two review
|
|
67
|
+
* events that hang off one. Each has a HEAD that a contributor controls and a
|
|
68
|
+
* BASE that the repository owner does, so an identity derived from the base
|
|
69
|
+
* alone cannot tell one from a push to that same base branch.
|
|
70
|
+
*/
|
|
71
|
+
const PULL_REQUEST_FAMILY_TRIGGER_EVENTS = [
|
|
72
|
+
"pull_request",
|
|
73
|
+
"review",
|
|
74
|
+
"review_comment"
|
|
75
|
+
];
|
|
76
|
+
/**
|
|
77
|
+
* True when a persisted `trigger_event` names a pull-request-family event.
|
|
78
|
+
*
|
|
79
|
+
* The stored value is `<type>` or `<type>:<action>` (`buildTriggerEvent`), so
|
|
80
|
+
* the action is stripped before the comparison. A null or unrecognised value
|
|
81
|
+
* reads as NOT PR-family, which is the conservative direction: it keeps the
|
|
82
|
+
* branch-shaped identity, which a trust policy can still constrain by ref.
|
|
83
|
+
*/
|
|
84
|
+
function isPullRequestFamilyTriggerEvent(triggerEvent) {
|
|
85
|
+
if (!triggerEvent) return false;
|
|
86
|
+
const type = triggerEvent.split(":", 1)[0];
|
|
87
|
+
return PULL_REQUEST_FAMILY_TRIGGER_EVENTS.includes(type);
|
|
88
|
+
}
|
|
65
89
|
//#endregion
|
|
66
|
-
export { TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES };
|
|
90
|
+
export { PULL_REQUEST_FAMILY_TRIGGER_EVENTS, TRIGGER_EVENT_META, TRIGGER_EVENT_TYPES, isPullRequestFamilyTriggerEvent };
|
|
67
91
|
|
|
68
92
|
//# sourceMappingURL=trigger-event-type.js.map
|
package/dist/trigger/types.d.ts
CHANGED
|
@@ -38,6 +38,10 @@
|
|
|
38
38
|
* Schema version 38 (additive): adds container.auth (private-registry credentials for the job image).
|
|
39
39
|
* Schema version 39 (additive): adds container.dockerfile/context/target/args (build the
|
|
40
40
|
* job's image from a Dockerfile in the repo) and container.auth.registry.
|
|
41
|
+
* Schema version 40 (additive): adds LockFile.siblingsDigest (the in-repo `workspace:`
|
|
42
|
+
* sibling closure the deps tarball carries, which no package-manager lock file moves).
|
|
43
|
+
* Schema version 41 (additive): adds LockDynamicJobFn.gitCredentials (named git credential
|
|
44
|
+
* refs declared by a dynamicJob generator and inherited by every job it generates).
|
|
41
45
|
*/
|
|
42
46
|
import { z } from 'zod';
|
|
43
47
|
import type { ProviderType } from '../provider/types.js';
|
|
@@ -50,7 +54,7 @@ import { ExecutionJobStatus } from '../protocol/messages/execution-status.js';
|
|
|
50
54
|
* schema change (additive or breaking); the bump-history comment above records
|
|
51
55
|
* which. See `BREAKING_FLOOR` for the compatibility-window semantics.
|
|
52
56
|
*/
|
|
53
|
-
export declare const SCHEMA_VERSION:
|
|
57
|
+
export declare const SCHEMA_VERSION: 41;
|
|
54
58
|
/**
|
|
55
59
|
* Oldest lock schema version this codebase can still read correctly — the lower
|
|
56
60
|
* bound of the acceptance window.
|
|
@@ -779,12 +783,17 @@ export interface LockJob {
|
|
|
779
783
|
*/
|
|
780
784
|
readonly runsOnPick?: RunsOnPick;
|
|
781
785
|
/**
|
|
782
|
-
* Named git credentials for this job
|
|
783
|
-
*
|
|
786
|
+
* Named git credentials for this job.
|
|
787
|
+
*
|
|
788
|
+
* A `<name>Secret` field is a SECRET NAME in qualified
|
|
789
|
+
* `<context>:<secret-name>` form. Its sibling `<name>Value` carries the
|
|
790
|
+
* material itself, for a credential that has no secret-store entry to name;
|
|
791
|
+
* the SDK accepts it deliberately and the compiler copies it through, so a
|
|
792
|
+
* lock CAN carry material and a reader must not assume otherwise.
|
|
784
793
|
*
|
|
785
794
|
* `default` is used when a call names no credential; any other key is
|
|
786
795
|
* referenced by name. Additive: an older orchestrator that does not
|
|
787
|
-
* understand it
|
|
796
|
+
* understand it passes it through in `jobConfig`, and an older agent
|
|
788
797
|
* ignores it (git falls back to its own mechanisms, exactly as before).
|
|
789
798
|
*/
|
|
790
799
|
readonly gitCredentials?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
@@ -939,6 +948,18 @@ export interface LockDynamicJobFn {
|
|
|
939
948
|
readonly needs?: readonly (string | NeedsEntry | NeedsGroupEntry)[];
|
|
940
949
|
/** True when this dynamic entry was authored as dynamicJob(group, { needs, generate }). */
|
|
941
950
|
readonly resultAware?: boolean;
|
|
951
|
+
/**
|
|
952
|
+
* Named git credentials the generator declares, inherited by every job it
|
|
953
|
+
* generates. Same shape and same rules as `LockJob.gitCredentials`.
|
|
954
|
+
*
|
|
955
|
+
* A generated job has no lock entry of its own, so this IS its declaration:
|
|
956
|
+
* the credential relay authorizes each generated child's requests against
|
|
957
|
+
* this map. It lives on the generator because the generator lives in the
|
|
958
|
+
* committed, content-hashed lock file, whereas the generated job definitions
|
|
959
|
+
* arrive from the agent's dynamic-eval reply — a map read from there would
|
|
960
|
+
* let job code declare its own authorization.
|
|
961
|
+
*/
|
|
962
|
+
readonly gitCredentials?: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
942
963
|
}
|
|
943
964
|
/** Job or dynamic job generator */
|
|
944
965
|
export type LockJobOrFactory = LockJob | LockDynamicJobFn;
|
|
@@ -1021,6 +1042,8 @@ export interface LockWorkflow {
|
|
|
1021
1042
|
* v11 adds the LockInlineValue type (deprecated; inline dynamic fields are resolved on the eval agent).
|
|
1022
1043
|
* v12 adds workflow-level registries and installEnv for private npm registry auth.
|
|
1023
1044
|
* v13 adds job-level and workflow-level timeout.
|
|
1045
|
+
* v40 adds siblingsDigest — the in-repo `workspace:` sibling closure the deps
|
|
1046
|
+
* tarball carries, which no package-manager lock file moves. Additive.
|
|
1024
1047
|
*/
|
|
1025
1048
|
export interface LockFile {
|
|
1026
1049
|
readonly schemaVersion: typeof SCHEMA_VERSION;
|
|
@@ -1037,6 +1060,23 @@ export interface LockFile {
|
|
|
1037
1060
|
readonly contentHash: string;
|
|
1038
1061
|
/** SHA-256 hash of .kici/ lockfile (pnpm-lock.yaml or package-lock.json). Used for dependency cache keying. */
|
|
1039
1062
|
readonly lockfileHash?: string;
|
|
1063
|
+
/**
|
|
1064
|
+
* SHA-256 over the git-tracked source of every in-repo `workspace:` /
|
|
1065
|
+
* `file:` / `link:` / `portal:` sibling package `.kici` depends on,
|
|
1066
|
+
* transitively.
|
|
1067
|
+
*
|
|
1068
|
+
* The deps tarball carries those sibling directories WITH their built output,
|
|
1069
|
+
* and `lockfileHash` alone names it — but editing a sibling's source moves no
|
|
1070
|
+
* package-manager lock file, so a warm dep cache restored the sibling's STALE
|
|
1071
|
+
* build over the fresh clone on every run. This enters the dep POINTER key
|
|
1072
|
+
* only; the immutable `{depsHash}.tar.gz` object keeps its own content
|
|
1073
|
+
* addressing, and `contentHash` is untouched (siblings ship in the deps
|
|
1074
|
+
* tarball, not the source one, so folding them in would make the source
|
|
1075
|
+
* digest unverifiable against the extracted tree).
|
|
1076
|
+
*
|
|
1077
|
+
* Absent when `.kici` depends on no in-repo sibling, which is the common case.
|
|
1078
|
+
*/
|
|
1079
|
+
readonly siblingsDigest?: string;
|
|
1040
1080
|
readonly workflows: readonly LockWorkflow[];
|
|
1041
1081
|
}
|
|
1042
1082
|
/** Type guard for static jobs */
|
|
@@ -1114,5 +1154,16 @@ export interface SimulatedEvent {
|
|
|
1114
1154
|
/** Repository identifier where the event occurred (e.g., "owner/repo").
|
|
1115
1155
|
* Used by global workflow repo pattern matching. */
|
|
1116
1156
|
sourceRepo?: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* `owner/repo` of the pull-request HEAD — where a contributor's code actually
|
|
1159
|
+
* lives. Set only for PR-family events; equals the base repository for a
|
|
1160
|
+
* same-repo PR and names the fork for a fork PR.
|
|
1161
|
+
*
|
|
1162
|
+
* Distinct from {@link SimulatedEvent.sourceRepo}, which is the repository the
|
|
1163
|
+
* event OCCURRED in (the base repository for a PR) and drives global-workflow
|
|
1164
|
+
* repo pattern matching. Conflating the two is what let a fork PR present as
|
|
1165
|
+
* a same-repo one.
|
|
1166
|
+
*/
|
|
1167
|
+
headRepo?: string;
|
|
1117
1168
|
}
|
|
1118
1169
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/trigger/types.js
CHANGED
|
@@ -43,13 +43,17 @@ import { z } from "zod";
|
|
|
43
43
|
* Schema version 38 (additive): adds container.auth (private-registry credentials for the job image).
|
|
44
44
|
* Schema version 39 (additive): adds container.dockerfile/context/target/args (build the
|
|
45
45
|
* job's image from a Dockerfile in the repo) and container.auth.registry.
|
|
46
|
+
* Schema version 40 (additive): adds LockFile.siblingsDigest (the in-repo `workspace:`
|
|
47
|
+
* sibling closure the deps tarball carries, which no package-manager lock file moves).
|
|
48
|
+
* Schema version 41 (additive): adds LockDynamicJobFn.gitCredentials (named git credential
|
|
49
|
+
* refs declared by a dynamicJob generator and inherited by every job it generates).
|
|
46
50
|
*/
|
|
47
51
|
/**
|
|
48
52
|
* Schema version the compiler emits into every lock file. Incremented on ANY
|
|
49
53
|
* schema change (additive or breaking); the bump-history comment above records
|
|
50
54
|
* which. See `BREAKING_FLOOR` for the compatibility-window semantics.
|
|
51
55
|
*/
|
|
52
|
-
const SCHEMA_VERSION =
|
|
56
|
+
const SCHEMA_VERSION = 41;
|
|
53
57
|
/**
|
|
54
58
|
* Oldest lock schema version this codebase can still read correctly — the lower
|
|
55
59
|
* bound of the acceptance window.
|
package/dist/ws/close-codes.d.ts
CHANGED
|
@@ -44,4 +44,12 @@ export declare const WS_CLOSE_REBALANCE = 4030;
|
|
|
44
44
|
* destroyed by their normal lifecycle; static agents reconnect and re-sync).
|
|
45
45
|
*/
|
|
46
46
|
export declare const WS_CLOSE_DISPATCH_ACK_TIMEOUT = 4031;
|
|
47
|
+
/**
|
|
48
|
+
* The connection was replaced: the same agent registered on a newer socket, so
|
|
49
|
+
* this one is a ghost. It is closed at registration time rather than left to
|
|
50
|
+
* the OS or the WS ping, because a half-open socket that closes later carries
|
|
51
|
+
* the same agent id and would otherwise tear down the live registration. The
|
|
52
|
+
* agent is already connected on the newer socket and does not reconnect.
|
|
53
|
+
*/
|
|
54
|
+
export declare const WS_CLOSE_SUPERSEDED_BY_RECONNECT = 4032;
|
|
47
55
|
//# sourceMappingURL=close-codes.d.ts.map
|
package/dist/ws/close-codes.js
CHANGED
|
@@ -46,7 +46,15 @@ const WS_CLOSE_REBALANCE = 4030;
|
|
|
46
46
|
* destroyed by their normal lifecycle; static agents reconnect and re-sync).
|
|
47
47
|
*/
|
|
48
48
|
const WS_CLOSE_DISPATCH_ACK_TIMEOUT = 4031;
|
|
49
|
+
/**
|
|
50
|
+
* The connection was replaced: the same agent registered on a newer socket, so
|
|
51
|
+
* this one is a ghost. It is closed at registration time rather than left to
|
|
52
|
+
* the OS or the WS ping, because a half-open socket that closes later carries
|
|
53
|
+
* the same agent id and would otherwise tear down the live registration. The
|
|
54
|
+
* agent is already connected on the newer socket and does not reconnect.
|
|
55
|
+
*/
|
|
56
|
+
const WS_CLOSE_SUPERSEDED_BY_RECONNECT = 4032;
|
|
49
57
|
//#endregion
|
|
50
|
-
export { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_REBALANCE, WS_CLOSE_UNAUTHORIZED };
|
|
58
|
+
export { WS_CLOSE_AGENT_AUTH_FAILED, WS_CLOSE_AUTH_TIMEOUT, WS_CLOSE_CLUSTER_NAME_CONFLICT, WS_CLOSE_DISPATCH_ACK_TIMEOUT, WS_CLOSE_GOING_AWAY, WS_CLOSE_HEARTBEAT_TIMEOUT, WS_CLOSE_INTERNAL_ERROR, WS_CLOSE_INVALID_MESSAGE, WS_CLOSE_PLAN_LIMIT, WS_CLOSE_PROTOCOL_ERROR, WS_CLOSE_REBALANCE, WS_CLOSE_SUPERSEDED_BY_RECONNECT, WS_CLOSE_UNAUTHORIZED };
|
|
51
59
|
|
|
52
60
|
//# sourceMappingURL=close-codes.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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",
|
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.7.0",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.7.0/503b5e34-6f3f-49dc-895a-92d03dba6006",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-09-
|
|
8
|
+
"created": "2026-09-11T07:37:30Z",
|
|
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.7.0",
|
|
58
58
|
"downloadLocation": "NOASSERTION",
|
|
59
59
|
"filesAnalyzed": false,
|
|
60
60
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -65,7 +65,7 @@
|
|
|
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.7.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.",
|