@kici-dev/compiler 0.1.22 → 0.1.24
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/cli.js +34 -10
- package/dist/commands/compile.d.ts +6 -0
- package/dist/commands/compile.js +6 -3
- package/dist/commands/docs.d.ts +8 -8
- package/dist/commands/docs.js +35 -16
- package/dist/commands/index.d.ts +4 -2
- package/dist/commands/index.js +3 -2
- package/dist/commands/init.js +2 -2
- package/dist/commands/org.js +2 -2
- package/dist/commands/pat.d.ts +27 -0
- package/dist/commands/pat.js +76 -0
- package/dist/commands/preview.d.ts +88 -0
- package/dist/commands/{test.js → preview.js} +15 -14
- package/dist/commands/run.d.ts +27 -2
- package/dist/commands/run.js +117 -18
- package/dist/commands/test.d.ts +4 -0
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.js +1 -1
- package/dist/commands/verify-attestation.d.ts +4 -1
- package/dist/commands/verify-attestation.js +26 -10
- package/dist/fixtures/describe-event.d.ts +6 -0
- package/dist/fixtures/describe-event.js +18 -0
- package/dist/fixtures/picker.d.ts +19 -0
- package/dist/fixtures/picker.js +64 -0
- package/dist/generators/secrets-dts.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/llm-context/llms-architecture.txt +1440 -0
- package/dist/llm-context/llms-cli.txt +2509 -0
- package/dist/llm-context/llms-features.txt +2491 -0
- package/dist/llm-context/llms-full.txt +1364 -361
- package/dist/llm-context/llms-getting-started.txt +519 -0
- package/dist/llm-context/llms-patterns.txt +1324 -0
- package/dist/llm-context/llms-providers.txt +805 -0
- package/dist/llm-context/llms-sdk.txt +3844 -0
- package/dist/llm-context/llms.txt +16 -1
- package/dist/local-executor/index.js +42 -4
- package/dist/local-executor/job-runner.d.ts +2 -0
- package/dist/local-executor/job-runner.js +38 -6
- package/dist/local-executor/types.d.ts +2 -0
- package/dist/lockfile/generator.d.ts +10 -2
- package/dist/lockfile/generator.js +112 -49
- package/dist/remote/history.d.ts +1 -1
- package/dist/remote/history.js +1 -1
- package/dist/remote/local-repo-identity.d.ts +32 -0
- package/dist/remote/local-repo-identity.js +74 -0
- package/dist/remote/platform-client.d.ts +6 -0
- package/dist/remote/prod-defaults.d.ts +8 -0
- package/dist/remote/prod-defaults.js +9 -1
- package/dist/remote/uploader.js +1 -0
- package/dist/templates/agents-md.d.ts +1 -1
- package/dist/templates/agents-md.js +2 -2
- package/dist/templates/package-json.js +1 -1
- package/dist/test-runner/rule-evaluator.d.ts +1 -1
- package/dist/test-runner/rule-evaluator.js +2 -1
- package/dist/test-runner/step-context.d.ts +1 -1
- package/dist/test-runner/step-context.js +8 -2
- package/dist/types.d.ts +38 -7
- package/dist/types.js +5 -1
- package/package.json +4 -7
- package/sbom.spdx.json +35 -35
|
@@ -17,7 +17,15 @@ const PROD_PLATFORM_URL = "https://api.kici.dev";
|
|
|
17
17
|
const PROD_OIDC_ISSUER = "https://auth.kici.dev/realms/kici-internal";
|
|
18
18
|
/** Public OIDC client id registered for the `kici` CLI. */
|
|
19
19
|
const PROD_OIDC_CLIENT_ID = "kici-cli";
|
|
20
|
+
/**
|
|
21
|
+
* Provenance trust root for `kici verify-attestation` when `--trust-root` is
|
|
22
|
+
* omitted: the hosted KiCI Platform's provenance issuer. The verifier appends
|
|
23
|
+
* `/.well-known/openid-configuration` and pins the token issuer to it. Pass
|
|
24
|
+
* `--trust-root` to verify against a different environment (e.g. staging) or an
|
|
25
|
+
* offline `{ issuer, jwks }` file.
|
|
26
|
+
*/
|
|
27
|
+
const PROD_PROVENANCE_ISSUER = "https://api.kici.dev";
|
|
20
28
|
//#endregion
|
|
21
|
-
export { PROD_OIDC_CLIENT_ID, PROD_OIDC_ISSUER, PROD_PLATFORM_URL };
|
|
29
|
+
export { PROD_OIDC_CLIENT_ID, PROD_OIDC_ISSUER, PROD_PLATFORM_URL, PROD_PROVENANCE_ISSUER };
|
|
22
30
|
|
|
23
31
|
//# sourceMappingURL=prod-defaults.js.map
|
package/dist/remote/uploader.js
CHANGED
|
@@ -232,6 +232,7 @@ function getSizeWarning(compressedSize) {
|
|
|
232
232
|
*/
|
|
233
233
|
async function uploadTarball(opts) {
|
|
234
234
|
const { tarballPath, signedUrl, orchestratorPublicKey, onProgress } = opts;
|
|
235
|
+
if (!signedUrl) throw new Error("The orchestrator did not return an upload URL, so the overlay cannot be uploaded. This usually means the orchestrator has no object storage configured for remote runs. Ask your orchestrator operator to enable cache storage (KICI_STORAGE_TYPE=s3 or filesystem).");
|
|
235
236
|
const { encryptedPath, cliPublicKey } = await encryptTarball(tarballPath, orchestratorPublicKey);
|
|
236
237
|
const encryptedData = await fs.readFile(encryptedPath);
|
|
237
238
|
const encryptedSize = encryptedData.length;
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* picked up by Claude Code, Cursor, Aider, and other coding agents that scan
|
|
5
5
|
* the working tree for an authoring context file.
|
|
6
6
|
*/
|
|
7
|
-
export declare const agentsMdTemplate = "# KiCI workflow authoring guide\n\nThis project uses KiCI \u2014 a TypeScript-native CI/CD workflow engine \u2014 instead\nof YAML-based CI. Workflows live in `.kici/workflows/*.ts`, are compiled\ninto a portable lock file, and executed by self-hosted agents.\n\n## Where the API surface lives\n\n- Public SDK types: `node_modules/@kici-dev/sdk/dist/index.d.ts` \u2014 read this\n for the canonical signatures of `workflow`, `job`, `step`, `pr`,\n `push`, `schedule`, `matrix`, `rule`, `dynamicJob`, etc.\n- Bundled offline reference for coding agents: `kici docs llm` prints the\n full markdown documentation bundle to stdout. `kici docs llm --index`\n prints just the curated link index (llms.txt format).\n- Online docs:\n - <https://kici.dev/docs/> \u2014 published docs site.\n - <https://kici.dev/llms.txt> \u2014 curated index for LLM consumers.\n - <https://kici.dev/llms-full.txt> \u2014 full markdown bundle.\n - Key pages: `user/sdk-reference`, `user/workflow-patterns`,\n `user/testing-guide`, `user/hooks`, `user/secrets`.\n\n## The five core patterns\n\n1. **Push trigger** \u2014 `on: push({ branches: 'main' })`. Pair with `paths`\n to scope to subtrees.\n\n ```ts\n import { workflow, job, step, push } from '@kici-dev/sdk';\n\n export default workflow('build', {\n on: push({ branches: 'main' }),\n jobs: [\n job('build', {\n runsOn: 'kici:os:linux',\n steps: [step('install', async ({ $ }) => { await $`pnpm install`; })],\n }),\n ],\n });\n ```\n\n `kici:os:linux` targets any agent reporting that OS \u2014 every agent\n self-reports `kici:os:` / `kici:arch:` / `kici:host:`. Use a custom label\n (e.g. `'gpu'`, `'prod-pool'`) to target a specific agent pool your scaler\n defines.\n\n2. **PR + matrix** \u2014 `pr({ target: 'main' })` plus a matrix over node\n versions. The matrix expands at dispatch time.\n\n ```ts\n import { workflow, job, step, pr, matrix } from '@kici-dev/sdk';\n\n export default workflow('test-matrix', {\n on: pr({ target: 'main' }),\n jobs: [\n job('test', {\n runsOn: 'kici:os:linux',\n strategy: { matrix: matrix({ node: ['20', '22', '24'] }) },\n steps: [\n step('test', async ({ $, matrix }) => {\n await $`node --version`;\n await $`pnpm install`;\n await $`pnpm test`;\n return { node: matrix.node };\n }),\n ],\n }),\n ],\n });\n ```\n\n3. **Lifecycle hooks** \u2014 `onFailure` / `onSuccess` / `onCancel` on a\n job or workflow run after the main steps in their own scope.\n\n4. **Secrets** \u2014 declared scopes resolve at dispatch:\n\n ```ts\n step('deploy', async ({ $, secrets }) => {\n await $`./scripts/deploy.sh`.env({ DEPLOY_TOKEN: secrets.production.DEPLOY_TOKEN });\n });\n ```\n\n Run `kici secrets list` to enumerate the contexts available for testing.\n\n5. **Dynamic jobs** \u2014 `dynamicJob` and `dynamicGroup` build the DAG at\n runtime from a step's outputs. Don't try to compute job names at top level;\n the lock file would be wrong.\n\n## Anti-patterns\n\n- **Do NOT write `.yml` / `.yaml` CI files** \u2014 KiCI replaces that entire\n layer. There is no compatibility shim.\n- **Do NOT `import` from any `@kici-dev/*` package's `/dist/...`\n subpath** \u2014 those are not part of the public API and break across versions.\n Import from the package root.\n- **Do NOT `await` outside step bodies.** The top-level workflow file is\n loaded by the compiler synchronously; async I/O at module scope means the\n lock file emits before it resolves and the workflow appears empty.\n- **Do NOT mutate shared variables between jobs.** Each job runs in its own\n agent process. Use `needs` + step outputs to thread values.\n- **Do NOT hand-edit `kici.lock.json`.** Regenerate it via `kici compile`.\n\n## Local commands a coding agent should run\n\n| Command | Purpose |\n| ------------------------------- | ------------------------------------------- |\n| `pnpm kici compile --check` | Validate workflow source without writing. |\n| `pnpm kici
|
|
7
|
+
export declare const agentsMdTemplate = "# KiCI workflow authoring guide\n\nThis project uses KiCI \u2014 a TypeScript-native CI/CD workflow engine \u2014 instead\nof YAML-based CI. Workflows live in `.kici/workflows/*.ts`, are compiled\ninto a portable lock file, and executed by self-hosted agents.\n\n## Where the API surface lives\n\n- Public SDK types: `node_modules/@kici-dev/sdk/dist/index.d.ts` \u2014 read this\n for the canonical signatures of `workflow`, `job`, `step`, `pr`,\n `push`, `schedule`, `matrix`, `rule`, `dynamicJob`, etc.\n- Bundled offline reference for coding agents: `kici docs llm` prints the\n full markdown documentation bundle to stdout. `kici docs llm --index`\n prints just the curated link index (llms.txt format).\n- Online docs:\n - <https://kici.dev/docs/> \u2014 published docs site.\n - <https://kici.dev/llms.txt> \u2014 curated index for LLM consumers.\n - <https://kici.dev/llms-full.txt> \u2014 full markdown bundle.\n - Key pages: `user/sdk-reference`, `user/workflow-patterns`,\n `user/testing-guide`, `user/hooks`, `user/secrets`.\n\n## The five core patterns\n\n1. **Push trigger** \u2014 `on: push({ branches: 'main' })`. Pair with `paths`\n to scope to subtrees.\n\n ```ts\n import { workflow, job, step, push } from '@kici-dev/sdk';\n\n export default workflow('build', {\n on: push({ branches: 'main' }),\n jobs: [\n job('build', {\n runsOn: 'kici:os:linux',\n steps: [step('install', async ({ $ }) => { await $`pnpm install`; })],\n }),\n ],\n });\n ```\n\n `kici:os:linux` targets any agent reporting that OS \u2014 every agent\n self-reports `kici:os:` / `kici:arch:` / `kici:host:`. Use a custom label\n (e.g. `'gpu'`, `'prod-pool'`) to target a specific agent pool your scaler\n defines.\n\n2. **PR + matrix** \u2014 `pr({ target: 'main' })` plus a matrix over node\n versions. The matrix expands at dispatch time.\n\n ```ts\n import { workflow, job, step, pr, matrix } from '@kici-dev/sdk';\n\n export default workflow('test-matrix', {\n on: pr({ target: 'main' }),\n jobs: [\n job('test', {\n runsOn: 'kici:os:linux',\n strategy: { matrix: matrix({ node: ['20', '22', '24'] }) },\n steps: [\n step('test', async ({ $, matrix }) => {\n await $`node --version`;\n await $`pnpm install`;\n await $`pnpm test`;\n return { node: matrix.node };\n }),\n ],\n }),\n ],\n });\n ```\n\n3. **Lifecycle hooks** \u2014 `onFailure` / `onSuccess` / `onCancel` on a\n job or workflow run after the main steps in their own scope.\n\n4. **Secrets** \u2014 declared scopes resolve at dispatch:\n\n ```ts\n step('deploy', async ({ $, secrets }) => {\n await $`./scripts/deploy.sh`.env({ DEPLOY_TOKEN: secrets.production.DEPLOY_TOKEN });\n });\n ```\n\n Run `kici secrets list` to enumerate the contexts available for testing.\n\n5. **Dynamic jobs** \u2014 `dynamicJob` and `dynamicGroup` build the DAG at\n runtime from a step's outputs. Don't try to compute job names at top level;\n the lock file would be wrong.\n\n## Anti-patterns\n\n- **Do NOT write `.yml` / `.yaml` CI files** \u2014 KiCI replaces that entire\n layer. There is no compatibility shim.\n- **Do NOT `import` from any `@kici-dev/*` package's `/dist/...`\n subpath** \u2014 those are not part of the public API and break across versions.\n Import from the package root.\n- **Do NOT `await` outside step bodies.** The top-level workflow file is\n loaded by the compiler synchronously; async I/O at module scope means the\n lock file emits before it resolves and the workflow appears empty.\n- **Do NOT mutate shared variables between jobs.** Each job runs in its own\n agent process. Use `needs` + step outputs to thread values.\n- **Do NOT hand-edit `kici.lock.json`.** Regenerate it via `kici compile`.\n\n## Local commands a coding agent should run\n\n| Command | Purpose |\n| ------------------------------- | ------------------------------------------- |\n| `pnpm kici compile --check` | Validate workflow source without writing. |\n| `pnpm kici preview pr:open --debug` | Preview which workflows match an event. |\n| `pnpm kici run local push` | Execute workflows locally with no orchestrator. |\n| `pnpm kici docs llm` | Print the full LLM documentation bundle. |\n| `pnpm kici docs llm --index` | Print the curated link index. |\n\nIf `pnpm kici` isn't in scripts, fall back to `npx kici`.\n\n## Loop\n\n1. Read the SDK types from `node_modules/@kici-dev/sdk/dist/index.d.ts`.\n2. Pipe `kici docs llm` into the agent's context if it doesn't already have\n the full bundle.\n3. Edit a workflow under `.kici/workflows/`.\n4. Run `kici compile --check` (zero exit means valid).\n5. Run `kici preview <event>` to preview matching.\n6. Run `kici run local <event>` to execute locally before pushing.\n";
|
|
8
8
|
//# sourceMappingURL=agents-md.d.ts.map
|
|
@@ -112,7 +112,7 @@ into a portable lock file, and executed by self-hosted agents.
|
|
|
112
112
|
| Command | Purpose |
|
|
113
113
|
| ------------------------------- | ------------------------------------------- |
|
|
114
114
|
| \`pnpm kici compile --check\` | Validate workflow source without writing. |
|
|
115
|
-
| \`pnpm kici
|
|
115
|
+
| \`pnpm kici preview pr:open --debug\` | Preview which workflows match an event. |
|
|
116
116
|
| \`pnpm kici run local push\` | Execute workflows locally with no orchestrator. |
|
|
117
117
|
| \`pnpm kici docs llm\` | Print the full LLM documentation bundle. |
|
|
118
118
|
| \`pnpm kici docs llm --index\` | Print the curated link index. |
|
|
@@ -126,7 +126,7 @@ If \`pnpm kici\` isn't in scripts, fall back to \`npx kici\`.
|
|
|
126
126
|
the full bundle.
|
|
127
127
|
3. Edit a workflow under \`.kici/workflows/\`.
|
|
128
128
|
4. Run \`kici compile --check\` (zero exit means valid).
|
|
129
|
-
5. Run \`kici
|
|
129
|
+
5. Run \`kici preview <event>\` to preview matching.
|
|
130
130
|
6. Run \`kici run local <event>\` to execute locally before pushing.
|
|
131
131
|
`;
|
|
132
132
|
//#endregion
|
|
@@ -3,7 +3,7 @@ import type { RuleEvaluationResult } from '@kici-dev/sdk';
|
|
|
3
3
|
/**
|
|
4
4
|
* Create RuleContext for rule evaluation.
|
|
5
5
|
*/
|
|
6
|
-
export declare function createRuleContext(event: EventPayload, changedFiles?: string[]): RuleContext;
|
|
6
|
+
export declare function createRuleContext(event: EventPayload, changedFiles?: string[], dispatchInputs?: Readonly<Record<string, string | number | boolean | null>>): RuleContext;
|
|
7
7
|
/**
|
|
8
8
|
* Evaluate rules with formatting output.
|
|
9
9
|
* Wraps the SDK's evaluateRules() with a callback that logs each rule result.
|
|
@@ -8,11 +8,12 @@ initZx();
|
|
|
8
8
|
/**
|
|
9
9
|
* Create RuleContext for rule evaluation.
|
|
10
10
|
*/
|
|
11
|
-
function createRuleContext(event, changedFiles = []) {
|
|
11
|
+
function createRuleContext(event, changedFiles = [], dispatchInputs = {}) {
|
|
12
12
|
return {
|
|
13
13
|
event,
|
|
14
14
|
changedFiles,
|
|
15
15
|
env: { ...process.env },
|
|
16
|
+
dispatchInputs,
|
|
16
17
|
$
|
|
17
18
|
};
|
|
18
19
|
}
|
|
@@ -11,5 +11,5 @@ import type { StepContext, WorkflowInfo, JobInfo, MatrixValues } from '@kici-dev
|
|
|
11
11
|
export declare function createStepContext(workflowInfo: WorkflowInfo, jobInfo: JobInfo, repoRoot: string, inputs?: Record<string, unknown>, matrix?: MatrixValues, testSecrets?: {
|
|
12
12
|
flat: Record<string, string>;
|
|
13
13
|
contexts: Record<string, Record<string, string>>;
|
|
14
|
-
}, environment?: string, rawPayload?: Record<string, unknown>, provider?: string): StepContext;
|
|
14
|
+
}, environment?: string, rawPayload?: Record<string, unknown>, provider?: string, dispatchInputs?: Readonly<Record<string, string | number | boolean | null>>, signal?: AbortSignal): StepContext;
|
|
15
15
|
//# sourceMappingURL=step-context.d.ts.map
|
|
@@ -42,7 +42,7 @@ function createTestLogger(jobName) {
|
|
|
42
42
|
* `ctx.$` would inherit `process.cwd()` — i.e. wherever the user invoked
|
|
43
43
|
* `kici` — which silently breaks any step that uses relative paths.
|
|
44
44
|
*/
|
|
45
|
-
function createStepContext(workflowInfo, jobInfo, repoRoot, inputs = {}, matrix, testSecrets, environment, rawPayload, provider) {
|
|
45
|
+
function createStepContext(workflowInfo, jobInfo, repoRoot, inputs = {}, matrix, testSecrets, environment, rawPayload, provider, dispatchInputs = {}, signal = new AbortController().signal) {
|
|
46
46
|
const flat = testSecrets?.flat ?? {};
|
|
47
47
|
const namespacedSecrets = testSecrets?.contexts ?? {};
|
|
48
48
|
const mergedFlat = { ...flat };
|
|
@@ -99,6 +99,7 @@ function createStepContext(workflowInfo, jobInfo, repoRoot, inputs = {}, matrix,
|
|
|
99
99
|
return {
|
|
100
100
|
$: scoped$,
|
|
101
101
|
log: createTestLogger(jobInfo.name),
|
|
102
|
+
signal,
|
|
102
103
|
env,
|
|
103
104
|
setEnv: (key, value) => {
|
|
104
105
|
env[key] = value;
|
|
@@ -110,6 +111,7 @@ function createStepContext(workflowInfo, jobInfo, repoRoot, inputs = {}, matrix,
|
|
|
110
111
|
process.env.PATH = updated;
|
|
111
112
|
},
|
|
112
113
|
inputs,
|
|
114
|
+
dispatchInputs,
|
|
113
115
|
workflow: workflowInfo,
|
|
114
116
|
job: jobInfo,
|
|
115
117
|
matrix,
|
|
@@ -138,7 +140,11 @@ function createStepContext(workflowInfo, jobInfo, repoRoot, inputs = {}, matrix,
|
|
|
138
140
|
get: () => Promise.resolve(null)
|
|
139
141
|
},
|
|
140
142
|
oidc: { token: () => Promise.reject(/* @__PURE__ */ new Error("ctx.kici.oidc.token() is not available in the local test runner")) },
|
|
141
|
-
host: { requestReboot: () => Promise.reject(/* @__PURE__ */ new Error("ctx.kici.host.requestReboot() is not available in the local test runner")) }
|
|
143
|
+
host: { requestReboot: () => Promise.reject(/* @__PURE__ */ new Error("ctx.kici.host.requestReboot() is not available in the local test runner")) },
|
|
144
|
+
bootstrap: {
|
|
145
|
+
ensureInitRunner: () => Promise.reject(/* @__PURE__ */ new Error("ctx.kici.bootstrap.ensureInitRunner() is not available in the local test runner")),
|
|
146
|
+
preBootSend: () => Promise.reject(/* @__PURE__ */ new Error("ctx.kici.bootstrap.preBootSend() is not available in the local test runner"))
|
|
147
|
+
}
|
|
142
148
|
},
|
|
143
149
|
cache: {
|
|
144
150
|
restore: async () => ({ hit: false }),
|
package/dist/types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* v15 adds per-job init config(s).
|
|
13
13
|
* v17 widens per-job init to typed presets ('mise' / { mise }) and 'auto' detection.
|
|
14
14
|
*/
|
|
15
|
-
import type { ResourceRequest, ApproverClause, RunsOnAllPredicate, OnUnreachableMode, LabelMatcher, ExecutionJobStatus } from '@kici-dev/engine';
|
|
15
|
+
import type { ResourceRequest, ApproverClause, RunsOnAllPredicate, OnUnreachableMode, LabelMatcher, ExecutionJobStatus, InputsDescriptorMap } from '@kici-dev/engine';
|
|
16
16
|
/**
|
|
17
17
|
* Normalized approval config carried in the lock file. Mirrors the engine
|
|
18
18
|
* `LockApproval` type. Produced by the compiler from an SDK `approval` config.
|
|
@@ -28,7 +28,7 @@ export interface LockApproval {
|
|
|
28
28
|
readonly when: 'always' | 'drift';
|
|
29
29
|
}
|
|
30
30
|
/** Schema version - re-exported from engine as single source of truth */
|
|
31
|
-
export declare const SCHEMA_VERSION:
|
|
31
|
+
export declare const SCHEMA_VERSION: 29;
|
|
32
32
|
/**
|
|
33
33
|
* Source file reference with meaningful path.
|
|
34
34
|
* Format: file is relative path from git root, export uses hash syntax.
|
|
@@ -127,6 +127,8 @@ export interface LockDispatchTrigger {
|
|
|
127
127
|
readonly _type: 'dispatch';
|
|
128
128
|
readonly types: readonly string[];
|
|
129
129
|
readonly repos?: readonly LockBranchPattern[];
|
|
130
|
+
/** Typed dispatch-input descriptors (from `dispatch({ inputs })`). */
|
|
131
|
+
readonly inputs?: InputsDescriptorMap;
|
|
130
132
|
}
|
|
131
133
|
/**
|
|
132
134
|
* Create trigger in lock file.
|
|
@@ -273,6 +275,8 @@ export interface LockScheduleTrigger {
|
|
|
273
275
|
readonly cronExpression: string;
|
|
274
276
|
readonly timezone: string;
|
|
275
277
|
readonly description?: string;
|
|
278
|
+
/** Typed schedule-input descriptors (from `schedule({ inputs })`); defaults-only. */
|
|
279
|
+
readonly inputs?: InputsDescriptorMap;
|
|
276
280
|
}
|
|
277
281
|
/**
|
|
278
282
|
* Lifecycle trigger in lock file.
|
|
@@ -317,6 +321,8 @@ export interface LockRule {
|
|
|
317
321
|
* Minimal representation - agents load full step functions from source.
|
|
318
322
|
*/
|
|
319
323
|
export interface LockStep {
|
|
324
|
+
/** Discriminator for the step union; absent/`'sequential'` is an ordinary step. */
|
|
325
|
+
readonly kind?: 'sequential';
|
|
320
326
|
readonly name: string;
|
|
321
327
|
readonly hasOutputs: boolean;
|
|
322
328
|
/** When true, job proceeds even if this step fails. */
|
|
@@ -351,6 +357,24 @@ export interface LockStep {
|
|
|
351
357
|
/** Normalized approval gate; when set the step pauses for a human approval. */
|
|
352
358
|
readonly approval?: LockApproval;
|
|
353
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* A concurrent group of sequential steps in the lock file. Children run
|
|
362
|
+
* concurrently behind a join barrier; the group wrapper itself consumes no
|
|
363
|
+
* flat step index (its children carry the indices). No nesting is allowed.
|
|
364
|
+
*/
|
|
365
|
+
export interface LockParallelStep {
|
|
366
|
+
readonly kind: 'parallel';
|
|
367
|
+
readonly name: string;
|
|
368
|
+
/** Cancel in-flight siblings when the first child fails (default true). */
|
|
369
|
+
readonly failFast: boolean;
|
|
370
|
+
/** Maximum children running at once; queued children report `pending`. */
|
|
371
|
+
readonly maxParallel?: number;
|
|
372
|
+
readonly children: readonly LockStep[];
|
|
373
|
+
}
|
|
374
|
+
/** A lock-file entry in a job's `steps` array: an ordinary step or a parallel group. */
|
|
375
|
+
export type LockStepEntry = LockStep | LockParallelStep;
|
|
376
|
+
/** Type guard distinguishing a parallel group from an ordinary lock step. */
|
|
377
|
+
export declare function isLockParallelStep(entry: LockStepEntry): entry is LockParallelStep;
|
|
354
378
|
/**
|
|
355
379
|
* Inline expression value for pure dynamic functions.
|
|
356
380
|
* The compiler serializes pure functions as { _type: 'inline', expression: '(event) => ...' }
|
|
@@ -392,6 +416,8 @@ export interface LockJob {
|
|
|
392
416
|
readonly runsOnAll?: RunsOnAllPredicate;
|
|
393
417
|
/** Failure policy for unreachable durable hosts in a runsOnAll fan-out. */
|
|
394
418
|
readonly onUnreachable?: OnUnreachableMode;
|
|
419
|
+
/** Widen runsOnAll to declared-but-un-agented hosts (init-runner bring-up per fresh box). */
|
|
420
|
+
readonly includeUninitialized?: boolean;
|
|
395
421
|
/** Fan-out concurrency width (sliding window; 1 = serial). Applies to matrix and runsOnAll. */
|
|
396
422
|
readonly maxParallel?: number;
|
|
397
423
|
/** Halt the fan-out on first child failure, skipping the held remainder. Default false. */
|
|
@@ -399,7 +425,7 @@ export interface LockJob {
|
|
|
399
425
|
readonly needs: readonly (string | LockNeedsEntry | LockNeedsGroupEntry)[];
|
|
400
426
|
/** Group names this job depends on (populated from dynamicGroup refs). */
|
|
401
427
|
readonly dependsOnGroups?: readonly string[];
|
|
402
|
-
readonly steps: readonly
|
|
428
|
+
readonly steps: readonly LockStepEntry[];
|
|
403
429
|
readonly matrix?: LockMatrix;
|
|
404
430
|
readonly include?: readonly Record<string, string>[];
|
|
405
431
|
readonly exclude?: readonly Record<string, string>[];
|
|
@@ -414,10 +440,15 @@ export interface LockJob {
|
|
|
414
440
|
image: string;
|
|
415
441
|
env?: Record<string, string>;
|
|
416
442
|
};
|
|
417
|
-
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
443
|
+
/**
|
|
444
|
+
* Deployment environments in merge order. Each entry is a static name or inline
|
|
445
|
+
* expression (pure function); `dynamic` is set when it is a function resolved at
|
|
446
|
+
* two-phase eval. Later entries override earlier ones on name collisions.
|
|
447
|
+
*/
|
|
448
|
+
readonly environments?: ReadonlyArray<{
|
|
449
|
+
value: string | LockInlineValue;
|
|
450
|
+
dynamic: boolean;
|
|
451
|
+
}>;
|
|
421
452
|
/** Static environment variables or inline expression (pure function). */
|
|
422
453
|
readonly env?: Record<string, string> | LockInlineValue;
|
|
423
454
|
/** When true, env is dynamic (function) -- resolved at orchestrator two-phase eval or inline. */
|
package/dist/types.js
CHANGED
|
@@ -17,6 +17,10 @@ import { SCHEMA_VERSION as SCHEMA_VERSION$1 } from "@kici-dev/engine";
|
|
|
17
17
|
*/
|
|
18
18
|
/** Schema version - re-exported from engine as single source of truth */
|
|
19
19
|
const SCHEMA_VERSION = SCHEMA_VERSION$1;
|
|
20
|
+
/** Type guard distinguishing a parallel group from an ordinary lock step. */
|
|
21
|
+
function isLockParallelStep(entry) {
|
|
22
|
+
return entry.kind === "parallel";
|
|
23
|
+
}
|
|
20
24
|
/** Type guard for inline expression values */
|
|
21
25
|
function isLockInlineValue(value) {
|
|
22
26
|
return typeof value === "object" && value !== null && value._type === "inline";
|
|
@@ -30,6 +34,6 @@ function isLockDynamicJobFn(job) {
|
|
|
30
34
|
return job._type === "dynamic";
|
|
31
35
|
}
|
|
32
36
|
//#endregion
|
|
33
|
-
export { SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockStaticJob };
|
|
37
|
+
export { SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob };
|
|
34
38
|
|
|
35
39
|
//# sourceMappingURL=types.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kici-dev/compiler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "Compiler and CLI for KiCI workflows. Compiles `.kici/workflows/*.ts` to a `kici.lock.json` file consumed by the orchestrator and agents, and runs workflows locally or against a remote orchestrator.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ci",
|
|
@@ -30,9 +30,6 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"type": "module",
|
|
33
|
-
"bin": {
|
|
34
|
-
"kici": "./dist/cli.js"
|
|
35
|
-
},
|
|
36
33
|
"files": [
|
|
37
34
|
"dist",
|
|
38
35
|
"!dist/**/*.map",
|
|
@@ -63,11 +60,11 @@
|
|
|
63
60
|
"yaml": "^2.9.0",
|
|
64
61
|
"zod": "^4.4.3",
|
|
65
62
|
"zx": "^8.8.5",
|
|
66
|
-
"@kici-dev/core": "0.1.
|
|
67
|
-
"@kici-dev/engine": "0.1.
|
|
63
|
+
"@kici-dev/core": "0.1.24",
|
|
64
|
+
"@kici-dev/engine": "0.1.24"
|
|
68
65
|
},
|
|
69
66
|
"peerDependencies": {
|
|
70
|
-
"@kici-dev/sdk": "0.1.
|
|
67
|
+
"@kici-dev/sdk": "0.1.24"
|
|
71
68
|
},
|
|
72
69
|
"devDependencies": {
|
|
73
70
|
"@types/proper-lockfile": "^4.1.4"
|
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/compiler@0.1.
|
|
6
|
-
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fcompiler/0.1.
|
|
5
|
+
"name": "@kici-dev/compiler@0.1.24",
|
|
6
|
+
"documentNamespace": "https://kici.dev/sbom/%40kici-dev%2Fcompiler/0.1.24/5972016c-419a-4b37-a318-6beead684099",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-06-
|
|
8
|
+
"created": "2026-06-28T16:24:34Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: kici-sbom-generator"
|
|
11
11
|
]
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
{
|
|
485
485
|
"SPDXID": "SPDXRef-RootPackage",
|
|
486
486
|
"name": "@kici-dev/compiler",
|
|
487
|
-
"versionInfo": "0.1.
|
|
487
|
+
"versionInfo": "0.1.24",
|
|
488
488
|
"downloadLocation": "NOASSERTION",
|
|
489
489
|
"filesAnalyzed": false,
|
|
490
490
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -495,16 +495,16 @@
|
|
|
495
495
|
{
|
|
496
496
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
497
497
|
"referenceType": "purl",
|
|
498
|
-
"referenceLocator": "pkg:npm/%40kici-dev/compiler@0.1.
|
|
498
|
+
"referenceLocator": "pkg:npm/%40kici-dev/compiler@0.1.24"
|
|
499
499
|
}
|
|
500
500
|
],
|
|
501
501
|
"description": "Compiler and CLI for KiCI workflows. Compiles `.kici/workflows/*.ts` to a `kici.lock.json` file consumed by the orchestrator and agents, and runs workflows locally or against a remote orchestrator.",
|
|
502
502
|
"homepage": "https://kici.dev"
|
|
503
503
|
},
|
|
504
504
|
{
|
|
505
|
-
"SPDXID": "SPDXRef-Package--kici-dev-core-0.1.
|
|
505
|
+
"SPDXID": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
506
506
|
"name": "@kici-dev/core",
|
|
507
|
-
"versionInfo": "0.1.
|
|
507
|
+
"versionInfo": "0.1.24",
|
|
508
508
|
"downloadLocation": "NOASSERTION",
|
|
509
509
|
"filesAnalyzed": false,
|
|
510
510
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -515,16 +515,16 @@
|
|
|
515
515
|
{
|
|
516
516
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
517
517
|
"referenceType": "purl",
|
|
518
|
-
"referenceLocator": "pkg:npm/%40kici-dev/core@0.1.
|
|
518
|
+
"referenceLocator": "pkg:npm/%40kici-dev/core@0.1.24"
|
|
519
519
|
}
|
|
520
520
|
],
|
|
521
521
|
"description": "Light shared utilities for the KiCI stack (logging, errors, formatting, crypto, zx init, the TypeScript ESM loader hook). No server-side dependencies.",
|
|
522
522
|
"homepage": "https://kici.dev"
|
|
523
523
|
},
|
|
524
524
|
{
|
|
525
|
-
"SPDXID": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
525
|
+
"SPDXID": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
526
526
|
"name": "@kici-dev/engine",
|
|
527
|
-
"versionInfo": "0.1.
|
|
527
|
+
"versionInfo": "0.1.24",
|
|
528
528
|
"downloadLocation": "NOASSERTION",
|
|
529
529
|
"filesAnalyzed": false,
|
|
530
530
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -535,16 +535,16 @@
|
|
|
535
535
|
{
|
|
536
536
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
537
537
|
"referenceType": "purl",
|
|
538
|
-
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.
|
|
538
|
+
"referenceLocator": "pkg:npm/%40kici-dev/engine@0.1.24"
|
|
539
539
|
}
|
|
540
540
|
],
|
|
541
541
|
"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.",
|
|
542
542
|
"homepage": "https://kici.dev"
|
|
543
543
|
},
|
|
544
544
|
{
|
|
545
|
-
"SPDXID": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
545
|
+
"SPDXID": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
546
546
|
"name": "@kici-dev/sdk",
|
|
547
|
-
"versionInfo": "0.1.
|
|
547
|
+
"versionInfo": "0.1.24",
|
|
548
548
|
"downloadLocation": "NOASSERTION",
|
|
549
549
|
"filesAnalyzed": false,
|
|
550
550
|
"licenseConcluded": "NOASSERTION",
|
|
@@ -555,7 +555,7 @@
|
|
|
555
555
|
{
|
|
556
556
|
"referenceCategory": "PACKAGE-MANAGER",
|
|
557
557
|
"referenceType": "purl",
|
|
558
|
-
"referenceLocator": "pkg:npm/%40kici-dev/sdk@0.1.
|
|
558
|
+
"referenceLocator": "pkg:npm/%40kici-dev/sdk@0.1.24"
|
|
559
559
|
}
|
|
560
560
|
],
|
|
561
561
|
"description": "TypeScript SDK for defining KiCI workflows. Import into `.kici/workflows/*.ts` to declare workflows, jobs, steps, triggers, rules, and matrix configurations.",
|
|
@@ -3222,17 +3222,17 @@
|
|
|
3222
3222
|
},
|
|
3223
3223
|
{
|
|
3224
3224
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
3225
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3225
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3226
3226
|
"relationshipType": "DEPENDS_ON"
|
|
3227
3227
|
},
|
|
3228
3228
|
{
|
|
3229
3229
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
3230
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3230
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3231
3231
|
"relationshipType": "DEPENDS_ON"
|
|
3232
3232
|
},
|
|
3233
3233
|
{
|
|
3234
3234
|
"spdxElementId": "SPDXRef-RootPackage",
|
|
3235
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3235
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3236
3236
|
"relationshipType": "DEPENDS_ON"
|
|
3237
3237
|
},
|
|
3238
3238
|
{
|
|
@@ -3301,82 +3301,82 @@
|
|
|
3301
3301
|
"relationshipType": "DEPENDS_ON"
|
|
3302
3302
|
},
|
|
3303
3303
|
{
|
|
3304
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3304
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3305
3305
|
"relatedSpdxElement": "SPDXRef-Package-oxc-transform-0.135.0",
|
|
3306
3306
|
"relationshipType": "DEPENDS_ON"
|
|
3307
3307
|
},
|
|
3308
3308
|
{
|
|
3309
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3309
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3310
3310
|
"relatedSpdxElement": "SPDXRef-Package-picocolors-1.1.1",
|
|
3311
3311
|
"relationshipType": "DEPENDS_ON"
|
|
3312
3312
|
},
|
|
3313
3313
|
{
|
|
3314
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3314
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3315
3315
|
"relatedSpdxElement": "SPDXRef-Package-winston-daily-rotate-file-5.0.0",
|
|
3316
3316
|
"relationshipType": "DEPENDS_ON"
|
|
3317
3317
|
},
|
|
3318
3318
|
{
|
|
3319
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3319
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3320
3320
|
"relatedSpdxElement": "SPDXRef-Package-winston-3.19.0",
|
|
3321
3321
|
"relationshipType": "DEPENDS_ON"
|
|
3322
3322
|
},
|
|
3323
3323
|
{
|
|
3324
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3324
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3325
3325
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
3326
3326
|
"relationshipType": "DEPENDS_ON"
|
|
3327
3327
|
},
|
|
3328
3328
|
{
|
|
3329
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3329
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3330
3330
|
"relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
|
|
3331
3331
|
"relationshipType": "DEPENDS_ON"
|
|
3332
3332
|
},
|
|
3333
3333
|
{
|
|
3334
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3334
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3335
3335
|
"relatedSpdxElement": "SPDXRef-Package-jose-6.2.3",
|
|
3336
3336
|
"relationshipType": "DEPENDS_ON"
|
|
3337
3337
|
},
|
|
3338
3338
|
{
|
|
3339
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3339
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3340
3340
|
"relatedSpdxElement": "SPDXRef-Package-jsonpath-plus-10.4.0",
|
|
3341
3341
|
"relationshipType": "DEPENDS_ON"
|
|
3342
3342
|
},
|
|
3343
3343
|
{
|
|
3344
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3344
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3345
3345
|
"relatedSpdxElement": "SPDXRef-Package-picomatch-4.0.4",
|
|
3346
3346
|
"relationshipType": "DEPENDS_ON"
|
|
3347
3347
|
},
|
|
3348
3348
|
{
|
|
3349
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3349
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3350
3350
|
"relatedSpdxElement": "SPDXRef-Package-safe-regex-2.1.1",
|
|
3351
3351
|
"relationshipType": "DEPENDS_ON"
|
|
3352
3352
|
},
|
|
3353
3353
|
{
|
|
3354
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3354
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3355
3355
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
3356
3356
|
"relationshipType": "DEPENDS_ON"
|
|
3357
3357
|
},
|
|
3358
3358
|
{
|
|
3359
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3360
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.
|
|
3359
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3360
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-core-0.1.24",
|
|
3361
3361
|
"relationshipType": "DEPENDS_ON"
|
|
3362
3362
|
},
|
|
3363
3363
|
{
|
|
3364
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3365
|
-
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.
|
|
3364
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3365
|
+
"relatedSpdxElement": "SPDXRef-Package--kici-dev-engine-0.1.24",
|
|
3366
3366
|
"relationshipType": "DEPENDS_ON"
|
|
3367
3367
|
},
|
|
3368
3368
|
{
|
|
3369
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3369
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3370
3370
|
"relatedSpdxElement": "SPDXRef-Package-micromatch-4.0.8",
|
|
3371
3371
|
"relationshipType": "DEPENDS_ON"
|
|
3372
3372
|
},
|
|
3373
3373
|
{
|
|
3374
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3374
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3375
3375
|
"relatedSpdxElement": "SPDXRef-Package-zod-4.4.3",
|
|
3376
3376
|
"relationshipType": "DEPENDS_ON"
|
|
3377
3377
|
},
|
|
3378
3378
|
{
|
|
3379
|
-
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.
|
|
3379
|
+
"spdxElementId": "SPDXRef-Package--kici-dev-sdk-0.1.24",
|
|
3380
3380
|
"relatedSpdxElement": "SPDXRef-Package-zx-8.8.5",
|
|
3381
3381
|
"relationshipType": "DEPENDS_ON"
|
|
3382
3382
|
},
|