@kici-dev/compiler 0.6.0 → 0.6.1

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/cli.js CHANGED
@@ -7,7 +7,7 @@ import { realpathSync } from "node:fs";
7
7
  import { Argument, Command } from "commander";
8
8
  import pc from "picocolors";
9
9
  //#region src/cli.ts
10
- const version = "0.6.0";
10
+ const version = "0.6.1";
11
11
  /**
12
12
  * Top-level commands that were removed, mapped to their current equivalent.
13
13
  * Consulted when the CLI hits an unknown command so the user gets a precise
@@ -484,7 +484,7 @@ Environment variables:
484
484
  const { docsCommand } = await import("./commands/index.js");
485
485
  const success = await docsCommand({ open: options.open });
486
486
  process.exit(success ? 0 : 1);
487
- }).command("llm [topic]").description("Print KiCI LLM docs bundles. No topic prints the llms.txt index; <topic> prints a task bundle (e.g. sdk, cli, patterns, features, providers, architecture, getting-started); \"full\" prints the complete bundle.").option("--out <path>", "Write the bundle to a file instead of stdout").action(async (topic, options) => {
487
+ }).command("llm [topic]").description("Print KiCI LLM docs bundles. No topic prints the llms.txt index; <topic> prints a task bundle (e.g. sdk, cli, cli-remote, patterns, features, providers, architecture, getting-started); \"full\" prints the complete bundle.").option("--out <path>", "Write the bundle to a file instead of stdout").action(async (topic, options) => {
488
488
  const { docsLlmCommand } = await import("./commands/index.js");
489
489
  const success = await docsLlmCommand({
490
490
  topic,
@@ -492,6 +492,14 @@ Environment variables:
492
492
  });
493
493
  process.exit(success ? 0 : 1);
494
494
  });
495
+ program.command("feedback").description("Print how to report a discrepancy between what KiCI advertises and what it does. Files nothing.").option("--open", "Open the prefilled issue form in the default browser").option("--json", "Emit the reporting contract as JSON").action(async (options) => {
496
+ const { feedbackCommand } = await import("./commands/index.js");
497
+ const success = await feedbackCommand({
498
+ open: options.open,
499
+ json: options.json
500
+ });
501
+ process.exit(success ? 0 : 1);
502
+ });
495
503
  program.command("admin").description("Operator-facing commands for running instances").command("drain-worker").description("Trigger graceful drain on a worker instance").requiredOption("--url <url>", "Worker URL (e.g., http://worker-host:<port>)").action(async (options) => {
496
504
  const { drainWorkerCommand } = await import("./commands/index.js");
497
505
  const success = await drainWorkerCommand({ url: options.url });
@@ -0,0 +1,53 @@
1
+ /** The public tracker. Reports about KiCI itself go here — never customer data. */
2
+ export declare const FEEDBACK_TRACKER_URL = "https://github.com/kici-dev/kici-public";
3
+ /** The issue form tuned for an advertised-versus-actual report. */
4
+ export declare const FEEDBACK_TEMPLATE = "agent_report.yml";
5
+ export declare const FEEDBACK_NEW_ISSUE_URL = "https://github.com/kici-dev/kici-public/issues/new?template=agent_report.yml";
6
+ /** Suspected vulnerabilities go here instead, privately. */
7
+ export declare const FEEDBACK_SECURITY_ADVISORY_URL = "https://github.com/kici-dev/kici-public/security/advisories/new";
8
+ export interface FeedbackField {
9
+ id: string;
10
+ label: string;
11
+ description: string;
12
+ }
13
+ export interface FeedbackContract {
14
+ tracker: string;
15
+ newIssueUrl: string;
16
+ template: string;
17
+ securityAdvisoryUrl: string;
18
+ guideUrl: string;
19
+ searchCommand: string;
20
+ approval: {
21
+ required: boolean;
22
+ rule: string;
23
+ };
24
+ qualifies: string[];
25
+ doesNotQualify: string[];
26
+ requiredFields: FeedbackField[];
27
+ prohibited: string[];
28
+ privateReportCommand: string;
29
+ }
30
+ /**
31
+ * The single definition of what a reportable discrepancy is and what a report
32
+ * must carry. `kici feedback` prints it, `--json` emits it verbatim, and
33
+ * hack/feedback-contract.test.ts asserts the published guide says the same
34
+ * thing — so the CLI and the doc cannot drift apart.
35
+ */
36
+ export declare const FEEDBACK_CONTRACT: FeedbackContract;
37
+ export interface FeedbackOptions {
38
+ /** Open the prefilled issue form in the default browser. */
39
+ open?: boolean;
40
+ /** Emit the contract as JSON on stdout instead of prose. */
41
+ json?: boolean;
42
+ }
43
+ /**
44
+ * Print the contract for reporting a KiCI discrepancy: what qualifies, what a
45
+ * report must carry, what must never appear in a public issue, and the rule
46
+ * that an agent drafts a report but a human decides to file it.
47
+ *
48
+ * The command reaches no network and files nothing. `--open` opens the
49
+ * prefilled issue form; `--json` emits the same contract for an agent to
50
+ * consume without parsing prose.
51
+ */
52
+ export declare function feedbackCommand(options?: FeedbackOptions): Promise<boolean>;
53
+ //# sourceMappingURL=feedback.d.ts.map
@@ -0,0 +1,142 @@
1
+ import "../rolldown-runtime-ClRpJifh.js";
2
+ import pc from "picocolors";
3
+ import { logger, toErrorMessage } from "@kici-dev/core";
4
+ import open from "open";
5
+ //#region src/commands/feedback.ts
6
+ /** The public tracker. Reports about KiCI itself go here — never customer data. */
7
+ const FEEDBACK_TRACKER_URL = "https://github.com/kici-dev/kici-public";
8
+ /** The issue form tuned for an advertised-versus-actual report. */
9
+ const FEEDBACK_TEMPLATE = "agent_report.yml";
10
+ const FEEDBACK_NEW_ISSUE_URL = `${FEEDBACK_TRACKER_URL}/issues/new?template=${FEEDBACK_TEMPLATE}`;
11
+ /** Suspected vulnerabilities go here instead, privately. */
12
+ const FEEDBACK_SECURITY_ADVISORY_URL = `${FEEDBACK_TRACKER_URL}/security/advisories/new`;
13
+ /**
14
+ * The single definition of what a reportable discrepancy is and what a report
15
+ * must carry. `kici feedback` prints it, `--json` emits it verbatim, and
16
+ * hack/feedback-contract.test.ts asserts the published guide says the same
17
+ * thing — so the CLI and the doc cannot drift apart.
18
+ */
19
+ const FEEDBACK_CONTRACT = {
20
+ tracker: FEEDBACK_TRACKER_URL,
21
+ newIssueUrl: FEEDBACK_NEW_ISSUE_URL,
22
+ template: FEEDBACK_TEMPLATE,
23
+ securityAdvisoryUrl: FEEDBACK_SECURITY_ADVISORY_URL,
24
+ guideUrl: "https://kici.dev/docs/user/reporting-discrepancies/",
25
+ searchCommand: "gh issue list --repo kici-dev/kici-public --search \"<terms>\" --state all",
26
+ approval: {
27
+ required: true,
28
+ rule: "Draft the issue, show the full body to the person you are working with, and file it only after they say yes."
29
+ },
30
+ qualifies: [
31
+ "A documented flag, command, or option that does not exist in the version you ran.",
32
+ "Documented output — a shape, a field, an exit code — that differs from what the command produced.",
33
+ "A CLI --help description that contradicts the published docs.",
34
+ "A documented behaviour that does not happen, or a documented guarantee that does not hold.",
35
+ "A documented error or limit that the tool does not actually enforce."
36
+ ],
37
+ doesNotQualify: [
38
+ "Usage questions, or behaviour you find surprising but that the docs describe correctly.",
39
+ "Feature requests and design preferences.",
40
+ "Anything you inferred from reading docs without running the command.",
41
+ "Anything reproduced only on a locally built or unreleased version.",
42
+ "A failure that is your workflow, your credentials, or your environment."
43
+ ],
44
+ requiredFields: [
45
+ {
46
+ id: "advertised",
47
+ label: "What the docs or CLI advertise",
48
+ description: "The exact claim, quoted, plus its source: a docs URL or the command whose --help says it."
49
+ },
50
+ {
51
+ id: "observed",
52
+ label: "What actually happened",
53
+ description: "The real output or behaviour, quoted, with any error text."
54
+ },
55
+ {
56
+ id: "reproduction",
57
+ label: "Minimal reproduction, including setup",
58
+ description: "Every step from an empty directory: the setup commands, a minimal synthetic workflow, and the exact command you ran."
59
+ },
60
+ {
61
+ id: "version",
62
+ label: "Version and environment",
63
+ description: "Output of `kici --version`, plus Node version and OS."
64
+ },
65
+ {
66
+ id: "justification",
67
+ label: "Why this is a discrepancy",
68
+ description: "One or two sentences ruling out the likely misreads — why the docs cannot be read to match what you observed."
69
+ }
70
+ ],
71
+ prohibited: [
72
+ "No secrets, tokens, or credentials — not even redacted-looking ones.",
73
+ "No private repository names, internal hostnames, organization ids, or run ids.",
74
+ "No log excerpts you have not read line by line.",
75
+ "Reproduce with a minimal synthetic workflow, never the real one you were working on."
76
+ ],
77
+ privateReportCommand: "kici report --run <run-id> --upload"
78
+ };
79
+ function printContract() {
80
+ const c = FEEDBACK_CONTRACT;
81
+ logger.info(pc.bold("Reporting a KiCI discrepancy"));
82
+ logger.info("");
83
+ logger.info("Use this when the published docs or the CLI advertise one behaviour and KiCI does another.");
84
+ logger.info(`Tracker: ${c.tracker}`);
85
+ logger.info(`Full guide: ${c.guideUrl}`);
86
+ logger.info("");
87
+ logger.info(pc.bold("1. Search first"));
88
+ logger.info("Comment on an existing report rather than opening a second one.");
89
+ logger.info(` ${c.searchCommand}`);
90
+ logger.info("");
91
+ logger.info(pc.bold("2. Check it qualifies"));
92
+ for (const item of c.qualifies) logger.info(` ${pc.green("+")} ${item}`);
93
+ logger.info(" Not a discrepancy:");
94
+ for (const item of c.doesNotQualify) logger.info(` ${pc.gray("-")} ${item}`);
95
+ logger.info("");
96
+ logger.info(pc.bold("3. Never file these publicly"));
97
+ logger.info(` A suspected vulnerability is never a public issue — open a private advisory instead:\n ${c.securityAdvisoryUrl}`);
98
+ logger.info(` A problem with your own runs is not a tracker issue — send it privately instead:\n ${c.privateReportCommand}`);
99
+ for (const rule of c.prohibited) logger.info(` ${pc.yellow("!")} ${rule}`);
100
+ logger.info("");
101
+ logger.info(pc.bold("4. Draft the report"));
102
+ for (const field of c.requiredFields) {
103
+ logger.info(` ${field.label}`);
104
+ logger.info(pc.gray(` ${field.description}`));
105
+ }
106
+ logger.info("");
107
+ logger.info(pc.bold("5. Get approval, then file"));
108
+ logger.info(` ${c.approval.rule}`);
109
+ logger.info(` Form: ${c.newIssueUrl}`);
110
+ logger.info(pc.gray(` Or: kici feedback --open`));
111
+ logger.info("");
112
+ logger.info(pc.gray("Machine-readable: kici feedback --json"));
113
+ }
114
+ /**
115
+ * Print the contract for reporting a KiCI discrepancy: what qualifies, what a
116
+ * report must carry, what must never appear in a public issue, and the rule
117
+ * that an agent drafts a report but a human decides to file it.
118
+ *
119
+ * The command reaches no network and files nothing. `--open` opens the
120
+ * prefilled issue form; `--json` emits the same contract for an agent to
121
+ * consume without parsing prose.
122
+ */
123
+ async function feedbackCommand(options = {}) {
124
+ if (options.json) {
125
+ process.stdout.write(`${JSON.stringify(FEEDBACK_CONTRACT, null, 2)}\n`);
126
+ return true;
127
+ }
128
+ printContract();
129
+ if (!options.open) return true;
130
+ try {
131
+ await open(FEEDBACK_NEW_ISSUE_URL);
132
+ return true;
133
+ } catch (error) {
134
+ logger.error(pc.red(`Could not open a browser: ${toErrorMessage(error)}`));
135
+ logger.info(pc.gray(`Open ${FEEDBACK_NEW_ISSUE_URL} manually.`));
136
+ return false;
137
+ }
138
+ }
139
+ //#endregion
140
+ export { FEEDBACK_CONTRACT, FEEDBACK_NEW_ISSUE_URL, FEEDBACK_SECURITY_ADVISORY_URL, FEEDBACK_TEMPLATE, FEEDBACK_TRACKER_URL, feedbackCommand };
141
+
142
+ //# sourceMappingURL=feedback.js.map
@@ -57,7 +57,9 @@ export type { WorkflowsListOptions } from './workflows.js';
57
57
  export { drainWorkerCommand } from './drain-worker.js';
58
58
  export type { DrainWorkerOptions } from './drain-worker.js';
59
59
  export { docsCommand, docsLlmCommand } from './docs.js';
60
+ export { feedbackCommand, FEEDBACK_CONTRACT } from './feedback.js';
60
61
  export type { DocsOptions, DocsLlmOptions } from './docs.js';
62
+ export type { FeedbackOptions, FeedbackContract, FeedbackField } from './feedback.js';
61
63
  export { verifyAttestationCommand } from './verify-attestation.js';
62
64
  export type { VerifyAttestationOptions } from './verify-attestation.js';
63
65
  export { notificationsChannelsListCommand, notificationsChannelsAddCommand, notificationsChannelsRemoveCommand, notificationsSubscriptionsListCommand, notificationsSubscriptionsAddCommand, notificationsSubscriptionsRemoveCommand, notificationsRosterListCommand, notificationsRosterAddCommand, notificationsRosterRemoveCommand, } from './notifications.js';
@@ -6,6 +6,7 @@ import { docsCommand, docsLlmCommand } from "./docs.js";
6
6
  import { doctorCommand } from "./doctor.js";
7
7
  import { drainWorkerCommand } from "./drain-worker.js";
8
8
  import { endpointsCommand } from "./endpoints.js";
9
+ import { FEEDBACK_CONTRACT, feedbackCommand } from "./feedback.js";
9
10
  import { fixtureCommand } from "./fixture.js";
10
11
  import { hookInstallCommand } from "./hook.js";
11
12
  import { watchCommand } from "./watch.js";
@@ -34,4 +35,4 @@ import { rejectCommand } from "./reject.js";
34
35
  import { workflowsListCommand } from "./workflows.js";
35
36
  import { verifyAttestationCommand } from "./verify-attestation.js";
36
37
  import { notificationsChannelsAddCommand, notificationsChannelsListCommand, notificationsChannelsRemoveCommand, notificationsRosterAddCommand, notificationsRosterListCommand, notificationsRosterRemoveCommand, notificationsSubscriptionsAddCommand, notificationsSubscriptionsListCommand, notificationsSubscriptionsRemoveCommand } from "./notifications.js";
37
- export { approveCommand, compileCommand, diagnosticsCommand, docsCommand, docsLlmCommand, doctorCommand, drainWorkerCommand, endpointsCommand, fixtureCommand, hookInstallCommand, initCommand, localAttachCommand, localDetachCommand, localDownCommand, localLogsCommand, localStatusCommand, localTrustRootCommand, localUpCommand, loginCommand, logoutCommand, notificationsChannelsAddCommand, notificationsChannelsListCommand, notificationsChannelsRemoveCommand, notificationsRosterAddCommand, notificationsRosterListCommand, notificationsRosterRemoveCommand, notificationsSubscriptionsAddCommand, notificationsSubscriptionsListCommand, notificationsSubscriptionsRemoveCommand, orchestratorsListCommand, orchestratorsUseCommand, orgCurrentCommand, orgListCommand, orgUseCommand, patCreateCommand, previewCommand, previewEvent, rejectCommand, reportCommand, reportListCommand, reportWithdrawCommand, runRemoteCommand, runRoutedCommand, runsArtifactsDownloadCommand, runsArtifactsListCommand, runsCancelCommand, runsListCommand, runsLogsCommand, runsRerunCommand, runsShowCommand, secretsListCommand, typesCommand, verifyAttestationCommand, watchCommand, workflowsListCommand };
38
+ export { FEEDBACK_CONTRACT, approveCommand, compileCommand, diagnosticsCommand, docsCommand, docsLlmCommand, doctorCommand, drainWorkerCommand, endpointsCommand, feedbackCommand, fixtureCommand, hookInstallCommand, initCommand, localAttachCommand, localDetachCommand, localDownCommand, localLogsCommand, localStatusCommand, localTrustRootCommand, localUpCommand, loginCommand, logoutCommand, notificationsChannelsAddCommand, notificationsChannelsListCommand, notificationsChannelsRemoveCommand, notificationsRosterAddCommand, notificationsRosterListCommand, notificationsRosterRemoveCommand, notificationsSubscriptionsAddCommand, notificationsSubscriptionsListCommand, notificationsSubscriptionsRemoveCommand, orchestratorsListCommand, orchestratorsUseCommand, orgCurrentCommand, orgListCommand, orgUseCommand, patCreateCommand, previewCommand, previewEvent, rejectCommand, reportCommand, reportListCommand, reportWithdrawCommand, runRemoteCommand, runRoutedCommand, runsArtifactsDownloadCommand, runsArtifactsListCommand, runsCancelCommand, runsListCommand, runsLogsCommand, runsRerunCommand, runsShowCommand, secretsListCommand, typesCommand, verifyAttestationCommand, watchCommand, workflowsListCommand };
@@ -19,7 +19,7 @@ import { PROTOCOL_VERSION } from "@kici-dev/engine";
19
19
  */
20
20
  function collectIdentity(probe) {
21
21
  const identity = {
22
- kiciCliVersion: "0.6.0",
22
+ kiciCliVersion: "0.6.1",
23
23
  nodeVersion: process.version,
24
24
  platform: process.platform,
25
25
  arch: process.arch,