@kici-dev/compiler 0.0.0 → 0.1.2

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 (221) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +1 -6
  3. package/dist/assets/api-TJJVHrjC.json +118 -0
  4. package/dist/assets/descriptor-BTtjzN9L.json +1382 -0
  5. package/dist/assets/package-BpQF9kR8.json +74 -0
  6. package/dist/assets/package-Ceo2h27X.json +89 -0
  7. package/dist/assets/source_context-D0atuL28.json +20 -0
  8. package/dist/assets/type-BFqO8SCZ.json +202 -0
  9. package/dist/auth/headless-detect.d.ts +14 -0
  10. package/dist/auth/headless-detect.js +25 -0
  11. package/dist/chunk-gOLHoazu.js +4 -0
  12. package/dist/cli.d.ts +3 -0
  13. package/dist/cli.js +193 -0
  14. package/dist/commands/cancel.d.ts +22 -0
  15. package/dist/commands/cancel.js +124 -0
  16. package/dist/commands/compile.d.ts +17 -0
  17. package/dist/commands/compile.js +99 -0
  18. package/dist/commands/docs.d.ts +26 -0
  19. package/dist/commands/docs.js +60 -0
  20. package/dist/commands/drain-worker.d.ts +19 -0
  21. package/dist/commands/drain-worker.js +45 -0
  22. package/dist/commands/endpoints.d.ts +53 -0
  23. package/dist/commands/endpoints.js +185 -0
  24. package/dist/commands/fixture.d.ts +14 -0
  25. package/dist/commands/fixture.js +104 -0
  26. package/dist/commands/hook.d.ts +20 -0
  27. package/dist/commands/hook.js +97 -0
  28. package/dist/commands/index.d.ts +33 -0
  29. package/dist/commands/index.js +20 -0
  30. package/dist/commands/init.d.ts +35 -0
  31. package/dist/commands/init.js +393 -0
  32. package/dist/commands/login.d.ts +23 -0
  33. package/dist/commands/login.js +144 -0
  34. package/dist/commands/logout.d.ts +18 -0
  35. package/dist/commands/logout.js +55 -0
  36. package/dist/commands/org.d.ts +27 -0
  37. package/dist/commands/org.js +126 -0
  38. package/dist/commands/run.d.ts +21 -0
  39. package/dist/commands/run.js +562 -0
  40. package/dist/commands/secrets-list.d.ts +16 -0
  41. package/dist/commands/secrets-list.js +85 -0
  42. package/dist/commands/status.d.ts +30 -0
  43. package/dist/commands/status.js +210 -0
  44. package/dist/commands/test.d.ts +61 -0
  45. package/dist/commands/test.js +220 -0
  46. package/dist/commands/types.d.ts +18 -0
  47. package/dist/commands/types.js +74 -0
  48. package/dist/commands/watch.d.ts +14 -0
  49. package/dist/commands/watch.js +97 -0
  50. package/dist/commands/workflows.d.ts +28 -0
  51. package/dist/commands/workflows.js +154 -0
  52. package/dist/comment-created.json +30 -0
  53. package/dist/create-branch.json +17 -0
  54. package/dist/delete-branch.json +15 -0
  55. package/dist/dispatch.json +15 -0
  56. package/dist/errors/capability-gap.d.ts +50 -0
  57. package/dist/errors/capability-gap.js +54 -0
  58. package/dist/errors/codes.d.ts +25 -0
  59. package/dist/errors/formatter.d.ts +32 -0
  60. package/dist/errors/formatter.js +35 -0
  61. package/dist/errors/index.d.ts +5 -0
  62. package/dist/errors/index.js +4 -0
  63. package/dist/execution/executor.d.ts +61 -0
  64. package/dist/execution/executor.js +230 -0
  65. package/dist/execution/index.d.ts +4 -0
  66. package/dist/execution/index.js +3 -0
  67. package/dist/execution/sdk-alias.d.ts +33 -0
  68. package/dist/execution/sdk-alias.js +102 -0
  69. package/dist/fixtures/compiler.d.ts +47 -0
  70. package/dist/fixtures/compiler.js +177 -0
  71. package/dist/fixtures/defaults/comment-created.json +30 -0
  72. package/dist/fixtures/defaults/create-branch.json +17 -0
  73. package/dist/fixtures/defaults/delete-branch.json +15 -0
  74. package/dist/fixtures/defaults/dispatch.json +15 -0
  75. package/dist/fixtures/defaults/fork.json +19 -0
  76. package/dist/fixtures/defaults/index.d.ts +16 -0
  77. package/dist/fixtures/defaults/index.js +105 -0
  78. package/dist/fixtures/defaults/index.ts +145 -0
  79. package/dist/fixtures/defaults/pr-closed.json +28 -0
  80. package/dist/fixtures/defaults/pr-opened.json +27 -0
  81. package/dist/fixtures/defaults/pr-reopened.json +27 -0
  82. package/dist/fixtures/defaults/pr-synchronize.json +27 -0
  83. package/dist/fixtures/defaults/push.json +16 -0
  84. package/dist/fixtures/defaults/release-published.json +23 -0
  85. package/dist/fixtures/defaults/review-comment-created.json +36 -0
  86. package/dist/fixtures/defaults/review-submitted.json +35 -0
  87. package/dist/fixtures/defaults/star-created.json +15 -0
  88. package/dist/fixtures/defaults/status.json +26 -0
  89. package/dist/fixtures/defaults/tag-push.json +20 -0
  90. package/dist/fixtures/defaults/watch-started.json +15 -0
  91. package/dist/fixtures/defaults/workflow-run-completed.json +23 -0
  92. package/dist/fork.json +19 -0
  93. package/dist/format.d.ts +5 -0
  94. package/dist/format.js +20 -0
  95. package/dist/generators/secrets-dts.d.ts +29 -0
  96. package/dist/generators/secrets-dts.js +67 -0
  97. package/dist/hooks/detector.d.ts +39 -0
  98. package/dist/hooks/detector.js +133 -0
  99. package/dist/hooks/index.d.ts +6 -0
  100. package/dist/hooks/index.js +5 -0
  101. package/dist/hooks/installer.d.ts +24 -0
  102. package/dist/hooks/installer.js +328 -0
  103. package/dist/hooks/templates.d.ts +26 -0
  104. package/dist/hooks/templates.js +63 -0
  105. package/dist/index.d.ts +12 -0
  106. package/dist/index.js +12 -0
  107. package/dist/llm-context/llms-full.txt +9974 -0
  108. package/dist/llm-context/llms.txt +61 -0
  109. package/dist/local-executor/dag-scheduler.d.ts +44 -0
  110. package/dist/local-executor/dag-scheduler.js +183 -0
  111. package/dist/local-executor/index.d.ts +23 -0
  112. package/dist/local-executor/index.js +309 -0
  113. package/dist/local-executor/job-runner.d.ts +40 -0
  114. package/dist/local-executor/job-runner.js +307 -0
  115. package/dist/local-executor/output-streamer.d.ts +31 -0
  116. package/dist/local-executor/output-streamer.js +166 -0
  117. package/dist/local-executor/payload-generator.d.ts +16 -0
  118. package/dist/local-executor/payload-generator.js +138 -0
  119. package/dist/local-executor/picker.d.ts +33 -0
  120. package/dist/local-executor/picker.js +109 -0
  121. package/dist/local-executor/secret-loader.d.ts +18 -0
  122. package/dist/local-executor/secret-loader.js +105 -0
  123. package/dist/local-executor/types.d.ts +80 -0
  124. package/dist/local-executor/types.js +2 -0
  125. package/dist/local-executor/workflow-lock.d.ts +81 -0
  126. package/dist/local-executor/workflow-lock.js +0 -0
  127. package/dist/lockfile/generator.d.ts +39 -0
  128. package/dist/lockfile/generator.js +688 -0
  129. package/dist/lockfile/hash-files.d.ts +14 -0
  130. package/dist/lockfile/hash-files.js +50 -0
  131. package/dist/lockfile/hasher.d.ts +36 -0
  132. package/dist/lockfile/hasher.js +46 -0
  133. package/dist/lockfile/index.d.ts +3 -0
  134. package/dist/lockfile/index.js +4 -0
  135. package/dist/lockfile/purity-analyzer.d.ts +25 -0
  136. package/dist/lockfile/purity-analyzer.js +204 -0
  137. package/dist/package-F7UXSDHW.json +74 -0
  138. package/dist/postinstall.d.ts +9 -0
  139. package/dist/postinstall.js +60 -0
  140. package/dist/pr-closed.json +28 -0
  141. package/dist/pr-opened.json +27 -0
  142. package/dist/pr-reopened.json +27 -0
  143. package/dist/pr-synchronize.json +27 -0
  144. package/dist/push.json +16 -0
  145. package/dist/release-published.json +23 -0
  146. package/dist/remote/client.d.ts +204 -0
  147. package/dist/remote/client.js +203 -0
  148. package/dist/remote/config.d.ts +54 -0
  149. package/dist/remote/config.js +92 -0
  150. package/dist/remote/encryption.d.ts +35 -0
  151. package/dist/remote/encryption.js +87 -0
  152. package/dist/remote/history.d.ts +91 -0
  153. package/dist/remote/history.js +146 -0
  154. package/dist/remote/oauth.d.ts +65 -0
  155. package/dist/remote/oauth.js +302 -0
  156. package/dist/remote/observer.d.ts +81 -0
  157. package/dist/remote/observer.js +174 -0
  158. package/dist/remote/output/json.d.ts +13 -0
  159. package/dist/remote/output/json.js +36 -0
  160. package/dist/remote/output/junit.d.ts +18 -0
  161. package/dist/remote/output/junit.js +50 -0
  162. package/dist/remote/output/streaming.d.ts +57 -0
  163. package/dist/remote/output/streaming.js +124 -0
  164. package/dist/remote/output/summary.d.ts +39 -0
  165. package/dist/remote/output/summary.js +99 -0
  166. package/dist/remote/uploader.d.ts +87 -0
  167. package/dist/remote/uploader.js +197 -0
  168. package/dist/review-comment-created.json +36 -0
  169. package/dist/review-submitted.json +35 -0
  170. package/dist/star-created.json +15 -0
  171. package/dist/status.json +26 -0
  172. package/dist/tag-push.json +20 -0
  173. package/dist/templates/agents-md.d.ts +8 -0
  174. package/dist/templates/agents-md.js +130 -0
  175. package/dist/templates/index.d.ts +43 -0
  176. package/dist/templates/index.js +48 -0
  177. package/dist/templates/package-json.d.ts +18 -0
  178. package/dist/templates/package-json.js +34 -0
  179. package/dist/templates/tsconfig-json.d.ts +9 -0
  180. package/dist/templates/tsconfig-json.js +26 -0
  181. package/dist/templates/workflows/hello-world.d.ts +2 -0
  182. package/dist/templates/workflows/hello-world.js +16 -0
  183. package/dist/templates/workflows/hello-world.ts +21 -0
  184. package/dist/templates/workflows/pr-checks.d.ts +2 -0
  185. package/dist/templates/workflows/pr-checks.js +40 -0
  186. package/dist/templates/workflows/pr-checks.ts +57 -0
  187. package/dist/test-runner/dry-run.d.ts +12 -0
  188. package/dist/test-runner/dry-run.js +66 -0
  189. package/dist/test-runner/event-types.d.ts +86 -0
  190. package/dist/test-runner/event-types.js +330 -0
  191. package/dist/test-runner/git-detector.d.ts +15 -0
  192. package/dist/test-runner/git-detector.js +30 -0
  193. package/dist/test-runner/index.d.ts +13 -0
  194. package/dist/test-runner/index.js +11 -0
  195. package/dist/test-runner/job-executor.d.ts +48 -0
  196. package/dist/test-runner/job-executor.js +245 -0
  197. package/dist/test-runner/output-formatter.d.ts +47 -0
  198. package/dist/test-runner/output-formatter.js +92 -0
  199. package/dist/test-runner/payload-builder.d.ts +20 -0
  200. package/dist/test-runner/payload-builder.js +216 -0
  201. package/dist/test-runner/rule-evaluator.d.ts +14 -0
  202. package/dist/test-runner/rule-evaluator.js +31 -0
  203. package/dist/test-runner/secrets-file.d.ts +24 -0
  204. package/dist/test-runner/secrets-file.js +62 -0
  205. package/dist/test-runner/step-context.d.ts +15 -0
  206. package/dist/test-runner/step-context.js +140 -0
  207. package/dist/test-runner/summary.d.ts +7 -0
  208. package/dist/types.d.ts +525 -0
  209. package/dist/types.js +33 -0
  210. package/dist/validation/index.d.ts +3 -0
  211. package/dist/validation/index.js +3 -0
  212. package/dist/validation/validator.d.ts +26 -0
  213. package/dist/validation/validator.js +164 -0
  214. package/dist/watch-started.json +15 -0
  215. package/dist/workflow-run-completed.json +23 -0
  216. package/dist/workflows/hello-world.ts +21 -0
  217. package/dist/workflows/pr-checks.ts +57 -0
  218. package/hack/postinstall.mjs +105 -0
  219. package/package.json +60 -6
  220. package/sbom.spdx.json +10997 -0
  221. package/index.js +0 -3
@@ -0,0 +1,34 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/templates/package-json.ts
3
+ /**
4
+ * Package.json template generator for kici init command
5
+ *
6
+ * Generates package.json for .kici/ directory in TypeScript mode.
7
+ * SDK is a devDependency resolved from the npm registry
8
+ * (or a private Verdaccio instance when .npmrc scopes the registry).
9
+ * The compiler is invoked via npx (not installed as a dependency).
10
+ */
11
+ /**
12
+ * Generate package.json content for .kici/ directory
13
+ *
14
+ * @param devMode - When true, uses a prerelease-compatible version range
15
+ * (`>=0.0.1-0`) so npm resolves Verdaccio's prerelease builds (e.g. 0.0.1-2856).
16
+ * Semver `^0.0.1` does NOT match prereleases, causing 404s on Verdaccio.
17
+ * @returns JSON string with proper formatting (2-space indent, trailing newline)
18
+ */
19
+ function generatePackageJson(devMode = false) {
20
+ return JSON.stringify({
21
+ name: "@kici-dev/workflows",
22
+ private: true,
23
+ type: "module",
24
+ scripts: {
25
+ compile: "npx --yes kici@latest compile",
26
+ typecheck: "tsc --noEmit"
27
+ },
28
+ devDependencies: { "@kici-dev/sdk": devMode ? ">=0.0.1-0" : "^0.0.1" }
29
+ }, null, 2) + "\n";
30
+ }
31
+ //#endregion
32
+ export { generatePackageJson };
33
+
34
+ //# sourceMappingURL=package-json.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * tsconfig.json template for kici init command
3
+ *
4
+ * Exported as a JSON string that matches examples/tsconfig.json exactly.
5
+ * These settings enable proper TypeScript type checking for workflow files
6
+ * with NodeNext module resolution.
7
+ */
8
+ export declare const tsconfigTemplate: string;
9
+ //# sourceMappingURL=tsconfig-json.d.ts.map
@@ -0,0 +1,26 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ //#region src/templates/tsconfig-json.ts
3
+ /**
4
+ * tsconfig.json template for kici init command
5
+ *
6
+ * Exported as a JSON string that matches examples/tsconfig.json exactly.
7
+ * These settings enable proper TypeScript type checking for workflow files
8
+ * with NodeNext module resolution.
9
+ */
10
+ const tsconfigTemplate = JSON.stringify({
11
+ compilerOptions: {
12
+ target: "ES2024",
13
+ module: "NodeNext",
14
+ moduleResolution: "NodeNext",
15
+ strict: true,
16
+ noEmit: true,
17
+ esModuleInterop: true,
18
+ skipLibCheck: true,
19
+ forceConsistentCasingInFileNames: true
20
+ },
21
+ include: ["workflows/**/*", "types/**/*.d.ts"]
22
+ }, null, 2) + "\n";
23
+ //#endregion
24
+ export { tsconfigTemplate };
25
+
26
+ //# sourceMappingURL=tsconfig-json.js.map
@@ -0,0 +1,2 @@
1
+ export declare const helloWorldWorkflow: import("@kici-dev/sdk").Workflow;
2
+ //# sourceMappingURL=hello-world.d.ts.map
@@ -0,0 +1,16 @@
1
+ import "../../chunk-gOLHoazu.js";
2
+ import { job, push, step, workflow } from "@kici-dev/sdk";
3
+ //#region src/templates/workflows/hello-world.ts
4
+ const helloWorldWorkflow = workflow("hello-world", {
5
+ on: push(),
6
+ jobs: [job("greet", {
7
+ runsOn: "ubuntu-latest",
8
+ steps: [step("say-hello", async ({ $ }) => {
9
+ await $`echo "Hello, World!"`;
10
+ })]
11
+ })]
12
+ });
13
+ //#endregion
14
+ export { helloWorldWorkflow };
15
+
16
+ //# sourceMappingURL=hello-world.js.map
@@ -0,0 +1,21 @@
1
+ // Hello World -- minimal push workflow
2
+ // Docs: https://kici.dev/docs/sdk-reference
3
+
4
+ import { workflow, job, step, push } from '@kici-dev/sdk';
5
+
6
+ export const helloWorldWorkflow = workflow('hello-world', {
7
+ // Trigger: push() matches any push event
8
+ // Options: branches, tags, paths, description (config-style; use !-prefix for exclusions)
9
+ on: push(),
10
+
11
+ jobs: [
12
+ job('greet', {
13
+ runsOn: 'ubuntu-latest',
14
+ steps: [
15
+ step('say-hello', async ({ $ }) => {
16
+ await $`echo "Hello, World!"`;
17
+ }),
18
+ ],
19
+ }),
20
+ ],
21
+ });
@@ -0,0 +1,2 @@
1
+ export declare const prChecksWorkflow: import("@kici-dev/sdk").Workflow;
2
+ //# sourceMappingURL=pr-checks.d.ts.map
@@ -0,0 +1,40 @@
1
+ import "../../chunk-gOLHoazu.js";
2
+ import { job, pr, rule, skip, step, workflow } from "@kici-dev/sdk";
3
+ //#region src/templates/workflows/pr-checks.ts
4
+ const prChecksWorkflow = workflow("pr-checks", {
5
+ on: pr({
6
+ target: "main",
7
+ paths: ["src/**"]
8
+ }),
9
+ rules: [skip("skip-draft-prs", async (ctx) => {
10
+ return ctx.event.pull_request?.draft === true;
11
+ }), rule("require-src-changes", async (ctx) => {
12
+ return ctx.changedFiles.some((file) => file.startsWith("src/"));
13
+ })],
14
+ jobs: [job("lint", {
15
+ runsOn: "ubuntu-latest",
16
+ steps: [step("checkout", async ({ $ }) => {
17
+ await $`echo "Checking out code..."`;
18
+ }), step("run-linter", async ({ $ }) => {
19
+ await $`echo "Running linter..."`;
20
+ })]
21
+ }), job("test", {
22
+ runsOn: "ubuntu-latest",
23
+ needs: ["lint"],
24
+ steps: [
25
+ step("checkout", async ({ $ }) => {
26
+ await $`echo "Checking out code..."`;
27
+ }),
28
+ step("install-deps", async ({ $ }) => {
29
+ await $`echo "Installing dependencies..."`;
30
+ }),
31
+ step("run-tests", async ({ $ }) => {
32
+ await $`echo "Running tests..."`;
33
+ })
34
+ ]
35
+ })]
36
+ });
37
+ //#endregion
38
+ export { prChecksWorkflow };
39
+
40
+ //# sourceMappingURL=pr-checks.js.map
@@ -0,0 +1,57 @@
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
4
+
5
+ import { workflow, job, step, pr, rule, skip } from '@kici-dev/sdk';
6
+
7
+ export const prChecksWorkflow = workflow('pr-checks', {
8
+ // Trigger: pr() matches pull request events
9
+ // Options: target, paths, events (config-style)
10
+ on: pr({ target: 'main', paths: ['src/**'] }),
11
+
12
+ // Rules: evaluated before workflow runs
13
+ // skip() = skip if true, rule() = run only if true
14
+ rules: [
15
+ skip('skip-draft-prs', async (ctx) => {
16
+ return (ctx.event as any).pull_request?.draft === true;
17
+ }),
18
+
19
+ rule('require-src-changes', async (ctx) => {
20
+ return ctx.changedFiles.some((file) => file.startsWith('src/'));
21
+ }),
22
+ ],
23
+
24
+ // Jobs: run in parallel unless connected via `needs`
25
+ jobs: [
26
+ job('lint', {
27
+ runsOn: 'ubuntu-latest',
28
+ steps: [
29
+ step('checkout', async ({ $ }) => {
30
+ await $`echo "Checking out code..."`;
31
+ }),
32
+ step('run-linter', async ({ $ }) => {
33
+ // Replace with your linter: eslint, biome, cargo clippy, etc.
34
+ await $`echo "Running linter..."`;
35
+ }),
36
+ ],
37
+ }),
38
+
39
+ job('test', {
40
+ runsOn: 'ubuntu-latest',
41
+ needs: ['lint'], // Waits for lint to pass
42
+ steps: [
43
+ step('checkout', async ({ $ }) => {
44
+ await $`echo "Checking out code..."`;
45
+ }),
46
+ step('install-deps', async ({ $ }) => {
47
+ // Replace with: npm ci, etc.
48
+ await $`echo "Installing dependencies..."`;
49
+ }),
50
+ step('run-tests', async ({ $ }) => {
51
+ // Replace with: npm test, vitest run, cargo test, etc.
52
+ await $`echo "Running tests..."`;
53
+ }),
54
+ ],
55
+ }),
56
+ ],
57
+ });
@@ -0,0 +1,12 @@
1
+ import type { LockWorkflow } from '../types.js';
2
+ import type { WorkflowDecision } from '@kici-dev/engine';
3
+ interface DryRunOptions {
4
+ workflow?: string;
5
+ job?: string;
6
+ }
7
+ /**
8
+ * Display dry-run output showing what would execute.
9
+ */
10
+ export declare function displayDryRun(workflows: readonly LockWorkflow[], decisions: WorkflowDecision[], options: DryRunOptions): void;
11
+ export {};
12
+ //# sourceMappingURL=dry-run.d.ts.map
@@ -0,0 +1,66 @@
1
+ import "../chunk-gOLHoazu.js";
2
+ import pc from "picocolors";
3
+ import { logger } from "@kici-dev/shared";
4
+ //#region src/test-runner/dry-run.ts
5
+ /**
6
+ * Display dry-run output showing what would execute.
7
+ */
8
+ function displayDryRun(workflows, decisions, options) {
9
+ logger.info(pc.bold("\nšŸ” DRY RUN - No commands will be executed\n"));
10
+ const matchedWorkflows = decisions.filter((d) => d.matched);
11
+ if (matchedWorkflows.length === 0) {
12
+ logger.info(pc.yellow("No workflows matched the event.\n"));
13
+ displayDecisionSummary(decisions);
14
+ return;
15
+ }
16
+ for (const decision of matchedWorkflows) {
17
+ if (options.workflow && decision.workflowName !== options.workflow) continue;
18
+ const workflow = workflows.find((w) => w.name === decision.workflowName);
19
+ logger.info(pc.cyan(`Workflow: ${workflow.name}`));
20
+ if (workflow.description) logger.info(pc.gray(` ${workflow.description}`));
21
+ logger.info(pc.yellow(` Triggers:`));
22
+ for (const trigger of workflow.triggers) logger.info(` - ${trigger._type}`);
23
+ if (decision.matchedTrigger !== void 0) logger.info(pc.green(` āœ“ Matched trigger ${decision.matchedTrigger + 1}`));
24
+ const staticJobs = workflow.jobs.filter((j) => j._type === "static");
25
+ logger.info(pc.yellow(` Jobs (${staticJobs.length}):`));
26
+ for (const job of staticJobs) {
27
+ if (options.job && job.name !== options.job) continue;
28
+ logger.info(` ${pc.bold(job.name)}`);
29
+ logger.info(pc.gray(` runs-on: ${job.runsOn}`));
30
+ if (job.needs.length > 0) logger.info(pc.gray(` needs: ${job.needs.join(", ")}`));
31
+ if (job.rules && job.rules.length > 0) logger.info(pc.gray(` rules: ${job.rules.map((r) => r.label).join(", ")}`));
32
+ if (job.matrix) if (job.matrix._type === "static" && job.matrix.values) logger.info(pc.gray(` matrix: ${JSON.stringify(job.matrix.values)}`));
33
+ else logger.info(pc.gray(` matrix: [dynamic]`));
34
+ logger.info(pc.gray(` steps (${job.steps.length}):`));
35
+ for (const step of job.steps) logger.info(pc.gray(` - ${step.name}`));
36
+ }
37
+ const dynamicJobs = workflow.jobs.filter((j) => j._type === "dynamic");
38
+ if (dynamicJobs.length > 0) {
39
+ logger.info(pc.yellow(` Dynamic job generators (${dynamicJobs.length}):`));
40
+ for (const _job of dynamicJobs) logger.info(pc.gray(` - [dynamic job generator]`));
41
+ }
42
+ logger.info("");
43
+ }
44
+ displayDecisionSummary(decisions);
45
+ logger.info(pc.green("āœ“ Dry run complete\n"));
46
+ }
47
+ /**
48
+ * Display decision trace summary.
49
+ */
50
+ function displayDecisionSummary(decisions) {
51
+ logger.info(pc.bold("\nDecision Summary:\n"));
52
+ for (const decision of decisions) {
53
+ const status = decision.matched ? pc.green("āœ“ matched") : pc.gray("āœ— skipped");
54
+ logger.info(` ${decision.workflowName}: ${status}`);
55
+ logger.info(pc.gray(` ${decision.summary}`));
56
+ if (decision.checks.length > 0 && !decision.matched) {
57
+ const failedCheck = decision.checks.find((c) => !c.passed);
58
+ if (failedCheck) logger.info(pc.gray(` Failed: ${failedCheck.check} - ${failedCheck.pattern} vs ${failedCheck.value}`));
59
+ }
60
+ }
61
+ logger.info("");
62
+ }
63
+ //#endregion
64
+ export { displayDryRun };
65
+
66
+ //# sourceMappingURL=dry-run.js.map
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Event type mapping system for webhook events.
3
+ * Supports all 22 trigger types defined in the SDK:
4
+ * 15 GitHub event types + 7 internal/generic types.
5
+ */
6
+ import type { LockTrigger } from '../types.js';
7
+ export type EventType = {
8
+ type: 'pull_request';
9
+ action: string;
10
+ } | {
11
+ type: 'push';
12
+ } | {
13
+ type: 'tag';
14
+ } | {
15
+ type: 'comment';
16
+ action: string;
17
+ } | {
18
+ type: 'review';
19
+ action: string;
20
+ } | {
21
+ type: 'review_comment';
22
+ action: string;
23
+ } | {
24
+ type: 'release';
25
+ action: string;
26
+ } | {
27
+ type: 'dispatch';
28
+ } | {
29
+ type: 'create';
30
+ refType?: string;
31
+ } | {
32
+ type: 'delete';
33
+ refType?: string;
34
+ } | {
35
+ type: 'status';
36
+ } | {
37
+ type: 'workflow_run';
38
+ action: string;
39
+ } | {
40
+ type: 'fork';
41
+ } | {
42
+ type: 'star';
43
+ action: string;
44
+ } | {
45
+ type: 'watch';
46
+ action: string;
47
+ } | {
48
+ type: 'kici_event';
49
+ eventName: string;
50
+ } | {
51
+ type: 'workflow_complete';
52
+ workflowName: string;
53
+ status: string;
54
+ } | {
55
+ type: 'job_complete';
56
+ workflowName: string;
57
+ jobName: string;
58
+ status: string;
59
+ } | {
60
+ type: 'generic_webhook';
61
+ source?: string;
62
+ } | {
63
+ type: 'schedule';
64
+ cronExpression?: string;
65
+ timezone?: string;
66
+ } | {
67
+ type: 'lifecycle';
68
+ lifecycleEvent: string;
69
+ };
70
+ /**
71
+ * Parse CLI event argument to EventType.
72
+ * Supports all trigger types and common action shortcuts.
73
+ */
74
+ export declare function parseEventArg(arg: string): EventType;
75
+ /**
76
+ * Derive an event-arg string from a `LockTrigger` that `parseEventArg` can accept.
77
+ * Inverse of `parseEventArg` for picker-driven flows: pick a trigger, feed the
78
+ * derived event arg back through the standard pipeline.
79
+ */
80
+ export declare function triggerToEventArg(trigger: LockTrigger): string;
81
+ /**
82
+ * One-line label for a `LockTrigger`, suitable for interactive picker rows.
83
+ * Keeps output compact and human-readable.
84
+ */
85
+ export declare function triggerSummary(trigger: LockTrigger): string;
86
+ //# sourceMappingURL=event-types.d.ts.map