cngkit 1.1.7 → 1.1.8

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 (45) hide show
  1. package/README.md +249 -82
  2. package/dist/{chunk-Z4DDLEWR.js → chunk-CELXWAUR.js} +4 -12
  3. package/dist/chunk-CELXWAUR.js.map +1 -0
  4. package/dist/{chunk-HUZZPV5E.js → chunk-FIRWCD2M.js} +16 -12
  5. package/dist/chunk-FIRWCD2M.js.map +1 -0
  6. package/dist/{chunk-QEZQGKFX.js → chunk-PXSVLAAG.js} +2 -2
  7. package/dist/{chunk-TZKXST4G.js → chunk-SFZS5K6B.js} +48 -20
  8. package/dist/chunk-SFZS5K6B.js.map +1 -0
  9. package/dist/{chunk-VI5XQH3U.js → chunk-WPBMAXXM.js} +3 -3
  10. package/dist/{chunk-VI5XQH3U.js.map → chunk-WPBMAXXM.js.map} +1 -1
  11. package/dist/{chunk-EQEIX7N5.js → chunk-WR4HJ57I.js} +2 -2
  12. package/dist/{chunk-EQEIX7N5.js.map → chunk-WR4HJ57I.js.map} +1 -1
  13. package/dist/chunk-X3THKPHT.js +83 -0
  14. package/dist/chunk-X3THKPHT.js.map +1 -0
  15. package/dist/cli.js +8 -8
  16. package/dist/cli.js.map +1 -1
  17. package/dist/commands/coderoom/index.js +4 -4
  18. package/dist/commands/coderoom/index.js.map +1 -1
  19. package/dist/commands/coderoom/join.js +5 -5
  20. package/dist/commands/coderoom/share.js +5 -5
  21. package/dist/commands/index.js +4 -4
  22. package/dist/commands/index.js.map +1 -1
  23. package/dist/commands/knowledges/audiences.js +6 -6
  24. package/dist/commands/knowledges/files.js +6 -6
  25. package/dist/commands/knowledges/glob.js +6 -6
  26. package/dist/commands/knowledges/grep.js +6 -6
  27. package/dist/commands/knowledges/index.js +4 -4
  28. package/dist/commands/knowledges/index.js.map +1 -1
  29. package/dist/commands/knowledges/list.js +6 -6
  30. package/dist/commands/knowledges/read.js +6 -6
  31. package/dist/commands/knowledges/search.js +6 -6
  32. package/dist/commands/knowledges/status.js +6 -6
  33. package/dist/commands/login.js +5 -5
  34. package/dist/commands/login.js.map +1 -1
  35. package/dist/commands/scrub.js +7 -7
  36. package/dist/commands/scrub.js.map +1 -1
  37. package/dist/commands/transcripts.js +9 -9
  38. package/dist/commands/transcripts.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunk-HUZZPV5E.js.map +0 -1
  41. package/dist/chunk-TZKXST4G.js.map +0 -1
  42. package/dist/chunk-XDXRVTPK.js +0 -18
  43. package/dist/chunk-XDXRVTPK.js.map +0 -1
  44. package/dist/chunk-Z4DDLEWR.js.map +0 -1
  45. /package/dist/{chunk-QEZQGKFX.js.map → chunk-PXSVLAAG.js.map} +0 -0
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  formatCngkitHelp
3
- } from "../chunk-VI5XQH3U.js";
3
+ } from "../chunk-WPBMAXXM.js";
4
4
  import {
5
5
  CommandRunner
6
- } from "../chunk-Z4DDLEWR.js";
7
- import "../chunk-XDXRVTPK.js";
6
+ } from "../chunk-CELXWAUR.js";
7
+ import "../chunk-X3THKPHT.js";
8
8
  import "../chunk-PZ5AY32C.js";
9
9
 
10
10
  // src/commands/index.tsx
11
11
  import { jsx } from "react/jsx-runtime";
12
12
  var description = "Show cngkit help";
13
13
  function IndexCommand() {
14
- return /* @__PURE__ */ jsx(CommandRunner, { run: async (output) => output.info(formatCngkitHelp()) });
14
+ return /* @__PURE__ */ jsx(CommandRunner, { run: async (output) => output.raw(formatCngkitHelp()) });
15
15
  }
16
16
  export {
17
17
  IndexCommand as default,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/index.tsx"],"sourcesContent":["import { CommandRunner } from \"../cli/command-runner.js\";\nimport { formatCngkitHelp } from \"../cli/help-specs.js\";\n\nexport const description = \"Show cngkit help\";\n\nexport default function IndexCommand() {\n return <CommandRunner run={async (output) => output.info(formatCngkitHelp())} />;\n}\n"],"mappings":";;;;;;;;;;AAMS;AAHF,IAAM,cAAc;AAEZ,SAAR,eAAgC;AACrC,SAAO,oBAAC,iBAAc,KAAK,OAAO,WAAW,OAAO,KAAK,iBAAiB,CAAC,GAAG;AAChF;","names":[]}
1
+ {"version":3,"sources":["../../src/commands/index.tsx"],"sourcesContent":["import { CommandRunner } from \"../cli/command-runner.js\";\nimport { formatCngkitHelp } from \"../cli/help-specs.js\";\n\nexport const description = \"Show cngkit help\";\n\nexport default function IndexCommand() {\n return <CommandRunner run={async (output) => output.raw(formatCngkitHelp())} />;\n}\n"],"mappings":";;;;;;;;;;AAMS;AAHF,IAAM,cAAc;AAEZ,SAAR,eAAgC;AACrC,SAAO,oBAAC,iBAAc,KAAK,OAAO,WAAW,OAAO,IAAI,iBAAiB,CAAC,GAAG;AAC/E;","names":[]}
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  runKnowAudiencesCommand
3
- } from "../../chunk-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema
10
10
  } from "../../chunk-MLKBG5YJ.js";
11
11
  import {
12
12
  CommandRunner
13
- } from "../../chunk-Z4DDLEWR.js";
14
- import "../../chunk-XDXRVTPK.js";
13
+ } from "../../chunk-CELXWAUR.js";
14
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-VI5XQH3U.js";
3
+ } from "../../chunk-WPBMAXXM.js";
4
4
  import {
5
5
  GlobalOptionsSchema
6
6
  } from "../../chunk-MLKBG5YJ.js";
7
7
  import {
8
8
  CommandRunner
9
- } from "../../chunk-Z4DDLEWR.js";
10
- import "../../chunk-XDXRVTPK.js";
9
+ } from "../../chunk-CELXWAUR.js";
10
+ import "../../chunk-X3THKPHT.js";
11
11
  import "../../chunk-PZ5AY32C.js";
12
12
 
13
13
  // src/commands/knowledges/index.tsx
@@ -15,7 +15,7 @@ import { jsx } from "react/jsx-runtime";
15
15
  var description = "Use the Cloudflare-backed Harness knowledges catalog";
16
16
  var options = GlobalOptionsSchema;
17
17
  function KnowledgesCommand() {
18
- return /* @__PURE__ */ jsx(CommandRunner, { run: async (output) => output.info(formatKnowledgesHelp()) });
18
+ return /* @__PURE__ */ jsx(CommandRunner, { run: async (output) => output.raw(formatKnowledgesHelp()) });
19
19
  }
20
20
  export {
21
21
  KnowledgesCommand as default,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/knowledges/index.tsx"],"sourcesContent":["import { GlobalOptionsSchema } from \"../../cli/options.js\";\nimport { formatKnowledgesHelp } from \"../../cli/help-specs.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Use the Cloudflare-backed Harness knowledges catalog\";\nexport const options = GlobalOptionsSchema;\n\nexport default function KnowledgesCommand() {\n return <CommandRunner run={async (output) => output.info(formatKnowledgesHelp())} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAQS;AAJF,IAAM,cAAc;AACpB,IAAM,UAAU;AAER,SAAR,oBAAqC;AAC1C,SAAO,oBAAC,iBAAc,KAAK,OAAO,WAAW,OAAO,KAAK,qBAAqB,CAAC,GAAG;AACpF;","names":[]}
1
+ {"version":3,"sources":["../../../src/commands/knowledges/index.tsx"],"sourcesContent":["import { GlobalOptionsSchema } from \"../../cli/options.js\";\nimport { formatKnowledgesHelp } from \"../../cli/help-specs.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Use the Cloudflare-backed Harness knowledges catalog\";\nexport const options = GlobalOptionsSchema;\n\nexport default function KnowledgesCommand() {\n return <CommandRunner run={async (output) => output.raw(formatKnowledgesHelp())} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAQS;AAJF,IAAM,cAAc;AACpB,IAAM,UAAU;AAER,SAAR,oBAAqC;AAC1C,SAAO,oBAAC,iBAAc,KAAK,OAAO,WAAW,OAAO,IAAI,qBAAqB,CAAC,GAAG;AACnF;","names":[]}
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  runKnowListCommand
3
- } from "../../chunk-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.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-Z4DDLEWR.js";
15
- import "../../chunk-XDXRVTPK.js";
14
+ } from "../../chunk-CELXWAUR.js";
15
+ import "../../chunk-X3THKPHT.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-TZKXST4G.js";
3
+ } from "../../chunk-SFZS5K6B.js";
4
4
  import "../../chunk-QZEB4VMX.js";
5
- import "../../chunk-VI5XQH3U.js";
6
- import "../../chunk-QEZQGKFX.js";
7
- import "../../chunk-EQEIX7N5.js";
5
+ import "../../chunk-WPBMAXXM.js";
6
+ import "../../chunk-PXSVLAAG.js";
7
+ import "../../chunk-WR4HJ57I.js";
8
8
  import {
9
9
  JsonOutputOptionsSchema
10
10
  } from "../../chunk-MLKBG5YJ.js";
11
11
  import {
12
12
  CommandRunner
13
- } from "../../chunk-Z4DDLEWR.js";
14
- import "../../chunk-XDXRVTPK.js";
13
+ } from "../../chunk-CELXWAUR.js";
14
+ import "../../chunk-X3THKPHT.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-EQEIX7N5.js";
3
+ } from "../chunk-WR4HJ57I.js";
4
4
  import {
5
5
  GlobalOptionsSchema
6
6
  } from "../chunk-MLKBG5YJ.js";
7
7
  import {
8
8
  CommandRunner
9
- } from "../chunk-Z4DDLEWR.js";
10
- import "../chunk-XDXRVTPK.js";
9
+ } from "../chunk-CELXWAUR.js";
10
+ import "../chunk-X3THKPHT.js";
11
11
  import "../chunk-PZ5AY32C.js";
12
12
 
13
13
  // src/shared/browser.ts
@@ -47,10 +47,10 @@ function browserOpenCommand(url) {
47
47
  async function runLoginCommand(options2, output) {
48
48
  const loginUrl = new URL("/login", resolveApiBaseUrl(options2));
49
49
  const loginUrlString = loginUrl.toString();
50
- output.info(`Opening ${loginUrlString}`);
50
+ output.success(`Opening ${loginUrlString}`);
51
51
  const didOpenBrowser = await openBrowserUrl(loginUrlString);
52
52
  if (!didOpenBrowser) {
53
- output.info(`No browser opener found. Open this URL manually: ${loginUrlString}`);
53
+ output.warning(`No browser opener found. Open this URL manually: ${loginUrlString}`);
54
54
  }
55
55
  }
56
56
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/browser.ts","../../src/features/login/run-login-command.ts","../../src/commands/login.tsx"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport process from \"node:process\";\n\nexport async function openBrowserUrl(url: string): Promise<boolean> {\n const command = browserOpenCommand(url);\n\n return await new Promise<boolean>((resolve, reject) => {\n const childProcess = spawn(command.command, command.args, {\n detached: true,\n stdio: \"ignore\",\n });\n\n childProcess.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") {\n resolve(false);\n return;\n }\n\n reject(error);\n });\n childProcess.on(\"spawn\", () => {\n childProcess.unref();\n resolve(true);\n });\n });\n}\n\nfunction browserOpenCommand(url: string): { command: string; args: string[] } {\n if (process.platform === \"darwin\") {\n return { command: \"open\", args: [url] };\n }\n\n if (process.platform === \"win32\") {\n return { command: \"cmd\", args: [\"/c\", \"start\", \"\", url] };\n }\n\n return { command: \"xdg-open\", args: [url] };\n}\n","import { openBrowserUrl } from \"../../shared/browser.js\";\nimport { resolveApiBaseUrl, type GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\n\nexport type LoginCommandOptions = GlobalCommandOptions;\n\nexport async function runLoginCommand(\n options: LoginCommandOptions,\n output: CommandOutput\n): Promise<void> {\n const loginUrl = new URL(\"/login\", resolveApiBaseUrl(options));\n const loginUrlString = loginUrl.toString();\n output.info(`Opening ${loginUrlString}`);\n\n const didOpenBrowser = await openBrowserUrl(loginUrlString);\n if (!didOpenBrowser) {\n output.info(`No browser opener found. Open this URL manually: ${loginUrlString}`);\n }\n}\n","import { GlobalOptionsSchema } from \"../cli/options.js\";\nimport { runLoginCommand, type LoginCommandOptions } from \"../features/login/run-login-command.js\";\nimport { CommandRunner } from \"../cli/command-runner.js\";\n\nexport const description = \"Open Curly login in your browser\";\nexport const options = GlobalOptionsSchema;\n\ntype LoginCommandProps = {\n readonly options: LoginCommandOptions;\n};\n\nexport default function LoginCommand({ options }: LoginCommandProps) {\n return <CommandRunner run={(output) => runLoginCommand(options, output)} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,OAAO,aAAa;AAEpB,eAAsB,eAAe,KAA+B;AAClE,QAAM,UAAU,mBAAmB,GAAG;AAEtC,SAAO,MAAM,IAAI,QAAiB,CAAC,SAAS,WAAW;AACrD,UAAM,eAAe,MAAM,QAAQ,SAAS,QAAQ,MAAM;AAAA,MACxD,UAAU;AAAA,MACV,OAAO;AAAA,IACT,CAAC;AAED,iBAAa,GAAG,SAAS,CAAC,UAAiC;AACzD,UAAI,MAAM,SAAS,UAAU;AAC3B,gBAAQ,KAAK;AACb;AAAA,MACF;AAEA,aAAO,KAAK;AAAA,IACd,CAAC;AACD,iBAAa,GAAG,SAAS,MAAM;AAC7B,mBAAa,MAAM;AACnB,cAAQ,IAAI;AAAA,IACd,CAAC;AAAA,EACH,CAAC;AACH;AAEA,SAAS,mBAAmB,KAAkD;AAC5E,MAAI,QAAQ,aAAa,UAAU;AACjC,WAAO,EAAE,SAAS,QAAQ,MAAM,CAAC,GAAG,EAAE;AAAA,EACxC;AAEA,MAAI,QAAQ,aAAa,SAAS;AAChC,WAAO,EAAE,SAAS,OAAO,MAAM,CAAC,MAAM,SAAS,IAAI,GAAG,EAAE;AAAA,EAC1D;AAEA,SAAO,EAAE,SAAS,YAAY,MAAM,CAAC,GAAG,EAAE;AAC5C;;;AC/BA,eAAsB,gBACpBA,UACA,QACe;AACf,QAAM,WAAW,IAAI,IAAI,UAAU,kBAAkBA,QAAO,CAAC;AAC7D,QAAM,iBAAiB,SAAS,SAAS;AACzC,SAAO,KAAK,WAAW,cAAc,EAAE;AAEvC,QAAM,iBAAiB,MAAM,eAAe,cAAc;AAC1D,MAAI,CAAC,gBAAgB;AACnB,WAAO,KAAK,oDAAoD,cAAc,EAAE;AAAA,EAClF;AACF;;;ACNS;AARF,IAAM,cAAc;AACpB,IAAM,UAAU;AAMR,SAAR,aAA8B,EAAE,SAAAC,SAAQ,GAAsB;AACnE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,gBAAgBA,UAAS,MAAM,GAAG;AAC3E;","names":["options","options"]}
1
+ {"version":3,"sources":["../../src/shared/browser.ts","../../src/features/login/run-login-command.ts","../../src/commands/login.tsx"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport process from \"node:process\";\n\nexport async function openBrowserUrl(url: string): Promise<boolean> {\n const command = browserOpenCommand(url);\n\n return await new Promise<boolean>((resolve, reject) => {\n const childProcess = spawn(command.command, command.args, {\n detached: true,\n stdio: \"ignore\",\n });\n\n childProcess.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") {\n resolve(false);\n return;\n }\n\n reject(error);\n });\n childProcess.on(\"spawn\", () => {\n childProcess.unref();\n resolve(true);\n });\n });\n}\n\nfunction browserOpenCommand(url: string): { command: string; args: string[] } {\n if (process.platform === \"darwin\") {\n return { command: \"open\", args: [url] };\n }\n\n if (process.platform === \"win32\") {\n return { command: \"cmd\", args: [\"/c\", \"start\", \"\", url] };\n }\n\n return { command: \"xdg-open\", args: [url] };\n}\n","import { openBrowserUrl } from \"../../shared/browser.js\";\nimport { resolveApiBaseUrl, type GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\n\nexport type LoginCommandOptions = GlobalCommandOptions;\n\nexport async function runLoginCommand(\n options: LoginCommandOptions,\n output: CommandOutput\n): Promise<void> {\n const loginUrl = new URL(\"/login\", resolveApiBaseUrl(options));\n const loginUrlString = loginUrl.toString();\n output.success(`Opening ${loginUrlString}`);\n\n const didOpenBrowser = await openBrowserUrl(loginUrlString);\n if (!didOpenBrowser) {\n output.warning(`No browser opener found. Open this URL manually: ${loginUrlString}`);\n }\n}\n","import { GlobalOptionsSchema } from \"../cli/options.js\";\nimport { runLoginCommand, type LoginCommandOptions } from \"../features/login/run-login-command.js\";\nimport { CommandRunner } from \"../cli/command-runner.js\";\n\nexport const description = \"Open Curly login in your browser\";\nexport const options = GlobalOptionsSchema;\n\ntype LoginCommandProps = {\n readonly options: LoginCommandOptions;\n};\n\nexport default function LoginCommand({ options }: LoginCommandProps) {\n return <CommandRunner run={(output) => runLoginCommand(options, output)} />;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,aAAa;AACtB,OAAO,aAAa;AAEpB,eAAsB,eAAe,KAA+B;AAClE,QAAM,UAAU,mBAAmB,GAAG;AAEtC,SAAO,MAAM,IAAI,QAAiB,CAAC,SAAS,WAAW;AACrD,UAAM,eAAe,MAAM,QAAQ,SAAS,QAAQ,MAAM;AAAA,MACxD,UAAU;AAAA,MACV,OAAO;AAAA,IACT,CAAC;AAED,iBAAa,GAAG,SAAS,CAAC,UAAiC;AACzD,UAAI,MAAM,SAAS,UAAU;AAC3B,gBAAQ,KAAK;AACb;AAAA,MACF;AAEA,aAAO,KAAK;AAAA,IACd,CAAC;AACD,iBAAa,GAAG,SAAS,MAAM;AAC7B,mBAAa,MAAM;AACnB,cAAQ,IAAI;AAAA,IACd,CAAC;AAAA,EACH,CAAC;AACH;AAEA,SAAS,mBAAmB,KAAkD;AAC5E,MAAI,QAAQ,aAAa,UAAU;AACjC,WAAO,EAAE,SAAS,QAAQ,MAAM,CAAC,GAAG,EAAE;AAAA,EACxC;AAEA,MAAI,QAAQ,aAAa,SAAS;AAChC,WAAO,EAAE,SAAS,OAAO,MAAM,CAAC,MAAM,SAAS,IAAI,GAAG,EAAE;AAAA,EAC1D;AAEA,SAAO,EAAE,SAAS,YAAY,MAAM,CAAC,GAAG,EAAE;AAC5C;;;AC/BA,eAAsB,gBACpBA,UACA,QACe;AACf,QAAM,WAAW,IAAI,IAAI,UAAU,kBAAkBA,QAAO,CAAC;AAC7D,QAAM,iBAAiB,SAAS,SAAS;AACzC,SAAO,QAAQ,WAAW,cAAc,EAAE;AAE1C,QAAM,iBAAiB,MAAM,eAAe,cAAc;AAC1D,MAAI,CAAC,gBAAgB;AACnB,WAAO,QAAQ,oDAAoD,cAAc,EAAE;AAAA,EACrF;AACF;;;ACNS;AARF,IAAM,cAAc;AACpB,IAAM,UAAU;AAMR,SAAR,aAA8B,EAAE,SAAAC,SAAQ,GAAsB;AACnE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,gBAAgBA,UAAS,MAAM,GAAG;AAC3E;","names":["options","options"]}
@@ -4,8 +4,8 @@ import {
4
4
  } from "../chunk-MLKBG5YJ.js";
5
5
  import {
6
6
  CommandRunner
7
- } from "../chunk-Z4DDLEWR.js";
8
- import "../chunk-XDXRVTPK.js";
7
+ } from "../chunk-CELXWAUR.js";
8
+ import "../chunk-X3THKPHT.js";
9
9
  import "../chunk-PZ5AY32C.js";
10
10
 
11
11
  // src/commands/scrub.tsx
@@ -234,23 +234,23 @@ async function runScrubCommand(targetPath, options2, output, dependencies) {
234
234
  }));
235
235
  const findings = await scanFilesystem(scrubTargetPath);
236
236
  if (findings.length === 0) {
237
- output.info("No secrets found.");
237
+ output.success("No secrets found.");
238
238
  return;
239
239
  }
240
- output.info(formatScrubReport(findings));
240
+ output.warning(formatScrubReport(findings));
241
241
  if (!options2.yes) {
242
242
  if (options2.mask) {
243
243
  throw new Error("Inline scrubbing rewrites files. Re-run with --yes to continue.");
244
244
  }
245
- output.info("Report only. Re-run with --yes to scrub files inline.");
245
+ output.warning("Report only. Re-run with --yes to scrub files inline.");
246
246
  return;
247
247
  }
248
248
  const result = await scrubFindingsInline(scrubTargetPath, findings);
249
- output.info(
249
+ output.success(
250
250
  `Masked ${result.replacements} secret${result.replacements === 1 ? "" : "s"} in ${result.filesChanged} file${result.filesChanged === 1 ? "" : "s"}.`
251
251
  );
252
252
  if (result.skippedFindings > 0) {
253
- output.info(`Skipped ${result.skippedFindings} finding(s) outside the scrub root.`);
253
+ output.warning(`Skipped ${result.skippedFindings} finding(s) outside the scrub root.`);
254
254
  }
255
255
  }
256
256
  function formatScrubReport(findings) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/scrub.tsx","../../src/features/scrub/run-scrub-command.ts","../../src/features/scrub/masker.ts","../../src/features/scrub/trufflehog.ts","../../src/features/scrub/findings.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { GlobalOptionsSchema, OptionalPathArgsSchema } from \"../cli/options.js\";\nimport { runScrubCommand, type ScrubCommandOptions } from \"../features/scrub/run-scrub-command.js\";\nimport { CommandRunner } from \"../cli/command-runner.js\";\n\nexport const description = \"Scan for secrets with TruffleHog and optionally mask them inline\";\nexport const args = OptionalPathArgsSchema;\nexport const options = GlobalOptionsSchema.extend({\n mask: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Compatibility alias for inline scrubbing; --yes is still required\",\n })\n ),\n yes: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Confirm and run inline scrubbing\",\n })\n ),\n});\n\ntype ScrubCommandProps = {\n readonly args: z.infer<typeof args>;\n readonly options: ScrubCommandOptions;\n};\n\nexport default function ScrubCommand({ args, options }: ScrubCommandProps) {\n return <CommandRunner run={(output) => runScrubCommand(args[0], options, output)} />;\n}\n","import process from \"node:process\";\n\nimport type { GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\nimport type { ScrubFinding } from \"./findings.js\";\nimport { scrubFindingsInline } from \"./masker.js\";\nimport { scanFilesystemWithTruffleHog } from \"./trufflehog.js\";\n\nexport type ScrubCommandOptions = GlobalCommandOptions & {\n mask?: boolean;\n yes?: boolean;\n};\n\nexport type ScrubCommandDependencies = {\n scanFilesystem(targetPath: string): Promise<ScrubFinding[]>;\n};\n\nexport async function runScrubCommand(\n targetPath: string | undefined,\n options: ScrubCommandOptions,\n output: CommandOutput,\n dependencies?: ScrubCommandDependencies\n): Promise<void> {\n const scrubTargetPath = targetPath ?? \".\";\n const scanFilesystem =\n dependencies?.scanFilesystem ??\n ((scanTargetPath: string) =>\n scanFilesystemWithTruffleHog(scanTargetPath, {\n cwd: process.cwd(),\n }));\n const findings = await scanFilesystem(scrubTargetPath);\n\n if (findings.length === 0) {\n output.info(\"No secrets found.\");\n return;\n }\n\n output.info(formatScrubReport(findings));\n\n if (!options.yes) {\n if (options.mask) {\n throw new Error(\"Inline scrubbing rewrites files. Re-run with --yes to continue.\");\n }\n\n output.info(\"Report only. Re-run with --yes to scrub files inline.\");\n return;\n }\n\n const result = await scrubFindingsInline(scrubTargetPath, findings);\n output.info(\n `Masked ${result.replacements} secret${result.replacements === 1 ? \"\" : \"s\"} in ${\n result.filesChanged\n } file${result.filesChanged === 1 ? \"\" : \"s\"}.`\n );\n\n if (result.skippedFindings > 0) {\n output.info(`Skipped ${result.skippedFindings} finding(s) outside the scrub root.`);\n }\n}\n\nfunction formatScrubReport(findings: ScrubFinding[]): string {\n const lines = [`Found ${findings.length} possible secret${findings.length === 1 ? \"\" : \"s\"}:`];\n\n for (const finding of findings) {\n const location = finding.line ? `${finding.filePath}:${finding.line}` : finding.filePath;\n const status = finding.verified ? \"verified\" : \"unverified\";\n lines.push(`- ${location} ${finding.detectorName} ${status}`);\n }\n\n return lines.join(\"\\n\");\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { ScrubFinding } from \"./findings.js\";\n\nexport type InlineScrubResult = {\n filesChanged: number;\n replacements: number;\n skippedFindings: number;\n};\n\nexport async function scrubFindingsInline(\n targetPath: string,\n findings: ScrubFinding[]\n): Promise<InlineScrubResult> {\n const target = await resolveScrubTarget(targetPath);\n const findingsByFile = groupFindingsBySafePath(target, findings);\n let filesChanged = 0;\n let replacements = 0;\n\n for (const [absolutePath, fileFindings] of findingsByFile.safeFindingsByPath) {\n const originalContent = await fs.readFile(absolutePath, \"utf8\");\n let scrubbedContent = originalContent;\n let fileReplacements = 0;\n\n for (const finding of fileFindings) {\n const placeholder = formatSecretPlaceholder(finding);\n const nextContent = scrubbedContent.split(finding.rawSecret).join(placeholder);\n if (nextContent !== scrubbedContent) {\n fileReplacements += countOccurrences(scrubbedContent, finding.rawSecret);\n scrubbedContent = nextContent;\n }\n }\n\n if (scrubbedContent !== originalContent) {\n await fs.writeFile(absolutePath, scrubbedContent);\n filesChanged += 1;\n replacements += fileReplacements;\n }\n }\n\n return {\n filesChanged,\n replacements,\n skippedFindings: findingsByFile.skippedFindings,\n };\n}\n\nexport function formatSecretPlaceholder(finding: ScrubFinding): string {\n return `[CNGKIT_SECRET:${sanitizePlaceholderPart(finding.detectorName)}:${\n finding.verified ? \"verified\" : \"unverified\"\n }]`;\n}\n\nfunction groupFindingsBySafePath(\n target: ScrubTarget,\n findings: ScrubFinding[]\n): {\n safeFindingsByPath: Map<string, ScrubFinding[]>;\n skippedFindings: number;\n} {\n const safeFindingsByPath = new Map<string, ScrubFinding[]>();\n let skippedFindings = 0;\n\n for (const finding of findings) {\n const absolutePath = resolveSafeFindingPath(target, finding.filePath);\n if (!absolutePath) {\n skippedFindings += 1;\n continue;\n }\n\n const fileFindings = safeFindingsByPath.get(absolutePath) ?? [];\n fileFindings.push(finding);\n safeFindingsByPath.set(absolutePath, fileFindings);\n }\n\n return { safeFindingsByPath, skippedFindings };\n}\n\ntype ScrubTarget = {\n rootDir: string;\n allowedFilePath?: string;\n};\n\nasync function resolveScrubTarget(targetPath: string): Promise<ScrubTarget> {\n const absoluteTargetPath = path.resolve(targetPath);\n const stat = await fs.stat(absoluteTargetPath);\n\n if (stat.isFile()) {\n return {\n rootDir: path.dirname(absoluteTargetPath),\n allowedFilePath: absoluteTargetPath,\n };\n }\n\n return {\n rootDir: absoluteTargetPath,\n };\n}\n\nfunction resolveSafeFindingPath(\n target: ScrubTarget,\n findingFilePath: string\n): string | undefined {\n const absolutePath = path.isAbsolute(findingFilePath)\n ? path.resolve(findingFilePath)\n : path.resolve(target.rootDir, findingFilePath);\n\n if (target.allowedFilePath) {\n return absolutePath === target.allowedFilePath ? absolutePath : undefined;\n }\n\n const normalizedRoot = `${path.resolve(target.rootDir)}${path.sep}`;\n\n if (absolutePath === path.resolve(target.rootDir) || absolutePath.startsWith(normalizedRoot)) {\n return absolutePath;\n }\n\n return undefined;\n}\n\nfunction countOccurrences(value: string, search: string): number {\n if (!search) {\n return 0;\n }\n\n return value.split(search).length - 1;\n}\n\nfunction sanitizePlaceholderPart(value: string): string {\n return value.replace(/[^A-Za-z0-9_-]+/g, \"-\").replace(/^-+|-+$/g, \"\") || \"Unknown\";\n}\n","import { spawn } from \"node:child_process\";\nimport path from \"node:path\";\n\nimport { parseTruffleHogJsonLines, type ScrubFinding } from \"./findings.js\";\n\nexport type TruffleHogScanOptions = {\n cwd: string;\n};\n\nexport async function scanFilesystemWithTruffleHog(\n targetPath: string,\n options: TruffleHogScanOptions\n): Promise<ScrubFinding[]> {\n const absoluteTargetPath = path.resolve(options.cwd, targetPath);\n const { stdout } = await runTruffleHog([\n \"filesystem\",\n absoluteTargetPath,\n \"--json\",\n \"--no-update\",\n \"--force-skip-binaries\",\n \"--force-skip-archives\",\n ]);\n\n return parseTruffleHogJsonLines(stdout);\n}\n\nfunction runTruffleHog(args: string[]): Promise<{ stdout: string; stderr: string }> {\n return new Promise((resolve, reject) => {\n const child = spawn(\"trufflehog\", args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const stdoutChunks: Buffer[] = [];\n const stderrChunks: Buffer[] = [];\n\n child.stdout.on(\"data\", (chunk: Buffer) => {\n stdoutChunks.push(chunk);\n });\n child.stderr.on(\"data\", (chunk: Buffer) => {\n stderrChunks.push(chunk);\n });\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") {\n reject(\n new Error(\n \"TruffleHog is not installed. Install it with `brew install trufflehog` or see https://github.com/trufflesecurity/trufflehog.\"\n )\n );\n return;\n }\n\n reject(error);\n });\n child.on(\"close\", (exitCode) => {\n const stdout = Buffer.concat(stdoutChunks).toString(\"utf8\");\n const stderr = Buffer.concat(stderrChunks).toString(\"utf8\");\n\n if (exitCode && exitCode !== 0) {\n reject(new Error(`TruffleHog scan failed with exit code ${exitCode}: ${stderr.trim()}`));\n return;\n }\n\n resolve({ stdout, stderr });\n });\n });\n}\n","export type ScrubFinding = {\n detectorName: string;\n filePath: string;\n line?: number;\n rawSecret: string;\n redactedSecret: string;\n verified: boolean;\n};\n\ntype JsonRecord = Record<string, unknown>;\n\nexport function parseTruffleHogJsonLines(output: string): ScrubFinding[] {\n const findings: ScrubFinding[] = [];\n\n for (const line of output.split(/\\r?\\n/)) {\n const trimmedLine = line.trim();\n if (!trimmedLine.startsWith(\"{\")) {\n continue;\n }\n\n const parsedLine = parseJsonRecord(trimmedLine);\n if (!parsedLine) {\n continue;\n }\n\n const finding = parseTruffleHogFinding(parsedLine);\n if (finding) {\n findings.push(finding);\n }\n }\n\n return findings;\n}\n\nfunction parseTruffleHogFinding(finding: JsonRecord): ScrubFinding | undefined {\n const rawSecret = readString(finding.Raw) || readString(finding.RawV2);\n const filePath = readFilesystemFilePath(finding);\n\n if (!rawSecret || !filePath) {\n return undefined;\n }\n\n return {\n detectorName: readString(finding.DetectorName) || \"Unknown\",\n filePath,\n line: readFilesystemLine(finding),\n rawSecret,\n redactedSecret: readString(finding.Redacted) || \"\",\n verified: finding.Verified === true,\n };\n}\n\nfunction readFilesystemFilePath(finding: JsonRecord): string | undefined {\n const filesystem = readFilesystemMetadata(finding);\n if (!filesystem) {\n return undefined;\n }\n\n return readString(filesystem.file) || readString(filesystem.path);\n}\n\nfunction readFilesystemLine(finding: JsonRecord): number | undefined {\n const filesystem = readFilesystemMetadata(finding);\n if (!filesystem) {\n return undefined;\n }\n\n return typeof filesystem.line === \"number\" ? filesystem.line : undefined;\n}\n\nfunction readFilesystemMetadata(finding: JsonRecord): JsonRecord | undefined {\n const sourceMetadata = readRecord(finding.SourceMetadata);\n const data = readRecord(sourceMetadata?.Data);\n return readRecord(data?.Filesystem);\n}\n\nfunction parseJsonRecord(line: string): JsonRecord | undefined {\n try {\n return readRecord(JSON.parse(line));\n } catch {\n return undefined;\n }\n}\n\nfunction isJsonRecord(value: unknown): value is JsonRecord {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction readRecord(value: unknown): JsonRecord | undefined {\n return isJsonRecord(value) ? value : undefined;\n}\n\nfunction readString(value: unknown): string | undefined {\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACDlB,OAAO,aAAa;;;ACApB,OAAO,QAAQ;AACf,OAAO,UAAU;AAUjB,eAAsB,oBACpB,YACA,UAC4B;AAC5B,QAAM,SAAS,MAAM,mBAAmB,UAAU;AAClD,QAAM,iBAAiB,wBAAwB,QAAQ,QAAQ;AAC/D,MAAI,eAAe;AACnB,MAAI,eAAe;AAEnB,aAAW,CAAC,cAAc,YAAY,KAAK,eAAe,oBAAoB;AAC5E,UAAM,kBAAkB,MAAM,GAAG,SAAS,cAAc,MAAM;AAC9D,QAAI,kBAAkB;AACtB,QAAI,mBAAmB;AAEvB,eAAW,WAAW,cAAc;AAClC,YAAM,cAAc,wBAAwB,OAAO;AACnD,YAAM,cAAc,gBAAgB,MAAM,QAAQ,SAAS,EAAE,KAAK,WAAW;AAC7E,UAAI,gBAAgB,iBAAiB;AACnC,4BAAoB,iBAAiB,iBAAiB,QAAQ,SAAS;AACvE,0BAAkB;AAAA,MACpB;AAAA,IACF;AAEA,QAAI,oBAAoB,iBAAiB;AACvC,YAAM,GAAG,UAAU,cAAc,eAAe;AAChD,sBAAgB;AAChB,sBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,iBAAiB,eAAe;AAAA,EAClC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AI,KAAK,GAAG,OACzE,OAAO,YACT,QAAQ,OAAO,iBAAiB,IAAI,KAAK,GAAG;AAAA,EAC9C;AAEA,MAAI,OAAO,kBAAkB,GAAG;AAC9B,WAAO,KAAK,WAAW,OAAO,eAAe,qCAAqC;AAAA,EACpF;AACF;AAEA,SAAS,kBAAkB,UAAkC;AAC3D,QAAM,QAAQ,CAAC,SAAS,SAAS,MAAM,mBAAmB,SAAS,WAAW,IAAI,KAAK,GAAG,GAAG;AAE7F,aAAW,WAAW,UAAU;AAC9B,UAAM,WAAW,QAAQ,OAAO,GAAG,QAAQ,QAAQ,IAAI,QAAQ,IAAI,KAAK,QAAQ;AAChF,UAAM,SAAS,QAAQ,WAAW,aAAa;AAC/C,UAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,YAAY,IAAI,MAAM,EAAE;AAAA,EAC9D;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;;;ADpCS;AA3BF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,oBAAoB,OAAO;AAAA,EAChD,MAAM,EACH,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACF,KAAK,EACF,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,aAA8B,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAAsB;AACzE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,gBAAgBD,MAAK,CAAC,GAAGC,UAAS,MAAM,GAAG;AACpF;","names":["path","options","path","args","options","args","options"]}
1
+ {"version":3,"sources":["../../src/commands/scrub.tsx","../../src/features/scrub/run-scrub-command.ts","../../src/features/scrub/masker.ts","../../src/features/scrub/trufflehog.ts","../../src/features/scrub/findings.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { GlobalOptionsSchema, OptionalPathArgsSchema } from \"../cli/options.js\";\nimport { runScrubCommand, type ScrubCommandOptions } from \"../features/scrub/run-scrub-command.js\";\nimport { CommandRunner } from \"../cli/command-runner.js\";\n\nexport const description = \"Scan for secrets with TruffleHog and optionally mask them inline\";\nexport const args = OptionalPathArgsSchema;\nexport const options = GlobalOptionsSchema.extend({\n mask: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Compatibility alias for inline scrubbing; --yes is still required\",\n })\n ),\n yes: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Confirm and run inline scrubbing\",\n })\n ),\n});\n\ntype ScrubCommandProps = {\n readonly args: z.infer<typeof args>;\n readonly options: ScrubCommandOptions;\n};\n\nexport default function ScrubCommand({ args, options }: ScrubCommandProps) {\n return <CommandRunner run={(output) => runScrubCommand(args[0], options, output)} />;\n}\n","import process from \"node:process\";\n\nimport type { GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\nimport type { ScrubFinding } from \"./findings.js\";\nimport { scrubFindingsInline } from \"./masker.js\";\nimport { scanFilesystemWithTruffleHog } from \"./trufflehog.js\";\n\nexport type ScrubCommandOptions = GlobalCommandOptions & {\n mask?: boolean;\n yes?: boolean;\n};\n\nexport type ScrubCommandDependencies = {\n scanFilesystem(targetPath: string): Promise<ScrubFinding[]>;\n};\n\nexport async function runScrubCommand(\n targetPath: string | undefined,\n options: ScrubCommandOptions,\n output: CommandOutput,\n dependencies?: ScrubCommandDependencies\n): Promise<void> {\n const scrubTargetPath = targetPath ?? \".\";\n const scanFilesystem =\n dependencies?.scanFilesystem ??\n ((scanTargetPath: string) =>\n scanFilesystemWithTruffleHog(scanTargetPath, {\n cwd: process.cwd(),\n }));\n const findings = await scanFilesystem(scrubTargetPath);\n\n if (findings.length === 0) {\n output.success(\"No secrets found.\");\n return;\n }\n\n output.warning(formatScrubReport(findings));\n\n if (!options.yes) {\n if (options.mask) {\n throw new Error(\"Inline scrubbing rewrites files. Re-run with --yes to continue.\");\n }\n\n output.warning(\"Report only. Re-run with --yes to scrub files inline.\");\n return;\n }\n\n const result = await scrubFindingsInline(scrubTargetPath, findings);\n output.success(\n `Masked ${result.replacements} secret${result.replacements === 1 ? \"\" : \"s\"} in ${\n result.filesChanged\n } file${result.filesChanged === 1 ? \"\" : \"s\"}.`\n );\n\n if (result.skippedFindings > 0) {\n output.warning(`Skipped ${result.skippedFindings} finding(s) outside the scrub root.`);\n }\n}\n\nfunction formatScrubReport(findings: ScrubFinding[]): string {\n const lines = [`Found ${findings.length} possible secret${findings.length === 1 ? \"\" : \"s\"}:`];\n\n for (const finding of findings) {\n const location = finding.line ? `${finding.filePath}:${finding.line}` : finding.filePath;\n const status = finding.verified ? \"verified\" : \"unverified\";\n lines.push(`- ${location} ${finding.detectorName} ${status}`);\n }\n\n return lines.join(\"\\n\");\n}\n","import fs from \"node:fs/promises\";\nimport path from \"node:path\";\n\nimport type { ScrubFinding } from \"./findings.js\";\n\nexport type InlineScrubResult = {\n filesChanged: number;\n replacements: number;\n skippedFindings: number;\n};\n\nexport async function scrubFindingsInline(\n targetPath: string,\n findings: ScrubFinding[]\n): Promise<InlineScrubResult> {\n const target = await resolveScrubTarget(targetPath);\n const findingsByFile = groupFindingsBySafePath(target, findings);\n let filesChanged = 0;\n let replacements = 0;\n\n for (const [absolutePath, fileFindings] of findingsByFile.safeFindingsByPath) {\n const originalContent = await fs.readFile(absolutePath, \"utf8\");\n let scrubbedContent = originalContent;\n let fileReplacements = 0;\n\n for (const finding of fileFindings) {\n const placeholder = formatSecretPlaceholder(finding);\n const nextContent = scrubbedContent.split(finding.rawSecret).join(placeholder);\n if (nextContent !== scrubbedContent) {\n fileReplacements += countOccurrences(scrubbedContent, finding.rawSecret);\n scrubbedContent = nextContent;\n }\n }\n\n if (scrubbedContent !== originalContent) {\n await fs.writeFile(absolutePath, scrubbedContent);\n filesChanged += 1;\n replacements += fileReplacements;\n }\n }\n\n return {\n filesChanged,\n replacements,\n skippedFindings: findingsByFile.skippedFindings,\n };\n}\n\nexport function formatSecretPlaceholder(finding: ScrubFinding): string {\n return `[CNGKIT_SECRET:${sanitizePlaceholderPart(finding.detectorName)}:${\n finding.verified ? \"verified\" : \"unverified\"\n }]`;\n}\n\nfunction groupFindingsBySafePath(\n target: ScrubTarget,\n findings: ScrubFinding[]\n): {\n safeFindingsByPath: Map<string, ScrubFinding[]>;\n skippedFindings: number;\n} {\n const safeFindingsByPath = new Map<string, ScrubFinding[]>();\n let skippedFindings = 0;\n\n for (const finding of findings) {\n const absolutePath = resolveSafeFindingPath(target, finding.filePath);\n if (!absolutePath) {\n skippedFindings += 1;\n continue;\n }\n\n const fileFindings = safeFindingsByPath.get(absolutePath) ?? [];\n fileFindings.push(finding);\n safeFindingsByPath.set(absolutePath, fileFindings);\n }\n\n return { safeFindingsByPath, skippedFindings };\n}\n\ntype ScrubTarget = {\n rootDir: string;\n allowedFilePath?: string;\n};\n\nasync function resolveScrubTarget(targetPath: string): Promise<ScrubTarget> {\n const absoluteTargetPath = path.resolve(targetPath);\n const stat = await fs.stat(absoluteTargetPath);\n\n if (stat.isFile()) {\n return {\n rootDir: path.dirname(absoluteTargetPath),\n allowedFilePath: absoluteTargetPath,\n };\n }\n\n return {\n rootDir: absoluteTargetPath,\n };\n}\n\nfunction resolveSafeFindingPath(\n target: ScrubTarget,\n findingFilePath: string\n): string | undefined {\n const absolutePath = path.isAbsolute(findingFilePath)\n ? path.resolve(findingFilePath)\n : path.resolve(target.rootDir, findingFilePath);\n\n if (target.allowedFilePath) {\n return absolutePath === target.allowedFilePath ? absolutePath : undefined;\n }\n\n const normalizedRoot = `${path.resolve(target.rootDir)}${path.sep}`;\n\n if (absolutePath === path.resolve(target.rootDir) || absolutePath.startsWith(normalizedRoot)) {\n return absolutePath;\n }\n\n return undefined;\n}\n\nfunction countOccurrences(value: string, search: string): number {\n if (!search) {\n return 0;\n }\n\n return value.split(search).length - 1;\n}\n\nfunction sanitizePlaceholderPart(value: string): string {\n return value.replace(/[^A-Za-z0-9_-]+/g, \"-\").replace(/^-+|-+$/g, \"\") || \"Unknown\";\n}\n","import { spawn } from \"node:child_process\";\nimport path from \"node:path\";\n\nimport { parseTruffleHogJsonLines, type ScrubFinding } from \"./findings.js\";\n\nexport type TruffleHogScanOptions = {\n cwd: string;\n};\n\nexport async function scanFilesystemWithTruffleHog(\n targetPath: string,\n options: TruffleHogScanOptions\n): Promise<ScrubFinding[]> {\n const absoluteTargetPath = path.resolve(options.cwd, targetPath);\n const { stdout } = await runTruffleHog([\n \"filesystem\",\n absoluteTargetPath,\n \"--json\",\n \"--no-update\",\n \"--force-skip-binaries\",\n \"--force-skip-archives\",\n ]);\n\n return parseTruffleHogJsonLines(stdout);\n}\n\nfunction runTruffleHog(args: string[]): Promise<{ stdout: string; stderr: string }> {\n return new Promise((resolve, reject) => {\n const child = spawn(\"trufflehog\", args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const stdoutChunks: Buffer[] = [];\n const stderrChunks: Buffer[] = [];\n\n child.stdout.on(\"data\", (chunk: Buffer) => {\n stdoutChunks.push(chunk);\n });\n child.stderr.on(\"data\", (chunk: Buffer) => {\n stderrChunks.push(chunk);\n });\n child.on(\"error\", (error: NodeJS.ErrnoException) => {\n if (error.code === \"ENOENT\") {\n reject(\n new Error(\n \"TruffleHog is not installed. Install it with `brew install trufflehog` or see https://github.com/trufflesecurity/trufflehog.\"\n )\n );\n return;\n }\n\n reject(error);\n });\n child.on(\"close\", (exitCode) => {\n const stdout = Buffer.concat(stdoutChunks).toString(\"utf8\");\n const stderr = Buffer.concat(stderrChunks).toString(\"utf8\");\n\n if (exitCode && exitCode !== 0) {\n reject(new Error(`TruffleHog scan failed with exit code ${exitCode}: ${stderr.trim()}`));\n return;\n }\n\n resolve({ stdout, stderr });\n });\n });\n}\n","export type ScrubFinding = {\n detectorName: string;\n filePath: string;\n line?: number;\n rawSecret: string;\n redactedSecret: string;\n verified: boolean;\n};\n\ntype JsonRecord = Record<string, unknown>;\n\nexport function parseTruffleHogJsonLines(output: string): ScrubFinding[] {\n const findings: ScrubFinding[] = [];\n\n for (const line of output.split(/\\r?\\n/)) {\n const trimmedLine = line.trim();\n if (!trimmedLine.startsWith(\"{\")) {\n continue;\n }\n\n const parsedLine = parseJsonRecord(trimmedLine);\n if (!parsedLine) {\n continue;\n }\n\n const finding = parseTruffleHogFinding(parsedLine);\n if (finding) {\n findings.push(finding);\n }\n }\n\n return findings;\n}\n\nfunction parseTruffleHogFinding(finding: JsonRecord): ScrubFinding | undefined {\n const rawSecret = readString(finding.Raw) || readString(finding.RawV2);\n const filePath = readFilesystemFilePath(finding);\n\n if (!rawSecret || !filePath) {\n return undefined;\n }\n\n return {\n detectorName: readString(finding.DetectorName) || \"Unknown\",\n filePath,\n line: readFilesystemLine(finding),\n rawSecret,\n redactedSecret: readString(finding.Redacted) || \"\",\n verified: finding.Verified === true,\n };\n}\n\nfunction readFilesystemFilePath(finding: JsonRecord): string | undefined {\n const filesystem = readFilesystemMetadata(finding);\n if (!filesystem) {\n return undefined;\n }\n\n return readString(filesystem.file) || readString(filesystem.path);\n}\n\nfunction readFilesystemLine(finding: JsonRecord): number | undefined {\n const filesystem = readFilesystemMetadata(finding);\n if (!filesystem) {\n return undefined;\n }\n\n return typeof filesystem.line === \"number\" ? filesystem.line : undefined;\n}\n\nfunction readFilesystemMetadata(finding: JsonRecord): JsonRecord | undefined {\n const sourceMetadata = readRecord(finding.SourceMetadata);\n const data = readRecord(sourceMetadata?.Data);\n return readRecord(data?.Filesystem);\n}\n\nfunction parseJsonRecord(line: string): JsonRecord | undefined {\n try {\n return readRecord(JSON.parse(line));\n } catch {\n return undefined;\n }\n}\n\nfunction isJsonRecord(value: unknown): value is JsonRecord {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction readRecord(value: unknown): JsonRecord | undefined {\n return isJsonRecord(value) ? value : undefined;\n}\n\nfunction readString(value: unknown): string | undefined {\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACDlB,OAAO,aAAa;;;ACApB,OAAO,QAAQ;AACf,OAAO,UAAU;AAUjB,eAAsB,oBACpB,YACA,UAC4B;AAC5B,QAAM,SAAS,MAAM,mBAAmB,UAAU;AAClD,QAAM,iBAAiB,wBAAwB,QAAQ,QAAQ;AAC/D,MAAI,eAAe;AACnB,MAAI,eAAe;AAEnB,aAAW,CAAC,cAAc,YAAY,KAAK,eAAe,oBAAoB;AAC5E,UAAM,kBAAkB,MAAM,GAAG,SAAS,cAAc,MAAM;AAC9D,QAAI,kBAAkB;AACtB,QAAI,mBAAmB;AAEvB,eAAW,WAAW,cAAc;AAClC,YAAM,cAAc,wBAAwB,OAAO;AACnD,YAAM,cAAc,gBAAgB,MAAM,QAAQ,SAAS,EAAE,KAAK,WAAW;AAC7E,UAAI,gBAAgB,iBAAiB;AACnC,4BAAoB,iBAAiB,iBAAiB,QAAQ,SAAS;AACvE,0BAAkB;AAAA,MACpB;AAAA,IACF;AAEA,QAAI,oBAAoB,iBAAiB;AACvC,YAAM,GAAG,UAAU,cAAc,eAAe;AAChD,sBAAgB;AAChB,sBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,iBAAiB,eAAe;AAAA,EAClC;AACF;AAEO,SAAS,wBAAwB,SAA+B;AACrE,SAAO,kBAAkB,wBAAwB,QAAQ,YAAY,CAAC,IACpE,QAAQ,WAAW,aAAa,YAClC;AACF;AAEA,SAAS,wBACP,QACA,UAIA;AACA,QAAM,qBAAqB,oBAAI,IAA4B;AAC3D,MAAI,kBAAkB;AAEtB,aAAW,WAAW,UAAU;AAC9B,UAAM,eAAe,uBAAuB,QAAQ,QAAQ,QAAQ;AACpE,QAAI,CAAC,cAAc;AACjB,yBAAmB;AAC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W,UAAU;AAC9B,UAAM,WAAW,QAAQ,OAAO,GAAG,QAAQ,QAAQ,IAAI,QAAQ,IAAI,KAAK,QAAQ;AAChF,UAAM,SAAS,QAAQ,WAAW,aAAa;AAC/C,UAAM,KAAK,KAAK,QAAQ,IAAI,QAAQ,YAAY,IAAI,MAAM,EAAE;AAAA,EAC9D;AAEA,SAAO,MAAM,KAAK,IAAI;AACxB;;;ADpCS;AA3BF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,oBAAoB,OAAO;AAAA,EAChD,MAAM,EACH,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACF,KAAK,EACF,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,aAA8B,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAAsB;AACzE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,gBAAgBD,MAAK,CAAC,GAAGC,UAAS,MAAM,GAAG;AACpF;","names":["path","options","path","args","options","args","options"]}
@@ -6,15 +6,15 @@ import {
6
6
  } from "../chunk-QZEB4VMX.js";
7
7
  import {
8
8
  formatCngkitHelp
9
- } from "../chunk-VI5XQH3U.js";
9
+ } from "../chunk-WPBMAXXM.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-Z4DDLEWR.js";
17
- import "../chunk-XDXRVTPK.js";
16
+ } from "../chunk-CELXWAUR.js";
17
+ import "../chunk-X3THKPHT.js";
18
18
  import "../chunk-PZ5AY32C.js";
19
19
 
20
20
  // src/commands/transcripts.tsx
@@ -294,12 +294,12 @@ async function runTranscriptCommand(args2, options2, output) {
294
294
  const includeInternal = options2.includeInternal === true;
295
295
  switch (action) {
296
296
  case "help":
297
- output.info(formatCngkitHelp("transcripts"));
297
+ output.raw(formatCngkitHelp("transcripts"));
298
298
  return;
299
299
  case "list": {
300
300
  const records = await listTranscriptRecords({ source, limit });
301
301
  if (options2.json) {
302
- output.info(formatJson({ records }));
302
+ output.raw(formatJson({ records }));
303
303
  return;
304
304
  }
305
305
  output.info(formatTranscriptRecords(records));
@@ -317,10 +317,10 @@ async function runTranscriptCommand(args2, options2, output) {
317
317
  includeInternal
318
318
  });
319
319
  if (options2.json) {
320
- output.info(formatJson({ entries }));
320
+ output.raw(formatJson({ entries }));
321
321
  return;
322
322
  }
323
- output.info(formatTranscriptEntries(entries));
323
+ output.raw(formatTranscriptEntries(entries));
324
324
  return;
325
325
  }
326
326
  case "grep": {
@@ -336,10 +336,10 @@ async function runTranscriptCommand(args2, options2, output) {
336
336
  includeInternal
337
337
  });
338
338
  if (options2.json) {
339
- output.info(formatJson({ entries }));
339
+ output.raw(formatJson({ entries }));
340
340
  return;
341
341
  }
342
- output.info(formatTranscriptEntries(entries));
342
+ output.raw(formatTranscriptEntries(entries));
343
343
  return;
344
344
  }
345
345
  default: