@kici-dev/compiler 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/headless-detect.js +1 -1
- package/dist/cli-banner.js +1 -1
- package/dist/cli.d.ts +18 -0
- package/dist/cli.js +57 -6
- package/dist/commands/approve.js +2 -2
- package/dist/commands/check-mode.js +1 -1
- package/dist/commands/compile.js +1 -1
- package/dist/commands/diagnostics.js +1 -1
- package/dist/commands/docs.js +1 -1
- package/dist/commands/drain-worker.js +1 -1
- package/dist/commands/endpoints.js +1 -1
- package/dist/commands/fixture.js +2 -2
- package/dist/commands/held-run-client.d.ts +1 -1
- package/dist/commands/held-run-client.js +1 -1
- package/dist/commands/hook.js +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.js +3 -3
- package/dist/commands/init.js +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/orchestrators.js +1 -1
- package/dist/commands/org.js +1 -1
- package/dist/commands/pat.js +1 -1
- package/dist/commands/preview.js +1 -1
- package/dist/commands/reject.js +2 -2
- package/dist/commands/run-hold-watch.d.ts +10 -1
- package/dist/commands/run-hold-watch.js +13 -12
- package/dist/commands/run.d.ts +9 -0
- package/dist/commands/run.js +29 -6
- package/dist/commands/runs/cancel.js +1 -1
- package/dist/commands/runs/list.js +1 -1
- package/dist/commands/runs/logs.js +1 -1
- package/dist/commands/runs/rerun.js +1 -1
- package/dist/commands/runs/show.js +1 -1
- package/dist/commands/secrets-list.js +1 -1
- package/dist/commands/types.js +1 -1
- package/dist/commands/verify-attestation.js +8 -2
- package/dist/commands/watch.js +1 -1
- package/dist/commands/workflows.js +1 -1
- package/dist/errors/capability-gap.js +1 -1
- package/dist/errors/formatter.js +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/execution/executor.d.ts +5 -6
- package/dist/execution/executor.js +6 -7
- package/dist/execution/index.js +1 -1
- package/dist/execution/sdk-alias.d.ts +4 -14
- package/dist/execution/sdk-alias.js +6 -45
- package/dist/execution/ts-loader.js +1 -1
- package/dist/fixtures/compiler.js +1 -1
- package/dist/fixtures/defaults/index.js +1 -1
- package/dist/fixtures/describe-event.d.ts +0 -4
- package/dist/fixtures/describe-event.js +35 -5
- package/dist/fixtures/picker.js +1 -1
- package/dist/format.js +1 -1
- package/dist/generators/secrets-dts.js +1 -1
- package/dist/hooks/detector.js +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/installer.js +1 -1
- package/dist/hooks/templates.js +1 -1
- package/dist/index.js +1 -1
- package/dist/llm-context/llms-architecture.txt +1 -1
- package/dist/llm-context/llms-cli.txt +230 -40
- package/dist/llm-context/llms-features.txt +24 -19
- package/dist/llm-context/llms-full.txt +256 -61
- package/dist/llm-context/llms-getting-started.txt +1 -1
- package/dist/llm-context/llms.txt +2 -2
- package/dist/local-executor/dag-scheduler.js +1 -1
- package/dist/local-executor/index.js +1 -1
- package/dist/local-executor/job-runner.js +1 -1
- package/dist/local-executor/materializer.js +1 -1
- package/dist/local-executor/output-streamer.js +1 -1
- package/dist/local-executor/payload-generator.js +1 -1
- package/dist/local-executor/picker.js +1 -1
- package/dist/local-executor/runs-on-display.js +1 -1
- package/dist/local-executor/secret-loader.js +1 -1
- package/dist/local-executor/to-event-payload.js +1 -1
- package/dist/local-executor/types.js +1 -1
- package/dist/local-executor/workflow-lock.js +0 -0
- package/dist/lockfile/generator.js +1 -1
- package/dist/lockfile/hash-files.js +1 -1
- package/dist/lockfile/hasher.js +1 -1
- package/dist/lockfile/index.js +1 -1
- package/dist/lockfile/purity-analyzer.js +3 -3
- package/dist/postinstall.js +1 -1
- package/dist/provenance-trust-root.js +1 -1
- package/dist/remote/config.js +1 -1
- package/dist/remote/dashboard-client.js +1 -1
- package/dist/remote/encryption.js +1 -1
- package/dist/remote/history.js +1 -1
- package/dist/remote/local-repo-identity.js +1 -1
- package/dist/remote/oauth.js +1 -1
- package/dist/remote/oidc-discovery.js +1 -1
- package/dist/remote/output/json.js +1 -1
- package/dist/remote/output/junit.js +1 -1
- package/dist/remote/output/streaming.js +1 -1
- package/dist/remote/output/summary.js +1 -1
- package/dist/remote/platform-client.d.ts +2 -0
- package/dist/remote/platform-client.js +1 -1
- package/dist/remote/prod-defaults.d.ts +1 -1
- package/dist/remote/prod-defaults.js +2 -2
- package/dist/remote/render.js +1 -1
- package/dist/remote/secret-upload.js +1 -1
- package/dist/remote/uploader.js +4 -4
- package/dist/{chunk-BTugEXQM.js → rolldown-runtime-ClRpJifh.js} +0 -1
- package/dist/templates/agents-md.js +1 -1
- package/dist/templates/index.js +1 -1
- package/dist/templates/package-json.js +2 -2
- package/dist/templates/tsconfig-json.js +1 -1
- package/dist/templates/workflows/hello-world.js +1 -1
- package/dist/templates/workflows/pr-checks.js +1 -1
- package/dist/test-runner/dry-run.js +1 -1
- package/dist/test-runner/event-types.js +1 -1
- package/dist/test-runner/git-detector.js +1 -1
- package/dist/test-runner/index.js +1 -1
- package/dist/test-runner/job-executor.js +1 -1
- package/dist/test-runner/output-formatter.js +1 -1
- package/dist/test-runner/payload-builder.js +1 -1
- package/dist/test-runner/rule-evaluator.js +1 -1
- package/dist/test-runner/secrets-file.js +1 -1
- package/dist/test-runner/step-context.js +1 -1
- package/dist/types.js +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/validator.js +1 -1
- package/package.json +4 -4
- package/sbom.spdx.json +35 -35
- package/dist/commands/held-run-resolve.js +0 -53
package/dist/cli-banner.js
CHANGED
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
/**
|
|
4
|
+
* Top-level commands that were removed, mapped to their current equivalent.
|
|
5
|
+
* Consulted when the CLI hits an unknown command so the user gets a precise
|
|
6
|
+
* redirect instead of a bare "unknown command" dead end. The redirect text
|
|
7
|
+
* lives here once; every consumer reads it from this map.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RETIRED_COMMANDS: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* Redirect message for a retired top-level command, or undefined if the name is
|
|
12
|
+
* not a known-retired command.
|
|
13
|
+
*/
|
|
14
|
+
export declare function retiredCommandHint(commandName: string | undefined): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Derive the command name a user attempted from the parsed operands, falling
|
|
17
|
+
* back to the first non-option token in the raw argv. Used to look up a retired
|
|
18
|
+
* command after commander rejects an unknown command.
|
|
19
|
+
*/
|
|
20
|
+
export declare function attemptedCommand(program: Command, argv: string[]): string | undefined;
|
|
3
21
|
/**
|
|
4
22
|
* Build the kici Commander program with every command registered. Exported so
|
|
5
23
|
* the surface registry can walk the real command tree without parsing argv (no
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./
|
|
2
|
+
import "./rolldown-runtime-ClRpJifh.js";
|
|
3
3
|
import { shouldSuppressBanner } from "./cli-banner.js";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { resolve } from "node:path";
|
|
@@ -7,7 +7,34 @@ import { realpathSync } from "node:fs";
|
|
|
7
7
|
import { Argument, Command, Option } from "commander";
|
|
8
8
|
import pc from "picocolors";
|
|
9
9
|
//#region src/cli.ts
|
|
10
|
-
const version = "0.1.
|
|
10
|
+
const version = "0.1.26";
|
|
11
|
+
/**
|
|
12
|
+
* Top-level commands that were removed, mapped to their current equivalent.
|
|
13
|
+
* Consulted when the CLI hits an unknown command so the user gets a precise
|
|
14
|
+
* redirect instead of a bare "unknown command" dead end. The redirect text
|
|
15
|
+
* lives here once; every consumer reads it from this map.
|
|
16
|
+
*/
|
|
17
|
+
const RETIRED_COMMANDS = {
|
|
18
|
+
status: "`kici status` is no longer a command. Use `kici runs list` / `kici runs show <run-id>` to inspect runs, or `kici diagnostics` for orchestrator, scaler, and agent health.",
|
|
19
|
+
cancel: "`kici cancel` is no longer a command. Use `kici runs cancel <run-id>`."
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Redirect message for a retired top-level command, or undefined if the name is
|
|
23
|
+
* not a known-retired command.
|
|
24
|
+
*/
|
|
25
|
+
function retiredCommandHint(commandName) {
|
|
26
|
+
return commandName ? RETIRED_COMMANDS[commandName] : void 0;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Derive the command name a user attempted from the parsed operands, falling
|
|
30
|
+
* back to the first non-option token in the raw argv. Used to look up a retired
|
|
31
|
+
* command after commander rejects an unknown command.
|
|
32
|
+
*/
|
|
33
|
+
function attemptedCommand(program, argv) {
|
|
34
|
+
const firstOperand = program.args[0];
|
|
35
|
+
if (firstOperand) return firstOperand;
|
|
36
|
+
return argv.slice(2).find((token) => !token.startsWith("-"));
|
|
37
|
+
}
|
|
11
38
|
/**
|
|
12
39
|
* Build the kici Commander program with every command registered. Exported so
|
|
13
40
|
* the surface registry can walk the real command tree without parsing argv (no
|
|
@@ -23,6 +50,8 @@ function buildProgram() {
|
|
|
23
50
|
program.configureOutput({ outputError: (str, write) => {
|
|
24
51
|
write(pc.red(str));
|
|
25
52
|
} });
|
|
53
|
+
program.showSuggestionAfterError(true);
|
|
54
|
+
program.showHelpAfterError("(run `kici --help` to see all commands)");
|
|
26
55
|
program.command("compile").description("Compile workflows from .kici/workflows/ to kici.lock.json").option("--check", "Validate workflows without writing lock file", false).option("--kici-dir <path>", "Path to .kici directory", ".kici").option("--verbose", "Detailed output", false).option("--watch", "Watch for changes and recompile", false).action(async (options) => {
|
|
27
56
|
const { compileCommand, watchCommand } = await import("./commands/index.js");
|
|
28
57
|
if (options.watch) await watchCommand({
|
|
@@ -50,7 +79,8 @@ function buildProgram() {
|
|
|
50
79
|
process.exit(2);
|
|
51
80
|
}
|
|
52
81
|
if (!options.pick && !event) {
|
|
53
|
-
|
|
82
|
+
const { printRunLocalUsage } = await import("./commands/index.js");
|
|
83
|
+
printRunLocalUsage();
|
|
54
84
|
process.exit(2);
|
|
55
85
|
}
|
|
56
86
|
const { runLocalCommand } = await import("./commands/index.js");
|
|
@@ -90,7 +120,7 @@ function buildProgram() {
|
|
|
90
120
|
});
|
|
91
121
|
process.exit(success ? 0 : 1);
|
|
92
122
|
});
|
|
93
|
-
runCommand.command("remote").argument("[fixture]", "Fixture name or glob pattern (omit to list available)").description("Execute fixtures remotely via orchestrator").option("--workflow <name>", "Run a specific workflow directly (bypass triggers)").option("--all", "Run all available fixtures", false).option("-p, --pick", "Interactively pick fixtures to run", false).option("--parallel", "Run matching fixtures concurrently", false).option("--no-wait", "Fire and forget (print runIds, don't stream)").option("--quiet", "Suppress output except final result", false).option("--json", "Output structured JSON result", false).option("--junit <path>", "Output JUnit XML result").option("--history", "Show recent run history", false).option("--routing-key <key>", "Override routing key for this run").option("--org <id>", "Target organization (overrides the active org)").option("--orchestrator <name>", "Target orchestrator cluster (overrides the per-org default)").option("--debug", "Verbose internals", false).option("--kici-dir <path>", "Path to .kici directory", ".kici").option("--context <ctx.key=value>", "Inject a namespaced context secret, uploaded encrypted to the orchestrator (repeatable)", (val, prev) => [...prev, val], []).option("--env <KEY=VALUE>", "Provide a per-run secret (repeatable); uploaded encrypted to the orchestrator", (val, prev) => [...prev, val], []).option("--check", "Run in check mode: report drift, change nothing", false).option("--fail-on-drift", "In check mode, exit non-zero if any step reports drift", false).option("--target <selector>", "Narrow runsOnAll jobs to hosts matching this label selector (repeatable, AND-combined)", (val, prev) => [...prev, val], []).option("--target-allow-empty", "A --target that narrows a runsOnAll job to zero hosts skips it instead of failing", false).option("--input <KEY=VALUE>", "Typed workflow-dispatch input (repeatable)", (val, prev) => [...prev, val], []).option("--approve-all
|
|
123
|
+
runCommand.command("remote").argument("[fixture]", "Fixture name or glob pattern (omit to list available)").description("Execute fixtures remotely via orchestrator").option("--workflow <name>", "Run a specific workflow directly (bypass triggers)").option("--all", "Run all available fixtures", false).option("-p, --pick", "Interactively pick fixtures to run", false).option("--parallel", "Run matching fixtures concurrently", false).option("--no-wait", "Fire and forget (print runIds, don't stream)").option("--quiet", "Suppress output except final result", false).option("--json", "Output structured JSON result", false).option("--junit <path>", "Output JUnit XML result").option("--history", "Show recent run history", false).option("--routing-key <key>", "Override routing key for this run").option("--org <id>", "Target organization (overrides the active org)").option("--orchestrator <name>", "Target orchestrator cluster (overrides the per-org default)").option("--debug", "Verbose internals", false).option("--kici-dir <path>", "Path to .kici directory", ".kici").option("--context <ctx.key=value>", "Inject a namespaced context secret, uploaded encrypted to the orchestrator (repeatable)", (val, prev) => [...prev, val], []).option("--env <KEY=VALUE>", "Provide a per-run secret (repeatable); uploaded encrypted to the orchestrator", (val, prev) => [...prev, val], []).option("--check", "Run in check mode: report drift, change nothing", false).option("--fail-on-drift", "In check mode, exit non-zero if any step reports drift", false).option("--target <selector>", "Narrow runsOnAll jobs to hosts matching this label selector (repeatable, AND-combined)", (val, prev) => [...prev, val], []).option("--target-allow-empty", "A --target that narrows a runsOnAll job to zero hosts skips it instead of failing", false).option("--input <KEY=VALUE>", "Typed workflow-dispatch input (repeatable)", (val, prev) => [...prev, val], []).option("--yes, --approve-all", "Auto-approve every approval gate this run holds on (run-scoped; eligibility still enforced)", false).action(async (fixture, options) => {
|
|
94
124
|
if (options.pick && fixture) {
|
|
95
125
|
console.error("Error: --pick selects fixtures interactively; do not also pass a fixture name.");
|
|
96
126
|
process.exit(2);
|
|
@@ -312,9 +342,30 @@ Environment variables:
|
|
|
312
342
|
});
|
|
313
343
|
return program;
|
|
314
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Handle a commander parse exit thrown under `exitOverride`. Help and version
|
|
347
|
+
* requests exit cleanly; an unknown command is augmented with a retired-command
|
|
348
|
+
* redirect when one applies (commander already wrote the generic error,
|
|
349
|
+
* suggestion, and help pointer before throwing); every other parse error keeps
|
|
350
|
+
* commander's own exit code and already-printed message.
|
|
351
|
+
*/
|
|
352
|
+
function handleCliParseExit(err, argv, program) {
|
|
353
|
+
if (err.code === "commander.helpDisplayed" || err.code === "commander.version") process.exit(0);
|
|
354
|
+
if (err.code === "commander.unknownCommand") {
|
|
355
|
+
const hint = retiredCommandHint(attemptedCommand(program, argv));
|
|
356
|
+
if (hint) process.stderr.write(pc.red(`${hint}\n`));
|
|
357
|
+
}
|
|
358
|
+
process.exit(err.exitCode ?? 1);
|
|
359
|
+
}
|
|
315
360
|
/** Build the program and parse argv — the bin-shim entry point. */
|
|
316
361
|
function runCli(argv = process.argv) {
|
|
317
|
-
buildProgram()
|
|
362
|
+
const program = buildProgram();
|
|
363
|
+
program.exitOverride();
|
|
364
|
+
try {
|
|
365
|
+
program.parse(argv);
|
|
366
|
+
} catch (err) {
|
|
367
|
+
handleCliParseExit(err, argv, program);
|
|
368
|
+
}
|
|
318
369
|
}
|
|
319
370
|
/**
|
|
320
371
|
* Decide whether this module is the process entry point, tolerating a
|
|
@@ -340,6 +391,6 @@ function isMainEntryPoint(argv1, importMetaUrl) {
|
|
|
340
391
|
}
|
|
341
392
|
if (isMainEntryPoint(process.argv[1], import.meta.url)) runCli();
|
|
342
393
|
//#endregion
|
|
343
|
-
export { buildProgram, isMainEntryPoint, runCli };
|
|
394
|
+
export { RETIRED_COMMANDS, attemptedCommand, buildProgram, isMainEntryPoint, retiredCommandHint, runCli };
|
|
344
395
|
|
|
345
396
|
//# sourceMappingURL=cli.js.map
|
package/dist/commands/approve.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { listHeldRunsForRun, postApprove, resolveHeldRunContext } from "./held-run-client.js";
|
|
3
|
-
import { resolveHeldRunId } from "./held-run-resolve.js";
|
|
4
3
|
import pc from "picocolors";
|
|
5
4
|
import { logger, toErrorMessage } from "@kici-dev/core";
|
|
5
|
+
import { resolveHeldRunId } from "@kici-dev/engine";
|
|
6
6
|
//#region src/commands/approve.ts
|
|
7
7
|
/**
|
|
8
8
|
* kici approve command
|
package/dist/commands/compile.js
CHANGED
package/dist/commands/docs.js
CHANGED
package/dist/commands/fixture.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { parseEventArg } from "../test-runner/event-types.js";
|
|
3
3
|
import { detectRepoFromGit } from "../test-runner/git-detector.js";
|
|
4
4
|
import { getDefaultFixture } from "../fixtures/defaults/index.js";
|
|
@@ -13,7 +13,7 @@ import { logger } from "@kici-dev/core";
|
|
|
13
13
|
* including internal events (schedule, lifecycle, generic_webhook, kici_event).
|
|
14
14
|
*/
|
|
15
15
|
/** Internal event types that don't have GitHub webhook fixture files */
|
|
16
|
-
const INTERNAL_EVENT_TYPES = new Set([
|
|
16
|
+
const INTERNAL_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
17
17
|
"kici_event",
|
|
18
18
|
"workflow_complete",
|
|
19
19
|
"job_complete",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* exposes thin list / approve / reject helpers against the Platform dashboard
|
|
6
6
|
* API.
|
|
7
7
|
*/
|
|
8
|
-
import type { HeldRunSummary } from '
|
|
8
|
+
import type { HeldRunSummary } from '@kici-dev/engine';
|
|
9
9
|
/** Resolved auth context for a held-run command. */
|
|
10
10
|
export interface HeldRunContext {
|
|
11
11
|
endpoint: string;
|
package/dist/commands/hook.js
CHANGED
package/dist/commands/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { fixtureCommand } from './fixture.js';
|
|
|
5
5
|
export type { FixtureOptions } from './fixture.js';
|
|
6
6
|
export { previewCommand, previewEvent } from './preview.js';
|
|
7
7
|
export type { PreviewOptions, RemoteRunOptions, RemoteRunResult } from './preview.js';
|
|
8
|
-
export { runLocalCommand, runRemoteCommand } from './run.js';
|
|
8
|
+
export { runLocalCommand, runRemoteCommand, printRunLocalUsage } from './run.js';
|
|
9
9
|
export { initCommand } from './init.js';
|
|
10
10
|
export type { InitOptions } from './init.js';
|
|
11
11
|
export { hookInstallCommand } from './hook.js';
|
package/dist/commands/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { compileCommand } from "./compile.js";
|
|
3
3
|
import { approveCommand } from "./approve.js";
|
|
4
4
|
import { diagnosticsCommand } from "./diagnostics.js";
|
|
@@ -9,7 +9,7 @@ import { fixtureCommand } from "./fixture.js";
|
|
|
9
9
|
import { hookInstallCommand } from "./hook.js";
|
|
10
10
|
import { watchCommand } from "./watch.js";
|
|
11
11
|
import { previewCommand, previewEvent } from "./preview.js";
|
|
12
|
-
import { runLocalCommand, runRemoteCommand } from "./run.js";
|
|
12
|
+
import { printRunLocalUsage, runLocalCommand, runRemoteCommand } from "./run.js";
|
|
13
13
|
import { initCommand } from "./init.js";
|
|
14
14
|
import { loginCommand } from "./login.js";
|
|
15
15
|
import { secretsListCommand } from "./secrets-list.js";
|
|
@@ -26,4 +26,4 @@ import { logoutCommand } from "./logout.js";
|
|
|
26
26
|
import { rejectCommand } from "./reject.js";
|
|
27
27
|
import { workflowsListCommand } from "./workflows.js";
|
|
28
28
|
import { verifyAttestationCommand } from "./verify-attestation.js";
|
|
29
|
-
export { approveCommand, compileCommand, diagnosticsCommand, docsCommand, docsLlmCommand, drainWorkerCommand, endpointsCommand, fixtureCommand, hookInstallCommand, initCommand, loginCommand, logoutCommand, orchestratorsListCommand, orchestratorsUseCommand, orgCurrentCommand, orgListCommand, orgUseCommand, patCreateCommand, previewCommand, previewEvent, rejectCommand, runLocalCommand, runRemoteCommand, runsCancelCommand, runsListCommand, runsLogsCommand, runsRerunCommand, runsShowCommand, secretsListCommand, typesCommand, verifyAttestationCommand, watchCommand, workflowsListCommand };
|
|
29
|
+
export { approveCommand, compileCommand, diagnosticsCommand, docsCommand, docsLlmCommand, drainWorkerCommand, endpointsCommand, fixtureCommand, hookInstallCommand, initCommand, loginCommand, logoutCommand, orchestratorsListCommand, orchestratorsUseCommand, orgCurrentCommand, orgListCommand, orgUseCommand, patCreateCommand, previewCommand, previewEvent, printRunLocalUsage, rejectCommand, runLocalCommand, runRemoteCommand, runsCancelCommand, runsListCommand, runsLogsCommand, runsRerunCommand, runsShowCommand, secretsListCommand, typesCommand, verifyAttestationCommand, watchCommand, workflowsListCommand };
|
package/dist/commands/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { agentsMdTemplate } from "../templates/agents-md.js";
|
|
3
3
|
import { tsconfigTemplate } from "../templates/tsconfig-json.js";
|
|
4
4
|
import { generatePackageJson } from "../templates/package-json.js";
|
package/dist/commands/login.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { getConfigPath, loadGlobalConfig, mergeGlobalConfig, saveGlobalConfig } from "../remote/config.js";
|
|
3
3
|
import { deviceFlow, exchangeTokenForPat, pkceFlow } from "../remote/oauth.js";
|
|
4
4
|
import "../remote/prod-defaults.js";
|
package/dist/commands/logout.js
CHANGED
package/dist/commands/org.js
CHANGED
package/dist/commands/pat.js
CHANGED
package/dist/commands/preview.js
CHANGED
package/dist/commands/reject.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { listHeldRunsForRun, postReject, resolveHeldRunContext } from "./held-run-client.js";
|
|
3
|
-
import { resolveHeldRunId } from "./held-run-resolve.js";
|
|
4
3
|
import pc from "picocolors";
|
|
5
4
|
import { logger, toErrorMessage } from "@kici-dev/core";
|
|
5
|
+
import { resolveHeldRunId } from "@kici-dev/engine";
|
|
6
6
|
//#region src/commands/reject.ts
|
|
7
7
|
/**
|
|
8
8
|
* kici reject command
|
|
@@ -10,10 +10,13 @@
|
|
|
10
10
|
* path as `kici approve` / `kici reject`. In a non-TTY it prints guidance and
|
|
11
11
|
* keeps polling (the run stays held until resolved out-of-band).
|
|
12
12
|
*/
|
|
13
|
-
import type { HeldRunSummary } from '
|
|
13
|
+
import type { HeldRunSummary } from '@kici-dev/engine';
|
|
14
14
|
import { type HeldRunContext } from './held-run-client.js';
|
|
15
15
|
/** A yes/no prompt; injected so the poll branch is unit-testable. */
|
|
16
16
|
export type ConfirmPrompt = (message: string) => Promise<boolean>;
|
|
17
|
+
/** Where hold/approve text is written. Injected so callers can route it to
|
|
18
|
+
* stderr in quiet/json mode (keeping stdout a pure JSON channel). */
|
|
19
|
+
export type HoldOutput = (line: string) => void;
|
|
17
20
|
/** What to do with a newly-observed hold. Pure — no IO. */
|
|
18
21
|
export type HoldAction = {
|
|
19
22
|
kind: 'prompt';
|
|
@@ -48,6 +51,12 @@ export declare function handleNewHolds(args: {
|
|
|
48
51
|
* audits it distinctly. Eligibility is still enforced server-side.
|
|
49
52
|
*/
|
|
50
53
|
approveAll?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Where hold/approve text goes. Defaults to `logger.info` (stdout). Quiet /
|
|
56
|
+
* `--json` callers pass a stderr sink so the machine-readable stdout payload
|
|
57
|
+
* stays pure.
|
|
58
|
+
*/
|
|
59
|
+
output?: HoldOutput;
|
|
51
60
|
/** Override for tests; defaults to the shared Platform held-run context. */
|
|
52
61
|
resolveContext?: () => Promise<HeldRunContext | null>;
|
|
53
62
|
/** Override for tests. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { postApprove, postReject, resolveHeldRunContext } from "./held-run-client.js";
|
|
3
3
|
import pc from "picocolors";
|
|
4
4
|
import { logger } from "@kici-dev/core";
|
|
@@ -37,14 +37,14 @@ function classifyNewHolds(holds, seen, isTty) {
|
|
|
37
37
|
seen: next
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
/** Print a hold's identity + its drift payload (when present)
|
|
41
|
-
function printHold(hold) {
|
|
40
|
+
/** Print a hold's identity + its drift payload (when present) via `out`. */
|
|
41
|
+
function printHold(hold, out) {
|
|
42
42
|
const scope = hold.holdScope ?? "job";
|
|
43
43
|
const where = scope === "step" && hold.stepIndex != null ? `step #${hold.stepIndex}${hold.jobId ? ` of job '${hold.jobId}'` : ""}` : hold.jobId ? `job '${hold.jobId}'` : scope;
|
|
44
|
-
|
|
44
|
+
out(pc.yellow(`\n[kici] Run held for approval (${where}).`));
|
|
45
45
|
if (hold.payload?.summaryMarkdown) {
|
|
46
|
-
|
|
47
|
-
for (const line of hold.payload.summaryMarkdown.split("\n"))
|
|
46
|
+
out(pc.dim("Computed drift — review before approving:"));
|
|
47
|
+
for (const line of hold.payload.summaryMarkdown.split("\n")) out(pc.dim(` ${line}`));
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -56,28 +56,29 @@ function printHold(hold) {
|
|
|
56
56
|
async function handleNewHolds(args) {
|
|
57
57
|
const { actions, seen } = classifyNewHolds(args.holds, args.seen, args.isTty);
|
|
58
58
|
if (actions.length === 0) return seen;
|
|
59
|
+
const out = args.output ?? ((line) => logger.info(line));
|
|
59
60
|
const resolveCtx = args.resolveContext ?? resolveHeldRunContext;
|
|
60
61
|
const doApprove = args.approve ?? postApprove;
|
|
61
62
|
const doReject = args.reject ?? postReject;
|
|
62
63
|
let ctx = null;
|
|
63
|
-
if (args.approveAll)
|
|
64
|
+
if (args.approveAll) out(pc.yellow("[kici] --approve-all: auto-approving every gate for this run (eligibility enforced)."));
|
|
64
65
|
for (const action of actions) {
|
|
65
|
-
printHold(action.hold);
|
|
66
|
+
printHold(action.hold, out);
|
|
66
67
|
ctx = ctx ?? await resolveCtx();
|
|
67
68
|
if (!ctx) {
|
|
68
|
-
|
|
69
|
+
out(pc.dim(`Run held; approve via \`kici approve ${action.hold.runId}\`.`));
|
|
69
70
|
continue;
|
|
70
71
|
}
|
|
71
72
|
if (args.approveAll) {
|
|
72
|
-
if (await doApprove(ctx, action.hold.id, true))
|
|
73
|
+
if (await doApprove(ctx, action.hold.id, true)) out(pc.green("[kici] Auto-approved."));
|
|
73
74
|
continue;
|
|
74
75
|
}
|
|
75
76
|
if (action.kind === "notify") {
|
|
76
|
-
|
|
77
|
+
out(pc.dim(`Run held; approve via the dashboard or \`kici approve ${action.hold.runId}\`.`));
|
|
77
78
|
continue;
|
|
78
79
|
}
|
|
79
80
|
const approved = await args.confirm("Approve this gate?");
|
|
80
|
-
if (approved ? await doApprove(ctx, action.hold.id) : await doReject(ctx, action.hold.id, "rejected via kici run"))
|
|
81
|
+
if (approved ? await doApprove(ctx, action.hold.id) : await doReject(ctx, action.hold.id, "rejected via kici run")) out(approved ? pc.green("[kici] Approved.") : pc.red("[kici] Rejected."));
|
|
81
82
|
}
|
|
82
83
|
return seen;
|
|
83
84
|
}
|
package/dist/commands/run.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { type HostTargetSelector, type InputsDescriptorMap } from '@kici-dev/engine';
|
|
2
2
|
import type { RunLocalOptions } from '../local-executor/types.js';
|
|
3
3
|
import type { RemoteRunOptions } from './preview.js';
|
|
4
|
+
/**
|
|
5
|
+
* Print a usage block for `kici run local` when the event argument is missing.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors the discoverable help `kici preview` prints for a missing event: a
|
|
8
|
+
* bold synopsis line, a one-line description, and a few concrete event
|
|
9
|
+
* examples. The caller exits non-zero after printing — a missing event is a
|
|
10
|
+
* usage error, unlike `kici preview` which treats no-event as help.
|
|
11
|
+
*/
|
|
12
|
+
export declare function printRunLocalUsage(): void;
|
|
4
13
|
/**
|
|
5
14
|
* Compile `--target` selector strings into a {@link HostTargetSelector}. Each
|
|
6
15
|
* string becomes one AND value (its own include set); repeated values
|
package/dist/commands/run.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { resolveKiciDir } from "../execution/executor.js";
|
|
3
3
|
import "../execution/index.js";
|
|
4
4
|
import { loadGlobalConfig } from "../remote/config.js";
|
|
@@ -24,8 +24,26 @@ import { coerceDispatchInputs, parseInputPairs } from "@kici-dev/engine";
|
|
|
24
24
|
import { normalizeRunsOnToMatchers } from "@kici-dev/engine/labels/compile";
|
|
25
25
|
import { confirm } from "@inquirer/prompts";
|
|
26
26
|
//#region src/commands/run.ts
|
|
27
|
+
/**
|
|
28
|
+
* Print a usage block for `kici run local` when the event argument is missing.
|
|
29
|
+
*
|
|
30
|
+
* Mirrors the discoverable help `kici preview` prints for a missing event: a
|
|
31
|
+
* bold synopsis line, a one-line description, and a few concrete event
|
|
32
|
+
* examples. The caller exits non-zero after printing — a missing event is a
|
|
33
|
+
* usage error, unlike `kici preview` which treats no-event as help.
|
|
34
|
+
*/
|
|
35
|
+
function printRunLocalUsage() {
|
|
36
|
+
logger.info(pc.bold("\nUsage: kici run local <event> [options]\n"));
|
|
37
|
+
logger.info(pc.gray("Execute workflows locally for a given event, without orchestrator infrastructure.\n"));
|
|
38
|
+
logger.info(pc.gray("Examples:"));
|
|
39
|
+
logger.info(pc.gray(" kici run local push"));
|
|
40
|
+
logger.info(pc.gray(" kici run local pr:open"));
|
|
41
|
+
logger.info(pc.gray(" kici run local schedule"));
|
|
42
|
+
logger.info(pc.gray(" kici run local lifecycle:workflow_complete\n"));
|
|
43
|
+
logger.info(pc.gray("Or pick a workflow interactively: kici run local --pick\n"));
|
|
44
|
+
}
|
|
27
45
|
/** Terminal run statuses returned by the Platform run-status snapshot. */
|
|
28
|
-
const TERMINAL_STATUSES = new Set([
|
|
46
|
+
const TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
29
47
|
"success",
|
|
30
48
|
"failed",
|
|
31
49
|
"cancelled",
|
|
@@ -420,7 +438,10 @@ async function runSingleFixture(fixture, ctx, options, config, history) {
|
|
|
420
438
|
reason: triggerResult.reason
|
|
421
439
|
};
|
|
422
440
|
}
|
|
423
|
-
if (!options.quiet)
|
|
441
|
+
if (!options.quiet) {
|
|
442
|
+
logger.info(pc.green(`Run started: ${triggerResult.runId}`));
|
|
443
|
+
for (const warning of triggerResult.warnings ?? []) logger.warn(pc.yellow(`⚠ ${warning}`));
|
|
444
|
+
}
|
|
424
445
|
await history.addEntry({
|
|
425
446
|
runId: triggerResult.runId,
|
|
426
447
|
fixtureId: fixture.id,
|
|
@@ -499,7 +520,7 @@ async function pollRunToCompletion(ctx, runId, fixtureId, options) {
|
|
|
499
520
|
lastStatus = await ctx.client.runStatus(ctx.orgId, runId, ctx.target);
|
|
500
521
|
const terminal = lastStatus.done || TERMINAL_STATUSES.has(lastStatus.status);
|
|
501
522
|
if (terminal && logs.done) return finishRun(fixtureId, runId, lastStatus, startTime, tailLines, options);
|
|
502
|
-
if (!terminal
|
|
523
|
+
if (!terminal) await watchRunHolds(runId, seenHolds, () => heldCtx, (c) => heldCtx = c, options);
|
|
503
524
|
await new Promise((resolve) => setTimeout(resolve, POLL_INTERVAL_MS));
|
|
504
525
|
}
|
|
505
526
|
return {
|
|
@@ -529,10 +550,12 @@ async function watchRunHolds(runId, seenHolds, getCtx, setCtx, options) {
|
|
|
529
550
|
if (!ctx) return;
|
|
530
551
|
const holds = await listHeldRunsForRun(ctx, runId);
|
|
531
552
|
if (holds.length === 0) return;
|
|
553
|
+
const quiet = Boolean(options.quiet);
|
|
532
554
|
await handleNewHolds({
|
|
533
555
|
holds,
|
|
534
556
|
seen: seenHolds,
|
|
535
|
-
isTty: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
557
|
+
isTty: quiet ? false : Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
558
|
+
output: quiet ? (line) => void process.stderr.write(line + "\n") : (line) => logger.info(line),
|
|
536
559
|
approveAll: Boolean(options.approveAll),
|
|
537
560
|
confirm: (message) => confirm({
|
|
538
561
|
message,
|
|
@@ -671,6 +694,6 @@ function displayRemoteResults(results) {
|
|
|
671
694
|
logger.info("");
|
|
672
695
|
}
|
|
673
696
|
//#endregion
|
|
674
|
-
export { buildDispatchInputs, buildTargetSelector, lookupDispatchInputsDescriptor, runLocalCommand, runRemoteCommand, withStdoutOnStderr };
|
|
697
|
+
export { buildDispatchInputs, buildTargetSelector, lookupDispatchInputsDescriptor, printRunLocalUsage, runLocalCommand, runRemoteCommand, withStdoutOnStderr };
|
|
675
698
|
|
|
676
699
|
//# sourceMappingURL=run.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { DashboardClient, DashboardClientError } from "../../remote/dashboard-client.js";
|
|
3
3
|
import { colorStatus, formatDuration as formatDuration$1, relativeTime, renderTable } from "../../remote/render.js";
|
|
4
4
|
import pc from "picocolors";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../
|
|
1
|
+
import "../../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { DashboardClient, DashboardClientError } from "../../remote/dashboard-client.js";
|
|
3
3
|
import { RunHistory } from "../../remote/history.js";
|
|
4
4
|
import { colorStatus, formatDuration as formatDuration$1, relativeTime } from "../../remote/render.js";
|
package/dist/commands/types.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { loadGlobalConfig } from "../remote/config.js";
|
|
3
3
|
import { DashboardClient, DashboardClientError } from "../remote/dashboard-client.js";
|
|
4
4
|
import { generateSecretsDts } from "../generators/secrets-dts.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../
|
|
1
|
+
import "../rolldown-runtime-ClRpJifh.js";
|
|
2
2
|
import { resolveTrustRoot } from "../provenance-trust-root.js";
|
|
3
3
|
import "../remote/prod-defaults.js";
|
|
4
4
|
import pc from "picocolors";
|
|
@@ -63,7 +63,13 @@ async function verifyAttestationCommand(artifact, options = {}) {
|
|
|
63
63
|
if (result.verified) {
|
|
64
64
|
logger.info(`${pc.green("PASS")} provenance verified (issuer ${issuer})`);
|
|
65
65
|
const c = result.claims ?? {};
|
|
66
|
-
logger.info(pc.gray(`
|
|
66
|
+
logger.info(pc.gray(` origin org=${c.org_id ?? "unknown"}`));
|
|
67
|
+
if (c.source_origin === "run-remote") logger.info(pc.bold(pc.yellow(" SOURCE: kici run remote (local working-tree overlay — repository/ref/sha are caller-supplied, not a triggered VCS commit)")));
|
|
68
|
+
else logger.info(pc.gray(` source: ${c.source_origin ?? "triggered"}`));
|
|
69
|
+
const origin = result.attestationOrigin ?? "live";
|
|
70
|
+
if (origin === "deferred") logger.info(pc.bold(pc.yellow(" ATTESTATION: deferred — the build facts were sealed at build time; the identity token was minted later (after a transient Platform outage), bound to the frozen statement by hash.")));
|
|
71
|
+
else if (origin === "offline-backfill") logger.info(pc.bold(pc.yellow(" ATTESTATION: offline-backfill — the run was ingested while the Platform was down; its run/job rows were backfilled and the token minted later. The org id is the authoritative anchor; the temporal gap is disclosed.")));
|
|
72
|
+
logger.info(pc.gray(` repository=${c.repository} ref=${c.ref} sha=${c.sha} provider=${c.provider ?? "unknown"} run=${c.kici_run_id} job=${c.kici_job_id}`));
|
|
67
73
|
} else logger.error(`${pc.red("FAIL")} provenance NOT verified: ${result.failures.join(", ")}`);
|
|
68
74
|
return result.verified;
|
|
69
75
|
} catch (error) {
|
package/dist/commands/watch.js
CHANGED