cngkit 1.1.23 → 1.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/{chunk-AS7FIJWP.js → chunk-2Y5FMKFS.js} +3 -4
- package/dist/chunk-2Y5FMKFS.js.map +1 -0
- package/dist/{chunk-VMTXY4KQ.js → chunk-3VDQDFHG.js} +14 -6
- package/dist/chunk-3VDQDFHG.js.map +1 -0
- package/dist/{chunk-WIEYHKQA.js → chunk-4Q2LNYVU.js} +12 -15
- package/dist/chunk-4Q2LNYVU.js.map +1 -0
- package/dist/{chunk-BXS4IKUA.js → chunk-EG3QD47O.js} +90 -15
- package/dist/chunk-EG3QD47O.js.map +1 -0
- package/dist/{chunk-67FUBMNB.js → chunk-H5LPFVPJ.js} +2 -2
- package/dist/{chunk-67FUBMNB.js.map → chunk-H5LPFVPJ.js.map} +1 -1
- package/dist/{chunk-BRFWVQI4.js → chunk-LC4CYVCT.js} +1 -1
- package/dist/chunk-LC4CYVCT.js.map +1 -0
- package/dist/{chunk-YALWTRIP.js → chunk-LNFZT3R3.js} +2 -2
- package/dist/{chunk-JNHW72SU.js → chunk-QCAHQE7Q.js} +14 -9
- package/dist/chunk-QCAHQE7Q.js.map +1 -0
- package/dist/{chunk-GYRLVNJX.js → chunk-SRZRHLRJ.js} +2 -2
- package/dist/{chunk-3BATDTKU.js → chunk-YPGDQ6P2.js} +2 -4
- package/dist/chunk-YPGDQ6P2.js.map +1 -0
- package/dist/{chunk-U725ZHCI.js → chunk-ZFBOTEAS.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/coderoom/index.js +3 -3
- package/dist/commands/coderoom/join.js +14 -5
- package/dist/commands/coderoom/join.js.map +1 -1
- package/dist/commands/coderoom/share.js +4 -4
- package/dist/commands/hookify/index.js +3 -3
- package/dist/commands/hookify/ingest.js +3 -3
- package/dist/commands/hooks/index.js +3 -3
- package/dist/commands/hooks/install.js +3 -3
- package/dist/commands/hooks/uninstall.js +3 -3
- package/dist/commands/index.js +3 -3
- package/dist/commands/knowledges/audiences.js +6 -6
- package/dist/commands/knowledges/cat.js +6 -6
- package/dist/commands/knowledges/files.js +6 -6
- package/dist/commands/knowledges/find.js +6 -6
- package/dist/commands/knowledges/find.js.map +1 -1
- package/dist/commands/knowledges/glob.js +5 -5
- package/dist/commands/knowledges/grep.js +5 -5
- package/dist/commands/knowledges/grep.js.map +1 -1
- package/dist/commands/knowledges/head.js +6 -6
- package/dist/commands/knowledges/index.js +3 -3
- package/dist/commands/knowledges/list.js +6 -6
- package/dist/commands/knowledges/ls.js +6 -6
- package/dist/commands/knowledges/ls.js.map +1 -1
- package/dist/commands/knowledges/read.js +5 -5
- package/dist/commands/knowledges/read.js.map +1 -1
- package/dist/commands/knowledges/realpath.js +3 -3
- package/dist/commands/knowledges/realpath.js.map +1 -1
- package/dist/commands/knowledges/search.js +6 -6
- package/dist/commands/knowledges/stat.js +6 -6
- package/dist/commands/knowledges/status.js +6 -6
- package/dist/commands/knowledges/tail.js +6 -6
- package/dist/commands/knowledges/tree.js +6 -6
- package/dist/commands/login.js +2 -2
- package/dist/commands/scrub.js +17 -14
- package/dist/commands/scrub.js.map +1 -1
- package/dist/commands/transcripts.js +37 -27
- package/dist/commands/transcripts.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3BATDTKU.js.map +0 -1
- package/dist/chunk-AS7FIJWP.js.map +0 -1
- package/dist/chunk-BRFWVQI4.js.map +0 -1
- package/dist/chunk-BXS4IKUA.js.map +0 -1
- package/dist/chunk-JNHW72SU.js.map +0 -1
- package/dist/chunk-VMTXY4KQ.js.map +0 -1
- package/dist/chunk-WIEYHKQA.js.map +0 -1
- /package/dist/{chunk-YALWTRIP.js.map → chunk-LNFZT3R3.js.map} +0 -0
- /package/dist/{chunk-GYRLVNJX.js.map → chunk-SRZRHLRJ.js.map} +0 -0
- /package/dist/{chunk-U725ZHCI.js.map → chunk-ZFBOTEAS.js.map} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hookToolIds,
|
|
3
3
|
runHooksInstallCommand
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-YPGDQ6P2.js";
|
|
5
5
|
import {
|
|
6
6
|
GlobalOptionsSchema
|
|
7
7
|
} from "../../chunk-25Q463MH.js";
|
|
8
8
|
import {
|
|
9
9
|
CommandRunner
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
11
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
12
12
|
import "../../chunk-PZ5AY32C.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/hooks/install.tsx
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hookToolIds,
|
|
3
3
|
runHooksUninstallCommand
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-YPGDQ6P2.js";
|
|
5
5
|
import {
|
|
6
6
|
GlobalOptionsSchema
|
|
7
7
|
} from "../../chunk-25Q463MH.js";
|
|
8
8
|
import {
|
|
9
9
|
CommandRunner
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
11
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
12
12
|
import "../../chunk-PZ5AY32C.js";
|
|
13
13
|
|
|
14
14
|
// src/commands/hooks/uninstall.tsx
|
package/dist/commands/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderCngkitHelp
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QCAHQE7Q.js";
|
|
4
4
|
import {
|
|
5
5
|
CommandRunner
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-4Q2LNYVU.js";
|
|
7
|
+
import "../chunk-H5LPFVPJ.js";
|
|
8
8
|
import "../chunk-PZ5AY32C.js";
|
|
9
9
|
|
|
10
10
|
// src/commands/index.tsx
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KnowAudienceList
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-3VDQDFHG.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
|
+
import "../../chunk-2Y5FMKFS.js";
|
|
8
8
|
import {
|
|
9
9
|
formatJson,
|
|
10
10
|
shouldPrintJson
|
|
11
11
|
} from "../../chunk-XQGLUQFM.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
13
13
|
import {
|
|
14
14
|
JsonOutputOptionsSchema
|
|
15
15
|
} from "../../chunk-25Q463MH.js";
|
|
16
16
|
import {
|
|
17
17
|
CommandRunner
|
|
18
|
-
} from "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
19
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
20
20
|
import "../../chunk-PZ5AY32C.js";
|
|
21
21
|
|
|
22
22
|
// src/features/knowledges/handlers/audiences.ts
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
outputRawContent
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-LC4CYVCT.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeCatalogPath
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
10
10
|
import "../../chunk-XQGLUQFM.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
12
12
|
import {
|
|
13
13
|
JsonOutputOptionsSchema,
|
|
14
14
|
RequiredFilePathArgsSchema
|
|
15
15
|
} from "../../chunk-25Q463MH.js";
|
|
16
16
|
import {
|
|
17
17
|
CommandRunner
|
|
18
|
-
} from "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
18
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
19
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
20
20
|
import "../../chunk-PZ5AY32C.js";
|
|
21
21
|
|
|
22
22
|
// src/features/knowledges/handlers/cat.ts
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KnowTopicFileList
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-3VDQDFHG.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeAudienceId
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
10
10
|
import {
|
|
11
11
|
coerceLimit,
|
|
12
12
|
formatJson,
|
|
13
13
|
shouldPrintJson
|
|
14
14
|
} from "../../chunk-XQGLUQFM.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
16
16
|
import {
|
|
17
17
|
JsonOutputOptionsSchema,
|
|
18
18
|
OptionalQueryArgsSchema
|
|
19
19
|
} from "../../chunk-25Q463MH.js";
|
|
20
20
|
import {
|
|
21
21
|
CommandRunner
|
|
22
|
-
} from "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
22
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
23
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
24
24
|
import "../../chunk-PZ5AY32C.js";
|
|
25
25
|
|
|
26
26
|
// src/commands/knowledges/files.tsx
|
|
@@ -2,28 +2,28 @@ import {
|
|
|
2
2
|
coerceOptionalFiniteNumber,
|
|
3
3
|
compareFilesystemEntries,
|
|
4
4
|
formatFilesystemEntryPath
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-LNFZT3R3.js";
|
|
6
6
|
import {
|
|
7
7
|
createKnowledgesApi
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
9
9
|
import {
|
|
10
10
|
formatCatalogPathForDisplay,
|
|
11
11
|
normalizeFilesystemCatalogPath
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
13
13
|
import {
|
|
14
14
|
coerceLimit,
|
|
15
15
|
formatJson,
|
|
16
16
|
shouldPrintJson
|
|
17
17
|
} from "../../chunk-XQGLUQFM.js";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
19
19
|
import {
|
|
20
20
|
JsonOutputOptionsSchema,
|
|
21
21
|
OptionalPathArgsSchema
|
|
22
22
|
} from "../../chunk-25Q463MH.js";
|
|
23
23
|
import {
|
|
24
24
|
CommandRunner
|
|
25
|
-
} from "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
25
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
26
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
27
27
|
import "../../chunk-PZ5AY32C.js";
|
|
28
28
|
|
|
29
29
|
// src/commands/knowledges/find.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/knowledges/find.tsx","../../../src/features/knowledges/handlers/find.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { JsonOutputOptionsSchema, OptionalPathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowFindCommand } from \"../../features/knowledges/handlers/find.js\";\nimport type { KnowFindCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Find remote catalog paths\";\nexport const args = OptionalPathArgsSchema;\nexport const options = JsonOutputOptionsSchema.extend({\n name: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Basename wildcard pattern\",\n valueDescription: \"pattern\",\n })\n ),\n type: z\n .enum([\"file\", \"directory\", \"f\", \"d\"])\n .transform((value) => {\n if (value === \"f\") {\n return \"file\";\n }\n\n if (value === \"d\") {\n return \"directory\";\n }\n\n return value;\n })\n .optional()\n .describe(\n option({\n description: \"Path type: file or directory\",\n valueDescription: \"type\",\n })\n ),\n maxDepth: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum descendant depth\",\n valueDescription: \"n\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum results\",\n valueDescription: \"n\",\n })\n ),\n});\n\ntype FindCommandProps = {\n readonly args: [string?];\n readonly options: KnowFindCommandOptions;\n};\n\nexport default function FindCommand({ args, options }: FindCommandProps) {\n return <CommandRunner run={(output) => runKnowFindCommand(args[0], options, output)} />;\n}\n","import { coerceLimit, formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {\n coerceOptionalFiniteNumber,\n compareFilesystemEntries,\n formatFilesystemEntryPath,\n} from \"../format/filesystem-format.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/knowledges/find.tsx","../../../src/features/knowledges/handlers/find.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { JsonOutputOptionsSchema, OptionalPathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowFindCommand } from \"../../features/knowledges/handlers/find.js\";\nimport type { KnowFindCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Find remote catalog paths\";\nexport const args = OptionalPathArgsSchema;\nexport const options = JsonOutputOptionsSchema.extend({\n name: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Basename wildcard pattern\",\n valueDescription: \"pattern\",\n })\n ),\n type: z\n .enum([\"file\", \"directory\", \"f\", \"d\"])\n .transform((value) => {\n if (value === \"f\") {\n return \"file\";\n }\n\n if (value === \"d\") {\n return \"directory\";\n }\n\n return value;\n })\n .optional()\n .describe(\n option({\n description: \"Path type: file or directory\",\n valueDescription: \"type\",\n })\n ),\n maxDepth: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum descendant depth\",\n valueDescription: \"n\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum results\",\n valueDescription: \"n\",\n })\n ),\n});\n\ntype FindCommandProps = {\n readonly args: [string?];\n readonly options: KnowFindCommandOptions;\n};\n\nexport default function FindCommand({ args, options }: FindCommandProps) {\n return <CommandRunner run={(output) => runKnowFindCommand(args[0], options, output)} />;\n}\n","import { coerceLimit, formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {\n coerceOptionalFiniteNumber,\n compareFilesystemEntries,\n formatFilesystemEntryPath,\n} from \"../format/filesystem-format.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {\n formatCatalogPathForDisplay,\n normalizeFilesystemCatalogPath,\n} from \"../knowledges-input.js\";\nimport type { KnowFindCommandOptions } from \"../knowledges-options.js\";\n\nexport async function runKnowFindCommand(\n path: string | undefined,\n options: KnowFindCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.find({\n path: normalizeFilesystemCatalogPath(path ?? \"/\"),\n name: options.name,\n type: options.type,\n maxDepth: coerceOptionalFiniteNumber(options.maxDepth),\n limit: coerceLimit(options.limit, 500, 2000),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n const entries = [...response.data.entries].sort(compareFilesystemEntries);\n const lines = entries.map(formatFilesystemEntryPath);\n\n if (lines.length > 0) {\n output.raw(lines.join(\"\\n\"));\n } else {\n output.warning(`No entries found under ${formatCatalogPathForDisplay(response.data.path)}.`);\n }\n\n if (response.data.truncated) {\n output.warning(`[truncated: ${response.data.total_entries} total entries]`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACalB,eAAsB,mBACpB,MACAA,UACA,QACA,cACe;AACf,QAAM,MAAM,cAAc,OAAO,oBAAoBA,QAAO;AAC5D,QAAM,WAAW,MAAM,IAAI,KAAK;AAAA,IAC9B,MAAM,+BAA+B,QAAQ,GAAG;AAAA,IAChD,MAAMA,SAAQ;AAAA,IACd,MAAMA,SAAQ;AAAA,IACd,UAAU,2BAA2BA,SAAQ,QAAQ;AAAA,IACrD,OAAO,YAAYA,SAAQ,OAAO,KAAK,GAAI;AAAA,EAC7C,CAAC;AAED,MAAI,gBAAgBA,QAAO,GAAG;AAC5B,WAAO,IAAI,WAAW,SAAS,IAAI,CAAC;AACpC;AAAA,EACF;AAEA,QAAM,UAAU,CAAC,GAAG,SAAS,KAAK,OAAO,EAAE,KAAK,wBAAwB;AACxE,QAAM,QAAQ,QAAQ,IAAI,yBAAyB;AAEnD,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO,IAAI,MAAM,KAAK,IAAI,CAAC;AAAA,EAC7B,OAAO;AACL,WAAO,QAAQ,0BAA0B,4BAA4B,SAAS,KAAK,IAAI,CAAC,GAAG;AAAA,EAC7F;AAEA,MAAI,SAAS,KAAK,WAAW;AAC3B,WAAO,QAAQ,eAAe,SAAS,KAAK,aAAa,iBAAiB;AAAA,EAC5E;AACF;;;ADoBS;AA1DF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,wBAAwB,OAAO;AAAA,EACpD,MAAM,EACH,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,MAAM,EACH,KAAK,CAAC,QAAQ,aAAa,KAAK,GAAG,CAAC,EACpC,UAAU,CAAC,UAAU;AACpB,QAAI,UAAU,KAAK;AACjB,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,KAAK;AACjB,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,CAAC,EACA,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,UAAU,EACP,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,OAAO,EACJ,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,YAA6B,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAAqB;AACvE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,mBAAmBD,MAAK,CAAC,GAAGC,UAAS,MAAM,GAAG;AACvF;","names":["options","args","options"]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnowledgesApi
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
4
4
|
import {
|
|
5
5
|
formatCatalogPathForDisplay,
|
|
6
6
|
normalizeCatalogPath
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
8
8
|
import {
|
|
9
9
|
coerceOptionalNumber,
|
|
10
10
|
formatJson,
|
|
11
11
|
shouldPrintJson
|
|
12
12
|
} from "../../chunk-XQGLUQFM.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
14
14
|
import {
|
|
15
15
|
LimitOptionsSchema,
|
|
16
16
|
OptionalGlobPatternArgsSchema
|
|
17
17
|
} from "../../chunk-25Q463MH.js";
|
|
18
18
|
import {
|
|
19
19
|
CommandRunner
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
21
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
22
22
|
import "../../chunk-PZ5AY32C.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/knowledges/glob.tsx
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnowledgesApi
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
4
4
|
import {
|
|
5
5
|
formatCatalogPathForDisplay,
|
|
6
6
|
normalizeCatalogPath,
|
|
7
7
|
normalizeGrepMode
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
9
9
|
import {
|
|
10
10
|
coerceLimit,
|
|
11
11
|
coerceOptionalNumber,
|
|
12
12
|
formatJson,
|
|
13
13
|
shouldPrintJson
|
|
14
14
|
} from "../../chunk-XQGLUQFM.js";
|
|
15
|
-
import "../../chunk-
|
|
15
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
16
16
|
import {
|
|
17
17
|
LimitOptionsSchema,
|
|
18
18
|
RequiredPatternArgsSchema
|
|
19
19
|
} from "../../chunk-25Q463MH.js";
|
|
20
20
|
import {
|
|
21
21
|
CommandRunner
|
|
22
|
-
} from "../../chunk-
|
|
23
|
-
import "../../chunk-
|
|
22
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
23
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
24
24
|
import "../../chunk-PZ5AY32C.js";
|
|
25
25
|
|
|
26
26
|
// src/commands/knowledges/grep.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/knowledges/grep.tsx","../../../src/features/knowledges/handlers/grep.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { LimitOptionsSchema, RequiredPatternArgsSchema } from \"../../cli/options.js\";\nimport { runKnowGrepCommand } from \"../../features/knowledges/handlers/grep.js\";\nimport type { KnowGrepCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Claude-style content search\";\nexport const args = RequiredPatternArgsSchema;\nexport const options = LimitOptionsSchema.extend({\n path: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Catalog path prefix\",\n valueDescription: \"path\",\n })\n ),\n include: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Filename include filter\",\n valueDescription: \"glob\",\n })\n ),\n outputMode: z\n .enum([\"content\", \"files_with_matches\", \"count\"])\n .optional()\n .describe(\n option({\n description: \"Output mode: content, files_with_matches, count\",\n valueDescription: \"mode\",\n })\n ),\n context: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Context lines around content matches\",\n valueDescription: \"n\",\n })\n ),\n caseInsensitive: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Case-insensitive search\",\n })\n ),\n});\n\ntype GrepCommandProps = {\n readonly args: string[];\n readonly options: KnowGrepCommandOptions;\n};\n\nexport default function GrepCommand({ args, options }: GrepCommandProps) {\n return <CommandRunner run={(output) => runKnowGrepCommand(args.join(\" \"), options, output)} />;\n}\n","import {\n coerceLimit,\n coerceOptionalNumber,\n formatJson,\n shouldPrintJson,\n} from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/knowledges/grep.tsx","../../../src/features/knowledges/handlers/grep.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { LimitOptionsSchema, RequiredPatternArgsSchema } from \"../../cli/options.js\";\nimport { runKnowGrepCommand } from \"../../features/knowledges/handlers/grep.js\";\nimport type { KnowGrepCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Claude-style content search\";\nexport const args = RequiredPatternArgsSchema;\nexport const options = LimitOptionsSchema.extend({\n path: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Catalog path prefix\",\n valueDescription: \"path\",\n })\n ),\n include: z\n .string()\n .optional()\n .describe(\n option({\n description: \"Filename include filter\",\n valueDescription: \"glob\",\n })\n ),\n outputMode: z\n .enum([\"content\", \"files_with_matches\", \"count\"])\n .optional()\n .describe(\n option({\n description: \"Output mode: content, files_with_matches, count\",\n valueDescription: \"mode\",\n })\n ),\n context: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Context lines around content matches\",\n valueDescription: \"n\",\n })\n ),\n caseInsensitive: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Case-insensitive search\",\n })\n ),\n});\n\ntype GrepCommandProps = {\n readonly args: string[];\n readonly options: KnowGrepCommandOptions;\n};\n\nexport default function GrepCommand({ args, options }: GrepCommandProps) {\n return <CommandRunner run={(output) => runKnowGrepCommand(args.join(\" \"), options, output)} />;\n}\n","import {\n coerceLimit,\n coerceOptionalNumber,\n formatJson,\n shouldPrintJson,\n} from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {\n formatCatalogPathForDisplay,\n normalizeCatalogPath,\n normalizeGrepMode,\n} from \"../knowledges-input.js\";\nimport type { KnowGrepCommandOptions } from \"../knowledges-options.js\";\n\nexport async function runKnowGrepCommand(\n pattern: string | undefined,\n options: KnowGrepCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!pattern) {\n throw new Error(\"Missing pattern. Usage: cngkit knowledges grep <pattern>\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const limit = options.limit !== undefined ? coerceOptionalNumber(options.limit) : undefined;\n const response = await api.grep({\n pattern,\n path: normalizeCatalogPath(options.path ?? \"/\"),\n include: options.include ?? \"*\",\n mode: normalizeGrepMode(options.outputMode),\n context: coerceLimit(options.context, 0, 20),\n ignoreCase: options.caseInsensitive === true,\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n if (response.data.mode === \"files_with_matches\") {\n const files = limit ? response.data.files.slice(0, limit) : response.data.files;\n if (files.length > 0) {\n output.raw(files.map(formatCatalogPathForDisplay).join(\"\\n\"));\n return;\n }\n\n output.warning(`No files matched \"${pattern}\".`);\n return;\n }\n\n if (response.data.mode === \"count\") {\n const counts = limit ? response.data.counts.slice(0, limit) : response.data.counts;\n const lines = counts.map(\n (count) => `${formatCatalogPathForDisplay(count.file_path)}: ${count.match_count}`\n );\n if (lines.length > 0) {\n output.raw(lines.join(\"\\n\"));\n return;\n }\n\n output.warning(`No matches for \"${pattern}\".`);\n return;\n }\n\n const matches = limit ? response.data.matches.slice(0, limit) : response.data.matches;\n const lines = matches.flatMap((match) => [\n `${formatCatalogPathForDisplay(match.file_path)}:${match.line_number}`,\n ...match.context_before.map((line) => ` ${line}`),\n `> ${match.line}`,\n ...match.context_after.map((line) => ` ${line}`),\n ]);\n\n if (lines.length > 0) {\n output.raw(lines.join(\"\\n\"));\n return;\n }\n\n output.warning(`No matches for \"${pattern}\".`);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACclB,eAAsB,mBACpB,SACAA,UACA,QACA,cACe;AACf,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,0DAA0D;AAAA,EAC5E;AAEA,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AAC,iBAAc,KAAK,CAAC,WAAW,mBAAmBD,MAAK,KAAK,GAAG,GAAGC,UAAS,MAAM,GAAG;AAC9F;","names":["options","lines","args","options"]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
outputRawContent
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-LC4CYVCT.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeCatalogPath
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
10
10
|
import {
|
|
11
11
|
coerceLimit
|
|
12
12
|
} from "../../chunk-XQGLUQFM.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
14
14
|
import {
|
|
15
15
|
JsonOutputOptionsSchema,
|
|
16
16
|
RequiredFilePathArgsSchema
|
|
17
17
|
} from "../../chunk-25Q463MH.js";
|
|
18
18
|
import {
|
|
19
19
|
CommandRunner
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
21
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
22
22
|
import "../../chunk-PZ5AY32C.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/knowledges/head.tsx
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
renderKnowledgesHelp
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-QCAHQE7Q.js";
|
|
4
4
|
import {
|
|
5
5
|
GlobalOptionsSchema
|
|
6
6
|
} from "../../chunk-25Q463MH.js";
|
|
7
7
|
import {
|
|
8
8
|
CommandRunner
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
10
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
11
11
|
import "../../chunk-PZ5AY32C.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/knowledges/index.tsx
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KnowTopicList
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-3VDQDFHG.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
|
+
import "../../chunk-2Y5FMKFS.js";
|
|
8
8
|
import {
|
|
9
9
|
coerceLimit,
|
|
10
10
|
formatJson,
|
|
11
11
|
shouldPrintJson
|
|
12
12
|
} from "../../chunk-XQGLUQFM.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
14
14
|
import {
|
|
15
15
|
LimitOptionsSchema,
|
|
16
16
|
OptionalQueryArgsSchema
|
|
17
17
|
} from "../../chunk-25Q463MH.js";
|
|
18
18
|
import {
|
|
19
19
|
CommandRunner
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
21
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
22
22
|
import "../../chunk-PZ5AY32C.js";
|
|
23
23
|
|
|
24
24
|
// src/features/knowledges/handlers/list.ts
|
|
@@ -2,28 +2,28 @@ import {
|
|
|
2
2
|
compareFilesystemEntries,
|
|
3
3
|
formatLongFilesystemEntryLine,
|
|
4
4
|
formatShellFilesystemEntryName
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-LNFZT3R3.js";
|
|
6
6
|
import {
|
|
7
7
|
createKnowledgesApi
|
|
8
|
-
} from "../../chunk-
|
|
8
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
9
9
|
import {
|
|
10
10
|
formatCatalogPathForDisplay,
|
|
11
11
|
normalizeFilesystemCatalogPath
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
13
13
|
import {
|
|
14
14
|
coerceLimit,
|
|
15
15
|
formatJson,
|
|
16
16
|
shouldPrintJson
|
|
17
17
|
} from "../../chunk-XQGLUQFM.js";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
19
19
|
import {
|
|
20
20
|
LimitOptionsSchema,
|
|
21
21
|
OptionalPathArgsSchema
|
|
22
22
|
} from "../../chunk-25Q463MH.js";
|
|
23
23
|
import {
|
|
24
24
|
CommandRunner
|
|
25
|
-
} from "../../chunk-
|
|
26
|
-
import "../../chunk-
|
|
25
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
26
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
27
27
|
import "../../chunk-PZ5AY32C.js";
|
|
28
28
|
|
|
29
29
|
// src/commands/knowledges/ls.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/knowledges/ls.tsx","../../../src/features/knowledges/handlers/ls.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { LimitOptionsSchema, OptionalPathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowLsCommand } from \"../../features/knowledges/handlers/ls.js\";\nimport type { KnowLsCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"List remote catalog directory entries\";\nexport const args = OptionalPathArgsSchema;\nexport const options = LimitOptionsSchema.extend({\n long: z\n .boolean()\n .optional()\n .describe(\n option({\n alias: \"l\",\n description: \"Print type, path, and metadata fields\",\n })\n ),\n});\n\ntype LsCommandProps = {\n readonly args: [string?];\n readonly options: KnowLsCommandOptions;\n};\n\nexport default function LsCommand({ args, options }: LsCommandProps) {\n return <CommandRunner run={(output) => runKnowLsCommand(args[0], options, output)} />;\n}\n","import { coerceLimit, formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {\n compareFilesystemEntries,\n formatLongFilesystemEntryLine,\n formatShellFilesystemEntryName,\n} from \"../format/filesystem-format.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/knowledges/ls.tsx","../../../src/features/knowledges/handlers/ls.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { LimitOptionsSchema, OptionalPathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowLsCommand } from \"../../features/knowledges/handlers/ls.js\";\nimport type { KnowLsCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"List remote catalog directory entries\";\nexport const args = OptionalPathArgsSchema;\nexport const options = LimitOptionsSchema.extend({\n long: z\n .boolean()\n .optional()\n .describe(\n option({\n alias: \"l\",\n description: \"Print type, path, and metadata fields\",\n })\n ),\n});\n\ntype LsCommandProps = {\n readonly args: [string?];\n readonly options: KnowLsCommandOptions;\n};\n\nexport default function LsCommand({ args, options }: LsCommandProps) {\n return <CommandRunner run={(output) => runKnowLsCommand(args[0], options, output)} />;\n}\n","import { coerceLimit, formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {\n compareFilesystemEntries,\n formatLongFilesystemEntryLine,\n formatShellFilesystemEntryName,\n} from \"../format/filesystem-format.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport {\n formatCatalogPathForDisplay,\n normalizeFilesystemCatalogPath,\n} from \"../knowledges-input.js\";\nimport type { KnowLsCommandOptions } from \"../knowledges-options.js\";\n\nexport async function runKnowLsCommand(\n path: string | undefined,\n options: KnowLsCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.listDirectory({\n path: normalizeFilesystemCatalogPath(path ?? \"/\"),\n limit: coerceLimit(options.limit, 100, 1000),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n const entries = [...response.data.entries].sort(compareFilesystemEntries);\n const lines = entries.map((entry) =>\n options.long === true\n ? formatLongFilesystemEntryLine(entry)\n : formatShellFilesystemEntryName(entry)\n );\n\n if (lines.length > 0) {\n output.raw(lines.join(\"\\n\"));\n } else {\n output.warning(`No entries under ${formatCatalogPathForDisplay(response.data.path)}.`);\n }\n\n if (response.data.truncated) {\n output.warning(`[truncated: ${response.data.total_entries} total entries]`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACalB,eAAsB,iBACpB,MACAA,UACA,QACA,cACe;AACf,QAAM,MAAM,cAAc,OAAO,oBAAoBA,QAAO;AAC5D,QAAM,WAAW,MAAM,IAAI,cAAc;AAAA,IACvC,MAAM,+BAA+B,QAAQ,GAAG;AAAA,IAChD,OAAO,YAAYA,SAAQ,OAAO,KAAK,GAAI;AAAA,EAC7C,CAAC;AAED,MAAI,gBAAgBA,QAAO,GAAG;AAC5B,WAAO,IAAI,WAAW,SAAS,IAAI,CAAC;AACpC;AAAA,EACF;AAEA,QAAM,UAAU,CAAC,GAAG,SAAS,KAAK,OAAO,EAAE,KAAK,wBAAwB;AACxE,QAAM,QAAQ,QAAQ;AAAA,IAAI,CAAC,UACzBA,SAAQ,SAAS,OACb,8BAA8B,KAAK,IACnC,+BAA+B,KAAK;AAAA,EAC1C;AAEA,MAAI,MAAM,SAAS,GAAG;AACpB,WAAO,IAAI,MAAM,KAAK,IAAI,CAAC;AAAA,EAC7B,OAAO;AACL,WAAO,QAAQ,oBAAoB,4BAA4B,SAAS,KAAK,IAAI,CAAC,GAAG;AAAA,EACvF;AAEA,MAAI,SAAS,KAAK,WAAW;AAC3B,WAAO,QAAQ,eAAe,SAAS,KAAK,aAAa,iBAAiB;AAAA,EAC5E;AACF;;;ADnBS;AApBF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,mBAAmB,OAAO;AAAA,EAC/C,MAAM,EACH,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,OAAO;AAAA,MACP,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,UAA2B,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAAmB;AACnE,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,iBAAiBD,MAAK,CAAC,GAAGC,UAAS,MAAM,GAAG;AACrF;","names":["options","args","options"]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createKnowledgesApi
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeCatalogPath
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
7
7
|
import {
|
|
8
8
|
coerceLimit,
|
|
9
9
|
coerceOptionalNumber,
|
|
10
10
|
formatJson,
|
|
11
11
|
shouldPrintJson
|
|
12
12
|
} from "../../chunk-XQGLUQFM.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
14
14
|
import {
|
|
15
15
|
JsonOutputOptionsSchema,
|
|
16
16
|
RequiredFilePathArgsSchema
|
|
17
17
|
} from "../../chunk-25Q463MH.js";
|
|
18
18
|
import {
|
|
19
19
|
CommandRunner
|
|
20
|
-
} from "../../chunk-
|
|
20
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
21
21
|
import {
|
|
22
22
|
resolveOutputFormat
|
|
23
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-H5LPFVPJ.js";
|
|
24
24
|
import "../../chunk-PZ5AY32C.js";
|
|
25
25
|
|
|
26
26
|
// src/commands/knowledges/read.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/commands/knowledges/read.tsx","../../../src/features/knowledges/handlers/read.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { JsonOutputOptionsSchema, RequiredFilePathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowReadCommand } from \"../../features/knowledges/handlers/read.js\";\nimport type { KnowReadCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Claude-style file read\";\nexport const args = RequiredFilePathArgsSchema;\nexport const options = JsonOutputOptionsSchema.extend({\n offset: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Starting line offset\",\n valueDescription: \"n\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum lines\",\n valueDescription: \"n\",\n })\n ),\n});\n\ntype ReadCommandProps = {\n readonly args: [string];\n readonly options: KnowReadCommandOptions;\n};\n\nexport default function ReadCommand({ args, options }: ReadCommandProps) {\n return <CommandRunner run={(output) => runKnowReadCommand(args[0], options, output)} />;\n}\n","import {
|
|
1
|
+
{"version":3,"sources":["../../../src/commands/knowledges/read.tsx","../../../src/features/knowledges/handlers/read.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { JsonOutputOptionsSchema, RequiredFilePathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowReadCommand } from \"../../features/knowledges/handlers/read.js\";\nimport type { KnowReadCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Claude-style file read\";\nexport const args = RequiredFilePathArgsSchema;\nexport const options = JsonOutputOptionsSchema.extend({\n offset: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Starting line offset\",\n valueDescription: \"n\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum lines\",\n valueDescription: \"n\",\n })\n ),\n});\n\ntype ReadCommandProps = {\n readonly args: [string];\n readonly options: KnowReadCommandOptions;\n};\n\nexport default function ReadCommand({ args, options }: ReadCommandProps) {\n return <CommandRunner run={(output) => runKnowReadCommand(args[0], options, output)} />;\n}\n","import {\n coerceLimit,\n coerceOptionalNumber,\n formatJson,\n shouldPrintJson,\n} from \"../../../shared/command-utils.js\";\nimport { resolveOutputFormat } from \"../../../shared/config.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"../knowledges-api.js\";\nimport { normalizeCatalogPath } from \"../knowledges-input.js\";\nimport type { KnowReadCommandOptions } from \"../knowledges-options.js\";\n\nexport async function runKnowReadCommand(\n filePath: string | undefined,\n options: KnowReadCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!filePath) {\n throw new Error(\"Missing file_path. Usage: cngkit knowledges read <file_path>\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.read({\n filePath: normalizeCatalogPath(filePath),\n offset: coerceOptionalNumber(options.offset),\n limit: coerceLimit(options.limit, 200, 2000),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n if (resolveOutputFormat() === \"markdown\" || !response.data.file_path.endsWith(\".md\")) {\n output.raw(response.data.content);\n } else {\n output.markdown(response.data.content);\n }\n\n if (response.data.truncated) {\n output.warning(\n `[truncated: showing ${response.data.limit} lines from offset ${response.data.offset} of ${response.data.total_lines}]`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACWlB,eAAsB,mBACpB,UACAA,UACA,QACA,cACe;AACf,MAAI,CAAC,UAAU;AACb,U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@@
|
|
|
1
1
|
import {
|
|
2
2
|
formatCatalogPathForDisplay,
|
|
3
3
|
normalizeFilesystemCatalogPath
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
5
5
|
import {
|
|
6
6
|
formatJson,
|
|
7
7
|
shouldPrintJson
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
} from "../../chunk-25Q463MH.js";
|
|
13
13
|
import {
|
|
14
14
|
CommandRunner
|
|
15
|
-
} from "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
15
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
16
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
17
17
|
import "../../chunk-PZ5AY32C.js";
|
|
18
18
|
|
|
19
19
|
// src/features/knowledges/handlers/realpath.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/features/knowledges/handlers/realpath.ts","../../../src/commands/knowledges/realpath.tsx"],"sourcesContent":["import { formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../src/features/knowledges/handlers/realpath.ts","../../../src/commands/knowledges/realpath.tsx"],"sourcesContent":["import { formatJson, shouldPrintJson } from \"../../../shared/command-utils.js\";\nimport type { CommandOutput } from \"../../../shared/output/types.js\";\nimport {\n formatCatalogPathForDisplay,\n normalizeFilesystemCatalogPath,\n} from \"../knowledges-input.js\";\nimport type { KnowRealpathCommandOptions } from \"../knowledges-options.js\";\n\nexport async function runKnowRealpathCommand(\n path: string | undefined,\n options: KnowRealpathCommandOptions,\n output: CommandOutput\n): Promise<void> {\n if (!path) {\n throw new Error(\"Missing path. Usage: cngkit knowledges realpath <path>\");\n }\n\n const resolvedPath = formatCatalogPathForDisplay(normalizeFilesystemCatalogPath(path));\n if (shouldPrintJson(options)) {\n output.raw(formatJson({ path: resolvedPath }));\n return;\n }\n\n output.raw(resolvedPath);\n}\n","import { JsonOutputOptionsSchema, RequiredCatalogPathArgsSchema } from \"../../cli/options.js\";\nimport { runKnowRealpathCommand } from \"../../features/knowledges/handlers/realpath.js\";\nimport type { KnowRealpathCommandOptions } from \"../../features/knowledges/knowledges-options.js\";\nimport { CommandRunner } from \"../../cli/command-runner.js\";\n\nexport const description = \"Normalize a topics-root catalog path\";\nexport const args = RequiredCatalogPathArgsSchema;\nexport const options = JsonOutputOptionsSchema;\n\ntype RealpathCommandProps = {\n readonly args: [string];\n readonly options: KnowRealpathCommandOptions;\n};\n\nexport default function RealpathCommand({ args, options }: RealpathCommandProps) {\n return <CommandRunner run={(output) => runKnowRealpathCommand(args[0], options, output)} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,eAAsB,uBACpB,MACAA,UACA,QACe;AACf,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,QAAM,eAAe,4BAA4B,+BAA+B,IAAI,CAAC;AACrF,MAAI,gBAAgBA,QAAO,GAAG;AAC5B,WAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC,CAAC;AAC7C;AAAA,EACF;AAEA,SAAO,IAAI,YAAY;AACzB;;;ACTS;AAVF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU;AAOR,SAAR,gBAAiC,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAAyB;AAC/E,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,uBAAuBD,MAAK,CAAC,GAAGC,UAAS,MAAM,GAAG;AAC3F;","names":["options","args","options"]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
KnowSearchResults
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-3VDQDFHG.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
|
+
import "../../chunk-2Y5FMKFS.js";
|
|
8
8
|
import {
|
|
9
9
|
coerceLimit,
|
|
10
10
|
formatJson,
|
|
11
11
|
shouldPrintJson
|
|
12
12
|
} from "../../chunk-XQGLUQFM.js";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
14
14
|
import {
|
|
15
15
|
LimitOptionsSchema,
|
|
16
16
|
RequiredQueryArgsSchema
|
|
17
17
|
} from "../../chunk-25Q463MH.js";
|
|
18
18
|
import {
|
|
19
19
|
CommandRunner
|
|
20
|
-
} from "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
21
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
22
22
|
import "../../chunk-PZ5AY32C.js";
|
|
23
23
|
|
|
24
24
|
// src/features/knowledges/handlers/search.ts
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
formatFilesystemStat
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-LNFZT3R3.js";
|
|
4
4
|
import {
|
|
5
5
|
createKnowledgesApi
|
|
6
|
-
} from "../../chunk-
|
|
6
|
+
} from "../../chunk-ZFBOTEAS.js";
|
|
7
7
|
import {
|
|
8
8
|
normalizeFilesystemCatalogPath
|
|
9
|
-
} from "../../chunk-
|
|
9
|
+
} from "../../chunk-2Y5FMKFS.js";
|
|
10
10
|
import {
|
|
11
11
|
formatJson,
|
|
12
12
|
shouldPrintJson
|
|
13
13
|
} from "../../chunk-XQGLUQFM.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-SRZRHLRJ.js";
|
|
15
15
|
import {
|
|
16
16
|
JsonOutputOptionsSchema,
|
|
17
17
|
RequiredCatalogPathArgsSchema
|
|
18
18
|
} from "../../chunk-25Q463MH.js";
|
|
19
19
|
import {
|
|
20
20
|
CommandRunner
|
|
21
|
-
} from "../../chunk-
|
|
22
|
-
import "../../chunk-
|
|
21
|
+
} from "../../chunk-4Q2LNYVU.js";
|
|
22
|
+
import "../../chunk-H5LPFVPJ.js";
|
|
23
23
|
import "../../chunk-PZ5AY32C.js";
|
|
24
24
|
|
|
25
25
|
// src/features/knowledges/handlers/stat.ts
|