@kici-dev/compiler 0.1.27 → 0.2.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 (153) hide show
  1. package/dist/auth/headless-detect.d.ts +14 -5
  2. package/dist/auth/headless-detect.js +50 -9
  3. package/dist/cli.js +120 -11
  4. package/dist/commands/compile.js +28 -4
  5. package/dist/commands/diagnostics.js +14 -2
  6. package/dist/commands/doctor.d.ts +64 -0
  7. package/dist/commands/doctor.js +413 -0
  8. package/dist/commands/endpoints.js +6 -0
  9. package/dist/commands/fixture.js +13 -0
  10. package/dist/commands/hook.js +3 -2
  11. package/dist/commands/index.d.ts +8 -0
  12. package/dist/commands/index.js +5 -1
  13. package/dist/commands/init-host-os.d.ts +34 -0
  14. package/dist/commands/init-host-os.js +44 -0
  15. package/dist/commands/init.d.ts +4 -0
  16. package/dist/commands/init.js +159 -36
  17. package/dist/commands/local.d.ts +28 -2
  18. package/dist/commands/local.js +74 -5
  19. package/dist/commands/login.js +1 -1
  20. package/dist/commands/notifications.d.ts +61 -0
  21. package/dist/commands/notifications.js +274 -0
  22. package/dist/commands/preview.js +8 -1
  23. package/dist/commands/run-routed.js +10 -1
  24. package/dist/commands/run.js +41 -12
  25. package/dist/commands/runs/artifacts/download.d.ts +24 -0
  26. package/dist/commands/runs/artifacts/download.js +154 -0
  27. package/dist/commands/runs/artifacts/list.d.ts +5 -0
  28. package/dist/commands/runs/artifacts/list.js +47 -0
  29. package/dist/commands/runs/cancel.js +2 -2
  30. package/dist/commands/runs/list.js +8 -2
  31. package/dist/commands/verify-attestation.d.ts +3 -1
  32. package/dist/commands/verify-attestation.js +18 -7
  33. package/dist/errors/formatter.d.ts +14 -1
  34. package/dist/errors/formatter.js +13 -3
  35. package/dist/errors/index.d.ts +2 -1
  36. package/dist/errors/index.js +3 -2
  37. package/dist/errors/source-location.d.ts +20 -0
  38. package/dist/errors/source-location.js +45 -0
  39. package/dist/execution/executor.js +25 -5
  40. package/dist/fixtures/defaults/index.js +2 -1
  41. package/dist/llm-context/llms-architecture.txt +48 -19
  42. package/dist/llm-context/llms-cli.txt +2461 -1582
  43. package/dist/llm-context/llms-features.txt +178 -106
  44. package/dist/llm-context/llms-full.txt +6124 -4423
  45. package/dist/llm-context/llms-getting-started.txt +306 -42
  46. package/dist/llm-context/llms-patterns.txt +13 -7
  47. package/dist/llm-context/llms-sdk-runtime.txt +2013 -0
  48. package/dist/llm-context/llms-sdk.txt +591 -2152
  49. package/dist/llm-context/llms.txt +30 -16
  50. package/dist/local-plane/orchestrator-process.d.ts +12 -7
  51. package/dist/local-plane/orchestrator-process.js +28 -14
  52. package/dist/local-plane/os-mismatch-hint.d.ts +16 -0
  53. package/dist/local-plane/os-mismatch-hint.js +34 -0
  54. package/dist/local-plane/plane-liveness.d.ts +68 -0
  55. package/dist/local-plane/plane-liveness.js +145 -0
  56. package/dist/local-plane/plane-manager.d.ts +60 -18
  57. package/dist/local-plane/plane-manager.js +210 -70
  58. package/dist/local-plane/plane-trigger.d.ts +13 -4
  59. package/dist/local-plane/plane-trigger.js +27 -14
  60. package/dist/local-plane/platform-attach.js +1 -5
  61. package/dist/local-plane/port-holder.d.ts +78 -0
  62. package/dist/local-plane/port-holder.js +227 -0
  63. package/dist/local-plane/postgres.d.ts +15 -3
  64. package/dist/local-plane/postgres.js +34 -12
  65. package/dist/local-plane/run-follow.d.ts +20 -0
  66. package/dist/local-plane/run-follow.js +51 -4
  67. package/dist/local-plane/scaler-config.d.ts +28 -14
  68. package/dist/local-plane/scaler-config.js +59 -41
  69. package/dist/local-plane/source-provider.js +4 -10
  70. package/dist/lockfile/generator.d.ts +14 -1
  71. package/dist/lockfile/generator.js +99 -33
  72. package/dist/lockfile/index.d.ts +3 -1
  73. package/dist/lockfile/index.js +3 -2
  74. package/dist/lockfile/purity-diagnostics.d.ts +31 -0
  75. package/dist/lockfile/purity-diagnostics.js +52 -0
  76. package/dist/postinstall.js +2 -1
  77. package/dist/remote/artifact-extract.d.ts +8 -0
  78. package/dist/remote/artifact-extract.js +58 -0
  79. package/dist/remote/config.d.ts +21 -3
  80. package/dist/remote/config.js +24 -5
  81. package/dist/remote/dashboard-client.d.ts +39 -2
  82. package/dist/remote/dashboard-client.js +47 -4
  83. package/dist/remote/fs-case.d.ts +21 -0
  84. package/dist/remote/fs-case.js +45 -0
  85. package/dist/remote/history.d.ts +9 -3
  86. package/dist/remote/history.js +79 -10
  87. package/dist/remote/local-repo-identity.d.ts +1 -1
  88. package/dist/remote/local-repo-identity.js +2 -1
  89. package/dist/remote/notifications-client.d.ts +149 -0
  90. package/dist/remote/notifications-client.js +103 -0
  91. package/dist/remote/oauth.d.ts +13 -0
  92. package/dist/remote/oauth.js +31 -5
  93. package/dist/remote/output/summary.js +76 -14
  94. package/dist/remote/render.js +30 -9
  95. package/dist/remote/uploader.js +5 -4
  96. package/dist/templates/agents-md.d.ts +1 -1
  97. package/dist/templates/agents-md.js +6 -6
  98. package/dist/templates/index.d.ts +1 -1
  99. package/dist/templates/index.js +2 -2
  100. package/dist/templates/package-json.d.ts +15 -0
  101. package/dist/templates/package-json.js +26 -5
  102. package/dist/test-runner/dry-run.d.ts +2 -1
  103. package/dist/test-runner/dry-run.js +18 -1
  104. package/dist/test-runner/event-types.d.ts +2 -0
  105. package/dist/test-runner/event-types.js +3 -0
  106. package/dist/test-runner/job-executor.d.ts +1 -0
  107. package/dist/test-runner/job-executor.js +81 -43
  108. package/dist/test-runner/output-formatter.d.ts +5 -2
  109. package/dist/test-runner/output-formatter.js +6 -4
  110. package/dist/test-runner/payload-builder.d.ts +7 -1
  111. package/dist/test-runner/payload-builder.js +11 -2
  112. package/dist/test-runner/rule-evaluator.d.ts +7 -3
  113. package/dist/test-runner/rule-evaluator.js +13 -12
  114. package/dist/test-runner/step-context.d.ts +23 -5
  115. package/dist/test-runner/step-context.js +28 -118
  116. package/dist/types.d.ts +21 -2
  117. package/dist/types.js +4 -2
  118. package/dist/validation/index.d.ts +2 -0
  119. package/dist/validation/index.js +2 -1
  120. package/dist/validation/typecheck.d.ts +28 -0
  121. package/dist/validation/typecheck.js +110 -0
  122. package/dist/validation/validator.d.ts +9 -4
  123. package/dist/validation/validator.js +38 -44
  124. package/package.json +12 -15
  125. package/sbom.spdx.json +1322 -1964
  126. package/dist/assets/api-TJJVHrjC.json +0 -118
  127. package/dist/assets/descriptor-BTtjzN9L.json +0 -1382
  128. package/dist/assets/package-BpQF9kR8.json +0 -74
  129. package/dist/assets/package-Ceo2h27X.json +0 -89
  130. package/dist/assets/source_context-D0atuL28.json +0 -20
  131. package/dist/assets/type-BFqO8SCZ.json +0 -202
  132. package/dist/commands/cancel.d.ts +0 -22
  133. package/dist/commands/detect-package-manager.d.ts +0 -42
  134. package/dist/commands/held-run-resolve.d.ts +0 -50
  135. package/dist/commands/status.d.ts +0 -34
  136. package/dist/commands/test.d.ts +0 -88
  137. package/dist/errors/codes.d.ts +0 -25
  138. package/dist/local-executor/dag-scheduler.d.ts +0 -44
  139. package/dist/local-executor/index.d.ts +0 -23
  140. package/dist/local-executor/job-runner.d.ts +0 -47
  141. package/dist/local-executor/materializer.d.ts +0 -44
  142. package/dist/local-executor/output-streamer.d.ts +0 -31
  143. package/dist/local-executor/payload-generator.d.ts +0 -16
  144. package/dist/local-executor/picker.d.ts +0 -33
  145. package/dist/local-executor/runs-on-display.d.ts +0 -9
  146. package/dist/local-executor/secret-loader.d.ts +0 -18
  147. package/dist/local-executor/to-event-payload.d.ts +0 -16
  148. package/dist/local-executor/types.d.ts +0 -93
  149. package/dist/local-executor/workflow-lock.d.ts +0 -82
  150. package/dist/package-F7UXSDHW.json +0 -74
  151. package/dist/remote/client.d.ts +0 -210
  152. package/dist/remote/observer.d.ts +0 -81
  153. package/dist/test-runner/summary.d.ts +0 -7
@@ -1,44 +0,0 @@
1
- /**
2
- * DAG-based parallel job scheduler with concurrency control and fail-fast.
3
- *
4
- * Generic scheduler that takes nodes with dependency relationships and
5
- * executes them via callbacks, respecting concurrency limits and
6
- * providing abort signals for fail-fast cancellation.
7
- */
8
- export interface DagNode {
9
- name: string;
10
- needs: string[];
11
- }
12
- interface DagExecutionCallbacks<T> {
13
- execute: (name: string, signal: AbortSignal) => Promise<T>;
14
- isSuccess: (result: T) => boolean;
15
- }
16
- interface DagOptions {
17
- maxConcurrency: number;
18
- failFast: boolean;
19
- }
20
- interface DagResult<T> {
21
- results: Map<string, T>;
22
- skipped: string[];
23
- cancelled: string[];
24
- status: 'success' | 'failure';
25
- }
26
- /**
27
- * Execute a DAG of nodes with bounded concurrency and fail-fast support.
28
- *
29
- * Algorithm:
30
- * 1. Detect cycles
31
- * 2. Initialize ready queue with zero-dependency nodes
32
- * 3. Event loop: launch ready nodes up to concurrency limit,
33
- * await first completion, update state, repeat
34
- * 4. On failure: if failFast, abort all running and skip pending;
35
- * if keep-going, only skip transitive dependents
36
- */
37
- export declare function executeDag<T>(nodes: DagNode[], callbacks: DagExecutionCallbacks<T>, options: DagOptions): Promise<DagResult<T>>;
38
- /**
39
- * Given a list of DAG nodes and a target job name, return the target
40
- * plus all transitive dependencies in topological order.
41
- */
42
- export declare function resolveJobFilter(nodes: DagNode[], targetName: string): DagNode[];
43
- export {};
44
- //# sourceMappingURL=dag-scheduler.d.ts.map
@@ -1,23 +0,0 @@
1
- /**
2
- * Public API: executeLocal() orchestrating compile, match, resolve, schedule, report.
3
- *
4
- * Pipeline:
5
- * 1. Compile workflows from .kici/ sources
6
- * 2. Load workflows (discover runtime modules)
7
- * 3. Load secrets from local files
8
- * 4. Build event payload from git state + CLI overrides
9
- * 5. Match triggers to find active workflows
10
- * 6. Apply --workflow and --job filters
11
- * 7. Resolve jobs (matrix expansion, dynamic evaluation)
12
- * 8. Execute via DAG scheduler with concurrency control
13
- * 9. Return success/failure
14
- */
15
- import type { RunLocalOptions } from './types.js';
16
- /**
17
- * Execute workflows locally -- the full compile-match-resolve-execute pipeline.
18
- *
19
- * @param options - CLI options from `kici run local`
20
- * @returns true if all workflows succeeded, false otherwise
21
- */
22
- export declare function executeLocal(options: RunLocalOptions): Promise<boolean>;
23
- //# sourceMappingURL=index.d.ts.map
@@ -1,47 +0,0 @@
1
- /**
2
- * Job resolution (matrix/dynamic) and single-job execution with step context.
3
- *
4
- * Handles:
5
- * - Static job resolution
6
- * - Matrix expansion into multiple ResolvedJob instances
7
- * - Dynamic job function evaluation
8
- * - Single-job step-by-step execution with rules, abort, and output chaining
9
- */
10
- import type { Workflow, OutputsMap } from '@kici-dev/sdk';
11
- import { CheckMode } from '@kici-dev/engine';
12
- import type { SimulatedEvent } from '@kici-dev/engine';
13
- import type { ParsedSecrets } from '../test-runner/secrets-file.js';
14
- import type { ResolvedJob, LocalJobResult } from './types.js';
15
- /**
16
- * Context passed to executeResolvedJob for single-job execution.
17
- */
18
- export interface JobExecutionContext {
19
- workflowName: string;
20
- event: SimulatedEvent;
21
- secrets: ParsedSecrets;
22
- /** Original `.kici/` dir — used for compile, secrets, and SDK setter resolution. */
23
- kiciDir: string;
24
- /** Directory steps execute against (isolated tmp checkout, or the repo root with --in-place). */
25
- execDir: string;
26
- jobOutputsMap: OutputsMap;
27
- signal: AbortSignal;
28
- /** Run mode for idempotent steps. Defaults to `apply` when unset. */
29
- checkMode?: CheckMode;
30
- /** Resolved (coerced + defaulted) workflow-dispatch inputs for `ctx.dispatchInputs`. */
31
- dispatchInputs?: Readonly<Record<string, string | number | boolean | null>>;
32
- }
33
- /**
34
- * Resolve all jobs in a workflow, expanding matrix jobs and evaluating dynamic jobs.
35
- *
36
- * - Static jobs: create ResolvedJob with name, needs, job reference
37
- * - Matrix jobs: use expandMatrix() from SDK, create one ResolvedJob per combination
38
- * - Dynamic job functions: evaluate the function, recursively resolve results
39
- * - Fan-in: if a job needs a matrix-expanded job, it needs ALL instances
40
- */
41
- export declare function resolveJobs(workflow: Workflow, event: SimulatedEvent): Promise<ResolvedJob[]>;
42
- /**
43
- * Execute a single resolved job: evaluate rules, run steps sequentially,
44
- * check abort signal between steps, collect outputs.
45
- */
46
- export declare function executeResolvedJob(resolvedJob: ResolvedJob, context: JobExecutionContext): Promise<LocalJobResult>;
47
- //# sourceMappingURL=job-runner.d.ts.map
@@ -1,44 +0,0 @@
1
- /**
2
- * Materialize an isolated tmp checkout of the repo for `kici run local`.
3
- *
4
- * Reproduces the same workspace `kici run remote` reconstructs on the agent:
5
- * a clone checked out at HEAD, with the local overlay (dirty + untracked,
6
- * minus gitignored, with `.kiciignore` applied) copied on top and local
7
- * deletions removed. Steps then execute against this copy so the developer's
8
- * real working tree is never mutated.
9
- *
10
- * Secrets are NOT part of the overlay: gitignored files such as
11
- * `.kici/.env.local` are excluded by the shared selection, so the tmp checkout
12
- * never receives them — the run reads them from the original `.kici/`.
13
- */
14
- /**
15
- * A materialized isolated checkout.
16
- */
17
- export interface MaterializedCheckout {
18
- /** Absolute path to the tmp checkout directory */
19
- path: string;
20
- /** Remove the tmp checkout directory */
21
- cleanup: () => Promise<void>;
22
- }
23
- /**
24
- * Options for {@link materializeCheckout}.
25
- */
26
- export interface MaterializeOptions {
27
- /** Base directory for the tmp checkout (default: os.tmpdir()) */
28
- runDir?: string;
29
- }
30
- /**
31
- * Materialize the repo at `repoRoot` into an isolated tmp checkout.
32
- *
33
- * @param repoRoot - Path to the git repository root
34
- * @param opts - Optional configuration (tmp base directory)
35
- * @returns The tmp checkout path and a cleanup callback
36
- * @throws If `repoRoot` is not inside a git work tree
37
- */
38
- export declare function materializeCheckout(repoRoot: string, opts?: MaterializeOptions): Promise<MaterializedCheckout>;
39
- /**
40
- * Collect stale retained checkouts under the run base. Invoked on every
41
- * `kici run local`; never throws (the GC must not break the run).
42
- */
43
- export declare function gcStaleRunCheckouts(base: string): Promise<string[]>;
44
- //# sourceMappingURL=materializer.d.ts.map
@@ -1,31 +0,0 @@
1
- /**
2
- * Output formatting for local execution: tree summary, JSON, JUnit XML.
3
- *
4
- * - displayLocalSummary: tree-format summary with per-step timing
5
- * - formatLocalJsonResult: structured JSON output
6
- * - formatLocalJunitResult: JUnit XML for CI integration
7
- */
8
- import type { WorkflowExecutionResult } from './types.js';
9
- /**
10
- * Display tree-format execution summary to the console.
11
- *
12
- * Shows per-workflow, per-job, per-step timing and status.
13
- * Matrix values appear in the job name.
14
- */
15
- export declare function displayLocalSummary(results: WorkflowExecutionResult[]): void;
16
- /**
17
- * Format workflow execution results as structured JSON.
18
- *
19
- * @returns JSON string with 2-space indentation.
20
- */
21
- export declare function formatLocalJsonResult(results: WorkflowExecutionResult[]): string;
22
- /**
23
- * Format workflow execution results as JUnit XML.
24
- *
25
- * Each workflow maps to a <testsuite>, each job maps to a <testcase>.
26
- * Failed jobs include failure message. Skipped/cancelled jobs use <skipped />.
27
- *
28
- * @returns Valid JUnit XML string.
29
- */
30
- export declare function formatLocalJunitResult(results: WorkflowExecutionResult[]): string;
31
- //# sourceMappingURL=output-streamer.d.ts.map
@@ -1,16 +0,0 @@
1
- import type { SimulatedEvent } from '@kici-dev/engine';
2
- import type { RunLocalOptions } from './types.js';
3
- /**
4
- * Generate a SimulatedEvent from git state and CLI overrides.
5
- *
6
- * For push events: detects branch, SHA, and changed files from git.
7
- * For PR events: uses current branch as source, 'main' (or --branch) as target.
8
- * If --payload flag is provided, delegates to existing buildEventPayload.
9
- * Falls back gracefully when not in a git repository.
10
- *
11
- * @param event - Event argument string (e.g. 'push', 'pr:open')
12
- * @param options - CLI options with override fields
13
- * @returns Generated SimulatedEvent
14
- */
15
- export declare function generateEventPayload(event: string, options: RunLocalOptions): Promise<SimulatedEvent>;
16
- //# sourceMappingURL=payload-generator.d.ts.map
@@ -1,33 +0,0 @@
1
- /**
2
- * Interactive workflow picker for `kici run local --pick`.
3
- *
4
- * Lists every workflow with a summary of its triggers, lets the user pick one
5
- * (and a specific trigger when there are multiple), and returns the derived
6
- * event arg plus workflow name. The caller feeds these back into the standard
7
- * executeLocal pipeline so the run remains consistent with normal trigger
8
- * matching.
9
- */
10
- import type { Workflow } from '@kici-dev/sdk';
11
- export declare class PickerCancelledError extends Error {
12
- constructor(message: string);
13
- }
14
- export interface PickerOptions {
15
- /**
16
- * Optional event-arg filter. When set, restrict the workflow list to those
17
- * with at least one trigger whose derived event arg shares the same family
18
- * (e.g. `filterEvent: 'pr'` keeps any workflow with a `pr:*` trigger).
19
- */
20
- filterEvent?: string;
21
- }
22
- export interface PickerResult {
23
- event: string;
24
- workflow: string;
25
- }
26
- /**
27
- * Run the interactive picker.
28
- *
29
- * @throws PickerCancelledError when stdin is not a TTY, when no eligible
30
- * workflows exist, or when the user aborts one of the prompts.
31
- */
32
- export declare function runPicker(workflows: Workflow[], opts?: PickerOptions): Promise<PickerResult>;
33
- //# sourceMappingURL=picker.d.ts.map
@@ -1,9 +0,0 @@
1
- import type { RunsOn } from '@kici-dev/sdk';
2
- /**
3
- * Render a job's `runsOn` to the comma-joined label string the local/test
4
- * runners surface as `ctx.job.runsOn`. A `runsOnAll` job has no `runsOn` —
5
- * locally it runs once on this machine, so we surface the marker `'runsOnAll'`.
6
- * RegExp selectors render via their `/source/flags` literal.
7
- */
8
- export declare function localRunsOnString(runsOn: RunsOn | undefined): string;
9
- //# sourceMappingURL=runs-on-display.d.ts.map
@@ -1,18 +0,0 @@
1
- import type { ParsedSecrets } from '../test-runner/secrets-file.js';
2
- /**
3
- * Load secrets from multiple sources with merge precedence.
4
- *
5
- * Merge order (lowest to highest priority):
6
- * 1. .kici/.secrets (INI-style, backward compat)
7
- * 2. .kici/.env.local (dotenv format)
8
- * 3. .kici/secrets.yaml (YAML with context scopes, merged flat)
9
- * 4. --env KEY=VALUE CLI flags
10
- *
11
- * Note: process.env is NOT merged here -- it's handled at step-context level.
12
- *
13
- * @param kiciDir - Path to the .kici directory
14
- * @param envFlags - Optional --env KEY=VALUE flag values
15
- * @returns Merged secrets with correct precedence
16
- */
17
- export declare function loadLocalSecrets(kiciDir: string, envFlags?: string[]): Promise<ParsedSecrets>;
18
- //# sourceMappingURL=secret-loader.d.ts.map
@@ -1,16 +0,0 @@
1
- import type { SimulatedEvent } from '@kici-dev/engine';
2
- import type { EventPayload } from '@kici-dev/sdk';
3
- /**
4
- * Map a {@link SimulatedEvent} into the normalized SDK {@link EventPayload}
5
- * envelope that every user-authored dynamic function (dynamic job generators,
6
- * `concurrency.group()`) receives as its `event` argument.
7
- *
8
- * `SimulatedEvent` already carries the normalized fields (`type`, `action`,
9
- * `targetBranch`, …) alongside the raw provider body under `payload`, so the
10
- * single cast at this boundary is a deliberate type assertion over a
11
- * structurally-identical value: it asserts the discriminated-union view
12
- * without reshaping anything. Raw provider fields stay nested under
13
- * `payload.<field>`; normalized fields live at the top level.
14
- */
15
- export declare function toEventPayload(event: SimulatedEvent): EventPayload;
16
- //# sourceMappingURL=to-event-payload.d.ts.map
@@ -1,93 +0,0 @@
1
- import type { MatrixValues, Job } from '@kici-dev/sdk';
2
- import type { CheckMode } from '@kici-dev/engine';
3
- import type { JobResult } from '../test-runner/job-executor.js';
4
- /**
5
- * All CLI flags for `kici run local`.
6
- */
7
- export interface RunLocalOptions {
8
- /** Positional arg: event type (e.g. 'push', 'pr:open'). Optional when `pick` is true. */
9
- event?: string;
10
- /** --pick / -p: interactive workflow picker (derives event arg from the selected trigger) */
11
- pick?: boolean;
12
- /** --workflow filter: run only matching workflow */
13
- workflow?: string;
14
- /** --job filter: run only matching job (includes transitive deps) */
15
- job?: string;
16
- /** --branch override: override detected git branch */
17
- branch?: string;
18
- /** --sha override: override detected git SHA */
19
- sha?: string;
20
- /** --payload path: explicit event payload JSON file */
21
- payload?: string;
22
- /** --concurrency: max parallel jobs (default: os.availableParallelism()) */
23
- concurrency?: number;
24
- /** --keep-going: continue after job failure (default: false) */
25
- keepGoing?: boolean;
26
- /** --container: use Podman isolation (default: false) */
27
- container?: boolean;
28
- /** --env KEY=VALUE overrides (repeatable) */
29
- env?: string[];
30
- /** --input KEY=VALUE typed workflow-dispatch inputs (repeatable) */
31
- inputs?: string[];
32
- /** --quiet: minimal output */
33
- quiet?: boolean;
34
- /** --json: JSON output format */
35
- json?: boolean;
36
- /** --junit: path for JUnit XML report */
37
- junit?: string;
38
- /** --files: override changed file paths (repeatable) */
39
- files?: string[];
40
- /** --debug: verbose debug output */
41
- debug?: boolean;
42
- /** --kici-dir: path to .kici directory */
43
- kiciDir?: string;
44
- /** --in-place: run against the real working directory instead of an isolated tmp checkout */
45
- inPlace?: boolean;
46
- /** --keep: always retain the isolated tmp checkout (default: keep only on failure) */
47
- keep?: boolean;
48
- /**
49
- * Run mode resolved from --check / --fail-on-drift. Threads to the agent step
50
- * loop: `apply` (default) converges, `check` previews drift, `check-fail-on-drift`
51
- * previews drift and fails the run if any step reports drift. Defaults to `apply`.
52
- */
53
- checkMode?: CheckMode;
54
- }
55
- /**
56
- * A job after matrix expansion with resolved values.
57
- */
58
- export interface ResolvedJob {
59
- /** Original job definition */
60
- job: Job;
61
- /** Expanded name (e.g. 'test (node-18, linux)') */
62
- expandedName: string;
63
- /** Matrix values for this expansion (empty object if no matrix) */
64
- matrixValues: MatrixValues;
65
- /** Resolved dependency names (expanded names of upstream jobs) */
66
- resolvedNeeds: string[];
67
- }
68
- /**
69
- * Result for a single job execution in local mode.
70
- * Extends JobResult with matrix context and cancellation.
71
- */
72
- export interface LocalJobResult extends Omit<JobResult, 'status'> {
73
- /** Job completion status (adds 'cancelled' to base JobResult statuses) */
74
- status: 'success' | 'failure' | 'skipped' | 'cancelled';
75
- /** Matrix values if this job was part of a matrix expansion */
76
- matrixValues?: MatrixValues;
77
- /** Whether this job was cancelled (e.g. by AbortSignal) */
78
- cancelled?: boolean;
79
- }
80
- /**
81
- * Result of executing a workflow locally.
82
- */
83
- export interface WorkflowExecutionResult {
84
- /** Workflow name */
85
- name: string;
86
- /** Overall status */
87
- status: 'success' | 'failure' | 'skipped';
88
- /** Individual job results */
89
- jobs: LocalJobResult[];
90
- /** Total execution duration in milliseconds */
91
- durationMs: number;
92
- }
93
- //# sourceMappingURL=types.d.ts.map
@@ -1,82 +0,0 @@
1
- /**
2
- * Workflow-level concurrency lock for `kici run local`.
3
- *
4
- * Enforces the SDK-declared `workflow.concurrency` block across concurrent
5
- * `kici run local` invocations on the same machine and user. Mirrors the
6
- * orchestrator semantics:
7
- *
8
- * - `group` callback evaluated against the simulated event, fails closed
9
- * on throw via {@link ConcurrencyKeyEvaluationError} (the caller aborts the
10
- * run rather than fall back to the workflow name).
11
- * - `cancelInProgress: true` interrupts the holder via SIGTERM, escalates
12
- * to SIGKILL after `KICI_LOCAL_LOCK_KILL_GRACE_MS` (default 30000ms).
13
- * - Otherwise contention waits in FIFO order on the underlying file lock.
14
- * - Stale locks (holder PID gone per `process.kill(pid, 0)`) are reclaimed.
15
- *
16
- * The lock primitive is `proper-lockfile` (atomic `mkdir` of a `.lock`
17
- * directory next to the metadata sidecar). The lock identity is
18
- * `sha256(workflowName + '\0' + groupKey)`, scoped to a per-user lock dir
19
- * (`$XDG_RUNTIME_DIR/kici-local-locks/` on Linux, else
20
- * `os.tmpdir()/kici-local-locks-<uid>/`).
21
- */
22
- import type { Workflow } from '@kici-dev/sdk';
23
- import type { SimulatedEvent } from '@kici-dev/engine';
24
- /** Sidecar metadata persisted next to the lock dir for diagnostics + reclamation. */
25
- export interface LockHolderMetadata {
26
- pid: number;
27
- startedAt: string;
28
- workflowName: string;
29
- groupKey: string;
30
- hostname: string;
31
- }
32
- /** Handle returned by {@link acquireWorkflowLock}. Caller MUST invoke `release()` in a `finally`. */
33
- export interface WorkflowLockHandle {
34
- release(): Promise<void>;
35
- }
36
- export interface AcquireWorkflowLockOptions {
37
- workflowName: string;
38
- workflow: Workflow;
39
- /** The simulated event mapped to the normalized envelope passed as `groupCtx.event`. */
40
- event: SimulatedEvent;
41
- /** Branch derived from the simulated event for `groupCtx.branch`. */
42
- branch: string;
43
- debug?: boolean;
44
- }
45
- /**
46
- * Thrown when the workflow's `concurrency.group()` function throws or rejects.
47
- * The caller surfaces this as a workflow failure (it does NOT fall back to the
48
- * workflow name as a key — fail-closed is the documented contract).
49
- */
50
- export declare class ConcurrencyKeyEvaluationError extends Error {
51
- readonly cause?: Error;
52
- readonly workflowName: string;
53
- constructor(workflowName: string, cause: unknown);
54
- }
55
- /** Module-level stub for `process.kill`, swappable by tests via {@link __setKillFnForTesting}. */
56
- type KillFn = (pid: number, signal?: string | number) => boolean;
57
- /** Test-only: swap the kill function so unit tests don't actually signal real PIDs. */
58
- export declare function __setKillFnForTesting(fn?: KillFn): void;
59
- /**
60
- * Resolve the per-user lock directory. Prefers `$XDG_RUNTIME_DIR/kici-local-locks/`
61
- * (Linux per-user runtime dir, mode 0700), else `os.tmpdir()/kici-local-locks-<uid>/`.
62
- *
63
- * Created with `mode: 0o700`. Falls through silently to the tmpdir form on EACCES/EROFS.
64
- */
65
- export declare function resolveLockDir(): Promise<string>;
66
- /**
67
- * Evaluate the workflow's concurrency `group` function against the simulated event.
68
- *
69
- * Returns `null` when the workflow has no `concurrency` block. Throws
70
- * {@link ConcurrencyKeyEvaluationError} when the group function throws or rejects.
71
- */
72
- export declare function resolveConcurrencyKey(workflow: Workflow, event: SimulatedEvent, branch: string): Promise<string | null>;
73
- /**
74
- * Acquire the workflow-level concurrency lock for a `kici run local` invocation.
75
- *
76
- * Returns `null` immediately when the workflow has no `concurrency` block (no
77
- * locking is performed). Otherwise blocks until the lock is held, then returns
78
- * a handle whose `release()` MUST be invoked in a `finally`.
79
- */
80
- export declare function acquireWorkflowLock(opts: AcquireWorkflowLockOptions): Promise<WorkflowLockHandle | null>;
81
- export {};
82
- //# sourceMappingURL=workflow-lock.d.ts.map
@@ -1,74 +0,0 @@
1
- {
2
- "name": "winston",
3
- "description": "A logger for just about everything.",
4
- "version": "3.19.0",
5
- "author": "Charlie Robbins <charlie.robbins@gmail.com>",
6
- "maintainers": [
7
- "David Hyde <dabh@alumni.stanford.edu>"
8
- ],
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/winstonjs/winston.git"
12
- },
13
- "keywords": [
14
- "winston",
15
- "logger",
16
- "logging",
17
- "logs",
18
- "sysadmin",
19
- "bunyan",
20
- "pino",
21
- "loglevel",
22
- "tools",
23
- "json",
24
- "stream"
25
- ],
26
- "dependencies": {
27
- "@dabh/diagnostics": "^2.0.8",
28
- "@colors/colors": "^1.6.0",
29
- "async": "^3.2.3",
30
- "is-stream": "^2.0.0",
31
- "logform": "^2.7.0",
32
- "one-time": "^1.0.0",
33
- "readable-stream": "^3.4.0",
34
- "safe-stable-stringify": "^2.3.1",
35
- "stack-trace": "0.0.x",
36
- "triple-beam": "^1.3.0",
37
- "winston-transport": "^4.9.0"
38
- },
39
- "devDependencies": {
40
- "@babel/cli": "^7.23.9",
41
- "@babel/core": "^7.24.0",
42
- "@babel/preset-env": "^7.24.0",
43
- "@dabh/eslint-config-populist": "^4.4.0",
44
- "@types/node": "^20.11.24",
45
- "abstract-winston-transport": "^0.5.1",
46
- "assume": "^2.2.0",
47
- "cross-spawn-async": "^2.2.5",
48
- "eslint": "^8.57.0",
49
- "hock": "^1.4.1",
50
- "jest": "^29.7.0",
51
- "rimraf": "5.0.10",
52
- "split2": "^4.1.0",
53
- "std-mocks": "^2.0.0",
54
- "through2": "^4.0.2",
55
- "winston-compat": "^0.1.5"
56
- },
57
- "main": "./lib/winston.js",
58
- "browser": "./dist/winston",
59
- "types": "./index.d.ts",
60
- "scripts": {
61
- "lint": "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
62
- "test": "jest",
63
- "test:unit": "jest -c test/jest.config.unit.js",
64
- "test:integration": "jest -c test/jest.config.integration.js",
65
- "test:typescript": "npx --package typescript tsc --project test",
66
- "build": "babel lib -d dist",
67
- "prebuild": "rimraf dist",
68
- "prepublishOnly": "npm run build"
69
- },
70
- "engines": {
71
- "node": ">= 12.0.0"
72
- },
73
- "license": "MIT"
74
- }