@kici-dev/compiler 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.
Files changed (55) hide show
  1. package/dist/cli.js +5 -4
  2. package/dist/commands/docs.js +2 -2
  3. package/dist/commands/feedback.d.ts +23 -1
  4. package/dist/commands/feedback.js +86 -9
  5. package/dist/commands/index.d.ts +2 -2
  6. package/dist/commands/index.js +2 -2
  7. package/dist/commands/local.d.ts +13 -5
  8. package/dist/commands/local.js +19 -8
  9. package/dist/commands/report/identity.js +1 -1
  10. package/dist/commands/run-banner.d.ts +1 -1
  11. package/dist/commands/run-banner.js +1 -1
  12. package/dist/commands/run-routed.js +3 -0
  13. package/dist/commands/run.js +5 -2
  14. package/dist/commands/runs/logs.js +3 -2
  15. package/dist/commands/verify-attestation.js +1 -1
  16. package/dist/llm-context/llms-architecture.txt +9 -7
  17. package/dist/llm-context/llms-cli-remote.txt +27 -12
  18. package/dist/llm-context/llms-cli.txt +6 -4
  19. package/dist/llm-context/llms-features-execution.txt +9 -9
  20. package/dist/llm-context/llms-features.txt +452 -133
  21. package/dist/llm-context/llms-full.txt +561 -197
  22. package/dist/llm-context/llms-getting-started.txt +34 -17
  23. package/dist/llm-context/llms-providers.txt +2 -2
  24. package/dist/llm-context/llms-sdk-runtime.txt +16 -2
  25. package/dist/llm-context/llms-sdk.txt +7 -12
  26. package/dist/llm-context/llms.txt +7 -6
  27. package/dist/local-plane/orchestrator-process.d.ts +4 -5
  28. package/dist/local-plane/orchestrator-process.js +5 -1
  29. package/dist/local-plane/paths.d.ts +1 -0
  30. package/dist/local-plane/paths.js +1 -0
  31. package/dist/local-plane/plane-log.d.ts +27 -0
  32. package/dist/local-plane/plane-log.js +39 -0
  33. package/dist/local-plane/plane-manager.js +2 -2
  34. package/dist/local-plane/plane-trigger.d.ts +28 -0
  35. package/dist/local-plane/plane-trigger.js +57 -2
  36. package/dist/local-plane/postgres.js +9 -6
  37. package/dist/local-plane/run-follow.js +2 -1
  38. package/dist/remote/output/streaming.d.ts +12 -0
  39. package/dist/remote/output/streaming.js +20 -1
  40. package/dist/remote/platform-client.d.ts +2 -0
  41. package/dist/templates/agents-md.d.ts +1 -1
  42. package/dist/templates/agents-md.js +9 -7
  43. package/dist/templates/package-json.d.ts +9 -7
  44. package/dist/templates/package-json.js +11 -9
  45. package/dist/templates/workflows/hello-world.ts +1 -1
  46. package/dist/templates/workflows/pr-checks.ts +2 -2
  47. package/dist/test-runner/job-executor.js +3 -2
  48. package/dist/types.d.ts +12 -35
  49. package/dist/types.js +2 -12
  50. package/dist/types.test-d.d.ts +2 -0
  51. package/dist/types.test-d.js +63 -0
  52. package/dist/workflows/hello-world.ts +1 -1
  53. package/dist/workflows/pr-checks.ts +2 -2
  54. package/package.json +15 -15
  55. package/sbom.spdx.json +1303 -1483
@@ -19,6 +19,25 @@ const COLOR_PALETTE = [
19
19
  pc.magenta,
20
20
  pc.cyan
21
21
  ];
22
+ /**
23
+ * The text a stored log line carries.
24
+ *
25
+ * The orchestrator stores every step log line as a JSON envelope —
26
+ * `{"ts":…,"level":"stdout","msg":"…","meta":{}}` — and the Platform relay
27
+ * returns those envelopes verbatim, so a run's log stream is the envelope
28
+ * stream. The dashboard unwraps `msg` before rendering; the terminal must too,
29
+ * or the developer watching `kici run remote` reads raw JSON. A line that is
30
+ * not an envelope (an orchestrator phase marker, a plain line from an older
31
+ * store) passes through unchanged.
32
+ */
33
+ function unwrapStoredLogLine(line) {
34
+ if (!line.startsWith("{")) return line;
35
+ try {
36
+ const parsed = JSON.parse(line);
37
+ if (typeof parsed === "object" && parsed !== null && typeof parsed.msg === "string") return parsed.msg;
38
+ } catch {}
39
+ return line;
40
+ }
22
41
  var StreamingFormatter = class {
23
42
  /** Color assignment per job name. */
24
43
  jobColors = /* @__PURE__ */ new Map();
@@ -119,6 +138,6 @@ var StreamingFormatter = class {
119
138
  }
120
139
  };
121
140
  //#endregion
122
- export { StreamingFormatter };
141
+ export { StreamingFormatter, unwrapStoredLogLine };
123
142
 
124
143
  //# sourceMappingURL=streaming.js.map
@@ -106,6 +106,8 @@ export interface PlatformRunStatusResponse {
106
106
  status: string;
107
107
  exitCode?: number | null;
108
108
  errorMessage?: string | null;
109
+ /** Absent or null from an orchestrator that does not report it. */
110
+ durationMs?: number | null;
109
111
  }>;
110
112
  done: boolean;
111
113
  }
@@ -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`, `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 } 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 matrix: { node: ['20', '22', '24'] },\n steps: [\n step('test', async ({ $, matrix }) => {\n await $`echo testing on node ${matrix!.node}`;\n await $`pnpm install`;\n await $`pnpm test`;\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 secrets.expose('DEPLOY_TOKEN');\n await $`./scripts/deploy.sh`;\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 push --local` | Execute a workflow locally (this machine as an ephemeral agent). |\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 <event> --local` to execute locally before pushing.\n";
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`, `rule`, `dynamicJob`, etc.\n- Bundled offline reference for coding agents: `kici docs llm` prints the\n curated link index (llms.txt format); `kici docs llm full` prints the\n complete markdown documentation bundle; `kici docs llm <topic>` prints one\n task bundle (`sdk`, `cli`, `patterns`, \u2026).\n- Online docs:\n - <https://docs.kici.dev/> \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 } 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 matrix: { node: ['20', '22', '24'] },\n steps: [\n step('test', async ({ $, matrix }) => {\n await $`echo testing on node ${matrix!.node}`;\n await $`pnpm install`;\n await $`pnpm test`;\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 secrets.expose('DEPLOY_TOKEN');\n await $`./scripts/deploy.sh`;\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 push --local` | Execute a workflow locally (this machine as an ephemeral agent). |\n| `pnpm kici docs llm` | Print the curated link index (llms.txt). |\n| `pnpm kici docs llm full` | Print the full LLM documentation bundle. |\n| `pnpm kici docs llm sdk` | Print one task bundle (also `cli`, `patterns`, \u2026). |\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 sdk` (or `kici docs llm full`) into the agent's context if\n it doesn't already have the authoring reference.\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 <event> --local` to execute locally before pushing.\n";
8
8
  //# sourceMappingURL=agents-md.d.ts.map
@@ -18,10 +18,11 @@ into a portable lock file, and executed by self-hosted agents.
18
18
  for the canonical signatures of \`workflow\`, \`job\`, \`step\`, \`pr\`,
19
19
  \`push\`, \`schedule\`, \`rule\`, \`dynamicJob\`, etc.
20
20
  - Bundled offline reference for coding agents: \`kici docs llm\` prints the
21
- full markdown documentation bundle to stdout. \`kici docs llm --index\`
22
- prints just the curated link index (llms.txt format).
21
+ curated link index (llms.txt format); \`kici docs llm full\` prints the
22
+ complete markdown documentation bundle; \`kici docs llm <topic>\` prints one
23
+ task bundle (\`sdk\`, \`cli\`, \`patterns\`, …).
23
24
  - Online docs:
24
- - <https://kici.dev/docs/> — published docs site.
25
+ - <https://docs.kici.dev/> — published docs site.
25
26
  - <https://kici.dev/llms.txt> — curated index for LLM consumers.
26
27
  - <https://kici.dev/llms-full.txt> — full markdown bundle.
27
28
  - Key pages: \`user/sdk-reference\`, \`user/workflow-patterns\`,
@@ -114,16 +115,17 @@ into a portable lock file, and executed by self-hosted agents.
114
115
  | \`pnpm kici compile --check\` | Validate workflow source without writing. |
115
116
  | \`pnpm kici preview pr:open --debug\` | Preview which workflows match an event. |
116
117
  | \`pnpm kici run push --local\` | Execute a workflow locally (this machine as an ephemeral agent). |
117
- | \`pnpm kici docs llm\` | Print the full LLM documentation bundle. |
118
- | \`pnpm kici docs llm --index\` | Print the curated link index. |
118
+ | \`pnpm kici docs llm\` | Print the curated link index (llms.txt). |
119
+ | \`pnpm kici docs llm full\` | Print the full LLM documentation bundle. |
120
+ | \`pnpm kici docs llm sdk\` | Print one task bundle (also \`cli\`, \`patterns\`, …). |
119
121
 
120
122
  If \`pnpm kici\` isn't in scripts, fall back to \`npx kici\`.
121
123
 
122
124
  ## Loop
123
125
 
124
126
  1. Read the SDK types from \`node_modules/@kici-dev/sdk/dist/index.d.ts\`.
125
- 2. Pipe \`kici docs llm\` into the agent's context if it doesn't already have
126
- the full bundle.
127
+ 2. Pipe \`kici docs llm sdk\` (or \`kici docs llm full\`) into the agent's context if
128
+ it doesn't already have the authoring reference.
127
129
  3. Edit a workflow under \`.kici/workflows/\`.
128
130
  4. Run \`kici compile --check\` (zero exit means valid).
129
131
  5. Run \`kici preview <event>\` to preview matching.
@@ -7,11 +7,14 @@
7
7
  * The compiler is invoked via npx (not installed as a dependency).
8
8
  */
9
9
  /**
10
- * The npm version range the scaffold pins `@kici-dev/sdk` to.
10
+ * The npm version spec the scaffold pins `@kici-dev/sdk` to.
11
11
  *
12
- * @param devMode - When true, a prerelease-compatible range (`>=0.0.1-0`) so
13
- * npm resolves Verdaccio's prerelease builds (e.g. 0.0.1-2856). Semver
14
- * `^0.0.1` does NOT match prereleases, causing 404s on Verdaccio.
12
+ * @param devMode - When true, the `latest` dist-tag, so npm resolves whatever
13
+ * build the dev registry (Verdaccio) currently publishes. Dev builds are
14
+ * prereleases such as `0.8.0-9726`, and no semver range reaches them: a
15
+ * prerelease only satisfies a comparator with the same major.minor.patch, so
16
+ * `^0.0.1` misses every one and `>=0.0.1-0` misses every one past 0.0.1.
17
+ * A dist-tag is resolved by name, never by range, so it follows the counter.
15
18
  */
16
19
  export declare function sdkDependencyRange(devMode?: boolean): string;
17
20
  /**
@@ -24,9 +27,8 @@ export declare const TYPESCRIPT_RANGE = "^6.0.3";
24
27
  /**
25
28
  * Generate package.json content for .kici/ directory
26
29
  *
27
- * @param devMode - When true, uses a prerelease-compatible version range
28
- * (`>=0.0.1-0`) so npm resolves Verdaccio's prerelease builds (e.g. 0.0.1-2856).
29
- * Semver `^0.0.1` does NOT match prereleases, causing 404s on Verdaccio.
30
+ * @param devMode - When true, pins the SDK to the `latest` dist-tag so npm
31
+ * resolves the dev registry's newest prerelease build (see sdkDependencyRange).
30
32
  * @returns JSON string with proper formatting (2-space indent, trailing newline)
31
33
  */
32
34
  export declare function generatePackageJson(devMode?: boolean): string;
@@ -1,15 +1,18 @@
1
1
  import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/templates/package-json.ts
3
- const sdkVersion = "0.7.0";
3
+ const sdkVersion = "0.9.0";
4
4
  /**
5
- * The npm version range the scaffold pins `@kici-dev/sdk` to.
5
+ * The npm version spec the scaffold pins `@kici-dev/sdk` to.
6
6
  *
7
- * @param devMode - When true, a prerelease-compatible range (`>=0.0.1-0`) so
8
- * npm resolves Verdaccio's prerelease builds (e.g. 0.0.1-2856). Semver
9
- * `^0.0.1` does NOT match prereleases, causing 404s on Verdaccio.
7
+ * @param devMode - When true, the `latest` dist-tag, so npm resolves whatever
8
+ * build the dev registry (Verdaccio) currently publishes. Dev builds are
9
+ * prereleases such as `0.8.0-9726`, and no semver range reaches them: a
10
+ * prerelease only satisfies a comparator with the same major.minor.patch, so
11
+ * `^0.0.1` misses every one and `>=0.0.1-0` misses every one past 0.0.1.
12
+ * A dist-tag is resolved by name, never by range, so it follows the counter.
10
13
  */
11
14
  function sdkDependencyRange(devMode = false) {
12
- return devMode ? ">=0.0.1-0" : `^${sdkVersion}`;
15
+ return devMode ? "latest" : `^${sdkVersion}`;
13
16
  }
14
17
  /**
15
18
  * The TypeScript range scaffolded into a `.kici` workspace. Pinned to the major
@@ -21,9 +24,8 @@ const TYPESCRIPT_RANGE = "^6.0.3";
21
24
  /**
22
25
  * Generate package.json content for .kici/ directory
23
26
  *
24
- * @param devMode - When true, uses a prerelease-compatible version range
25
- * (`>=0.0.1-0`) so npm resolves Verdaccio's prerelease builds (e.g. 0.0.1-2856).
26
- * Semver `^0.0.1` does NOT match prereleases, causing 404s on Verdaccio.
27
+ * @param devMode - When true, pins the SDK to the `latest` dist-tag so npm
28
+ * resolves the dev registry's newest prerelease build (see sdkDependencyRange).
27
29
  * @returns JSON string with proper formatting (2-space indent, trailing newline)
28
30
  */
29
31
  function generatePackageJson(devMode = false) {
@@ -1,5 +1,5 @@
1
1
  // Hello World -- minimal push workflow
2
- // Docs: https://kici.dev/docs/sdk-reference
2
+ // Docs: https://docs.kici.dev/user/sdk-reference/
3
3
 
4
4
  import { workflow, job, step, push } from '@kici-dev/sdk';
5
5
 
@@ -1,6 +1,6 @@
1
1
  // PR Checks -- workflow with rules, dependencies, and multiple jobs
2
- // Docs: https://kici.dev/docs/sdk-reference
3
- // Patterns: https://kici.dev/docs/workflow-patterns
2
+ // Docs: https://docs.kici.dev/user/sdk-reference/
3
+ // Patterns: https://docs.kici.dev/user/workflow-patterns/
4
4
 
5
5
  import { workflow, job, step, pr, rule, skip, isEventType } from '@kici-dev/sdk';
6
6
 
@@ -12,13 +12,14 @@ import { setJobOutputsMap, setStepOutputsMap, setStepRefMap } from "@kici-dev/sd
12
12
  /**
13
13
  * Resolve SDK output setter functions from the workflow's module instance.
14
14
  * This ensures the output maps are set on the same SDK module that the
15
- * workflow code uses for .result proxy resolution and ctx.outputsOf().
15
+ * workflow code uses for .result proxy resolution and ctx.outputsOf(). The
16
+ * setters live only on the `@kici-dev/sdk/internal` subpath.
16
17
  *
17
18
  * Falls back to the compiler's own SDK import if dynamic resolution fails.
18
19
  */
19
20
  async function resolveSdkSetters(kiciDir) {
20
21
  if (kiciDir) try {
21
- const sdkPath = path.join(kiciDir, "node_modules", "@kici-dev", "sdk", "dist", "index.js");
22
+ const sdkPath = path.join(kiciDir, "node_modules", "@kici-dev", "sdk", "dist", "internal.js");
22
23
  const sdk = await import(pathToFileURL(sdkPath).href);
23
24
  return {
24
25
  setStepOutputsMap: sdk.setStepOutputsMap,
package/dist/types.d.ts CHANGED
@@ -8,7 +8,7 @@
8
8
  * v6 replaces job-level contexts with environment/env/concurrencyGroup.
9
9
  * v7 adds hook flags, step rules, gracePeriod, and workflow concurrency config.
10
10
  * v8 adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
11
- * v11 adds LockInlineValue type for pure function inline evaluation.
11
+ * v11 added an inline-expression value shape for dynamic fields, which is no longer parsed.
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
  */
@@ -394,29 +394,6 @@ export interface LockParallelStep {
394
394
  export type LockStepEntry = LockStep | LockParallelStep;
395
395
  /** Type guard distinguishing a parallel group from an ordinary lock step. */
396
396
  export declare function isLockParallelStep(entry: LockStepEntry): entry is LockParallelStep;
397
- /**
398
- * Serialized inline expression for a dynamic env/context/concurrencyGroup
399
- * field, shaped as `{ _type: 'inline', expression: '(event) => ...' }`
400
- * alongside the existing 'static' and 'dynamic' discriminants.
401
- *
402
- * @deprecated Schema v11 inline expressions are no longer evaluated in the
403
- * orchestrator. Dynamic env/context/concurrencyGroup fields are resolved on the
404
- * eval agent's init-runner. The compiler no longer emits this type; readers keep
405
- * recognizing it only to defer an old lock's field to the init round. Removed at
406
- * the next major (v1.0.0).
407
- */
408
- export interface LockInlineValue {
409
- readonly _type: 'inline';
410
- readonly expression: string;
411
- }
412
- /**
413
- * Type guard for inline expression values.
414
- *
415
- * @deprecated See {@link LockInlineValue}. Retained only so a reader can
416
- * recognize an old lock's inline field and defer it to the eval agent's
417
- * init-runner. Removed at the next major (v1.0.0).
418
- */
419
- export declare function isLockInlineValue(value: unknown): value is LockInlineValue;
420
397
  /**
421
398
  * Static job in lock file.
422
399
  * Contains all orchestrator-readable information for scheduling.
@@ -500,21 +477,21 @@ export interface LockJob {
500
477
  };
501
478
  };
502
479
  /**
503
- * Bound contexts in merge order. Each entry is a static name or inline
504
- * expression (pure function); `dynamic` is set when it is a function resolved at
505
- * two-phase eval. Later entries override earlier ones on name collisions.
480
+ * Bound contexts in merge order. Each entry is a static name; `dynamic` is set
481
+ * when it is a function resolved on the eval agent's init-runner. Later entries
482
+ * override earlier ones on name collisions.
506
483
  */
507
484
  readonly contexts?: ReadonlyArray<{
508
- value: string | LockInlineValue;
485
+ value: string;
509
486
  dynamic: boolean;
510
487
  }>;
511
- /** Static environment variables or inline expression (pure function). */
512
- readonly env?: Record<string, string> | LockInlineValue;
513
- /** When true, env is dynamic (function) -- resolved at orchestrator two-phase eval or inline. */
488
+ /** Static environment variables. */
489
+ readonly env?: Record<string, string>;
490
+ /** When true, env is dynamic (function) -- resolved on the eval agent's init-runner. */
514
491
  readonly dynamicEnv?: boolean;
515
- /** Concurrency group name (static string) or inline expression (pure function). */
516
- readonly concurrencyGroup?: string | LockInlineValue;
517
- /** When true, concurrencyGroup is dynamic (function) -- resolved at orchestrator two-phase eval or inline. */
492
+ /** Concurrency group name (static string). */
493
+ readonly concurrencyGroup?: string;
494
+ /** When true, concurrencyGroup is dynamic (function) -- resolved on the eval agent's init-runner. */
518
495
  readonly dynamicConcurrencyGroup?: boolean;
519
496
  /** Whether this job has an onCancel hook. */
520
497
  readonly hasOnCancel?: boolean;
@@ -658,7 +635,7 @@ export interface LockWorkflow {
658
635
  * v6 replaces job-level contexts with environment/env/concurrencyGroup.
659
636
  * v7 adds hook flags, step rules, gracePeriod, and workflow concurrency config.
660
637
  * v8 adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
661
- * v11 adds LockInlineValue type for pure function inline evaluation.
638
+ * v11 added an inline-expression value shape for dynamic fields, which is no longer parsed.
662
639
  * v13 adds job-level and workflow-level timeout.
663
640
  * v34 adds LockWorkflow.hasFilter (workflow-level pre-dispatch filter predicate).
664
641
  */
package/dist/types.js CHANGED
@@ -11,7 +11,7 @@ import { BREAKING_FLOOR as BREAKING_FLOOR$1, SCHEMA_VERSION as SCHEMA_VERSION$1
11
11
  * v6 replaces job-level contexts with environment/env/concurrencyGroup.
12
12
  * v7 adds hook flags, step rules, gracePeriod, and workflow concurrency config.
13
13
  * v8 adds runsOn polymorphic type (string | string[] | selector) and excludeLabels.
14
- * v11 adds LockInlineValue type for pure function inline evaluation.
14
+ * v11 added an inline-expression value shape for dynamic fields, which is no longer parsed.
15
15
  * v15 adds per-job init config(s).
16
16
  * v17 widens per-job init to typed presets ('mise' / { mise }) and 'auto' detection.
17
17
  */
@@ -23,16 +23,6 @@ const BREAKING_FLOOR = BREAKING_FLOOR$1;
23
23
  function isLockParallelStep(entry) {
24
24
  return entry.kind === "parallel";
25
25
  }
26
- /**
27
- * Type guard for inline expression values.
28
- *
29
- * @deprecated See {@link LockInlineValue}. Retained only so a reader can
30
- * recognize an old lock's inline field and defer it to the eval agent's
31
- * init-runner. Removed at the next major (v1.0.0).
32
- */
33
- function isLockInlineValue(value) {
34
- return typeof value === "object" && value !== null && value._type === "inline";
35
- }
36
26
  /** Type guard for static jobs */
37
27
  function isLockStaticJob(job) {
38
28
  return job._type === "static";
@@ -42,6 +32,6 @@ function isLockDynamicJobFn(job) {
42
32
  return job._type === "dynamic";
43
33
  }
44
34
  //#endregion
45
- export { BREAKING_FLOOR, SCHEMA_VERSION, isLockDynamicJobFn, isLockInlineValue, isLockParallelStep, isLockStaticJob };
35
+ export { BREAKING_FLOOR, SCHEMA_VERSION, isLockDynamicJobFn, isLockParallelStep, isLockStaticJob };
46
36
 
47
37
  //# sourceMappingURL=types.js.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.test-d.d.ts.map
@@ -0,0 +1,63 @@
1
+ import "./rolldown-runtime-ClRpJifh.js";
2
+ import { describe, expectTypeOf, it } from "vitest";
3
+ //#region src/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
@@ -1,5 +1,5 @@
1
1
  // Hello World -- minimal push workflow
2
- // Docs: https://kici.dev/docs/sdk-reference
2
+ // Docs: https://docs.kici.dev/user/sdk-reference/
3
3
 
4
4
  import { workflow, job, step, push } from '@kici-dev/sdk';
5
5
 
@@ -1,6 +1,6 @@
1
1
  // PR Checks -- workflow with rules, dependencies, and multiple jobs
2
- // Docs: https://kici.dev/docs/sdk-reference
3
- // Patterns: https://kici.dev/docs/workflow-patterns
2
+ // Docs: https://docs.kici.dev/user/sdk-reference/
3
+ // Patterns: https://docs.kici.dev/user/workflow-patterns/
4
4
 
5
5
  import { workflow, job, step, pr, rule, skip, isEventType } from '@kici-dev/sdk';
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kici-dev/compiler",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
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",
@@ -45,38 +45,38 @@
45
45
  "./cli": "./dist/cli.js"
46
46
  },
47
47
  "dependencies": {
48
- "@inquirer/prompts": "^8.7.0",
48
+ "@inquirer/prompts": "^8.7.2",
49
49
  "archiver": "^8.0.0",
50
50
  "chokidar": "^5.0.0",
51
51
  "commander": "^15.0.0",
52
52
  "embedded-postgres": "18.4.0-beta.17",
53
53
  "fast-glob": "^3.3.3",
54
- "open": "11.0.0",
54
+ "open": "11.0.4",
55
55
  "picocolors": "^1.1.1",
56
56
  "picomatch": "^4.0.7",
57
57
  "tar": "^7.5.22",
58
- "typescript": "^6.0.3",
59
58
  "ws": "^8.21.3",
60
- "wsl-utils": "^0.3.0",
61
- "yaml": "^2.9.0",
62
- "zod": "^4.4.3",
59
+ "wsl-utils": "^1.0.0",
60
+ "yaml": "^2.9.1",
61
+ "zod": "^4.6.5",
63
62
  "zx": "^8.8.5",
64
- "@kici-dev/agent": "0.7.0",
65
- "@kici-dev/orchestrator": "0.7.0",
66
- "@kici-dev/core": "0.7.0",
67
- "@kici-dev/engine": "0.7.0"
63
+ "@kici-dev/agent": "0.9.0",
64
+ "@kici-dev/orchestrator": "0.9.0",
65
+ "@kici-dev/core": "0.9.0",
66
+ "@kici-dev/engine": "0.9.0"
68
67
  },
69
68
  "devDependencies": {
70
69
  "@types/archiver": "^8.0.0",
71
- "jszip": "^3.10.1"
70
+ "jszip": "^3.10.2",
71
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
72
72
  },
73
73
  "peerDependencies": {
74
- "@kici-dev/sdk": "0.7.0"
74
+ "@kici-dev/sdk": "0.9.0"
75
75
  },
76
76
  "scripts": {
77
- "build": "node ../../scripts/build-ts.mjs && tsgo --emitDeclarationOnly",
77
+ "build": "node ../../scripts/build-ts.mjs && tsc --emitDeclarationOnly",
78
78
  "postbuild": "zx hack/postbuild.mjs",
79
- "typecheck": "tsgo --noEmit",
79
+ "typecheck": "tsc --noEmit",
80
80
  "test": "vitest run",
81
81
  "test:watch": "vitest"
82
82
  }