@kici-dev/compiler 0.1.23 → 0.1.25

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 (137) hide show
  1. package/dist/auth/headless-detect.js +1 -1
  2. package/dist/cli-banner.js +1 -1
  3. package/dist/cli.d.ts +18 -0
  4. package/dist/cli.js +71 -10
  5. package/dist/commands/approve.js +2 -2
  6. package/dist/commands/check-mode.js +1 -1
  7. package/dist/commands/compile.js +1 -1
  8. package/dist/commands/diagnostics.js +1 -1
  9. package/dist/commands/docs.js +1 -1
  10. package/dist/commands/drain-worker.js +1 -1
  11. package/dist/commands/endpoints.js +1 -1
  12. package/dist/commands/fixture.js +2 -2
  13. package/dist/commands/held-run-client.d.ts +1 -1
  14. package/dist/commands/held-run-client.js +1 -1
  15. package/dist/commands/hook.js +1 -1
  16. package/dist/commands/index.d.ts +5 -3
  17. package/dist/commands/index.js +5 -4
  18. package/dist/commands/init.js +3 -3
  19. package/dist/commands/login.js +1 -1
  20. package/dist/commands/logout.js +1 -1
  21. package/dist/commands/orchestrators.js +1 -1
  22. package/dist/commands/org.js +1 -1
  23. package/dist/commands/pat.d.ts +27 -0
  24. package/dist/commands/pat.js +76 -0
  25. package/dist/commands/preview.d.ts +88 -0
  26. package/dist/commands/{test.js → preview.js} +16 -15
  27. package/dist/commands/reject.js +2 -2
  28. package/dist/commands/run-hold-watch.d.ts +10 -1
  29. package/dist/commands/run-hold-watch.js +13 -12
  30. package/dist/commands/run.d.ts +20 -1
  31. package/dist/commands/run.js +62 -12
  32. package/dist/commands/runs/cancel.js +1 -1
  33. package/dist/commands/runs/list.js +1 -1
  34. package/dist/commands/runs/logs.js +1 -1
  35. package/dist/commands/runs/rerun.js +1 -1
  36. package/dist/commands/runs/show.js +1 -1
  37. package/dist/commands/secrets-list.js +1 -1
  38. package/dist/commands/types.js +1 -1
  39. package/dist/commands/verify-attestation.d.ts +4 -1
  40. package/dist/commands/verify-attestation.js +34 -12
  41. package/dist/commands/watch.js +1 -1
  42. package/dist/commands/workflows.js +1 -1
  43. package/dist/errors/capability-gap.js +1 -1
  44. package/dist/errors/formatter.js +1 -1
  45. package/dist/errors/index.js +1 -1
  46. package/dist/execution/executor.d.ts +5 -6
  47. package/dist/execution/executor.js +6 -7
  48. package/dist/execution/index.js +1 -1
  49. package/dist/execution/sdk-alias.d.ts +4 -14
  50. package/dist/execution/sdk-alias.js +6 -45
  51. package/dist/execution/ts-loader.js +1 -1
  52. package/dist/fixtures/compiler.js +1 -1
  53. package/dist/fixtures/defaults/index.js +1 -1
  54. package/dist/fixtures/describe-event.d.ts +0 -4
  55. package/dist/fixtures/describe-event.js +35 -5
  56. package/dist/fixtures/picker.js +1 -1
  57. package/dist/format.js +1 -1
  58. package/dist/generators/secrets-dts.js +3 -1
  59. package/dist/hooks/detector.js +1 -1
  60. package/dist/hooks/index.js +1 -1
  61. package/dist/hooks/installer.js +1 -1
  62. package/dist/hooks/templates.js +1 -1
  63. package/dist/index.d.ts +2 -2
  64. package/dist/index.js +3 -3
  65. package/dist/llm-context/llms-architecture.txt +4 -4
  66. package/dist/llm-context/llms-cli.txt +346 -33
  67. package/dist/llm-context/llms-features.txt +128 -21
  68. package/dist/llm-context/llms-full.txt +610 -71
  69. package/dist/llm-context/llms-getting-started.txt +7 -7
  70. package/dist/llm-context/llms-sdk.txt +125 -6
  71. package/dist/llm-context/llms.txt +7 -5
  72. package/dist/local-executor/dag-scheduler.js +1 -1
  73. package/dist/local-executor/index.js +3 -2
  74. package/dist/local-executor/job-runner.js +4 -4
  75. package/dist/local-executor/materializer.js +1 -1
  76. package/dist/local-executor/output-streamer.js +1 -1
  77. package/dist/local-executor/payload-generator.js +1 -1
  78. package/dist/local-executor/picker.js +1 -1
  79. package/dist/local-executor/runs-on-display.js +1 -1
  80. package/dist/local-executor/secret-loader.js +1 -1
  81. package/dist/local-executor/to-event-payload.js +1 -1
  82. package/dist/local-executor/types.js +1 -1
  83. package/dist/local-executor/workflow-lock.js +0 -0
  84. package/dist/lockfile/generator.d.ts +10 -2
  85. package/dist/lockfile/generator.js +107 -53
  86. package/dist/lockfile/hash-files.js +1 -1
  87. package/dist/lockfile/hasher.js +1 -1
  88. package/dist/lockfile/index.js +1 -1
  89. package/dist/lockfile/purity-analyzer.js +3 -3
  90. package/dist/postinstall.js +1 -1
  91. package/dist/provenance-trust-root.js +1 -1
  92. package/dist/remote/config.js +1 -1
  93. package/dist/remote/dashboard-client.js +1 -1
  94. package/dist/remote/encryption.js +1 -1
  95. package/dist/remote/history.d.ts +1 -1
  96. package/dist/remote/history.js +2 -2
  97. package/dist/remote/local-repo-identity.d.ts +32 -0
  98. package/dist/remote/local-repo-identity.js +74 -0
  99. package/dist/remote/oauth.js +1 -1
  100. package/dist/remote/oidc-discovery.js +1 -1
  101. package/dist/remote/output/json.js +1 -1
  102. package/dist/remote/output/junit.js +1 -1
  103. package/dist/remote/output/streaming.js +1 -1
  104. package/dist/remote/output/summary.js +1 -1
  105. package/dist/remote/platform-client.d.ts +2 -0
  106. package/dist/remote/platform-client.js +1 -1
  107. package/dist/remote/prod-defaults.d.ts +9 -1
  108. package/dist/remote/prod-defaults.js +11 -3
  109. package/dist/remote/render.js +1 -1
  110. package/dist/remote/secret-upload.js +1 -1
  111. package/dist/remote/uploader.js +4 -4
  112. package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
  113. package/dist/templates/agents-md.d.ts +1 -1
  114. package/dist/templates/agents-md.js +3 -3
  115. package/dist/templates/index.js +1 -1
  116. package/dist/templates/package-json.js +2 -2
  117. package/dist/templates/tsconfig-json.js +1 -1
  118. package/dist/templates/workflows/hello-world.js +1 -1
  119. package/dist/templates/workflows/pr-checks.js +1 -1
  120. package/dist/test-runner/dry-run.js +1 -1
  121. package/dist/test-runner/event-types.js +1 -1
  122. package/dist/test-runner/git-detector.js +1 -1
  123. package/dist/test-runner/index.js +1 -1
  124. package/dist/test-runner/job-executor.js +1 -1
  125. package/dist/test-runner/output-formatter.js +1 -1
  126. package/dist/test-runner/payload-builder.js +1 -1
  127. package/dist/test-runner/rule-evaluator.js +1 -1
  128. package/dist/test-runner/secrets-file.js +1 -1
  129. package/dist/test-runner/step-context.d.ts +1 -1
  130. package/dist/test-runner/step-context.js +3 -2
  131. package/dist/types.d.ts +33 -6
  132. package/dist/types.js +6 -2
  133. package/dist/validation/index.js +1 -1
  134. package/dist/validation/validator.js +1 -1
  135. package/package.json +4 -7
  136. package/sbom.spdx.json +35 -35
  137. package/dist/commands/held-run-resolve.js +0 -53
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import path from "node:path";
3
3
  import { readFileSync } from "node:fs";
4
4
  import fg from "fast-glob";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { normalizeLineEndings, sha256 } from "@kici-dev/core";
3
3
  //#region src/lockfile/hasher.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { COMPILE_SCHEMA_VERSION, computeContentHash } from "./hasher.js";
3
3
  import { computeLockfileHash, detectGitRoot, generateLockFile, serializeLockFile } from "./generator.js";
4
4
  export { COMPILE_SCHEMA_VERSION, computeContentHash, computeLockfileHash, detectGitRoot, generateLockFile, serializeLockFile };
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import ts from "typescript";
3
3
  //#region src/lockfile/purity-analyzer.ts
4
4
  /**
@@ -16,7 +16,7 @@ import ts from "typescript";
16
16
  * Safe globals that pure functions are allowed to reference.
17
17
  * These are deterministic, side-effect-free built-ins.
18
18
  */
19
- const SAFE_GLOBALS = new Set([
19
+ const SAFE_GLOBALS = /* @__PURE__ */ new Set([
20
20
  "undefined",
21
21
  "null",
22
22
  "true",
@@ -42,7 +42,7 @@ const SAFE_GLOBALS = new Set([
42
42
  /**
43
43
  * Assignment operators that indicate mutation.
44
44
  */
45
- const ASSIGNMENT_OPERATORS = new Set([
45
+ const ASSIGNMENT_OPERATORS = /* @__PURE__ */ new Set([
46
46
  ts.SyntaxKind.EqualsToken,
47
47
  ts.SyntaxKind.PlusEqualsToken,
48
48
  ts.SyntaxKind.MinusEqualsToken,
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-BTugEXQM.js";
2
+ import "./rolldown-runtime-ClRpJifh.js";
3
3
  import path from "node:path";
4
4
  import { readFile } from "node:fs/promises";
5
5
  import { spawn } from "node:child_process";
@@ -1,4 +1,4 @@
1
- import "./chunk-BTugEXQM.js";
1
+ import "./rolldown-runtime-ClRpJifh.js";
2
2
  import { readFile } from "node:fs/promises";
3
3
  //#region src/provenance-trust-root.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import path from "node:path";
3
3
  import fs from "node:fs/promises";
4
4
  import os from "node:os";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { loadGlobalConfig } from "./config.js";
3
3
  import { dashboardRunDetailApiResponseSchema, dashboardStepLogsApiResponseSchema, diagnosticsInfrastructureResponseSchema, diagnosticsSummaryResponseSchema, registrationItemSchema, runListItemSchema, runListResponseSchema } from "@kici-dev/engine";
4
4
  import { z } from "zod";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import fs from "node:fs/promises";
3
3
  import { deriveSharedSecret } from "@kici-dev/core";
4
4
  import crypto from "node:crypto";
@@ -2,7 +2,7 @@
2
2
  * Local run history manager.
3
3
  *
4
4
  * Persists test run history in ~/.kici/history/runs.json so developers
5
- * can review past runs (kici test --history) and inspect specific runs
5
+ * can review past runs (kici run remote --history) and inspect specific runs
6
6
  * (kici status <run-id>).
7
7
  */
8
8
  /** Status of a test run */
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { formatRelativeTime } from "../format.js";
3
3
  import { getConfigDir } from "./config.js";
4
4
  import path from "node:path";
@@ -11,7 +11,7 @@ import picomatch from "picomatch";
11
11
  * Local run history manager.
12
12
  *
13
13
  * Persists test run history in ~/.kici/history/runs.json so developers
14
- * can review past runs (kici test --history) and inspect specific runs
14
+ * can review past runs (kici run remote --history) and inspect specific runs
15
15
  * (kici status <run-id>).
16
16
  */
17
17
  /** Maximum number of entries to keep in history */
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ /** Git hosts whose origin URL we can turn into a real `owner/repo` + web link. */
3
+ export declare const RecognizedProvider: z.ZodEnum<{
4
+ github: "github";
5
+ gitlab: "gitlab";
6
+ bitbucket: "bitbucket";
7
+ }>;
8
+ export type RecognizedProvider = z.infer<typeof RecognizedProvider>;
9
+ /** The literal provider value stamped when no recognized git origin exists. */
10
+ export declare const LOCAL_PROVIDER = "local";
11
+ /**
12
+ * Parse a git remote URL into `{ provider, owner/repo }` for a recognized host.
13
+ * Handles scp-style ssh (`git@host:owner/repo.git`), `ssh://`, and `https://`
14
+ * forms; strips a trailing `.git`. Returns null for any unrecognized host or
15
+ * unparseable input.
16
+ */
17
+ export declare function parseGitOrigin(url: string): {
18
+ provider: RecognizedProvider;
19
+ repoIdentifier: string;
20
+ } | null;
21
+ /** Read the `origin` remote URL of the working tree at `repoRoot`, or null. */
22
+ export declare function detectGitOrigin(repoRoot: string): string | null;
23
+ /**
24
+ * Build the repo identity stamped on a `kici run remote` run. A recognized git
25
+ * origin yields the real `owner/repo` + provider so the dashboard can link to
26
+ * it; otherwise a synthetic `local/<basename>` identity with provider `local`.
27
+ */
28
+ export declare function buildLocalRepoIdentity(repoRoot: string): {
29
+ repoIdentifier: string;
30
+ provider: string;
31
+ };
32
+ //# sourceMappingURL=local-repo-identity.d.ts.map
@@ -0,0 +1,74 @@
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
+ import path from "node:path";
3
+ import { execSync } from "node:child_process";
4
+ import { z } from "zod";
5
+ //#region src/remote/local-repo-identity.ts
6
+ /** Git hosts whose origin URL we can turn into a real `owner/repo` + web link. */
7
+ const RecognizedProvider = z.enum([
8
+ "github",
9
+ "gitlab",
10
+ "bitbucket"
11
+ ]);
12
+ /** Host → provider map. The keys are the canonical public hostnames. */
13
+ const HOST_PROVIDER = {
14
+ "github.com": "github",
15
+ "gitlab.com": "gitlab",
16
+ "bitbucket.org": "bitbucket"
17
+ };
18
+ /** The literal provider value stamped when no recognized git origin exists. */
19
+ const LOCAL_PROVIDER = "local";
20
+ /**
21
+ * Parse a git remote URL into `{ provider, owner/repo }` for a recognized host.
22
+ * Handles scp-style ssh (`git@host:owner/repo.git`), `ssh://`, and `https://`
23
+ * forms; strips a trailing `.git`. Returns null for any unrecognized host or
24
+ * unparseable input.
25
+ */
26
+ function parseGitOrigin(url) {
27
+ const trimmed = url.trim();
28
+ const scp = /^[^@]+@([^:]+):(.+?)(?:\.git)?$/.exec(trimmed);
29
+ const urlStyle = /^[a-z]+:\/\/(?:[^@/]+@)?([^/]+)\/(.+?)(?:\.git)?$/.exec(trimmed);
30
+ const match = scp ?? urlStyle;
31
+ if (!match) return null;
32
+ const provider = HOST_PROVIDER[match[1].toLowerCase()];
33
+ if (!provider) return null;
34
+ const repoIdentifier = match[2].replace(/^\/+|\/+$/g, "");
35
+ if (!repoIdentifier.includes("/")) return null;
36
+ return {
37
+ provider,
38
+ repoIdentifier
39
+ };
40
+ }
41
+ /** Read the `origin` remote URL of the working tree at `repoRoot`, or null. */
42
+ function detectGitOrigin(repoRoot) {
43
+ try {
44
+ return execSync("git remote get-url origin", {
45
+ cwd: repoRoot,
46
+ encoding: "utf-8",
47
+ stdio: [
48
+ "pipe",
49
+ "pipe",
50
+ "pipe"
51
+ ]
52
+ }).trim();
53
+ } catch {
54
+ return null;
55
+ }
56
+ }
57
+ /**
58
+ * Build the repo identity stamped on a `kici run remote` run. A recognized git
59
+ * origin yields the real `owner/repo` + provider so the dashboard can link to
60
+ * it; otherwise a synthetic `local/<basename>` identity with provider `local`.
61
+ */
62
+ function buildLocalRepoIdentity(repoRoot) {
63
+ const origin = detectGitOrigin(repoRoot);
64
+ const parsed = origin ? parseGitOrigin(origin) : null;
65
+ if (parsed) return parsed;
66
+ return {
67
+ repoIdentifier: `local/${path.basename(repoRoot)}`,
68
+ provider: LOCAL_PROVIDER
69
+ };
70
+ }
71
+ //#endregion
72
+ export { LOCAL_PROVIDER, RecognizedProvider, buildLocalRepoIdentity, detectGitOrigin, parseGitOrigin };
73
+
74
+ //# sourceMappingURL=local-repo-identity.js.map
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { discoverOidcEndpoints } from "./oidc-discovery.js";
3
3
  import pc from "picocolors";
4
4
  import { toErrorMessage } from "@kici-dev/core";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { toErrorMessage } from "@kici-dev/core";
3
3
  //#region src/remote/oidc-discovery.ts
4
4
  const cache = /* @__PURE__ */ new Map();
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/remote/output/json.ts
3
3
  /**
4
4
  * Format run results as structured JSON with 2-space indentation.
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/remote/output/junit.ts
3
3
  /**
4
4
  * Format run results as JUnit XML following the standard schema.
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import pc from "picocolors";
3
3
  import { formatDuration } from "@kici-dev/core";
4
4
  //#region src/remote/output/streaming.ts
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import pc from "picocolors";
3
3
  import { formatDuration } from "@kici-dev/core";
4
4
  //#region src/remote/output/summary.ts
@@ -94,6 +94,8 @@ export interface PlatformTriggerResponse {
94
94
  status: 'accepted' | 'rejected';
95
95
  reason?: string;
96
96
  jobIds?: string[];
97
+ /** User-visible warnings on acceptance (e.g. skipped non-test bound environments). */
98
+ warnings?: string[];
97
99
  }
98
100
  export interface PlatformRunStatusResponse {
99
101
  runId: string;
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { toErrorMessage } from "@kici-dev/core";
3
3
  //#region src/remote/platform-client.ts
4
4
  /**
@@ -3,7 +3,7 @@
3
3
  * env var (or the `--platform-endpoint` flag) is unset, login resolves
4
4
  * these so a developer targeting the hosted KiCI Platform authenticates
5
5
  * with no setup. Setting the env var overrides the default — staging E2E
6
- * and self-hosted Platforms depend on that override path.
6
+ * and other KiCI environments depend on that override path.
7
7
  *
8
8
  * Resolution is login-local: these are read into locals in `oauthLogin`,
9
9
  * never written back into `process.env`, so the orchestrator's separate
@@ -15,4 +15,12 @@ export declare const PROD_PLATFORM_URL = "https://api.kici.dev";
15
15
  export declare const PROD_OIDC_ISSUER = "https://auth.kici.dev/realms/kici-internal";
16
16
  /** Public OIDC client id registered for the `kici` CLI. */
17
17
  export declare const PROD_OIDC_CLIENT_ID = "kici-cli";
18
+ /**
19
+ * Provenance trust root for `kici verify-attestation` when `--trust-root` is
20
+ * omitted: the hosted KiCI Platform's provenance issuer. The verifier appends
21
+ * `/.well-known/openid-configuration` and pins the token issuer to it. Pass
22
+ * `--trust-root` to verify against a different environment (e.g. staging) or an
23
+ * offline `{ issuer, jwks }` file.
24
+ */
25
+ export declare const PROD_PROVENANCE_ISSUER = "https://api.kici.dev";
18
26
  //# sourceMappingURL=prod-defaults.d.ts.map
@@ -1,11 +1,11 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/remote/prod-defaults.ts
3
3
  /**
4
4
  * Production defaults for the `kici login` OAuth flow. When the matching
5
5
  * env var (or the `--platform-endpoint` flag) is unset, login resolves
6
6
  * these so a developer targeting the hosted KiCI Platform authenticates
7
7
  * with no setup. Setting the env var overrides the default — staging E2E
8
- * and self-hosted Platforms depend on that override path.
8
+ * and other KiCI environments depend on that override path.
9
9
  *
10
10
  * Resolution is login-local: these are read into locals in `oauthLogin`,
11
11
  * never written back into `process.env`, so the orchestrator's separate
@@ -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
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import pc from "picocolors";
3
3
  import { formatDuration } from "@kici-dev/core";
4
4
  //#region src/remote/render.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { loadLocalSecrets } from "../local-executor/secret-loader.js";
3
3
  import { encryptJson } from "@kici-dev/core";
4
4
  //#region src/remote/secret-upload.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { encryptTarball } from "./encryption.js";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs/promises";
@@ -113,7 +113,7 @@ async function selectOverlayFiles(repoRoot, options) {
113
113
  const unstaged = gitLines("git diff --name-only HEAD", repoRoot);
114
114
  const staged = gitLines("git diff --name-only --cached HEAD", repoRoot);
115
115
  const untracked = gitLines("git ls-files --others --exclude-standard", repoRoot);
116
- allFiles = [...new Set([
116
+ allFiles = [.../* @__PURE__ */ new Set([
117
117
  ...unstaged,
118
118
  ...staged,
119
119
  ...untracked
@@ -121,13 +121,13 @@ async function selectOverlayFiles(repoRoot, options) {
121
121
  } else {
122
122
  const tracked = gitLines("git ls-files", repoRoot);
123
123
  const untracked = gitLines("git ls-files --others --exclude-standard", repoRoot);
124
- allFiles = [...new Set([...tracked, ...untracked])];
124
+ allFiles = [.../* @__PURE__ */ new Set([...tracked, ...untracked])];
125
125
  }
126
126
  const kiciIgnore = await loadKiciIgnore(options?.kiciIgnorePath ?? path.join(repoRoot, ".kiciignore"));
127
127
  if (kiciIgnore) allFiles = allFiles.filter((f) => !kiciIgnore(f));
128
128
  if (options?.fullWorkingTree) {
129
129
  const gitFiles = await collectGitDirFiles(repoRoot);
130
- allFiles = [...new Set([...allFiles, ...gitFiles])];
130
+ allFiles = [.../* @__PURE__ */ new Set([...allFiles, ...gitFiles])];
131
131
  }
132
132
  const existingFiles = [];
133
133
  const deletedFiles = [];
@@ -1,4 +1,3 @@
1
1
  import "node:module";
2
- import.meta.url;
3
2
  //#endregion
4
3
  export {};
@@ -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 test 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 test <event>` to preview matching.\n6. Run `kici run local <event>` 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`, `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
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/templates/agents-md.ts
3
3
  /**
4
4
  * Template body for .kici/AGENTS.md, written by `kici init` (unless opted out
@@ -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 test pr:open --debug\`| Preview which workflows match an event. |
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 test <event>\` to preview matching.
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
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { agentsMdTemplate } from "./agents-md.js";
3
3
  import { helloWorldWorkflow } from "./workflows/hello-world.js";
4
4
  import { prChecksWorkflow } from "./workflows/pr-checks.js";
@@ -1,6 +1,6 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/templates/package-json.ts
3
- const sdkVersion = "0.1.23";
3
+ const sdkVersion = "0.1.25";
4
4
  /**
5
5
  * Generate package.json content for .kici/ directory
6
6
  *
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/templates/tsconfig-json.ts
3
3
  /**
4
4
  * tsconfig.json template for kici init command
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { job, push, step, workflow } from "@kici-dev/sdk";
3
3
  //#region src/templates/workflows/hello-world.ts
4
4
  const helloWorldWorkflow = workflow("hello-world", {
@@ -1,4 +1,4 @@
1
- import "../../chunk-BTugEXQM.js";
1
+ import "../../rolldown-runtime-ClRpJifh.js";
2
2
  import { isEventType, job, pr, rule, skip, step, workflow } from "@kici-dev/sdk";
3
3
  //#region src/templates/workflows/pr-checks.ts
4
4
  const prChecksWorkflow = workflow("pr-checks", {
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import pc from "picocolors";
3
3
  import { logger } from "@kici-dev/core";
4
4
  //#region src/test-runner/dry-run.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  //#region src/test-runner/event-types.ts
3
3
  /**
4
4
  * Parse CLI event argument to EventType.
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import path from "node:path";
3
3
  import { readFile } from "node:fs/promises";
4
4
  //#region src/test-runner/git-detector.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { displayDryRun } from "./dry-run.js";
3
3
  import { parseEventArg, triggerSummary, triggerToEventArg } from "./event-types.js";
4
4
  import { detectRepoFromGit } from "./git-detector.js";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { formatter } from "./output-formatter.js";
3
3
  import { createStepContext } from "./step-context.js";
4
4
  import { createRuleContext, evaluateRules as evaluateRulesWithFormatting } from "./rule-evaluator.js";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import pc from "picocolors";
3
3
  import { logger } from "@kici-dev/core";
4
4
  //#region src/test-runner/output-formatter.ts
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { parseEventArg } from "./event-types.js";
3
3
  import { detectRepoFromGit } from "./git-detector.js";
4
4
  import { getDefaultFixture } from "../fixtures/defaults/index.js";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { formatter } from "./output-formatter.js";
3
3
  import { evaluateRules } from "@kici-dev/sdk";
4
4
  import { initZx } from "@kici-dev/core";
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import path from "node:path";
3
3
  import { readFile } from "node:fs/promises";
4
4
  //#region src/test-runner/secrets-file.ts
@@ -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, dispatchInputs?: Readonly<Record<string, string | number | boolean | null>>): 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
@@ -1,4 +1,4 @@
1
- import "../chunk-BTugEXQM.js";
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
2
  import { formatter } from "./output-formatter.js";
3
3
  import { join } from "node:path";
4
4
  import { chmodSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
@@ -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, dispatchInputs = {}) {
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;