@kici-dev/engine 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/audit/access-log-policy.js +1 -0
- package/dist/audit/retention-policy.js +2 -0
- package/dist/context/held-run-job-id.d.ts +26 -10
- package/dist/context/held-run-job-id.js +30 -11
- package/dist/context/host-match.js +2 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +3 -3
- package/dist/context/types.d.ts +10 -1
- package/dist/context/types.js +10 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +17 -12
- package/dist/labels/compile.d.ts +2 -7
- package/dist/labels/compile.js +1 -10
- package/dist/labels.d.ts +74 -12
- package/dist/labels.js +82 -17
- package/dist/mcp/held-run-resolve.d.ts +40 -0
- package/dist/mcp/held-run-resolve.js +68 -15
- package/dist/mcp/tool-schemas.d.ts +4 -0
- package/dist/mcp/tool-schemas.js +13 -1
- package/dist/metrics/catalog-policy.d.ts +17 -3
- package/dist/metrics/catalog-policy.js +44 -13
- package/dist/metrics/metric-catalog.generated.d.ts +140 -0
- package/dist/metrics/metric-catalog.generated.js +168 -0
- package/dist/protocol/dashboard-global-workflows.js +2 -2
- package/dist/protocol/event-log-payload.js +1 -1
- package/dist/protocol/messages/access-log.d.ts +5 -0
- package/dist/protocol/messages/access-log.js +1 -0
- package/dist/protocol/messages/actor.d.ts +13 -2
- package/dist/protocol/messages/actor.js +16 -5
- package/dist/protocol/messages/common.js +1 -1
- package/dist/protocol/messages/dashboard-global-workflows.d.ts +29 -3
- package/dist/protocol/messages/dashboard-global-workflows.js +48 -4
- package/dist/protocol/messages/dashboard.d.ts +48 -7
- package/dist/protocol/messages/dashboard.js +62 -6
- package/dist/protocol/messages/execution-status.d.ts +44 -0
- package/dist/protocol/messages/execution-status.js +69 -2
- package/dist/protocol/messages/git-credential-relay.d.ts +78 -0
- package/dist/protocol/messages/git-credential-relay.js +86 -0
- package/dist/protocol/messages/orchestrator-agent.d.ts +138 -0
- package/dist/protocol/messages/orchestrator-agent.js +131 -3
- package/dist/protocol/messages/peer.d.ts +7 -0
- package/dist/protocol/messages/peer.js +18 -1
- package/dist/protocol/messages/platform-orchestrator.d.ts +155 -2
- package/dist/protocol/messages/platform-orchestrator.js +178 -19
- package/dist/protocol/version.d.ts +19 -2
- package/dist/protocol/version.js +20 -3
- package/dist/provenance/verify.js +11 -10
- package/dist/provider/check-status-poster.d.ts +37 -2
- package/dist/provider/contributor-resolver.d.ts +11 -3
- package/dist/provider/file-contents-fetcher.d.ts +39 -0
- package/dist/provider/file-contents-fetcher.js +2 -0
- package/dist/provider/git-credential.d.ts +77 -0
- package/dist/provider/git-credential.js +10 -0
- package/dist/provider/index.d.ts +4 -0
- package/dist/provider/index.js +2 -1
- package/dist/provider/webhook-normalizer.d.ts +12 -12
- package/dist/repo/pattern-negation.d.ts +73 -0
- package/dist/repo/pattern-negation.js +86 -0
- package/dist/safe-regex.d.ts +16 -0
- package/dist/safe-regex.js +24 -0
- package/dist/scaler/registry-auth.d.ts +18 -0
- package/dist/scaler/registry-auth.js +28 -0
- package/dist/scaler/scaler-backend-type.d.ts +35 -0
- package/dist/scaler/scaler-backend-type.js +39 -2
- package/dist/scaler/scaler-events.d.ts +79 -0
- package/dist/scaler/scaler-events.js +87 -0
- package/dist/trigger/compiled-matchers.d.ts +21 -1
- package/dist/trigger/compiled-matchers.js +30 -3
- package/dist/trigger/content-requirements.d.ts +31 -0
- package/dist/trigger/content-requirements.js +125 -0
- package/dist/trigger/decision-trace.d.ts +168 -0
- package/dist/trigger/decision-trace.js +207 -4
- package/dist/trigger/jsonpath-matcher.js +5 -1
- package/dist/trigger/matcher.js +61 -10
- package/dist/trigger/text-match.d.ts +27 -0
- package/dist/trigger/text-match.js +86 -0
- package/dist/trigger/types.d.ts +265 -23
- package/dist/trigger/types.js +37 -5
- package/dist/ws/rate-limiter.js +3 -3
- package/package.json +20 -3
- package/sbom.spdx.json +40 -15
package/dist/trigger/types.js
CHANGED
|
@@ -34,13 +34,22 @@ import { z } from "zod";
|
|
|
34
34
|
* Schema version 30 (BREAKING): renames job-level `environments` to `contexts`.
|
|
35
35
|
* Schema version 31 (additive): adds the workflows_failed_batch lock trigger.
|
|
36
36
|
* Schema version 32 (additive): adds LockJob.sandbox (per-job escape-hatch request).
|
|
37
|
+
* Schema version 33 (additive): adds `requires` (declarative static content filter) to the push/pr/tag git-event triggers.
|
|
38
|
+
* Schema version 34 (additive): adds LockWorkflow.hasFilter (workflow-level pre-dispatch filter predicate).
|
|
39
|
+
* Schema version 35 (additive): adds `commitMessage` (LockTextMatch) to the push/pr/tag
|
|
40
|
+
* git-event triggers, and contains/notContains/notMatches to LockContentRequirement.
|
|
41
|
+
* Schema version 36 (additive): adds LockJob.invoke (invokeSource gate, incl. optional).
|
|
42
|
+
* Schema version 37 (additive): adds LockJob.gitCredentials (named git credential refs).
|
|
43
|
+
* Schema version 38 (additive): adds container.auth (private-registry credentials for the job image).
|
|
44
|
+
* Schema version 39 (additive): adds container.dockerfile/context/target/args (build the
|
|
45
|
+
* job's image from a Dockerfile in the repo) and container.auth.registry.
|
|
37
46
|
*/
|
|
38
47
|
/**
|
|
39
48
|
* Schema version the compiler emits into every lock file. Incremented on ANY
|
|
40
49
|
* schema change (additive or breaking); the bump-history comment above records
|
|
41
50
|
* which. See `BREAKING_FLOOR` for the compatibility-window semantics.
|
|
42
51
|
*/
|
|
43
|
-
const SCHEMA_VERSION =
|
|
52
|
+
const SCHEMA_VERSION = 39;
|
|
44
53
|
/**
|
|
45
54
|
* Oldest lock schema version this codebase can still read correctly — the lower
|
|
46
55
|
* bound of the acceptance window.
|
|
@@ -53,15 +62,38 @@ const SCHEMA_VERSION = 32;
|
|
|
53
62
|
* Bump rule: move this to the current `SCHEMA_VERSION` ONLY in the commit that
|
|
54
63
|
* lands a `BREAKING` schema change (see the bump-history convention above). It
|
|
55
64
|
* currently sits at 30 because v30 (`environments`→`contexts`) was the most
|
|
56
|
-
* recent breaking bump; v31
|
|
57
|
-
* correctly.
|
|
65
|
+
* recent breaking bump; v31 through v35 were additive, so a v30 lock still
|
|
66
|
+
* reads correctly.
|
|
58
67
|
*/
|
|
59
68
|
const BREAKING_FLOOR = 30;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve a content requirement's parse format to a concrete value. An explicit
|
|
71
|
+
* non-`auto` format is returned as-is; `auto` (or unset) is resolved by the file
|
|
72
|
+
* extension: `.json` → json, `.yaml`/`.yml` → yaml, everything else text.
|
|
73
|
+
*
|
|
74
|
+
* Yaml-free (pure string logic) so it lives in the browser-safe barrel and is
|
|
75
|
+
* the single source of truth for both the compiler's compile-time serializer and
|
|
76
|
+
* the orchestrator's eval-time matcher — the two can never disagree about how a
|
|
77
|
+
* file's format is picked.
|
|
78
|
+
*/
|
|
79
|
+
function resolveContentFormat(file, format) {
|
|
80
|
+
if (format && format !== "auto") return format;
|
|
81
|
+
const lower = file.toLowerCase();
|
|
82
|
+
if (lower.endsWith(".json")) return "json";
|
|
83
|
+
if (lower.endsWith(".yaml") || lower.endsWith(".yml")) return "yaml";
|
|
84
|
+
return "text";
|
|
85
|
+
}
|
|
60
86
|
/** Type guard distinguishing a parallel group from an ordinary lock step. */
|
|
61
87
|
function isLockParallelStep(entry) {
|
|
62
88
|
return entry.kind === "parallel";
|
|
63
89
|
}
|
|
64
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Type guard for inline expression values.
|
|
92
|
+
*
|
|
93
|
+
* @deprecated See {@link LockInlineValue}. Retained only so a reader can
|
|
94
|
+
* recognize an old lock's inline field and defer it to the eval agent's
|
|
95
|
+
* init-runner. Removed at the next major (v1.0.0).
|
|
96
|
+
*/
|
|
65
97
|
function isLockInlineValue(value) {
|
|
66
98
|
return typeof value === "object" && value !== null && value._type === "inline";
|
|
67
99
|
}
|
|
@@ -178,6 +210,6 @@ const changedFilesStatusSchema = z.enum([
|
|
|
178
210
|
"skipped"
|
|
179
211
|
]);
|
|
180
212
|
//#endregion
|
|
181
|
-
export { BREAKING_FLOOR, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SANDBOX_NETWORK_MODES, SCHEMA_VERSION, changedFilesStatusSchema, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob, resolveWhenToRunOn };
|
|
213
|
+
export { BREAKING_FLOOR, NeedsEntrySchema, NeedsGroupEntrySchema, NeedsRunOn, NeedsWhen, OnUnreachableMode, RunsOnPick, SANDBOX_NETWORK_MODES, SCHEMA_VERSION, changedFilesStatusSchema, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob, resolveContentFormat, resolveWhenToRunOn };
|
|
182
214
|
|
|
183
215
|
//# sourceMappingURL=types.js.map
|
package/dist/ws/rate-limiter.js
CHANGED
|
@@ -79,10 +79,10 @@ var WsRateLimiter = class {
|
|
|
79
79
|
bytesCapacity;
|
|
80
80
|
disconnectAfterMs;
|
|
81
81
|
constructor(config) {
|
|
82
|
-
const bytesCapacity = config?.bytesCapacity ??
|
|
82
|
+
const bytesCapacity = config?.bytesCapacity ?? 2097152;
|
|
83
83
|
this.messages = new TokenBucket(config?.messageCapacity ?? 200, config?.messageRefillRate ?? 100);
|
|
84
|
-
this.bytes = new TokenBucket(bytesCapacity, config?.bytesRefillRate ??
|
|
85
|
-
this.maxMessageSize = config?.maxMessageSize ??
|
|
84
|
+
this.bytes = new TokenBucket(bytesCapacity, config?.bytesRefillRate ?? 512e3);
|
|
85
|
+
this.maxMessageSize = config?.maxMessageSize ?? 4194304;
|
|
86
86
|
this.bytesCapacity = bytesCapacity;
|
|
87
87
|
this.disconnectAfterMs = config?.disconnectAfterMs ?? 5e3;
|
|
88
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -45,10 +45,22 @@
|
|
|
45
45
|
"import": "./dist/trigger/trigger-event-type.js",
|
|
46
46
|
"types": "./dist/trigger/trigger-event-type.d.ts"
|
|
47
47
|
},
|
|
48
|
+
"./trigger/content-requirements": {
|
|
49
|
+
"import": "./dist/trigger/content-requirements.js",
|
|
50
|
+
"types": "./dist/trigger/content-requirements.d.ts"
|
|
51
|
+
},
|
|
48
52
|
"./webhook/signature": {
|
|
49
53
|
"import": "./dist/webhook/signature.js",
|
|
50
54
|
"types": "./dist/webhook/signature.d.ts"
|
|
51
55
|
},
|
|
56
|
+
"./scaler/registry-auth": {
|
|
57
|
+
"import": "./dist/scaler/registry-auth.js",
|
|
58
|
+
"types": "./dist/scaler/registry-auth.d.ts"
|
|
59
|
+
},
|
|
60
|
+
"./safe-regex": {
|
|
61
|
+
"import": "./dist/safe-regex.js",
|
|
62
|
+
"types": "./dist/safe-regex.d.ts"
|
|
63
|
+
},
|
|
52
64
|
"./labels/compile": {
|
|
53
65
|
"import": "./dist/labels/compile.js",
|
|
54
66
|
"types": "./dist/labels/compile.d.ts"
|
|
@@ -97,6 +109,10 @@
|
|
|
97
109
|
"import": "./dist/protocol/messages/oidc-mint.js",
|
|
98
110
|
"types": "./dist/protocol/messages/oidc-mint.d.ts"
|
|
99
111
|
},
|
|
112
|
+
"./protocol/messages/git-credential-relay": {
|
|
113
|
+
"import": "./dist/protocol/messages/git-credential-relay.js",
|
|
114
|
+
"types": "./dist/protocol/messages/git-credential-relay.d.ts"
|
|
115
|
+
},
|
|
100
116
|
"./provenance/schema": {
|
|
101
117
|
"import": "./dist/provenance/schema.js",
|
|
102
118
|
"types": "./dist/provenance/schema.d.ts"
|
|
@@ -131,10 +147,11 @@
|
|
|
131
147
|
}
|
|
132
148
|
},
|
|
133
149
|
"dependencies": {
|
|
134
|
-
"jose": "^6.
|
|
150
|
+
"jose": "^6.2.10",
|
|
135
151
|
"jsonpath-plus": "^10.4.0",
|
|
136
|
-
"picomatch": "^4.0.
|
|
152
|
+
"picomatch": "^4.0.7",
|
|
137
153
|
"safe-regex": "^2.1.1",
|
|
154
|
+
"yaml": "^2.9.0",
|
|
138
155
|
"zod": "^4.4.3"
|
|
139
156
|
},
|
|
140
157
|
"devDependencies": {
|
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.6.0",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fengine/0.6.0/257d679c-2415-4ce3-b560-a0cc82187192",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-
|
|
8
|
+
"created": "2026-09-01T13:57:11Z",
|
|
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.6.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.6.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.10",
|
|
76
76
|
"name": "jose",
|
|
77
|
-
"versionInfo": "6.2.
|
|
78
|
-
"downloadLocation": "https://registry.npmjs.org/jose/-/jose-6.2.
|
|
77
|
+
"versionInfo": "6.2.10",
|
|
78
|
+
"downloadLocation": "https://registry.npmjs.org/jose/-/jose-6.2.10.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.10"
|
|
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",
|
|
@@ -132,10 +132,10 @@
|
|
|
132
132
|
"homepage": "https://github.com/s3u/JSONPath"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
|
-
"SPDXID": "SPDXRef-Package-picomatch-4.0.
|
|
135
|
+
"SPDXID": "SPDXRef-Package-picomatch-4.0.7",
|
|
136
136
|
"name": "picomatch",
|
|
137
|
-
"versionInfo": "4.0.
|
|
138
|
-
"downloadLocation": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.
|
|
137
|
+
"versionInfo": "4.0.7",
|
|
138
|
+
"downloadLocation": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",
|
|
139
139
|
"filesAnalyzed": false,
|
|
140
140
|
"licenseConcluded": "NOASSERTION",
|
|
141
141
|
"licenseDeclared": "MIT",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
{
|
|
146
146
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
147
147
|
"referenceType": "purl",
|
|
148
|
-
"referenceLocator": "pkg:npm/picomatch@4.0.
|
|
148
|
+
"referenceLocator": "pkg:npm/picomatch@4.0.7"
|
|
149
149
|
}
|
|
150
150
|
],
|
|
151
151
|
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
|
|
@@ -191,6 +191,26 @@
|
|
|
191
191
|
"description": "detect possibly catastrophic, exponential-time regular expressions",
|
|
192
192
|
"homepage": "https://github.com/davisjam/safe-regex"
|
|
193
193
|
},
|
|
194
|
+
{
|
|
195
|
+
"SPDXID": "SPDXRef-Package-yaml-2.9.0",
|
|
196
|
+
"name": "yaml",
|
|
197
|
+
"versionInfo": "2.9.0",
|
|
198
|
+
"downloadLocation": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
|
|
199
|
+
"filesAnalyzed": false,
|
|
200
|
+
"licenseConcluded": "NOASSERTION",
|
|
201
|
+
"licenseDeclared": "ISC",
|
|
202
|
+
"copyrightText": "NOASSERTION",
|
|
203
|
+
"supplier": "NOASSERTION",
|
|
204
|
+
"externalRefs": [
|
|
205
|
+
{
|
|
206
|
+
"referenceCategory": "PACKAGE-MANAGER",
|
|
207
|
+
"referenceType": "purl",
|
|
208
|
+
"referenceLocator": "pkg:npm/yaml@2.9.0"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"description": "JavaScript parser and stringifier for YAML",
|
|
212
|
+
"homepage": "https://eemeli.org/yaml/"
|
|
213
|
+
},
|
|
194
214
|
{
|
|
195
215
|
"SPDXID": "SPDXRef-Package-zod-4.4.3",
|
|
196
216
|
"name": "zod",
|
|
@@ -230,7 +250,7 @@
|
|
|
230
250
|
},
|
|
231
251
|
{
|
|
232
252
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
233
|
-
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.
|
|
253
|
+
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.10",
|
|
234
254
|
"relationshipType": "DEPENDS_ON"
|
|
235
255
|
},
|
|
236
256
|
{
|
|
@@ -240,7 +260,7 @@
|
|
|
240
260
|
},
|
|
241
261
|
{
|
|
242
262
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
243
|
-
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.
|
|
263
|
+
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.7",
|
|
244
264
|
"relationshipType": "DEPENDS_ON"
|
|
245
265
|
},
|
|
246
266
|
{
|
|
@@ -248,6 +268,11 @@
|
|
|
248
268
|
"relatedSpdxElement": "SPDXRef-Package-safe-regex-2.1.1",
|
|
249
269
|
"relationshipType": "DEPENDS_ON"
|
|
250
270
|
},
|
|
271
|
+
{
|
|
272
|
+
"spdxElementId": "SPDXRef-RootPackage",
|
|
273
|
+
"relatedSpdxElement": "SPDXRef-Package-yaml-2.9.0",
|
|
274
|
+
"relationshipType": "DEPENDS_ON"
|
|
275
|
+
},
|
|
251
276
|
{
|
|
252
277
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
253
278
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|