cngkit 1.1.12 → 1.1.14

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 (35) hide show
  1. package/README.md +7 -5
  2. package/dist/{chunk-IMOIIPGC.js → chunk-AOJSBSHF.js} +3 -3
  3. package/dist/{chunk-WD3MW5UT.js → chunk-BXKVJRTD.js} +2 -2
  4. package/dist/{chunk-C7FNUZYD.js → chunk-ERSRJLYP.js} +2 -2
  5. package/dist/{chunk-VCURAGDZ.js → chunk-JX33GP2L.js} +2 -2
  6. package/dist/{chunk-7Z74PS5X.js → chunk-Q3F7DVFP.js} +4 -3
  7. package/dist/chunk-Q3F7DVFP.js.map +1 -0
  8. package/dist/{chunk-4UBOEQN2.js → chunk-UZMVTVL2.js} +2 -2
  9. package/dist/{chunk-4UBOEQN2.js.map → chunk-UZMVTVL2.js.map} +1 -1
  10. package/dist/{chunk-S6LINZSY.js → chunk-VQTRHKNP.js} +121 -59
  11. package/dist/chunk-VQTRHKNP.js.map +1 -0
  12. package/dist/cli.js +3 -3
  13. package/dist/commands/coderoom/index.js +3 -3
  14. package/dist/commands/coderoom/join.js +5 -5
  15. package/dist/commands/coderoom/share.js +5 -5
  16. package/dist/commands/index.js +3 -3
  17. package/dist/commands/knowledges/audiences.js +6 -6
  18. package/dist/commands/knowledges/files.js +6 -6
  19. package/dist/commands/knowledges/glob.js +6 -6
  20. package/dist/commands/knowledges/grep.js +6 -6
  21. package/dist/commands/knowledges/index.js +3 -3
  22. package/dist/commands/knowledges/list.js +6 -6
  23. package/dist/commands/knowledges/read.js +6 -6
  24. package/dist/commands/knowledges/search.js +6 -6
  25. package/dist/commands/knowledges/status.js +6 -6
  26. package/dist/commands/login.js +3 -3
  27. package/dist/commands/scrub.js +2 -2
  28. package/dist/commands/transcripts.js +3 -3
  29. package/package.json +1 -1
  30. package/dist/chunk-7Z74PS5X.js.map +0 -1
  31. package/dist/chunk-S6LINZSY.js.map +0 -1
  32. /package/dist/{chunk-IMOIIPGC.js.map → chunk-AOJSBSHF.js.map} +0 -0
  33. /package/dist/{chunk-WD3MW5UT.js.map → chunk-BXKVJRTD.js.map} +0 -0
  34. /package/dist/{chunk-C7FNUZYD.js.map → chunk-ERSRJLYP.js.map} +0 -0
  35. /package/dist/{chunk-VCURAGDZ.js.map → chunk-JX33GP2L.js.map} +0 -0
package/README.md CHANGED
@@ -244,6 +244,7 @@ results, and piped output stay clean. Set `CNGKIT_COLOR=never` to disable CLI co
244
244
  - **Pastel** owns command and subcommand routing through files under `src/commands/`.
245
245
  - **Ink** owns terminal rendering through built-in components such as `<Text>`.
246
246
  - **marked-terminal** owns terminal Markdown rendering for help screens.
247
+ - **Chalk** owns the cngkit color theme passed into the Markdown renderer.
247
248
  - **Zod** owns option and argument schemas for each route.
248
249
 
249
250
  So yes, subcommands are built in through Pastel's nested route files. Adding a
@@ -261,9 +262,9 @@ src/commands/
261
262
  ```
262
263
 
263
264
  The CLI does not hand-roll ANSI escape codes. Status styles go through Ink's built-in
264
- `<Text color="..." bold dimColor>` support, and help screens use a shared Chalk-backed
265
- Markdown theme through `marked-terminal`. Commands that return content for agents or shell
266
- pipelines write raw lines instead.
265
+ `<Text color="..." bold dimColor>` support, and help screens render through
266
+ `marked-terminal` with a shared Chalk-backed theme. Commands that return content for agents
267
+ or shell pipelines write raw lines instead.
267
268
 
268
269
  ## For Contributors
269
270
 
@@ -274,7 +275,7 @@ src/
274
275
  cli/ Pastel bootstrap support, help text, option schemas, Ink output runner
275
276
  commands/ Thin Pastel route files
276
277
  features/ Command behavior grouped by feature
277
- shared/ Config, output, browser, API client, shared command utilities
278
+ shared/ Config, theme, output, browser, API client, shared command utilities
278
279
  ```
279
280
 
280
281
  The route files under `src/commands/` should stay thin. Put behavior in
@@ -301,7 +302,8 @@ pnpm --filter cngkit run deploy
301
302
  ```
302
303
 
303
304
  That command runs typecheck, lint, build, smoke, npm pack dry-run, npm publish, registry
304
- verification, `npm install -g cngkit@latest`, and a final global `cngkit --version` check.
305
+ verification, exact global install of the published version, and a final global
306
+ `cngkit --version` check.
305
307
 
306
308
  The package build uses `tsup` to emit a file-preserving ESM build. The published binary is
307
309
  `dist/cli.js`, and Pastel discovers command files under `dist/commands/**`.
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  readBackendHealth
3
- } from "./chunk-C7FNUZYD.js";
3
+ } from "./chunk-ERSRJLYP.js";
4
4
  import {
5
5
  createPeerId,
6
6
  createRoomCode,
7
7
  resolveApiBaseUrl
8
- } from "./chunk-4UBOEQN2.js";
8
+ } from "./chunk-UZMVTVL2.js";
9
9
 
10
10
  // src/features/coderoom/run-coderoom-command.ts
11
11
  import process2 from "process";
@@ -412,4 +412,4 @@ export {
412
412
  runShareCommand,
413
413
  runJoinCommand
414
414
  };
415
- //# sourceMappingURL=chunk-IMOIIPGC.js.map
415
+ //# sourceMappingURL=chunk-AOJSBSHF.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-QZEB4VMX.js";
7
7
  import {
8
8
  createCngApiClient
9
- } from "./chunk-C7FNUZYD.js";
9
+ } from "./chunk-ERSRJLYP.js";
10
10
 
11
11
  // src/features/knowledges/knowledges-api.ts
12
12
  function createKnowledgesApi(options) {
@@ -316,4 +316,4 @@ export {
316
316
  runKnowGrepCommand,
317
317
  runKnowGlobCommand
318
318
  };
319
- //# sourceMappingURL=chunk-WD3MW5UT.js.map
319
+ //# sourceMappingURL=chunk-BXKVJRTD.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveApiBaseUrl
3
- } from "./chunk-4UBOEQN2.js";
3
+ } from "./chunk-UZMVTVL2.js";
4
4
  import {
5
5
  __export
6
6
  } from "./chunk-PZ5AY32C.js";
@@ -3231,4 +3231,4 @@ export {
3231
3231
  createCngApiClient,
3232
3232
  readBackendHealth
3233
3233
  };
3234
- //# sourceMappingURL=chunk-C7FNUZYD.js.map
3234
+ //# sourceMappingURL=chunk-ERSRJLYP.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createCommandOutput,
3
3
  formatError
4
- } from "./chunk-7Z74PS5X.js";
4
+ } from "./chunk-Q3F7DVFP.js";
5
5
 
6
6
  // src/cli/command-runner.tsx
7
7
  import { useEffect } from "react";
@@ -23,4 +23,4 @@ function CommandRunner({ run }) {
23
23
  export {
24
24
  CommandRunner
25
25
  };
26
- //# sourceMappingURL=chunk-VCURAGDZ.js.map
26
+ //# sourceMappingURL=chunk-JX33GP2L.js.map
@@ -48,7 +48,7 @@ function createMarkdownTheme(useColor) {
48
48
  del: chalk.dim.strikethrough,
49
49
  link: chalk.blueBright,
50
50
  href: chalk.blue.underline,
51
- text: chalk.reset,
51
+ text: identity,
52
52
  showSectionPrefix: true,
53
53
  reflowText: true,
54
54
  unescape: true,
@@ -134,11 +134,12 @@ function formatMarkdownMessage(stream, markdown) {
134
134
  return markdown;
135
135
  }
136
136
  const useColor = shouldRenderColor(stream);
137
+ const markdownWidth = clampMarkdownWidth(stream.columns);
137
138
  const parser = new Marked();
138
139
  parser.use(
139
140
  markedTerminal({
140
141
  ...createMarkdownTheme(useColor),
141
- width: clampMarkdownWidth(stream.columns)
142
+ width: markdownWidth
142
143
  })
143
144
  );
144
145
  const renderedMarkdown = String(parser.parse(markdown)).trimEnd();
@@ -169,4 +170,4 @@ export {
169
170
  createCommandOutput,
170
171
  formatError
171
172
  };
172
- //# sourceMappingURL=chunk-7Z74PS5X.js.map
173
+ //# sourceMappingURL=chunk-Q3F7DVFP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shared/output.ts","../src/shared/theme.ts"],"sourcesContent":["import process from \"node:process\";\nimport { Marked, type MarkedExtension } from \"marked\";\nimport { markedTerminal } from \"marked-terminal\";\nimport { createElement } from \"react\";\nimport { renderToString, Text } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\nimport {\n createMarkdownTheme,\n decorateMarkdownOutput,\n statusStylePropsByOutputStyle,\n type OutputStyle,\n} from \"./theme.js\";\n\ntype OutputStream = NodeJS.WriteStream & {\n isTTY?: boolean;\n columns?: number;\n};\n\nexport type CommandOutput = {\n info(message: string): void;\n success(message: string): void;\n warning(message: string): void;\n muted(message: string): void;\n markdown(message: string): void;\n raw(message: string): void;\n error(message: string): void;\n};\n\nexport const consoleOutput = createCommandOutput(process.stdout, process.stderr);\n\nexport function createCommandOutput(stdout: OutputStream, stderr: OutputStream): CommandOutput {\n return {\n info(message) {\n writeStyledMessage(stdout, \"info\", message);\n },\n success(message) {\n writeStyledMessage(stdout, \"success\", message);\n },\n warning(message) {\n writeStyledMessage(stdout, \"warning\", message);\n },\n muted(message) {\n writeStyledMessage(stdout, \"muted\", message);\n },\n markdown(message) {\n stdout.write(`${formatMarkdownMessage(stdout, message)}\\n`);\n },\n raw(message) {\n stdout.write(`${message}\\n`);\n },\n error(message) {\n writeStyledMessage(stderr, \"error\", message);\n },\n };\n}\n\nexport function formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction writeStyledMessage(stream: OutputStream, style: OutputStyle, message: string): void {\n stream.write(`${formatStyledMessage(stream, style, message)}\\n`);\n}\n\nfunction formatStyledMessage(stream: OutputStream, style: OutputStyle, message: string): string {\n if (!shouldRenderColor(stream)) {\n return message;\n }\n\n return renderToString(\n createElement(\n Text,\n {\n ...statusStylePropsByOutputStyle[style],\n wrap: \"wrap\",\n },\n message\n ),\n {\n columns: 10_000,\n }\n );\n}\n\nfunction formatMarkdownMessage(stream: OutputStream, markdown: string): string {\n if (stream.isTTY !== true) {\n return markdown;\n }\n\n const useColor = shouldRenderColor(stream);\n const markdownWidth = clampMarkdownWidth(stream.columns);\n const parser = new Marked();\n parser.use(\n markedTerminal({\n ...createMarkdownTheme(useColor),\n width: markdownWidth,\n }) as unknown as MarkedExtension\n );\n\n const renderedMarkdown = String(parser.parse(markdown)).trimEnd();\n\n return useColor ? decorateMarkdownOutput(renderedMarkdown) : stripAnsi(renderedMarkdown);\n}\n\nfunction shouldRenderColor(stream: OutputStream): boolean {\n const colorMode = process.env.CNGKIT_COLOR?.toLowerCase();\n\n if (colorMode === \"never\" || colorMode === \"0\" || colorMode === \"false\") {\n return false;\n }\n\n if (colorMode === \"always\" || colorMode === \"1\" || colorMode === \"true\") {\n return true;\n }\n\n if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== \"0\") {\n return true;\n }\n\n return stream.isTTY === true;\n}\n\nfunction clampMarkdownWidth(columns: number | undefined): number {\n if (columns === undefined) {\n return 100;\n }\n\n return Math.max(72, Math.min(columns, 120));\n}\n","import { Chalk } from \"chalk\";\nimport type { TextProps } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\n\nexport type OutputStyle = \"info\" | \"success\" | \"warning\" | \"muted\" | \"error\";\n\nexport const statusStylePropsByOutputStyle = {\n info: {\n color: \"cyan\",\n },\n success: {\n color: \"green\",\n bold: true,\n },\n warning: {\n color: \"yellow\",\n bold: true,\n },\n muted: {\n dimColor: true,\n },\n error: {\n color: \"red\",\n bold: true,\n },\n} satisfies Record<OutputStyle, TextProps>;\n\nexport function createMarkdownTheme(useColor: boolean) {\n const chalk = new Chalk({ level: useColor ? 1 : 0 });\n const identity = (value: string) => value;\n\n return {\n code: chalk.green,\n blockquote: chalk.dim.italic,\n html: chalk.gray,\n heading: chalk.blueBright.bold,\n firstHeading: chalk.magentaBright.bold,\n hr: chalk.gray,\n listitem: identity,\n table: identity,\n paragraph: identity,\n strong: chalk.bold,\n em: chalk.italic,\n codespan: chalk.cyanBright,\n del: chalk.dim.strikethrough,\n link: chalk.blueBright,\n href: chalk.blue.underline,\n text: identity,\n showSectionPrefix: true,\n reflowText: true,\n unescape: true,\n emoji: false,\n tab: 2,\n };\n}\n\nexport function decorateMarkdownOutput(output: string): string {\n const chalk = new Chalk({ level: 1 });\n\n const decoratedLines = output\n .split(\"\\n\")\n .map((line) => {\n const plainLine = stripAnsi(line);\n\n if (plainLine.startsWith(\"# \")) {\n return chalk.magentaBright.bold(plainLine);\n }\n\n if (plainLine.startsWith(\"## \")) {\n return chalk.blueBright.bold(plainLine);\n }\n\n return line;\n })\n .join(\"\\n\");\n\n return decoratedLines\n .replace(/`([^`\\n]+)`/g, (_match, value: string) => chalk.cyanBright(value))\n .replace(/(^|\\s)(--[a-z][a-z0-9-]*)/g, (_match, prefix: string, flag: string) => {\n return `${prefix}${chalk.yellow(flag)}`;\n })\n .replace(/(https?:\\/\\/[^\\s)]+)/g, (url: string) => chalk.blueBright.underline(url))\n .replace(/^(\\s*)\\*\\s+/gm, (_match, prefix: string) => {\n return `${prefix}${chalk.magentaBright(\"-\")} `;\n });\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,cAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,gBAAgB,YAAY;AACrC,OAAOA,gBAAe;;;ACLtB,SAAS,aAAa;AAEtB,OAAO,eAAe;AAIf,IAAM,gCAAgC;AAAA,EAC3C,MAAM;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AACF;AAEO,SAAS,oBAAoB,UAAmB;AACrD,QAAM,QAAQ,IAAI,MAAM,EAAE,OAAO,WAAW,IAAI,EAAE,CAAC;AACnD,QAAM,WAAW,CAAC,UAAkB;AAEpC,SAAO;AAAA,IACL,MAAM,MAAM;AAAA,IACZ,YAAY,MAAM,IAAI;AAAA,IACtB,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM,WAAW;AAAA,IAC1B,cAAc,MAAM,cAAc;AAAA,IAClC,IAAI,MAAM;AAAA,IACV,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW;AAAA,IACX,QAAQ,MAAM;AAAA,IACd,IA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A,QAAM,mBAAmB,OAAO,OAAO,MAAM,QAAQ,CAAC,EAAE,QAAQ;AAEhE,SAAO,WAAW,uBAAuB,gBAAgB,IAAIC,WAAU,gBAAgB;AACzF;AAEA,SAAS,kBAAkB,QAA+B;AACxD,QAAM,YAAY,QAAQ,IAAI,cAAc,YAAY;AAExD,MAAI,cAAc,WAAW,cAAc,OAAO,cAAc,SAAS;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,cAAc,YAAY,cAAc,OAAO,cAAc,QAAQ;AACvE,WAAO;AAAA,EACT;AAEA,MAAI,QAAQ,IAAI,gBAAgB,UAAa,QAAQ,IAAI,gBAAgB,KAAK;AAC5E,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,UAAU;AAC1B;AAEA,SAAS,mBAAmB,SAAqC;AAC/D,MAAI,YAAY,QAAW;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,IAAI,IAAI,KAAK,IAAI,SAAS,GAAG,CAAC;AAC5C;","names":["stripAnsi","stripAnsi"]}
@@ -1,7 +1,7 @@
1
1
  // src/shared/config.ts
2
2
  import { randomBytes, randomUUID } from "crypto";
3
3
  import process from "process";
4
- var packageVersion = "1.1.12";
4
+ var packageVersion = "1.1.14";
5
5
  var defaultApiBaseUrl = "https://curly.ng";
6
6
  function resolveApiBaseUrl(options) {
7
7
  return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;
@@ -19,4 +19,4 @@ export {
19
19
  createRoomCode,
20
20
  createPeerId
21
21
  };
22
- //# sourceMappingURL=chunk-4UBOEQN2.js.map
22
+ //# sourceMappingURL=chunk-UZMVTVL2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shared/config.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\";\nimport process from \"node:process\";\n\nexport const packageVersion = \"1.1.12\";\nexport const defaultApiBaseUrl = \"https://curly.ng\";\n\nexport type GlobalCommandOptions = {\n apiBaseUrl?: string;\n};\n\nexport function resolveApiBaseUrl(options: GlobalCommandOptions): string {\n return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;\n}\n\nexport function createRoomCode(): string {\n return randomBytes(4).toString(\"hex\").toUpperCase();\n}\n\nexport function createPeerId(): string {\n return randomUUID();\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAO,aAAa;AAEb,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAM1B,SAAS,kBAAkB,SAAuC;AACvE,SAAO,QAAQ,cAAc,QAAQ,IAAI,uBAAuB;AAClE;AAEO,SAAS,iBAAyB;AACvC,SAAO,YAAY,CAAC,EAAE,SAAS,KAAK,EAAE,YAAY;AACpD;AAEO,SAAS,eAAuB;AACrC,SAAO,WAAW;AACpB;","names":[]}
1
+ {"version":3,"sources":["../src/shared/config.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\";\nimport process from \"node:process\";\n\nexport const packageVersion = \"1.1.14\";\nexport const defaultApiBaseUrl = \"https://curly.ng\";\n\nexport type GlobalCommandOptions = {\n apiBaseUrl?: string;\n};\n\nexport function resolveApiBaseUrl(options: GlobalCommandOptions): string {\n return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;\n}\n\nexport function createRoomCode(): string {\n return randomBytes(4).toString(\"hex\").toUpperCase();\n}\n\nexport function createPeerId(): string {\n return randomUUID();\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAO,aAAa;AAEb,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAM1B,SAAS,kBAAkB,SAAuC;AACvE,SAAO,QAAQ,cAAc,QAAQ,IAAI,uBAAuB;AAClE;AAEO,SAAS,iBAAyB;AACvC,SAAO,YAAY,CAAC,EAAE,SAAS,KAAK,EAAE,YAAY;AACpD;AAEO,SAAS,eAAuB;AACrC,SAAO,WAAW;AACpB;","names":[]}
@@ -1,10 +1,10 @@
1
1
  // src/cli/help-specs.ts
2
2
  var commandList = [
3
- "- `cngkit login` - open Curly.ng login.",
4
- "- `cngkit coderoom ...` - unite developers in a live shared code room.",
5
- "- `cngkit scrub [path]` - scan for secrets and optionally mask them inline.",
3
+ "- `cngkit login` - open Curly.ng login, or print the URL in headless shells.",
4
+ "- `cngkit coderoom ...` - share or join a live developer room for a working tree.",
5
+ "- `cngkit scrub [path]` - scan for secrets; rewrite only when `--yes` is passed.",
6
6
  "- `cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.",
7
- "- `cngkit knowledges ...` - read the hosted Harness catalog."
7
+ "- `cngkit knowledges ...` - search and read the hosted Harness knowledge catalog."
8
8
  ].join("\n");
9
9
  var coderoomCommandList = [
10
10
  "- `share [room-code]` - start a live room from the current directory.",
@@ -26,9 +26,16 @@ var helpTopics = [
26
26
  aliases: ["", "overview", "help"],
27
27
  body: `# cngkit
28
28
 
29
- Curly.ng operator CLI for backend-connected repo sync, secret scrubbing, and Harness knowledges access.
29
+ Curly.ng operator CLI for shared code rooms, safe local cleanup, local agent transcripts, and hosted Harness knowledges.
30
30
 
31
- ## Usage
31
+ ## Run Now
32
+
33
+ \`\`\`bash
34
+ npx --yes cngkit@latest --help
35
+ npx --yes cngkit@latest knowledges search "cloudflare backend" --limit 3
36
+ \`\`\`
37
+
38
+ ## Installed Usage
32
39
 
33
40
  \`\`\`bash
34
41
  cngkit <command> [options]
@@ -38,9 +45,10 @@ cngkit <command> [options]
38
45
 
39
46
  ${commandList}
40
47
 
41
- ## Progressive Help
48
+ ## Help Map
42
49
 
43
50
  \`\`\`bash
51
+ cngkit help <topic>
44
52
  cngkit <command> --help
45
53
  cngkit coderoom --help
46
54
  cngkit coderoom <subcommand> --help
@@ -49,7 +57,12 @@ cngkit knowledges --help
49
57
  cngkit knowledges <subcommand> --help
50
58
  \`\`\`
51
59
 
52
- The CLI intentionally prints plain Markdown or line-oriented text with no color-only state, tables that require terminal width, or hidden interactive prompts. Add \`--json\` to read-only knowledges commands when another agent or tool needs structured backend data.
60
+ ## AI And Scripts
61
+
62
+ - Help is Markdown in pipes and colorized Markdown in interactive terminals.
63
+ - Text output is line-oriented; commands do not rely on color-only state.
64
+ - Use \`--json\` on read-only knowledges commands for typed backend payloads.
65
+ - Use \`CNGKIT_COLOR=never\` for logs, screenshots, and strict plain text.
53
66
 
54
67
  ## Backend
55
68
 
@@ -68,18 +81,19 @@ CNGKIT_API_BASE_URL=<url> cngkit ...
68
81
  aliases: ["login"],
69
82
  body: `# cngkit login
70
83
 
71
- Open Curly.ng login in a browser. In headless environments, print the URL so an agent can surface it to the operator.
84
+ Open Curly.ng login in a browser. In headless shells, print the URL so an agent can show it to the operator.
72
85
 
73
86
  ## Usage
74
87
 
75
88
  \`\`\`bash
89
+ npx --yes cngkit@latest login
76
90
  cngkit login
77
91
  \`\`\`
78
92
 
79
- ## Output Contract
93
+ ## Output
80
94
 
81
95
  - First line names the login URL being opened.
82
- - If no local browser opener exists, the CLI prints a direct URL.
96
+ - If no browser opener exists, the CLI prints a direct URL.
83
97
  - No credentials are printed or persisted by this command.
84
98
  `
85
99
  },
@@ -88,9 +102,9 @@ cngkit login
88
102
  aliases: ["transcripts", "transcript"],
89
103
  body: `# cngkit transcripts
90
104
 
91
- Read local agent transcript JSONL files from \`~/.codex/sessions\`, \`~/.codex/archived_sessions\`, \`~/.claude/projects\`, and \`~/.claude/history.jsonl\`.
105
+ Read local Claude and Codex transcript JSONL files.
92
106
 
93
- This is local operator tooling. It does not call the Curly backend and it does not upload transcript content.
107
+ This is local-only operator tooling. It does not call Curly.ng and it does not upload transcript content.
94
108
 
95
109
  ## Usage
96
110
 
@@ -100,6 +114,13 @@ cngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limi
100
114
  cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json]
101
115
  \`\`\`
102
116
 
117
+ ## Sources
118
+
119
+ - \`~/.codex/sessions\`
120
+ - \`~/.codex/archived_sessions\`
121
+ - \`~/.claude/projects\`
122
+ - \`~/.claude/history.jsonl\`
123
+
103
124
  ## Defaults
104
125
 
105
126
  - \`list\`: newest 12 transcript files.
@@ -107,7 +128,7 @@ cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--fil
107
128
  - \`grep\`: first 80 matching user/assistant entries from the newest 60 files.
108
129
  - \`--source\`: \`all\`.
109
130
 
110
- ## Output Contract
131
+ ## Output
111
132
 
112
133
  - Text mode prints source, role, timestamp when available, and extracted message text.
113
134
  - Internal developer/system payloads and hook/tool noise are skipped unless \`--include-internal\` is passed.
@@ -119,9 +140,7 @@ cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--fil
119
140
  aliases: ["coderoom", "code-room", "repo-sync"],
120
141
  body: `# cngkit coderoom
121
142
 
122
- Coderoom is the fast way to unite developers around one working tree. It gives a pair or team a temporary shared room over the Curly backend so one developer can share local file changes and another can join from their own machine.
123
-
124
- It is intentionally closer to a Drive-like project room than a raw socket command: the room code is the shared folder link, each connected machine is a collaborator, and the file stream is the activity feed. The browser experience at \`/coderoom\` provides the helper surface for copying commands and explaining the room model.
143
+ Create or join a temporary live room for sharing a working tree over the Curly backend.
125
144
 
126
145
  ## Usage
127
146
 
@@ -136,17 +155,17 @@ ${coderoomCommandList}
136
155
  ## Common Flow
137
156
 
138
157
  \`\`\`bash
139
- cngkit coderoom share
140
- cngkit coderoom join <room-code>
158
+ npx --yes cngkit@latest coderoom share
159
+ npx --yes cngkit@latest coderoom join <room-code>
141
160
  \`\`\`
142
161
 
143
- ## Backend Contract
162
+ ## Behavior
144
163
 
145
164
  - Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
146
165
  - Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
147
166
  - Sends an initial snapshot, then file and delete events.
148
167
  - Last received change wins.
149
- - Current rooms are live relays, not durable cloud storage. The Drive-like frontend is the collaboration shell around that live primitive.
168
+ - Current rooms are live relays, not durable cloud storage.
150
169
  `
151
170
  },
152
171
  {
@@ -154,7 +173,7 @@ cngkit coderoom join <room-code>
154
173
  aliases: ["coderoom-share"],
155
174
  body: `# cngkit coderoom share
156
175
 
157
- Start a real-time repository sync room from the current directory.
176
+ Start a live repository sync room from the current directory.
158
177
 
159
178
  ## Usage
160
179
 
@@ -162,7 +181,7 @@ Start a real-time repository sync room from the current directory.
162
181
  cngkit coderoom share [room-code]
163
182
  \`\`\`
164
183
 
165
- ## Backend Contract
184
+ ## Behavior
166
185
 
167
186
  - Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
168
187
  - Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
@@ -175,7 +194,7 @@ cngkit coderoom share [room-code]
175
194
  - Preserves files ignored by the repo's \`.gitignore\`.
176
195
  - Sends regular files as base64 payloads in the sync protocol.
177
196
 
178
- ## Output Contract
197
+ ## Output
179
198
 
180
199
  - Prints room code, repo root, peer id, backend health, and concise sync events.
181
200
  - Keeps running until the socket closes or the process receives a termination signal.
@@ -186,7 +205,7 @@ cngkit coderoom share [room-code]
186
205
  aliases: ["coderoom-join"],
187
206
  body: `# cngkit coderoom join
188
207
 
189
- Join an existing real-time repository sync room in the current directory.
208
+ Join an existing live repository sync room from the current directory.
190
209
 
191
210
  ## Usage
192
211
 
@@ -194,11 +213,11 @@ Join an existing real-time repository sync room in the current directory.
194
213
  cngkit coderoom join <room-code>
195
214
  \`\`\`
196
215
 
197
- ## Backend Contract
216
+ ## Behavior
198
217
 
199
218
  Same transport and filesystem contract as \`cngkit coderoom share\`. The supplied room code selects the Durable Object room.
200
219
 
201
- ## Output Contract
220
+ ## Output
202
221
 
203
222
  - Prints backend health, room code, repo root, peer id, and concise sync events.
204
223
  - Missing room code exits with a usage error.
@@ -209,7 +228,7 @@ Same transport and filesystem contract as \`cngkit coderoom share\`. The supplie
209
228
  aliases: ["scrub"],
210
229
  body: `# cngkit scrub
211
230
 
212
- Scan a file or directory for secrets with TruffleHog. Report-only is the default. Inline masking requires \`--yes\`.
231
+ Scan a file or directory for secrets with TruffleHog. Report-only is the default.
213
232
 
214
233
  ## Usage
215
234
 
@@ -218,16 +237,21 @@ cngkit scrub [path]
218
237
  cngkit scrub [path] --yes
219
238
  \`\`\`
220
239
 
240
+ ## Safety
241
+
242
+ - Default mode does not rewrite files.
243
+ - Inline masking rewrites files and requires \`--yes\`.
244
+ - Raw and redacted secret values are never printed.
245
+
221
246
  ## Requirements
222
247
 
223
248
  - \`trufflehog\` must be available on \`PATH\`.
224
249
 
225
- ## Safety Contract
250
+ ## Mask Format
226
251
 
227
- - Default mode does not rewrite files.
228
- - \`--yes\` rewrites detected secret values inline with \`[CNGKIT_SECRET:<detector>:<verified|unverified>]\` placeholders.
229
- - \`--mask\` is accepted as a compatibility alias, but still requires \`--yes\`.
230
- - Raw and redacted secret values are never printed in the report.
252
+ \`\`\`text
253
+ [CNGKIT_SECRET:<detector>:<verified|unverified>]
254
+ \`\`\`
231
255
  `
232
256
  },
233
257
  {
@@ -235,7 +259,7 @@ cngkit scrub [path] --yes
235
259
  aliases: ["knowledges", "knowledge"],
236
260
  body: `# cngkit knowledges
237
261
 
238
- Read the hosted Harness knowledges catalog from the Curly backend. These commands are read-only and use the generated \`@cng/client\` SDK against public backend routes.
262
+ Search and read the hosted Harness knowledges catalog from the Curly backend.
239
263
 
240
264
  ## Usage
241
265
 
@@ -250,6 +274,7 @@ ${knowledgesCommandList}
250
274
  ## Progressive Help
251
275
 
252
276
  \`\`\`bash
277
+ cngkit help knowledges <subcommand>
253
278
  cngkit knowledges <subcommand> --help
254
279
  cngkit knowledges read --help
255
280
  cngkit knowledges grep --help
@@ -259,10 +284,10 @@ cngkit knowledges glob --help
259
284
  ## Common Examples
260
285
 
261
286
  \`\`\`bash
262
- cngkit knowledges search "cloudflare backend" --limit 3
263
- cngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
264
- cngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
265
- cngkit knowledges glob "**/*.md" --path /libraries/lib-cloudflare
287
+ npx --yes cngkit@latest knowledges search "cloudflare backend" --limit 3
288
+ npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
289
+ npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
290
+ npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare
266
291
  \`\`\`
267
292
 
268
293
  ## AI-Friendly Output
@@ -279,7 +304,7 @@ cngkit knowledges glob "**/*.md" --path /libraries/lib-cloudflare
279
304
  aliases: ["knowledges-status", "status"],
280
305
  body: `# cngkit knowledges status
281
306
 
282
- Print remote Harness catalog state from \`GET /api/harness/knowledges/catalog\`.
307
+ Print remote Harness catalog state.
283
308
 
284
309
  ## Usage
285
310
 
@@ -287,7 +312,7 @@ Print remote Harness catalog state from \`GET /api/harness/knowledges/catalog\`.
287
312
  cngkit knowledges status [--json]
288
313
  \`\`\`
289
314
 
290
- ## Output Contract
315
+ ## Output
291
316
 
292
317
  - Text mode prints catalog name, file count, blob count, Vectorize binding, and latest run when present.
293
318
  - \`--json\` prints the backend data payload.
@@ -298,7 +323,7 @@ cngkit knowledges status [--json]
298
323
  aliases: ["knowledges-audiences", "audiences"],
299
324
  body: `# cngkit knowledges audiences
300
325
 
301
- List valid audience filters from \`GET /api/harness/knowledges/audiences\`.
326
+ List valid audience filters for catalog browsing.
302
327
 
303
328
  ## Usage
304
329
 
@@ -306,7 +331,9 @@ List valid audience filters from \`GET /api/harness/knowledges/audiences\`.
306
331
  cngkit knowledges audiences [--json]
307
332
  \`\`\`
308
333
 
309
- Use this before \`cngkit knowledges files --audience <id>\`.
334
+ ## Use When
335
+
336
+ Run this before \`cngkit knowledges files --audience <id>\`.
310
337
  `
311
338
  },
312
339
  {
@@ -314,7 +341,7 @@ Use this before \`cngkit knowledges files --audience <id>\`.
314
341
  aliases: ["knowledges-search", "search"],
315
342
  body: `# cngkit knowledges search
316
343
 
317
- Run semantic search against the Cloudflare Vectorize-backed Harness index.
344
+ Search the hosted Harness index for relevant skills and subskills.
318
345
 
319
346
  ## Usage
320
347
 
@@ -329,7 +356,7 @@ cngkit knowledges search <query> [--limit <n>] [--json]
329
356
  ## Example
330
357
 
331
358
  \`\`\`bash
332
- cngkit knowledges search "cloudflare backend" --limit 3
359
+ npx --yes cngkit@latest knowledges search "cloudflare backend" --limit 3
333
360
  \`\`\`
334
361
  `
335
362
  },
@@ -338,7 +365,7 @@ cngkit knowledges search "cloudflare backend" --limit 3
338
365
  aliases: ["knowledges-list", "list"],
339
366
  body: `# cngkit knowledges list
340
367
 
341
- List known subskills from \`GET /api/harness/knowledges/subskills\`, optionally filtered locally by query.
368
+ List hosted Harness subskills, optionally filtered by query.
342
369
 
343
370
  ## Usage
344
371
 
@@ -349,6 +376,12 @@ cngkit knowledges list [query] [--limit <n>] [--json]
349
376
  ## Defaults
350
377
 
351
378
  - \`--limit\`: \`25\`
379
+
380
+ ## Example
381
+
382
+ \`\`\`bash
383
+ cngkit knowledges list cloudflare --limit 10
384
+ \`\`\`
352
385
  `
353
386
  },
354
387
  {
@@ -356,7 +389,7 @@ cngkit knowledges list [query] [--limit <n>] [--json]
356
389
  aliases: ["knowledges-files", "files"],
357
390
  body: `# cngkit knowledges files
358
391
 
359
- List uploaded catalog files from \`GET /api/harness/knowledges/files\`.
392
+ List uploaded Harness catalog files, optionally filtered by query or audience.
360
393
 
361
394
  ## Usage
362
395
 
@@ -369,7 +402,12 @@ cngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json]
369
402
  - \`--limit\`: \`25\`
370
403
  - \`--audience\`: omitted
371
404
 
372
- Run \`cngkit knowledges audiences\` to discover supported audience ids.
405
+ ## Example
406
+
407
+ \`\`\`bash
408
+ cngkit knowledges files cloudflare --limit 10
409
+ cngkit knowledges files "vector search" --audience builders
410
+ \`\`\`
373
411
  `
374
412
  },
375
413
  {
@@ -377,7 +415,7 @@ Run \`cngkit knowledges audiences\` to discover supported audience ids.
377
415
  aliases: ["knowledges-read", "read"],
378
416
  body: `# cngkit knowledges read
379
417
 
380
- Claude-style read tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/read\` and \`HarnessReadQuerySchema\`.
418
+ Read a hosted Harness catalog file by path.
381
419
 
382
420
  ## Usage
383
421
 
@@ -391,7 +429,7 @@ cngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]
391
429
  - \`--offset\`: zero-based starting line. Default: \`0\`.
392
430
  - \`--limit\`: maximum lines. Default in CLI: \`200\`. Backend max: \`2000\`.
393
431
 
394
- ## Output Contract
432
+ ## Output
395
433
 
396
434
  - Text mode prints only the returned file content first.
397
435
  - If truncated, a final bracketed truncation note is printed after the content.
@@ -400,7 +438,7 @@ cngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]
400
438
  ## Example
401
439
 
402
440
  \`\`\`bash
403
- cngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
441
+ npx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
404
442
  \`\`\`
405
443
  `
406
444
  },
@@ -409,7 +447,7 @@ cngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
409
447
  aliases: ["knowledges-grep", "grep"],
410
448
  body: `# cngkit knowledges grep
411
449
 
412
- Claude-style grep tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/grep\` and \`HarnessGrepQuerySchema\`.
450
+ Search inside hosted Harness catalog files with a JavaScript regular expression.
413
451
 
414
452
  ## Usage
415
453
 
@@ -427,7 +465,7 @@ cngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mo
427
465
  - \`--context\`: context lines around content matches. Default: \`0\`. Backend max: \`20\`.
428
466
  - \`--case-insensitive\`: maps to backend \`case_insensitive=true\`.
429
467
 
430
- ## Output Contract
468
+ ## Output
431
469
 
432
470
  - \`content\`: prints blocks as \`file_path:line_number\`, optional context lines, then \`> matching line\`.
433
471
  - \`files_with_matches\`: prints one matching file path per line.
@@ -437,8 +475,8 @@ cngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mo
437
475
  ## Examples
438
476
 
439
477
  \`\`\`bash
440
- cngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
441
- cngkit knowledges grep "Vectorize|D1" --path /libraries/lib-cloudflare --context 2
478
+ npx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
479
+ npx --yes cngkit@latest knowledges grep "Vectorize|D1" --path /libraries/lib-cloudflare --context 2
442
480
  \`\`\`
443
481
  `
444
482
  },
@@ -447,7 +485,7 @@ cngkit knowledges grep "Vectorize|D1" --path /libraries/lib-cloudflare --context
447
485
  aliases: ["knowledges-glob", "glob"],
448
486
  body: `# cngkit knowledges glob
449
487
 
450
- Claude-style glob tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/glob\` and \`HarnessGlobQuerySchema\`.
488
+ Find hosted Harness catalog files by glob pattern.
451
489
 
452
490
  ## Usage
453
491
 
@@ -469,7 +507,7 @@ cngkit knowledges glob [pattern] [--path <path>] [--json]
469
507
  - \`*.SUBSKILL.md\`
470
508
  - \`SKILL.md\`
471
509
 
472
- ## Output Contract
510
+ ## Output
473
511
 
474
512
  - Text mode prints one file path per line.
475
513
  - If truncated, a final bracketed truncation note is printed.
@@ -478,11 +516,12 @@ cngkit knowledges glob [pattern] [--path <path>] [--json]
478
516
  ## Example
479
517
 
480
518
  \`\`\`bash
481
- cngkit knowledges glob "**/*.md" --path /libraries/lib-cloudflare
519
+ npx --yes cngkit@latest knowledges glob "**/*.md" --path /libraries/lib-cloudflare
482
520
  \`\`\`
483
521
  `
484
522
  }
485
523
  ];
524
+ var helpTopicNames = helpTopics.filter((topic) => topic.title !== "cngkit").map((topic) => topic.title).sort();
486
525
  var helpTopicByAlias = /* @__PURE__ */ new Map();
487
526
  for (const topic of helpTopics) {
488
527
  for (const alias of topic.aliases) {
@@ -491,7 +530,14 @@ for (const topic of helpTopics) {
491
530
  }
492
531
  function formatCngkitHelp(topicName) {
493
532
  const normalizedTopicName = normalizeHelpTopicName(topicName);
494
- return (helpTopicByAlias.get(normalizedTopicName) ?? helpTopicByAlias.get(""))?.body.trim() ?? "";
533
+ const topic = helpTopicByAlias.get(normalizedTopicName);
534
+ if (topic) {
535
+ return topic.body.trim();
536
+ }
537
+ if (normalizedTopicName === "") {
538
+ return helpTopicByAlias.get("")?.body.trim() ?? "";
539
+ }
540
+ return formatUnknownHelpTopic(normalizedTopicName);
495
541
  }
496
542
  function formatKnowledgesHelp(topicName) {
497
543
  const normalizedTopicName = normalizeHelpTopicName(topicName);
@@ -501,9 +547,25 @@ function formatKnowledgesHelp(topicName) {
501
547
  function normalizeHelpTopicName(value) {
502
548
  return value?.trim().toLowerCase().replace(/\s+/g, "-") ?? "";
503
549
  }
550
+ function formatUnknownHelpTopic(topicName) {
551
+ return `# cngkit help
552
+
553
+ No help topic named \`${topicName}\`.
554
+
555
+ ## Available Topics
556
+
557
+ ${helpTopicNames.map((name) => `- \`${name}\``).join("\n")}
558
+
559
+ ## Usage
560
+
561
+ \`\`\`bash
562
+ cngkit help <topic>
563
+ cngkit <command> --help
564
+ \`\`\``;
565
+ }
504
566
 
505
567
  export {
506
568
  formatCngkitHelp,
507
569
  formatKnowledgesHelp
508
570
  };
509
- //# sourceMappingURL=chunk-S6LINZSY.js.map
571
+ //# sourceMappingURL=chunk-VQTRHKNP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/help-specs.ts"],"sourcesContent":["type HelpTopic = {\n title: string;\n aliases: string[];\n body: string;\n};\n\nconst commandList = [\n \"- `cngkit login` - open Curly.ng login, or print the URL in headless shells.\",\n \"- `cngkit coderoom ...` - share or join a live developer room for a working tree.\",\n \"- `cngkit scrub [path]` - scan for secrets; rewrite only when `--yes` is passed.\",\n \"- `cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.\",\n \"- `cngkit knowledges ...` - search and read the hosted Harness knowledge catalog.\",\n].join(\"\\n\");\n\nconst coderoomCommandList = [\n \"- `share [room-code]` - start a live room from the current directory.\",\n \"- `join <room-code>` - join another developer's live room from the current directory.\",\n].join(\"\\n\");\n\nconst knowledgesCommandList = [\n \"- `status` - print remote catalog state.\",\n \"- `audiences` - list valid audience filters.\",\n \"- `search <query>` - semantic search over Cloudflare Vectorize-backed records.\",\n \"- `list [query]` - list known subskills.\",\n \"- `files [query]` - list uploaded catalog files.\",\n \"- `read <file-path>` - Claude-style file read.\",\n \"- `grep <pattern>` - Claude-style content search.\",\n \"- `glob [pattern]` - Claude-style file discovery.\",\n].join(\"\\n\");\n\nconst helpTopics: HelpTopic[] = [\n {\n title: \"cngkit\",\n aliases: [\"\", \"overview\", \"help\"],\n body: `# cngkit\n\nCurly.ng operator CLI for shared code rooms, safe local cleanup, local agent transcripts, and hosted Harness knowledges.\n\n## Run Now\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest --help\nnpx --yes cngkit@latest knowledges search \"cloudflare backend\" --limit 3\n\\`\\`\\`\n\n## Installed Usage\n\n\\`\\`\\`bash\ncngkit <command> [options]\n\\`\\`\\`\n\n## Commands\n\n${commandList}\n\n## Help Map\n\n\\`\\`\\`bash\ncngkit help <topic>\ncngkit <command> --help\ncngkit coderoom --help\ncngkit coderoom <subcommand> --help\ncngkit transcripts --help\ncngkit knowledges --help\ncngkit knowledges <subcommand> --help\n\\`\\`\\`\n\n## AI And Scripts\n\n- Help is Markdown in pipes and colorized Markdown in interactive terminals.\n- Text output is line-oriented; commands do not rely on color-only state.\n- Use \\`--json\\` on read-only knowledges commands for typed backend payloads.\n- Use \\`CNGKIT_COLOR=never\\` for logs, screenshots, and strict plain text.\n\n## Backend\n\nDefault API: \\`https://curly.ng\\`\n\nOverride with:\n\n\\`\\`\\`bash\ncngkit --api-base-url <url> ...\nCNGKIT_API_BASE_URL=<url> cngkit ...\n\\`\\`\\`\n`,\n },\n {\n title: \"login\",\n aliases: [\"login\"],\n body: `# cngkit login\n\nOpen Curly.ng login in a browser. In headless shells, print the URL so an agent can show it to the operator.\n\n## Usage\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest login\ncngkit login\n\\`\\`\\`\n\n## Output\n\n- First line names the login URL being opened.\n- If no browser opener exists, the CLI prints a direct URL.\n- No credentials are printed or persisted by this command.\n`,\n },\n {\n title: \"transcripts\",\n aliases: [\"transcripts\", \"transcript\"],\n body: `# cngkit transcripts\n\nRead local Claude and Codex transcript JSONL files.\n\nThis is local-only operator tooling. It does not call Curly.ng and it does not upload transcript content.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json]\ncngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json]\ncngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json]\n\\`\\`\\`\n\n## Sources\n\n- \\`~/.codex/sessions\\`\n- \\`~/.codex/archived_sessions\\`\n- \\`~/.claude/projects\\`\n- \\`~/.claude/history.jsonl\\`\n\n## Defaults\n\n- \\`list\\`: newest 12 transcript files.\n- \\`read\\`: newest 80 user/assistant entries from the selected file.\n- \\`grep\\`: first 80 matching user/assistant entries from the newest 60 files.\n- \\`--source\\`: \\`all\\`.\n\n## Output\n\n- Text mode prints source, role, timestamp when available, and extracted message text.\n- Internal developer/system payloads and hook/tool noise are skipped unless \\`--include-internal\\` is passed.\n- Direct file paths, home-relative paths, and partial session ids are accepted by \\`read\\`.\n`,\n },\n {\n title: \"coderoom\",\n aliases: [\"coderoom\", \"code-room\", \"repo-sync\"],\n body: `# cngkit coderoom\n\nCreate or join a temporary live room for sharing a working tree over the Curly backend.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${coderoomCommandList}\n\n## Common Flow\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest coderoom share\nnpx --yes cngkit@latest coderoom join <room-code>\n\\`\\`\\`\n\n## Behavior\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n- Current rooms are live relays, not durable cloud storage.\n`,\n },\n {\n title: \"coderoom share\",\n aliases: [\"coderoom-share\"],\n body: `# cngkit coderoom share\n\nStart a live repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom share [room-code]\n\\`\\`\\`\n\n## Behavior\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n\n## Filesystem Contract\n\n- Preserves \\`.git/\\`.\n- Preserves files ignored by the repo's \\`.gitignore\\`.\n- Sends regular files as base64 payloads in the sync protocol.\n\n## Output\n\n- Prints room code, repo root, peer id, backend health, and concise sync events.\n- Keeps running until the socket closes or the process receives a termination signal.\n`,\n },\n {\n title: \"coderoom join\",\n aliases: [\"coderoom-join\"],\n body: `# cngkit coderoom join\n\nJoin an existing live repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Behavior\n\nSame transport and filesystem contract as \\`cngkit coderoom share\\`. The supplied room code selects the Durable Object room.\n\n## Output\n\n- Prints backend health, room code, repo root, peer id, and concise sync events.\n- Missing room code exits with a usage error.\n`,\n },\n {\n title: \"scrub\",\n aliases: [\"scrub\"],\n body: `# cngkit scrub\n\nScan a file or directory for secrets with TruffleHog. Report-only is the default.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit scrub [path]\ncngkit scrub [path] --yes\n\\`\\`\\`\n\n## Safety\n\n- Default mode does not rewrite files.\n- Inline masking rewrites files and requires \\`--yes\\`.\n- Raw and redacted secret values are never printed.\n\n## Requirements\n\n- \\`trufflehog\\` must be available on \\`PATH\\`.\n\n## Mask Format\n\n\\`\\`\\`text\n[CNGKIT_SECRET:<detector>:<verified|unverified>]\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges\",\n aliases: [\"knowledges\", \"knowledge\"],\n body: `# cngkit knowledges\n\nSearch and read the hosted Harness knowledges catalog from the Curly backend.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${knowledgesCommandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit help knowledges <subcommand>\ncngkit knowledges <subcommand> --help\ncngkit knowledges read --help\ncngkit knowledges grep --help\ncngkit knowledges glob --help\n\\`\\`\\`\n\n## Common Examples\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges search \"cloudflare backend\" --limit 3\nnpx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\nnpx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\nnpx --yes cngkit@latest knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n\n## AI-Friendly Output\n\n- Default output is line-oriented and intended to be directly usable by agents.\n- \\`read\\` prints file content with no wrapper before any truncation note.\n- \\`grep --output-mode content\\` prints \\`path:line\\` blocks.\n- \\`grep --output-mode files_with_matches\\` and \\`glob\\` print one path per line.\n- \\`--json\\` prints the typed backend data payload for machine consumption.\n`,\n },\n {\n title: \"knowledges status\",\n aliases: [\"knowledges-status\", \"status\"],\n body: `# cngkit knowledges status\n\nPrint remote Harness catalog state.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges status [--json]\n\\`\\`\\`\n\n## Output\n\n- Text mode prints catalog name, file count, blob count, Vectorize binding, and latest run when present.\n- \\`--json\\` prints the backend data payload.\n`,\n },\n {\n title: \"knowledges audiences\",\n aliases: [\"knowledges-audiences\", \"audiences\"],\n body: `# cngkit knowledges audiences\n\nList valid audience filters for catalog browsing.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges audiences [--json]\n\\`\\`\\`\n\n## Use When\n\nRun this before \\`cngkit knowledges files --audience <id>\\`.\n`,\n },\n {\n title: \"knowledges search\",\n aliases: [\"knowledges-search\", \"search\"],\n body: `# cngkit knowledges search\n\nSearch the hosted Harness index for relevant skills and subskills.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges search <query> [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`5\\`\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges search \"cloudflare backend\" --limit 3\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges list\",\n aliases: [\"knowledges-list\", \"list\"],\n body: `# cngkit knowledges list\n\nList hosted Harness subskills, optionally filtered by query.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges list [query] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges list cloudflare --limit 10\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges files\",\n aliases: [\"knowledges-files\", \"files\"],\n body: `# cngkit knowledges files\n\nList uploaded Harness catalog files, optionally filtered by query or audience.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n- \\`--audience\\`: omitted\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges files cloudflare --limit 10\ncngkit knowledges files \"vector search\" --audience builders\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges read\",\n aliases: [\"knowledges-read\", \"read\"],\n body: `# cngkit knowledges read\n\nRead a hosted Harness catalog file by path.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`file-path\\`: normalized catalog path. Shorthand paths such as \\`/libraries/lib-cloudflare/SUBSKILL.md\\` are expanded to \\`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\\`.\n- \\`--offset\\`: zero-based starting line. Default: \\`0\\`.\n- \\`--limit\\`: maximum lines. Default in CLI: \\`200\\`. Backend max: \\`2000\\`.\n\n## Output\n\n- Text mode prints only the returned file content first.\n- If truncated, a final bracketed truncation note is printed after the content.\n- \\`--json\\` prints \\`{ file_path, content, total_lines, offset, limit, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges grep\",\n aliases: [\"knowledges-grep\", \"grep\"],\n body: `# cngkit knowledges grep\n\nSearch inside hosted Harness catalog files with a JavaScript regular expression.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: JavaScript regular expression source.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n- \\`--include\\`: filename include filter. Default: \\`*\\`.\n- Modes: content, files_with_matches, or count.\n- \\`--output-mode\\`: \\`content\\`, \\`files_with_matches\\`, or \\`count\\`. Default: \\`content\\`.\n- \\`--context\\`: context lines around content matches. Default: \\`0\\`. Backend max: \\`20\\`.\n- \\`--case-insensitive\\`: maps to backend \\`case_insensitive=true\\`.\n\n## Output\n\n- \\`content\\`: prints blocks as \\`file_path:line_number\\`, optional context lines, then \\`> matching line\\`.\n- \\`files_with_matches\\`: prints one matching file path per line.\n- \\`count\\`: prints \\`file_path: match_count\\` lines.\n- \\`--json\\` prints the typed backend response union.\n\n## Examples\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\nnpx --yes cngkit@latest knowledges grep \"Vectorize|D1\" --path /libraries/lib-cloudflare --context 2\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges glob\",\n aliases: [\"knowledges-glob\", \"glob\"],\n body: `# cngkit knowledges glob\n\nFind hosted Harness catalog files by glob pattern.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges glob [pattern] [--path <path>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: supported glob pattern. CLI default: \\`**/*.md\\`.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n\n## Supported Patterns\n\n- \\`**/*.md\\`\n- \\`**/*.SUBSKILL.md\\`\n- \\`**/SKILL.md\\`\n- \\`*.md\\`\n- \\`*.SUBSKILL.md\\`\n- \\`SKILL.md\\`\n\n## Output\n\n- Text mode prints one file path per line.\n- If truncated, a final bracketed truncation note is printed.\n- \\`--json\\` prints \\`{ files, total_files, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\nnpx --yes cngkit@latest knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n`,\n },\n];\n\nconst helpTopicNames = helpTopics\n .filter((topic) => topic.title !== \"cngkit\")\n .map((topic) => topic.title)\n .sort();\n\nconst helpTopicByAlias = new Map<string, HelpTopic>();\n\nfor (const topic of helpTopics) {\n for (const alias of topic.aliases) {\n helpTopicByAlias.set(alias, topic);\n }\n}\n\nexport function formatCngkitHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topic = helpTopicByAlias.get(normalizedTopicName);\n\n if (topic) {\n return topic.body.trim();\n }\n\n if (normalizedTopicName === \"\") {\n return helpTopicByAlias.get(\"\")?.body.trim() ?? \"\";\n }\n\n return formatUnknownHelpTopic(normalizedTopicName);\n}\n\nexport function formatKnowledgesHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : \"knowledges\";\n return formatCngkitHelp(topicKey);\n}\n\nfunction normalizeHelpTopicName(value: string | undefined): string {\n return value?.trim().toLowerCase().replace(/\\s+/g, \"-\") ?? \"\";\n}\n\nfunction formatUnknownHelpTopic(topicName: string): string {\n return `# cngkit help\n\nNo help topic named \\`${topicName}\\`.\n\n## Available Topics\n\n${helpTopicNames.map((name) => `- \\`${name}\\``).join(\"\\n\")}\n\n## Usage\n\n\\`\\`\\`bash\ncngkit help <topic>\ncngkit <command> --help\n\\`\\`\\``;\n}\n"],"mappings":";AAMA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,aAA0B;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,IAAI,YAAY,MAAM;AAAA,IAChC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBR,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgCX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,OAAO;AAAA,IACjB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAiBR;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,eAAe,YAAY;AAAA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A4B;AAC3D,QAAM,sBAAsB,uBAAuB,SAAS;AAC5D,QAAM,QAAQ,iBAAiB,IAAI,mBAAmB;AAEtD,MAAI,OAAO;AACT,WAAO,MAAM,KAAK,KAAK;AAAA,EACzB;AAEA,MAAI,wBAAwB,IAAI;AAC9B,WAAO,iBAAiB,IAAI,EAAE,GAAG,KAAK,KAAK,KAAK;AAAA,EAClD;AAEA,SAAO,uBAAuB,mBAAmB;AACnD;AAEO,SAAS,qBAAqB,WAA4B;AAC/D,QAAM,sBAAsB,uBAAuB,SAAS;AAC5D,QAAM,WAAW,sBAAsB,cAAc,mBAAmB,KAAK;AAC7E,SAAO,iBAAiB,QAAQ;AAClC;AAEA,SAAS,uBAAuB,OAAmC;AACjE,SAAO,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,QAAQ,GAAG,KAAK;AAC7D;AAEA,SAAS,uBAAuB,WAA2B;AACzD,SAAO;AAAA;AAAA,wBAEe,SAAS;AAAA;AAAA;AAAA;AAAA,EAI/B,eAAe,IAAI,CAAC,SAAS,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQ1D;","names":[]}
package/dist/cli.js CHANGED
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  formatCngkitHelp,
4
4
  formatKnowledgesHelp
5
- } from "./chunk-S6LINZSY.js";
5
+ } from "./chunk-VQTRHKNP.js";
6
6
  import {
7
7
  packageVersion
8
- } from "./chunk-4UBOEQN2.js";
8
+ } from "./chunk-UZMVTVL2.js";
9
9
  import {
10
10
  consoleOutput,
11
11
  formatError
12
- } from "./chunk-7Z74PS5X.js";
12
+ } from "./chunk-Q3F7DVFP.js";
13
13
  import "./chunk-PZ5AY32C.js";
14
14
 
15
15
  // src/cli.ts
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  formatCngkitHelp
3
- } from "../../chunk-S6LINZSY.js";
3
+ } from "../../chunk-VQTRHKNP.js";
4
4
  import {
5
5
  GlobalOptionsSchema
6
6
  } from "../../chunk-MLKBG5YJ.js";
7
7
  import {
8
8
  CommandRunner
9
- } from "../../chunk-VCURAGDZ.js";
10
- import "../../chunk-7Z74PS5X.js";
9
+ } from "../../chunk-JX33GP2L.js";
10
+ import "../../chunk-Q3F7DVFP.js";
11
11
  import "../../chunk-PZ5AY32C.js";
12
12
 
13
13
  // src/commands/coderoom/index.tsx
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  runJoinCommand
3
- } from "../../chunk-IMOIIPGC.js";
4
- import "../../chunk-C7FNUZYD.js";
5
- import "../../chunk-4UBOEQN2.js";
3
+ } from "../../chunk-AOJSBSHF.js";
4
+ import "../../chunk-ERSRJLYP.js";
5
+ import "../../chunk-UZMVTVL2.js";
6
6
  import {
7
7
  GlobalOptionsSchema,
8
8
  RequiredRoomCodeArgsSchema
9
9
  } from "../../chunk-MLKBG5YJ.js";
10
10
  import {
11
11
  CommandRunner
12
- } from "../../chunk-VCURAGDZ.js";
13
- import "../../chunk-7Z74PS5X.js";
12
+ } from "../../chunk-JX33GP2L.js";
13
+ import "../../chunk-Q3F7DVFP.js";
14
14
  import "../../chunk-PZ5AY32C.js";
15
15
 
16
16
  // src/commands/coderoom/join.tsx
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  runShareCommand
3
- } from "../../chunk-IMOIIPGC.js";
4
- import "../../chunk-C7FNUZYD.js";
5
- import "../../chunk-4UBOEQN2.js";
3
+ } from "../../chunk-AOJSBSHF.js";
4
+ import "../../chunk-ERSRJLYP.js";
5
+ import "../../chunk-UZMVTVL2.js";
6
6
  import {
7
7
  GlobalOptionsSchema,
8
8
  OptionalRoomCodeArgsSchema
9
9
  } from "../../chunk-MLKBG5YJ.js";
10
10
  import {
11
11
  CommandRunner
12
- } from "../../chunk-VCURAGDZ.js";
13
- import "../../chunk-7Z74PS5X.js";
12
+ } from "../../chunk-JX33GP2L.js";
13
+ import "../../chunk-Q3F7DVFP.js";
14
14
  import "../../chunk-PZ5AY32C.js";
15
15
 
16
16
  // src/commands/coderoom/share.tsx
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  formatCngkitHelp
3
- } from "../chunk-S6LINZSY.js";
3
+ } from "../chunk-VQTRHKNP.js";
4
4
  import {
5
5
  CommandRunner
6
- } from "../chunk-VCURAGDZ.js";
7
- import "../chunk-7Z74PS5X.js";
6
+ } from "../chunk-JX33GP2L.js";
7
+ import "../chunk-Q3F7DVFP.js";
8
8
  import "../chunk-PZ5AY32C.js";
9
9
 
10
10
  // src/commands/index.tsx
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  runKnowAudiencesCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema
10
10
  } from "../../chunk-MLKBG5YJ.js";
11
11
  import {
12
12
  CommandRunner
13
- } from "../../chunk-VCURAGDZ.js";
14
- import "../../chunk-7Z74PS5X.js";
13
+ } from "../../chunk-JX33GP2L.js";
14
+ import "../../chunk-Q3F7DVFP.js";
15
15
  import "../../chunk-PZ5AY32C.js";
16
16
 
17
17
  // src/commands/knowledges/audiences.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowFilesCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema,
10
10
  OptionalQueryArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/files.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowGlobCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  LimitOptionsSchema,
10
10
  OptionalGlobPatternArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/glob.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowGrepCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  LimitOptionsSchema,
10
10
  RequiredPatternArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/grep.tsx
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  formatKnowledgesHelp
3
- } from "../../chunk-S6LINZSY.js";
3
+ } from "../../chunk-VQTRHKNP.js";
4
4
  import {
5
5
  GlobalOptionsSchema
6
6
  } from "../../chunk-MLKBG5YJ.js";
7
7
  import {
8
8
  CommandRunner
9
- } from "../../chunk-VCURAGDZ.js";
10
- import "../../chunk-7Z74PS5X.js";
9
+ } from "../../chunk-JX33GP2L.js";
10
+ import "../../chunk-Q3F7DVFP.js";
11
11
  import "../../chunk-PZ5AY32C.js";
12
12
 
13
13
  // src/commands/knowledges/index.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowListCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  LimitOptionsSchema,
10
10
  OptionalQueryArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/list.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowReadCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema,
10
10
  RequiredFilePathArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/read.tsx
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowSearchCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  LimitOptionsSchema,
10
10
  RequiredQueryArgsSchema
11
11
  } from "../../chunk-MLKBG5YJ.js";
12
12
  import {
13
13
  CommandRunner
14
- } from "../../chunk-VCURAGDZ.js";
15
- import "../../chunk-7Z74PS5X.js";
14
+ } from "../../chunk-JX33GP2L.js";
15
+ import "../../chunk-Q3F7DVFP.js";
16
16
  import "../../chunk-PZ5AY32C.js";
17
17
 
18
18
  // src/commands/knowledges/search.tsx
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  runKnowStatusCommand
3
- } from "../../chunk-WD3MW5UT.js";
3
+ } from "../../chunk-BXKVJRTD.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-S6LINZSY.js";
6
- import "../../chunk-C7FNUZYD.js";
7
- import "../../chunk-4UBOEQN2.js";
5
+ import "../../chunk-VQTRHKNP.js";
6
+ import "../../chunk-ERSRJLYP.js";
7
+ import "../../chunk-UZMVTVL2.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema
10
10
  } from "../../chunk-MLKBG5YJ.js";
11
11
  import {
12
12
  CommandRunner
13
- } from "../../chunk-VCURAGDZ.js";
14
- import "../../chunk-7Z74PS5X.js";
13
+ } from "../../chunk-JX33GP2L.js";
14
+ import "../../chunk-Q3F7DVFP.js";
15
15
  import "../../chunk-PZ5AY32C.js";
16
16
 
17
17
  // src/commands/knowledges/status.tsx
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  resolveApiBaseUrl
3
- } from "../chunk-4UBOEQN2.js";
3
+ } from "../chunk-UZMVTVL2.js";
4
4
  import {
5
5
  GlobalOptionsSchema
6
6
  } from "../chunk-MLKBG5YJ.js";
7
7
  import {
8
8
  CommandRunner
9
- } from "../chunk-VCURAGDZ.js";
10
- import "../chunk-7Z74PS5X.js";
9
+ } from "../chunk-JX33GP2L.js";
10
+ import "../chunk-Q3F7DVFP.js";
11
11
  import "../chunk-PZ5AY32C.js";
12
12
 
13
13
  // src/shared/browser.ts
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-MLKBG5YJ.js";
5
5
  import {
6
6
  CommandRunner
7
- } from "../chunk-VCURAGDZ.js";
8
- import "../chunk-7Z74PS5X.js";
7
+ } from "../chunk-JX33GP2L.js";
8
+ import "../chunk-Q3F7DVFP.js";
9
9
  import "../chunk-PZ5AY32C.js";
10
10
 
11
11
  // src/commands/scrub.tsx
@@ -6,15 +6,15 @@ import {
6
6
  } from "../chunk-QZEB4VMX.js";
7
7
  import {
8
8
  formatCngkitHelp
9
- } from "../chunk-S6LINZSY.js";
9
+ } from "../chunk-VQTRHKNP.js";
10
10
  import {
11
11
  GlobalOptionsSchema,
12
12
  TranscriptArgsSchema
13
13
  } from "../chunk-MLKBG5YJ.js";
14
14
  import {
15
15
  CommandRunner
16
- } from "../chunk-VCURAGDZ.js";
17
- import "../chunk-7Z74PS5X.js";
16
+ } from "../chunk-JX33GP2L.js";
17
+ import "../chunk-Q3F7DVFP.js";
18
18
  import "../chunk-PZ5AY32C.js";
19
19
 
20
20
  // src/commands/transcripts.tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cngkit",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "Opinionated Curly.ng CLI kit for Coderoom collaboration and website tooling.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shared/output.ts","../src/shared/theme.ts"],"sourcesContent":["import process from \"node:process\";\nimport { Marked, type MarkedExtension } from \"marked\";\nimport { markedTerminal } from \"marked-terminal\";\nimport { createElement } from \"react\";\nimport { renderToString, Text } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\nimport {\n createMarkdownTheme,\n decorateMarkdownOutput,\n statusStylePropsByOutputStyle,\n type OutputStyle,\n} from \"./theme.js\";\n\ntype OutputStream = NodeJS.WriteStream & {\n isTTY?: boolean;\n columns?: number;\n};\n\nexport type CommandOutput = {\n info(message: string): void;\n success(message: string): void;\n warning(message: string): void;\n muted(message: string): void;\n markdown(message: string): void;\n raw(message: string): void;\n error(message: string): void;\n};\n\nexport const consoleOutput = createCommandOutput(process.stdout, process.stderr);\n\nexport function createCommandOutput(stdout: OutputStream, stderr: OutputStream): CommandOutput {\n return {\n info(message) {\n writeStyledMessage(stdout, \"info\", message);\n },\n success(message) {\n writeStyledMessage(stdout, \"success\", message);\n },\n warning(message) {\n writeStyledMessage(stdout, \"warning\", message);\n },\n muted(message) {\n writeStyledMessage(stdout, \"muted\", message);\n },\n markdown(message) {\n stdout.write(`${formatMarkdownMessage(stdout, message)}\\n`);\n },\n raw(message) {\n stdout.write(`${message}\\n`);\n },\n error(message) {\n writeStyledMessage(stderr, \"error\", message);\n },\n };\n}\n\nexport function formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nfunction writeStyledMessage(stream: OutputStream, style: OutputStyle, message: string): void {\n stream.write(`${formatStyledMessage(stream, style, message)}\\n`);\n}\n\nfunction formatStyledMessage(stream: OutputStream, style: OutputStyle, message: string): string {\n if (!shouldRenderColor(stream)) {\n return message;\n }\n\n return renderToString(\n createElement(\n Text,\n {\n ...statusStylePropsByOutputStyle[style],\n wrap: \"wrap\",\n },\n message\n ),\n {\n columns: 10_000,\n }\n );\n}\n\nfunction formatMarkdownMessage(stream: OutputStream, markdown: string): string {\n if (stream.isTTY !== true) {\n return markdown;\n }\n\n const useColor = shouldRenderColor(stream);\n const parser = new Marked();\n parser.use(\n markedTerminal({\n ...createMarkdownTheme(useColor),\n width: clampMarkdownWidth(stream.columns),\n }) as unknown as MarkedExtension\n );\n\n const renderedMarkdown = String(parser.parse(markdown)).trimEnd();\n return useColor ? decorateMarkdownOutput(renderedMarkdown) : stripAnsi(renderedMarkdown);\n}\n\nfunction shouldRenderColor(stream: OutputStream): boolean {\n const colorMode = process.env.CNGKIT_COLOR?.toLowerCase();\n\n if (colorMode === \"never\" || colorMode === \"0\" || colorMode === \"false\") {\n return false;\n }\n\n if (colorMode === \"always\" || colorMode === \"1\" || colorMode === \"true\") {\n return true;\n }\n\n if (process.env.FORCE_COLOR !== undefined && process.env.FORCE_COLOR !== \"0\") {\n return true;\n }\n\n return stream.isTTY === true;\n}\n\nfunction clampMarkdownWidth(columns: number | undefined): number {\n if (columns === undefined) {\n return 100;\n }\n\n return Math.max(72, Math.min(columns, 120));\n}\n","import { Chalk } from \"chalk\";\nimport type { TextProps } from \"ink\";\nimport stripAnsi from \"strip-ansi\";\n\nexport type OutputStyle = \"info\" | \"success\" | \"warning\" | \"muted\" | \"error\";\n\nexport const statusStylePropsByOutputStyle = {\n info: {\n color: \"cyan\",\n },\n success: {\n color: \"green\",\n bold: true,\n },\n warning: {\n color: \"yellow\",\n bold: true,\n },\n muted: {\n dimColor: true,\n },\n error: {\n color: \"red\",\n bold: true,\n },\n} satisfies Record<OutputStyle, TextProps>;\n\nexport function createMarkdownTheme(useColor: boolean) {\n const chalk = new Chalk({ level: useColor ? 1 : 0 });\n const identity = (value: string) => value;\n\n return {\n code: chalk.green,\n blockquote: chalk.dim.italic,\n html: chalk.gray,\n heading: chalk.blueBright.bold,\n firstHeading: chalk.magentaBright.bold,\n hr: chalk.gray,\n listitem: identity,\n table: identity,\n paragraph: identity,\n strong: chalk.bold,\n em: chalk.italic,\n codespan: chalk.cyanBright,\n del: chalk.dim.strikethrough,\n link: chalk.blueBright,\n href: chalk.blue.underline,\n text: chalk.reset,\n showSectionPrefix: true,\n reflowText: true,\n unescape: true,\n emoji: false,\n tab: 2,\n };\n}\n\nexport function decorateMarkdownOutput(output: string): string {\n const chalk = new Chalk({ level: 1 });\n\n const decoratedLines = output\n .split(\"\\n\")\n .map((line) => {\n const plainLine = stripAnsi(line);\n\n if (plainLine.startsWith(\"# \")) {\n return chalk.magentaBright.bold(plainLine);\n }\n\n if (plainLine.startsWith(\"## \")) {\n return chalk.blueBright.bold(plainLine);\n }\n\n return line;\n })\n .join(\"\\n\");\n\n return decoratedLines\n .replace(/`([^`\\n]+)`/g, (_match, value: string) => chalk.cyanBright(value))\n .replace(/(^|\\s)(--[a-z][a-z0-9-]*)/g, (_match, prefix: string, flag: string) => {\n return `${prefix}${chalk.yellow(flag)}`;\n })\n .replace(/(https?:\\/\\/[^\\s)]+)/g, (url: string) => chalk.blueBright.underline(url))\n .replace(/^(\\s*)\\*\\s+/gm, (_match, prefix: string) => {\n return `${prefix}${chalk.magentaBright(\"-\")} `;\n });\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,SAAS,cAAoC;AAC7C,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,g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AAmB,SAAqC;AAC/D,MAAI,YAAY,QAAW;AACzB,WAAO;AAAA,EACT;AAEA,SAAO,KAAK,IAAI,IAAI,KAAK,IAAI,SAAS,GAAG,CAAC;AAC5C;","names":["stripAnsi","stripAnsi"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/cli/help-specs.ts"],"sourcesContent":["type HelpTopic = {\n title: string;\n aliases: string[];\n body: string;\n};\n\nconst commandList = [\n \"- `cngkit login` - open Curly.ng login.\",\n \"- `cngkit coderoom ...` - unite developers in a live shared code room.\",\n \"- `cngkit scrub [path]` - scan for secrets and optionally mask them inline.\",\n \"- `cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.\",\n \"- `cngkit knowledges ...` - read the hosted Harness catalog.\",\n].join(\"\\n\");\n\nconst coderoomCommandList = [\n \"- `share [room-code]` - start a live room from the current directory.\",\n \"- `join <room-code>` - join another developer's live room from the current directory.\",\n].join(\"\\n\");\n\nconst knowledgesCommandList = [\n \"- `status` - print remote catalog state.\",\n \"- `audiences` - list valid audience filters.\",\n \"- `search <query>` - semantic search over Cloudflare Vectorize-backed records.\",\n \"- `list [query]` - list known subskills.\",\n \"- `files [query]` - list uploaded catalog files.\",\n \"- `read <file-path>` - Claude-style file read.\",\n \"- `grep <pattern>` - Claude-style content search.\",\n \"- `glob [pattern]` - Claude-style file discovery.\",\n].join(\"\\n\");\n\nconst helpTopics: HelpTopic[] = [\n {\n title: \"cngkit\",\n aliases: [\"\", \"overview\", \"help\"],\n body: `# cngkit\n\nCurly.ng operator CLI for backend-connected repo sync, secret scrubbing, and Harness knowledges access.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit <command> [options]\n\\`\\`\\`\n\n## Commands\n\n${commandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit <command> --help\ncngkit coderoom --help\ncngkit coderoom <subcommand> --help\ncngkit transcripts --help\ncngkit knowledges --help\ncngkit knowledges <subcommand> --help\n\\`\\`\\`\n\nThe CLI intentionally prints plain Markdown or line-oriented text with no color-only state, tables that require terminal width, or hidden interactive prompts. Add \\`--json\\` to read-only knowledges commands when another agent or tool needs structured backend data.\n\n## Backend\n\nDefault API: \\`https://curly.ng\\`\n\nOverride with:\n\n\\`\\`\\`bash\ncngkit --api-base-url <url> ...\nCNGKIT_API_BASE_URL=<url> cngkit ...\n\\`\\`\\`\n`,\n },\n {\n title: \"login\",\n aliases: [\"login\"],\n body: `# cngkit login\n\nOpen Curly.ng login in a browser. In headless environments, print the URL so an agent can surface it to the operator.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit login\n\\`\\`\\`\n\n## Output Contract\n\n- First line names the login URL being opened.\n- If no local browser opener exists, the CLI prints a direct URL.\n- No credentials are printed or persisted by this command.\n`,\n },\n {\n title: \"transcripts\",\n aliases: [\"transcripts\", \"transcript\"],\n body: `# cngkit transcripts\n\nRead local agent transcript JSONL files from \\`~/.codex/sessions\\`, \\`~/.codex/archived_sessions\\`, \\`~/.claude/projects\\`, and \\`~/.claude/history.jsonl\\`.\n\nThis is local operator tooling. It does not call the Curly backend and it does not upload transcript content.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json]\ncngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json]\ncngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`list\\`: newest 12 transcript files.\n- \\`read\\`: newest 80 user/assistant entries from the selected file.\n- \\`grep\\`: first 80 matching user/assistant entries from the newest 60 files.\n- \\`--source\\`: \\`all\\`.\n\n## Output Contract\n\n- Text mode prints source, role, timestamp when available, and extracted message text.\n- Internal developer/system payloads and hook/tool noise are skipped unless \\`--include-internal\\` is passed.\n- Direct file paths, home-relative paths, and partial session ids are accepted by \\`read\\`.\n`,\n },\n {\n title: \"coderoom\",\n aliases: [\"coderoom\", \"code-room\", \"repo-sync\"],\n body: `# cngkit coderoom\n\nCoderoom is the fast way to unite developers around one working tree. It gives a pair or team a temporary shared room over the Curly backend so one developer can share local file changes and another can join from their own machine.\n\nIt is intentionally closer to a Drive-like project room than a raw socket command: the room code is the shared folder link, each connected machine is a collaborator, and the file stream is the activity feed. The browser experience at \\`/coderoom\\` provides the helper surface for copying commands and explaining the room model.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${coderoomCommandList}\n\n## Common Flow\n\n\\`\\`\\`bash\ncngkit coderoom share\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Backend Contract\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n- Current rooms are live relays, not durable cloud storage. The Drive-like frontend is the collaboration shell around that live primitive.\n`,\n },\n {\n title: \"coderoom share\",\n aliases: [\"coderoom-share\"],\n body: `# cngkit coderoom share\n\nStart a real-time repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom share [room-code]\n\\`\\`\\`\n\n## Backend Contract\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n\n## Filesystem Contract\n\n- Preserves \\`.git/\\`.\n- Preserves files ignored by the repo's \\`.gitignore\\`.\n- Sends regular files as base64 payloads in the sync protocol.\n\n## Output Contract\n\n- Prints room code, repo root, peer id, backend health, and concise sync events.\n- Keeps running until the socket closes or the process receives a termination signal.\n`,\n },\n {\n title: \"coderoom join\",\n aliases: [\"coderoom-join\"],\n body: `# cngkit coderoom join\n\nJoin an existing real-time repository sync room in the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Backend Contract\n\nSame transport and filesystem contract as \\`cngkit coderoom share\\`. The supplied room code selects the Durable Object room.\n\n## Output Contract\n\n- Prints backend health, room code, repo root, peer id, and concise sync events.\n- Missing room code exits with a usage error.\n`,\n },\n {\n title: \"scrub\",\n aliases: [\"scrub\"],\n body: `# cngkit scrub\n\nScan a file or directory for secrets with TruffleHog. Report-only is the default. Inline masking requires \\`--yes\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit scrub [path]\ncngkit scrub [path] --yes\n\\`\\`\\`\n\n## Requirements\n\n- \\`trufflehog\\` must be available on \\`PATH\\`.\n\n## Safety Contract\n\n- Default mode does not rewrite files.\n- \\`--yes\\` rewrites detected secret values inline with \\`[CNGKIT_SECRET:<detector>:<verified|unverified>]\\` placeholders.\n- \\`--mask\\` is accepted as a compatibility alias, but still requires \\`--yes\\`.\n- Raw and redacted secret values are never printed in the report.\n`,\n },\n {\n title: \"knowledges\",\n aliases: [\"knowledges\", \"knowledge\"],\n body: `# cngkit knowledges\n\nRead the hosted Harness knowledges catalog from the Curly backend. These commands are read-only and use the generated \\`@cng/client\\` SDK against public backend routes.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${knowledgesCommandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> --help\ncngkit knowledges read --help\ncngkit knowledges grep --help\ncngkit knowledges glob --help\n\\`\\`\\`\n\n## Common Examples\n\n\\`\\`\\`bash\ncngkit knowledges search \"cloudflare backend\" --limit 3\ncngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\ncngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\ncngkit knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n\n## AI-Friendly Output\n\n- Default output is line-oriented and intended to be directly usable by agents.\n- \\`read\\` prints file content with no wrapper before any truncation note.\n- \\`grep --output-mode content\\` prints \\`path:line\\` blocks.\n- \\`grep --output-mode files_with_matches\\` and \\`glob\\` print one path per line.\n- \\`--json\\` prints the typed backend data payload for machine consumption.\n`,\n },\n {\n title: \"knowledges status\",\n aliases: [\"knowledges-status\", \"status\"],\n body: `# cngkit knowledges status\n\nPrint remote Harness catalog state from \\`GET /api/harness/knowledges/catalog\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges status [--json]\n\\`\\`\\`\n\n## Output Contract\n\n- Text mode prints catalog name, file count, blob count, Vectorize binding, and latest run when present.\n- \\`--json\\` prints the backend data payload.\n`,\n },\n {\n title: \"knowledges audiences\",\n aliases: [\"knowledges-audiences\", \"audiences\"],\n body: `# cngkit knowledges audiences\n\nList valid audience filters from \\`GET /api/harness/knowledges/audiences\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges audiences [--json]\n\\`\\`\\`\n\nUse this before \\`cngkit knowledges files --audience <id>\\`.\n`,\n },\n {\n title: \"knowledges search\",\n aliases: [\"knowledges-search\", \"search\"],\n body: `# cngkit knowledges search\n\nRun semantic search against the Cloudflare Vectorize-backed Harness index.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges search <query> [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`5\\`\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges search \"cloudflare backend\" --limit 3\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges list\",\n aliases: [\"knowledges-list\", \"list\"],\n body: `# cngkit knowledges list\n\nList known subskills from \\`GET /api/harness/knowledges/subskills\\`, optionally filtered locally by query.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges list [query] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n`,\n },\n {\n title: \"knowledges files\",\n aliases: [\"knowledges-files\", \"files\"],\n body: `# cngkit knowledges files\n\nList uploaded catalog files from \\`GET /api/harness/knowledges/files\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n- \\`--audience\\`: omitted\n\nRun \\`cngkit knowledges audiences\\` to discover supported audience ids.\n`,\n },\n {\n title: \"knowledges read\",\n aliases: [\"knowledges-read\", \"read\"],\n body: `# cngkit knowledges read\n\nClaude-style read tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/read\\` and \\`HarnessReadQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`file-path\\`: normalized catalog path. Shorthand paths such as \\`/libraries/lib-cloudflare/SUBSKILL.md\\` are expanded to \\`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\\`.\n- \\`--offset\\`: zero-based starting line. Default: \\`0\\`.\n- \\`--limit\\`: maximum lines. Default in CLI: \\`200\\`. Backend max: \\`2000\\`.\n\n## Output Contract\n\n- Text mode prints only the returned file content first.\n- If truncated, a final bracketed truncation note is printed after the content.\n- \\`--json\\` prints \\`{ file_path, content, total_lines, offset, limit, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges grep\",\n aliases: [\"knowledges-grep\", \"grep\"],\n body: `# cngkit knowledges grep\n\nClaude-style grep tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/grep\\` and \\`HarnessGrepQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: JavaScript regular expression source.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n- \\`--include\\`: filename include filter. Default: \\`*\\`.\n- Modes: content, files_with_matches, or count.\n- \\`--output-mode\\`: \\`content\\`, \\`files_with_matches\\`, or \\`count\\`. Default: \\`content\\`.\n- \\`--context\\`: context lines around content matches. Default: \\`0\\`. Backend max: \\`20\\`.\n- \\`--case-insensitive\\`: maps to backend \\`case_insensitive=true\\`.\n\n## Output Contract\n\n- \\`content\\`: prints blocks as \\`file_path:line_number\\`, optional context lines, then \\`> matching line\\`.\n- \\`files_with_matches\\`: prints one matching file path per line.\n- \\`count\\`: prints \\`file_path: match_count\\` lines.\n- \\`--json\\` prints the typed backend response union.\n\n## Examples\n\n\\`\\`\\`bash\ncngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\ncngkit knowledges grep \"Vectorize|D1\" --path /libraries/lib-cloudflare --context 2\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges glob\",\n aliases: [\"knowledges-glob\", \"glob\"],\n body: `# cngkit knowledges glob\n\nClaude-style glob tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/glob\\` and \\`HarnessGlobQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges glob [pattern] [--path <path>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: supported glob pattern. CLI default: \\`**/*.md\\`.\n- \\`--path\\`: catalog path prefix. Default: \\`skills\\`.\n\n## Supported Patterns\n\n- \\`**/*.md\\`\n- \\`**/*.SUBSKILL.md\\`\n- \\`**/SKILL.md\\`\n- \\`*.md\\`\n- \\`*.SUBSKILL.md\\`\n- \\`SKILL.md\\`\n\n## Output Contract\n\n- Text mode prints one file path per line.\n- If truncated, a final bracketed truncation note is printed.\n- \\`--json\\` prints \\`{ files, total_files, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n`,\n },\n];\n\nconst helpTopicByAlias = new Map<string, HelpTopic>();\n\nfor (const topic of helpTopics) {\n for (const alias of topic.aliases) {\n helpTopicByAlias.set(alias, topic);\n }\n}\n\nexport function formatCngkitHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n return (helpTopicByAlias.get(normalizedTopicName) ?? helpTopicByAlias.get(\"\"))?.body.trim() ?? \"\";\n}\n\nexport function formatKnowledgesHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : \"knowledges\";\n return formatCngkitHelp(topicKey);\n}\n\nfunction normalizeHelpTopicName(value: string | undefined): string {\n return value?.trim().toLowerCase().replace(/\\s+/g, \"-\") ?? \"\";\n}\n"],"mappings":";AAMA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,aAA0B;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,IAAI,YAAY,MAAM;AAAA,IAChC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYR,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,OAAO;AAAA,IACjB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,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