cngkit 1.1.3 → 1.1.4
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 +24 -0
- package/dist/chunk-HBBUFPJG.js +4585 -0
- package/dist/chunk-HBBUFPJG.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-SNTLRTQ2.js +34 -0
- package/dist/chunk-SNTLRTQ2.js.map +1 -0
- package/dist/chunk-SSRUN6G5.js +524 -0
- package/dist/chunk-SSRUN6G5.js.map +1 -0
- package/dist/chunk-XWVFKUUD.js +22 -0
- package/dist/chunk-XWVFKUUD.js.map +1 -0
- package/dist/chunk-YY2VGJ5N.js +114 -0
- package/dist/chunk-YY2VGJ5N.js.map +1 -0
- package/dist/cli.js +88 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/_app.js +11 -0
- package/dist/commands/_app.js.map +1 -0
- package/dist/commands/coderoom/index.js +24 -0
- package/dist/commands/coderoom/index.js.map +1 -0
- package/dist/commands/coderoom/join.js +29 -0
- package/dist/commands/coderoom/join.js.map +1 -0
- package/dist/commands/coderoom/share.js +29 -0
- package/dist/commands/coderoom/share.js.map +1 -0
- package/dist/commands/index.js +19 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/knowledges/audiences.js +26 -0
- package/dist/commands/knowledges/audiences.js.map +1 -0
- package/dist/commands/knowledges/files.js +44 -0
- package/dist/commands/knowledges/files.js.map +1 -0
- package/dist/commands/knowledges/glob.js +38 -0
- package/dist/commands/knowledges/glob.js.map +1 -0
- package/dist/commands/knowledges/grep.js +61 -0
- package/dist/commands/knowledges/grep.js.map +1 -0
- package/dist/commands/knowledges/index.js +24 -0
- package/dist/commands/knowledges/index.js.map +1 -0
- package/dist/commands/knowledges/list.js +29 -0
- package/dist/commands/knowledges/list.js.map +1 -0
- package/dist/commands/knowledges/read.js +44 -0
- package/dist/commands/knowledges/read.js.map +1 -0
- package/dist/commands/knowledges/search.js +29 -0
- package/dist/commands/knowledges/search.js.map +1 -0
- package/dist/commands/knowledges/status.js +26 -0
- package/dist/commands/knowledges/status.js.map +1 -0
- package/dist/commands/login.js +26 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/scrub.js +42 -0
- package/dist/commands/scrub.js.map +1 -0
- package/dist/commands/transcripts.js +60 -0
- package/dist/commands/transcripts.js.map +1 -0
- package/package.json +15 -9
- package/dist/cli.cjs +0 -25247
- package/dist/cli.cjs.map +0 -1
- package/dist/cli.d.cts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
formatError
|
|
3
|
+
} from "./chunk-SSRUN6G5.js";
|
|
4
|
+
|
|
5
|
+
// src/ink/command-runner.tsx
|
|
6
|
+
import { useEffect } from "react";
|
|
7
|
+
import { useApp } from "ink";
|
|
8
|
+
function CommandRunner({ run }) {
|
|
9
|
+
const { exit } = useApp();
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const output = {
|
|
12
|
+
info(message) {
|
|
13
|
+
process.stdout.write(`${message}
|
|
14
|
+
`);
|
|
15
|
+
},
|
|
16
|
+
error(message) {
|
|
17
|
+
process.stderr.write(`${message}
|
|
18
|
+
`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
void run(output).catch((error) => {
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
output.error(formatError(error));
|
|
24
|
+
}).finally(() => {
|
|
25
|
+
exit();
|
|
26
|
+
});
|
|
27
|
+
}, [exit, run]);
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
CommandRunner
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=chunk-SNTLRTQ2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ink/command-runner.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useApp } from \"ink\";\n\nimport { formatError, type CommandOutput } from \"../output.js\";\n\ntype CommandRunnerProps = {\n readonly run: (output: CommandOutput) => Promise<void>;\n};\n\nexport function CommandRunner({ run }: CommandRunnerProps) {\n const { exit } = useApp();\n\n useEffect(() => {\n const output: CommandOutput = {\n info(message) {\n process.stdout.write(`${message}\\n`);\n },\n error(message) {\n process.stderr.write(`${message}\\n`);\n },\n };\n\n void run(output)\n .catch((error: unknown) => {\n process.exitCode = 1;\n output.error(formatError(error));\n })\n .finally(() => {\n exit();\n });\n }, [exit, run]);\n\n return null;\n}\n"],"mappings":";;;;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AAQhB,SAAS,cAAc,EAAE,IAAI,GAAuB;AACzD,QAAM,EAAE,KAAK,IAAI,OAAO;AAExB,YAAU,MAAM;AACd,UAAM,SAAwB;AAAA,MAC5B,KAAK,SAAS;AACZ,gBAAQ,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AAAA,MACrC;AAAA,MACA,MAAM,SAAS;AACb,gBAAQ,OAAO,MAAM,GAAG,OAAO;AAAA,CAAI;AAAA,MACrC;AAAA,IACF;AAEA,SAAK,IAAI,MAAM,EACZ,MAAM,CAAC,UAAmB;AACzB,cAAQ,WAAW;AACnB,aAAO,MAAM,YAAY,KAAK,CAAC;AAAA,IACjC,CAAC,EACA,QAAQ,MAAM;AACb,WAAK;AAAA,IACP,CAAC;AAAA,EACL,GAAG,CAAC,MAAM,GAAG,CAAC;AAEd,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
// src/help-specs.ts
|
|
2
|
+
var commandList = [
|
|
3
|
+
"`cngkit login` - open Curly.ng login.",
|
|
4
|
+
"`cngkit coderoom ...` - unite developers in a live shared code room.",
|
|
5
|
+
"`cngkit scrub [path]` - scan for secrets and optionally mask them inline.",
|
|
6
|
+
"`cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.",
|
|
7
|
+
"`cngkit knowledges ...` - read the hosted Harness catalog."
|
|
8
|
+
].join("\n");
|
|
9
|
+
var coderoomCommandList = [
|
|
10
|
+
"`share [room-code]` - start a live room from the current directory.",
|
|
11
|
+
"`join <room-code>` - join another developer's live room from the current directory."
|
|
12
|
+
].join("\n");
|
|
13
|
+
var knowledgesCommandList = [
|
|
14
|
+
"`status` - print remote catalog state.",
|
|
15
|
+
"`audiences` - list valid audience filters.",
|
|
16
|
+
"`search <query>` - semantic search over Cloudflare Vectorize-backed records.",
|
|
17
|
+
"`list [query]` - list known subskills.",
|
|
18
|
+
"`files [query]` - list uploaded catalog files.",
|
|
19
|
+
"`read <file-path>` - Claude-style file read.",
|
|
20
|
+
"`grep <pattern>` - Claude-style content search.",
|
|
21
|
+
"`glob [pattern]` - Claude-style file discovery."
|
|
22
|
+
].join("\n");
|
|
23
|
+
var helpTopics = [
|
|
24
|
+
{
|
|
25
|
+
title: "cngkit",
|
|
26
|
+
aliases: ["", "overview", "help"],
|
|
27
|
+
body: `# cngkit
|
|
28
|
+
|
|
29
|
+
Curly.ng operator CLI for backend-connected repo sync, secret scrubbing, and Harness knowledges access.
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
\`\`\`bash
|
|
34
|
+
cngkit <command> [options]
|
|
35
|
+
\`\`\`
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
${commandList}
|
|
40
|
+
|
|
41
|
+
## Progressive Help
|
|
42
|
+
|
|
43
|
+
\`\`\`bash
|
|
44
|
+
cngkit <command> --help
|
|
45
|
+
cngkit coderoom --help
|
|
46
|
+
cngkit coderoom <subcommand> --help
|
|
47
|
+
cngkit transcripts --help
|
|
48
|
+
cngkit knowledges --help
|
|
49
|
+
cngkit knowledges <subcommand> --help
|
|
50
|
+
\`\`\`
|
|
51
|
+
|
|
52
|
+
The CLI intentionally prints plain Markdown or line-oriented text with no color-only state, tables that require terminal width, or hidden interactive prompts. Add \`--json\` to read-only knowledges commands when another agent or tool needs structured backend data.
|
|
53
|
+
|
|
54
|
+
## Backend
|
|
55
|
+
|
|
56
|
+
Default API: \`https://curly.ng\`
|
|
57
|
+
|
|
58
|
+
Override with:
|
|
59
|
+
|
|
60
|
+
\`\`\`bash
|
|
61
|
+
cngkit --api-base-url <url> ...
|
|
62
|
+
CNGKIT_API_BASE_URL=<url> cngkit ...
|
|
63
|
+
\`\`\`
|
|
64
|
+
`
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: "login",
|
|
68
|
+
aliases: ["login"],
|
|
69
|
+
body: `# cngkit login
|
|
70
|
+
|
|
71
|
+
Open Curly.ng login in a browser. In headless environments, print the URL so an agent can surface it to the operator.
|
|
72
|
+
|
|
73
|
+
## Usage
|
|
74
|
+
|
|
75
|
+
\`\`\`bash
|
|
76
|
+
cngkit login
|
|
77
|
+
\`\`\`
|
|
78
|
+
|
|
79
|
+
## Output Contract
|
|
80
|
+
|
|
81
|
+
- First line names the login URL being opened.
|
|
82
|
+
- If no local browser opener exists, the CLI prints a direct URL.
|
|
83
|
+
- No credentials are printed or persisted by this command.
|
|
84
|
+
`
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "transcripts",
|
|
88
|
+
aliases: ["transcripts", "transcript"],
|
|
89
|
+
body: `# cngkit transcripts
|
|
90
|
+
|
|
91
|
+
Read local agent transcript JSONL files from \`~/.codex/sessions\`, \`~/.codex/archived_sessions\`, \`~/.claude/projects\`, and \`~/.claude/history.jsonl\`.
|
|
92
|
+
|
|
93
|
+
This is local operator tooling. It does not call the Curly backend and it does not upload transcript content.
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
\`\`\`bash
|
|
98
|
+
cngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json]
|
|
99
|
+
cngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json]
|
|
100
|
+
cngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json]
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
## Defaults
|
|
104
|
+
|
|
105
|
+
- \`list\`: newest 12 transcript files.
|
|
106
|
+
- \`read\`: newest 80 user/assistant entries from the selected file.
|
|
107
|
+
- \`grep\`: first 80 matching user/assistant entries from the newest 60 files.
|
|
108
|
+
- \`--source\`: \`all\`.
|
|
109
|
+
|
|
110
|
+
## Output Contract
|
|
111
|
+
|
|
112
|
+
- Text mode prints source, role, timestamp when available, and extracted message text.
|
|
113
|
+
- Internal developer/system payloads and hook/tool noise are skipped unless \`--include-internal\` is passed.
|
|
114
|
+
- Direct file paths, home-relative paths, and partial session ids are accepted by \`read\`.
|
|
115
|
+
`
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
title: "coderoom",
|
|
119
|
+
aliases: ["coderoom", "code-room", "repo-sync"],
|
|
120
|
+
body: `# cngkit coderoom
|
|
121
|
+
|
|
122
|
+
Coderoom is the fast way to unite developers around one working tree. It gives a pair or team a temporary shared room over the Curly backend so one developer can share local file changes and another can join from their own machine.
|
|
123
|
+
|
|
124
|
+
It is intentionally closer to a Drive-like project room than a raw socket command: the room code is the shared folder link, each connected machine is a collaborator, and the file stream is the activity feed. The browser experience at \`/coderoom\` provides the helper surface for copying commands and explaining the room model.
|
|
125
|
+
|
|
126
|
+
## Usage
|
|
127
|
+
|
|
128
|
+
\`\`\`bash
|
|
129
|
+
cngkit coderoom <subcommand> [options]
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
## Subcommands
|
|
133
|
+
|
|
134
|
+
${coderoomCommandList}
|
|
135
|
+
|
|
136
|
+
## Common Flow
|
|
137
|
+
|
|
138
|
+
\`\`\`bash
|
|
139
|
+
cngkit coderoom share
|
|
140
|
+
cngkit coderoom join <room-code>
|
|
141
|
+
\`\`\`
|
|
142
|
+
|
|
143
|
+
## Backend Contract
|
|
144
|
+
|
|
145
|
+
- Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
|
|
146
|
+
- Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
|
|
147
|
+
- Sends an initial snapshot, then file and delete events.
|
|
148
|
+
- Last received change wins.
|
|
149
|
+
- Current rooms are live relays, not durable cloud storage. The Drive-like frontend is the collaboration shell around that live primitive.
|
|
150
|
+
`
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
title: "coderoom share",
|
|
154
|
+
aliases: ["coderoom-share"],
|
|
155
|
+
body: `# cngkit coderoom share
|
|
156
|
+
|
|
157
|
+
Start a real-time repository sync room from the current directory.
|
|
158
|
+
|
|
159
|
+
## Usage
|
|
160
|
+
|
|
161
|
+
\`\`\`bash
|
|
162
|
+
cngkit coderoom share [room-code]
|
|
163
|
+
\`\`\`
|
|
164
|
+
|
|
165
|
+
## Backend Contract
|
|
166
|
+
|
|
167
|
+
- Connects to \`/api/cng/sync/:roomCode\` on the configured Curly backend.
|
|
168
|
+
- Uses WebSocket transport backed by the \`CngSyncRoom\` Durable Object.
|
|
169
|
+
- Sends an initial snapshot, then file and delete events.
|
|
170
|
+
- Last received change wins.
|
|
171
|
+
|
|
172
|
+
## Filesystem Contract
|
|
173
|
+
|
|
174
|
+
- Preserves \`.git/\`.
|
|
175
|
+
- Preserves files ignored by the repo's \`.gitignore\`.
|
|
176
|
+
- Sends regular files as base64 payloads in the sync protocol.
|
|
177
|
+
|
|
178
|
+
## Output Contract
|
|
179
|
+
|
|
180
|
+
- Prints room code, repo root, peer id, backend health, and concise sync events.
|
|
181
|
+
- Keeps running until the socket closes or the process receives a termination signal.
|
|
182
|
+
`
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
title: "coderoom join",
|
|
186
|
+
aliases: ["coderoom-join"],
|
|
187
|
+
body: `# cngkit coderoom join
|
|
188
|
+
|
|
189
|
+
Join an existing real-time repository sync room in the current directory.
|
|
190
|
+
|
|
191
|
+
## Usage
|
|
192
|
+
|
|
193
|
+
\`\`\`bash
|
|
194
|
+
cngkit coderoom join <room-code>
|
|
195
|
+
\`\`\`
|
|
196
|
+
|
|
197
|
+
## Backend Contract
|
|
198
|
+
|
|
199
|
+
Same transport and filesystem contract as \`cngkit coderoom share\`. The supplied room code selects the Durable Object room.
|
|
200
|
+
|
|
201
|
+
## Output Contract
|
|
202
|
+
|
|
203
|
+
- Prints backend health, room code, repo root, peer id, and concise sync events.
|
|
204
|
+
- Missing room code exits with a usage error.
|
|
205
|
+
`
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
title: "scrub",
|
|
209
|
+
aliases: ["scrub"],
|
|
210
|
+
body: `# cngkit scrub
|
|
211
|
+
|
|
212
|
+
Scan a file or directory for secrets with TruffleHog. Report-only is the default. Inline masking requires \`--yes\`.
|
|
213
|
+
|
|
214
|
+
## Usage
|
|
215
|
+
|
|
216
|
+
\`\`\`bash
|
|
217
|
+
cngkit scrub [path]
|
|
218
|
+
cngkit scrub [path] --yes
|
|
219
|
+
\`\`\`
|
|
220
|
+
|
|
221
|
+
## Requirements
|
|
222
|
+
|
|
223
|
+
- \`trufflehog\` must be available on \`PATH\`.
|
|
224
|
+
|
|
225
|
+
## Safety Contract
|
|
226
|
+
|
|
227
|
+
- Default mode does not rewrite files.
|
|
228
|
+
- \`--yes\` rewrites detected secret values inline with \`[CNGKIT_SECRET:<detector>:<verified|unverified>]\` placeholders.
|
|
229
|
+
- \`--mask\` is accepted as a compatibility alias, but still requires \`--yes\`.
|
|
230
|
+
- Raw and redacted secret values are never printed in the report.
|
|
231
|
+
`
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
title: "knowledges",
|
|
235
|
+
aliases: ["knowledges", "knowledge"],
|
|
236
|
+
body: `# cngkit knowledges
|
|
237
|
+
|
|
238
|
+
Read the hosted Harness knowledges catalog from the Curly backend. These commands are read-only and use the generated \`@cng/client\` SDK against public backend routes.
|
|
239
|
+
|
|
240
|
+
## Usage
|
|
241
|
+
|
|
242
|
+
\`\`\`bash
|
|
243
|
+
cngkit knowledges <subcommand> [options]
|
|
244
|
+
\`\`\`
|
|
245
|
+
|
|
246
|
+
## Subcommands
|
|
247
|
+
|
|
248
|
+
${knowledgesCommandList}
|
|
249
|
+
|
|
250
|
+
## Progressive Help
|
|
251
|
+
|
|
252
|
+
\`\`\`bash
|
|
253
|
+
cngkit knowledges <subcommand> --help
|
|
254
|
+
cngkit knowledges read --help
|
|
255
|
+
cngkit knowledges grep --help
|
|
256
|
+
cngkit knowledges glob --help
|
|
257
|
+
\`\`\`
|
|
258
|
+
|
|
259
|
+
## Common Examples
|
|
260
|
+
|
|
261
|
+
\`\`\`bash
|
|
262
|
+
cngkit knowledges search "cloudflare backend" --limit 3
|
|
263
|
+
cngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
|
|
264
|
+
cngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
|
|
265
|
+
cngkit knowledges glob "**/*.md" --path /libraries/lib-cloudflare
|
|
266
|
+
\`\`\`
|
|
267
|
+
|
|
268
|
+
## AI-Friendly Output
|
|
269
|
+
|
|
270
|
+
- Default output is line-oriented and intended to be directly usable by agents.
|
|
271
|
+
- \`read\` prints file content with no wrapper before any truncation note.
|
|
272
|
+
- \`grep --output-mode content\` prints \`path:line\` blocks.
|
|
273
|
+
- \`grep --output-mode files_with_matches\` and \`glob\` print one path per line.
|
|
274
|
+
- \`--json\` prints the typed backend data payload for machine consumption.
|
|
275
|
+
`
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
title: "knowledges status",
|
|
279
|
+
aliases: ["knowledges-status", "status"],
|
|
280
|
+
body: `# cngkit knowledges status
|
|
281
|
+
|
|
282
|
+
Print remote Harness catalog state from \`GET /api/harness/knowledges/catalog\`.
|
|
283
|
+
|
|
284
|
+
## Usage
|
|
285
|
+
|
|
286
|
+
\`\`\`bash
|
|
287
|
+
cngkit knowledges status [--json]
|
|
288
|
+
\`\`\`
|
|
289
|
+
|
|
290
|
+
## Output Contract
|
|
291
|
+
|
|
292
|
+
- Text mode prints catalog name, file count, blob count, Vectorize binding, and latest run when present.
|
|
293
|
+
- \`--json\` prints the backend data payload.
|
|
294
|
+
`
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
title: "knowledges audiences",
|
|
298
|
+
aliases: ["knowledges-audiences", "audiences"],
|
|
299
|
+
body: `# cngkit knowledges audiences
|
|
300
|
+
|
|
301
|
+
List valid audience filters from \`GET /api/harness/knowledges/audiences\`.
|
|
302
|
+
|
|
303
|
+
## Usage
|
|
304
|
+
|
|
305
|
+
\`\`\`bash
|
|
306
|
+
cngkit knowledges audiences [--json]
|
|
307
|
+
\`\`\`
|
|
308
|
+
|
|
309
|
+
Use this before \`cngkit knowledges files --audience <id>\`.
|
|
310
|
+
`
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
title: "knowledges search",
|
|
314
|
+
aliases: ["knowledges-search", "search"],
|
|
315
|
+
body: `# cngkit knowledges search
|
|
316
|
+
|
|
317
|
+
Run semantic search against the Cloudflare Vectorize-backed Harness index.
|
|
318
|
+
|
|
319
|
+
## Usage
|
|
320
|
+
|
|
321
|
+
\`\`\`bash
|
|
322
|
+
cngkit knowledges search <query> [--limit <n>] [--json]
|
|
323
|
+
\`\`\`
|
|
324
|
+
|
|
325
|
+
## Defaults
|
|
326
|
+
|
|
327
|
+
- \`--limit\`: \`5\`
|
|
328
|
+
|
|
329
|
+
## Example
|
|
330
|
+
|
|
331
|
+
\`\`\`bash
|
|
332
|
+
cngkit knowledges search "cloudflare backend" --limit 3
|
|
333
|
+
\`\`\`
|
|
334
|
+
`
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
title: "knowledges list",
|
|
338
|
+
aliases: ["knowledges-list", "list"],
|
|
339
|
+
body: `# cngkit knowledges list
|
|
340
|
+
|
|
341
|
+
List known subskills from \`GET /api/harness/knowledges/subskills\`, optionally filtered locally by query.
|
|
342
|
+
|
|
343
|
+
## Usage
|
|
344
|
+
|
|
345
|
+
\`\`\`bash
|
|
346
|
+
cngkit knowledges list [query] [--limit <n>] [--json]
|
|
347
|
+
\`\`\`
|
|
348
|
+
|
|
349
|
+
## Defaults
|
|
350
|
+
|
|
351
|
+
- \`--limit\`: \`25\`
|
|
352
|
+
`
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
title: "knowledges files",
|
|
356
|
+
aliases: ["knowledges-files", "files"],
|
|
357
|
+
body: `# cngkit knowledges files
|
|
358
|
+
|
|
359
|
+
List uploaded catalog files from \`GET /api/harness/knowledges/files\`.
|
|
360
|
+
|
|
361
|
+
## Usage
|
|
362
|
+
|
|
363
|
+
\`\`\`bash
|
|
364
|
+
cngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json]
|
|
365
|
+
\`\`\`
|
|
366
|
+
|
|
367
|
+
## Defaults
|
|
368
|
+
|
|
369
|
+
- \`--limit\`: \`25\`
|
|
370
|
+
- \`--audience\`: omitted
|
|
371
|
+
|
|
372
|
+
Run \`cngkit knowledges audiences\` to discover supported audience ids.
|
|
373
|
+
`
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
title: "knowledges read",
|
|
377
|
+
aliases: ["knowledges-read", "read"],
|
|
378
|
+
body: `# cngkit knowledges read
|
|
379
|
+
|
|
380
|
+
Claude-style read tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/read\` and \`HarnessReadQuerySchema\`.
|
|
381
|
+
|
|
382
|
+
## Usage
|
|
383
|
+
|
|
384
|
+
\`\`\`bash
|
|
385
|
+
cngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]
|
|
386
|
+
\`\`\`
|
|
387
|
+
|
|
388
|
+
## Inputs
|
|
389
|
+
|
|
390
|
+
- \`file-path\`: normalized catalog path. Shorthand paths such as \`/libraries/lib-cloudflare/SUBSKILL.md\` are expanded to \`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\`.
|
|
391
|
+
- \`--offset\`: zero-based starting line. Default: \`0\`.
|
|
392
|
+
- \`--limit\`: maximum lines. Default in CLI: \`200\`. Backend max: \`2000\`.
|
|
393
|
+
|
|
394
|
+
## Output Contract
|
|
395
|
+
|
|
396
|
+
- Text mode prints only the returned file content first.
|
|
397
|
+
- If truncated, a final bracketed truncation note is printed after the content.
|
|
398
|
+
- \`--json\` prints \`{ file_path, content, total_lines, offset, limit, truncated }\`.
|
|
399
|
+
|
|
400
|
+
## Example
|
|
401
|
+
|
|
402
|
+
\`\`\`bash
|
|
403
|
+
cngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80
|
|
404
|
+
\`\`\`
|
|
405
|
+
`
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
title: "knowledges grep",
|
|
409
|
+
aliases: ["knowledges-grep", "grep"],
|
|
410
|
+
body: `# cngkit knowledges grep
|
|
411
|
+
|
|
412
|
+
Claude-style grep tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/grep\` and \`HarnessGrepQuerySchema\`.
|
|
413
|
+
|
|
414
|
+
## Usage
|
|
415
|
+
|
|
416
|
+
\`\`\`bash
|
|
417
|
+
cngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json]
|
|
418
|
+
\`\`\`
|
|
419
|
+
|
|
420
|
+
## Inputs
|
|
421
|
+
|
|
422
|
+
- \`pattern\`: JavaScript regular expression source.
|
|
423
|
+
- \`--path\`: catalog path prefix. Default: \`/\`.
|
|
424
|
+
- \`--include\`: filename include filter. Default: \`*\`.
|
|
425
|
+
- Modes: content, files_with_matches, or count.
|
|
426
|
+
- \`--output-mode\`: \`content\`, \`files_with_matches\`, or \`count\`. Default: \`content\`.
|
|
427
|
+
- \`--context\`: context lines around content matches. Default: \`0\`. Backend max: \`20\`.
|
|
428
|
+
- \`--case-insensitive\`: maps to backend \`case_insensitive=true\`.
|
|
429
|
+
|
|
430
|
+
## Output Contract
|
|
431
|
+
|
|
432
|
+
- \`content\`: prints blocks as \`file_path:line_number\`, optional context lines, then \`> matching line\`.
|
|
433
|
+
- \`files_with_matches\`: prints one matching file path per line.
|
|
434
|
+
- \`count\`: prints \`file_path: match_count\` lines.
|
|
435
|
+
- \`--json\` prints the typed backend response union.
|
|
436
|
+
|
|
437
|
+
## Examples
|
|
438
|
+
|
|
439
|
+
\`\`\`bash
|
|
440
|
+
cngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches
|
|
441
|
+
cngkit knowledges grep "Vectorize|D1" --path /libraries/lib-cloudflare --context 2
|
|
442
|
+
\`\`\`
|
|
443
|
+
`
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
title: "knowledges glob",
|
|
447
|
+
aliases: ["knowledges-glob", "glob"],
|
|
448
|
+
body: `# cngkit knowledges glob
|
|
449
|
+
|
|
450
|
+
Claude-style glob tool for hosted Harness catalog files. Backed by \`GET /api/harness/filesystem/glob\` and \`HarnessGlobQuerySchema\`.
|
|
451
|
+
|
|
452
|
+
## Usage
|
|
453
|
+
|
|
454
|
+
\`\`\`bash
|
|
455
|
+
cngkit knowledges glob [pattern] [--path <path>] [--json]
|
|
456
|
+
\`\`\`
|
|
457
|
+
|
|
458
|
+
## Inputs
|
|
459
|
+
|
|
460
|
+
- \`pattern\`: supported glob pattern. CLI default: \`**/*.md\`.
|
|
461
|
+
- \`--path\`: catalog path prefix. Default: \`/\`.
|
|
462
|
+
|
|
463
|
+
## Supported Patterns
|
|
464
|
+
|
|
465
|
+
- \`**/*.md\`
|
|
466
|
+
- \`**/*.SUBSKILL.md\`
|
|
467
|
+
- \`**/SKILL.md\`
|
|
468
|
+
- \`*.md\`
|
|
469
|
+
- \`*.SUBSKILL.md\`
|
|
470
|
+
- \`SKILL.md\`
|
|
471
|
+
|
|
472
|
+
## Output Contract
|
|
473
|
+
|
|
474
|
+
- Text mode prints one file path per line.
|
|
475
|
+
- If truncated, a final bracketed truncation note is printed.
|
|
476
|
+
- \`--json\` prints \`{ files, total_files, truncated }\`.
|
|
477
|
+
|
|
478
|
+
## Example
|
|
479
|
+
|
|
480
|
+
\`\`\`bash
|
|
481
|
+
cngkit knowledges glob "**/*.md" --path /libraries/lib-cloudflare
|
|
482
|
+
\`\`\`
|
|
483
|
+
`
|
|
484
|
+
}
|
|
485
|
+
];
|
|
486
|
+
var helpTopicByAlias = /* @__PURE__ */ new Map();
|
|
487
|
+
for (const topic of helpTopics) {
|
|
488
|
+
for (const alias of topic.aliases) {
|
|
489
|
+
helpTopicByAlias.set(alias, topic);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
function formatCngkitHelp(topicName) {
|
|
493
|
+
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
494
|
+
return (helpTopicByAlias.get(normalizedTopicName) ?? helpTopicByAlias.get(""))?.body.trim() ?? "";
|
|
495
|
+
}
|
|
496
|
+
function formatKnowledgesHelp(topicName) {
|
|
497
|
+
const normalizedTopicName = normalizeHelpTopicName(topicName);
|
|
498
|
+
const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : "knowledges";
|
|
499
|
+
return formatCngkitHelp(topicKey);
|
|
500
|
+
}
|
|
501
|
+
function normalizeHelpTopicName(value) {
|
|
502
|
+
return value?.trim().toLowerCase().replace(/\s+/g, "-") ?? "";
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// src/output.ts
|
|
506
|
+
var consoleOutput = {
|
|
507
|
+
info(message) {
|
|
508
|
+
console.log(message);
|
|
509
|
+
},
|
|
510
|
+
error(message) {
|
|
511
|
+
console.error(message);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
function formatError(error) {
|
|
515
|
+
return error instanceof Error ? error.message : String(error);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export {
|
|
519
|
+
formatCngkitHelp,
|
|
520
|
+
formatKnowledgesHelp,
|
|
521
|
+
consoleOutput,
|
|
522
|
+
formatError
|
|
523
|
+
};
|
|
524
|
+
//# sourceMappingURL=chunk-SSRUN6G5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/help-specs.ts","../src/output.ts"],"sourcesContent":["type HelpTopic = {\n title: string;\n aliases: string[];\n body: string;\n};\n\nconst commandList = [\n \"`cngkit login` - open Curly.ng login.\",\n \"`cngkit coderoom ...` - unite developers in a live shared code room.\",\n \"`cngkit scrub [path]` - scan for secrets and optionally mask them inline.\",\n \"`cngkit transcripts ...` - list, read, and grep local Claude/Codex transcripts.\",\n \"`cngkit knowledges ...` - read the hosted Harness catalog.\",\n].join(\"\\n\");\n\nconst coderoomCommandList = [\n \"`share [room-code]` - start a live room from the current directory.\",\n \"`join <room-code>` - join another developer's live room from the current directory.\",\n].join(\"\\n\");\n\nconst knowledgesCommandList = [\n \"`status` - print remote catalog state.\",\n \"`audiences` - list valid audience filters.\",\n \"`search <query>` - semantic search over Cloudflare Vectorize-backed records.\",\n \"`list [query]` - list known subskills.\",\n \"`files [query]` - list uploaded catalog files.\",\n \"`read <file-path>` - Claude-style file read.\",\n \"`grep <pattern>` - Claude-style content search.\",\n \"`glob [pattern]` - Claude-style file discovery.\",\n].join(\"\\n\");\n\nconst helpTopics: HelpTopic[] = [\n {\n title: \"cngkit\",\n aliases: [\"\", \"overview\", \"help\"],\n body: `# cngkit\n\nCurly.ng operator CLI for backend-connected repo sync, secret scrubbing, and Harness knowledges access.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit <command> [options]\n\\`\\`\\`\n\n## Commands\n\n${commandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit <command> --help\ncngkit coderoom --help\ncngkit coderoom <subcommand> --help\ncngkit transcripts --help\ncngkit knowledges --help\ncngkit knowledges <subcommand> --help\n\\`\\`\\`\n\nThe CLI intentionally prints plain Markdown or line-oriented text with no color-only state, tables that require terminal width, or hidden interactive prompts. Add \\`--json\\` to read-only knowledges commands when another agent or tool needs structured backend data.\n\n## Backend\n\nDefault API: \\`https://curly.ng\\`\n\nOverride with:\n\n\\`\\`\\`bash\ncngkit --api-base-url <url> ...\nCNGKIT_API_BASE_URL=<url> cngkit ...\n\\`\\`\\`\n`,\n },\n {\n title: \"login\",\n aliases: [\"login\"],\n body: `# cngkit login\n\nOpen Curly.ng login in a browser. In headless environments, print the URL so an agent can surface it to the operator.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit login\n\\`\\`\\`\n\n## Output Contract\n\n- First line names the login URL being opened.\n- If no local browser opener exists, the CLI prints a direct URL.\n- No credentials are printed or persisted by this command.\n`,\n },\n {\n title: \"transcripts\",\n aliases: [\"transcripts\", \"transcript\"],\n body: `# cngkit transcripts\n\nRead local agent transcript JSONL files from \\`~/.codex/sessions\\`, \\`~/.codex/archived_sessions\\`, \\`~/.claude/projects\\`, and \\`~/.claude/history.jsonl\\`.\n\nThis is local operator tooling. It does not call the Curly backend and it does not upload transcript content.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit transcripts list [--source all|codex|claude] [--limit <n>] [--json]\ncngkit transcripts read <path-or-session-id> [--source all|codex|claude] [--limit <n>] [--include-internal] [--json]\ncngkit transcripts grep <query> [--source all|codex|claude] [--limit <n>] [--file-limit <n>] [--include-internal] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`list\\`: newest 12 transcript files.\n- \\`read\\`: newest 80 user/assistant entries from the selected file.\n- \\`grep\\`: first 80 matching user/assistant entries from the newest 60 files.\n- \\`--source\\`: \\`all\\`.\n\n## Output Contract\n\n- Text mode prints source, role, timestamp when available, and extracted message text.\n- Internal developer/system payloads and hook/tool noise are skipped unless \\`--include-internal\\` is passed.\n- Direct file paths, home-relative paths, and partial session ids are accepted by \\`read\\`.\n`,\n },\n {\n title: \"coderoom\",\n aliases: [\"coderoom\", \"code-room\", \"repo-sync\"],\n body: `# cngkit coderoom\n\nCoderoom is the fast way to unite developers around one working tree. It gives a pair or team a temporary shared room over the Curly backend so one developer can share local file changes and another can join from their own machine.\n\nIt is intentionally closer to a Drive-like project room than a raw socket command: the room code is the shared folder link, each connected machine is a collaborator, and the file stream is the activity feed. The browser experience at \\`/coderoom\\` provides the helper surface for copying commands and explaining the room model.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${coderoomCommandList}\n\n## Common Flow\n\n\\`\\`\\`bash\ncngkit coderoom share\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Backend Contract\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n- Current rooms are live relays, not durable cloud storage. The Drive-like frontend is the collaboration shell around that live primitive.\n`,\n },\n {\n title: \"coderoom share\",\n aliases: [\"coderoom-share\"],\n body: `# cngkit coderoom share\n\nStart a real-time repository sync room from the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom share [room-code]\n\\`\\`\\`\n\n## Backend Contract\n\n- Connects to \\`/api/cng/sync/:roomCode\\` on the configured Curly backend.\n- Uses WebSocket transport backed by the \\`CngSyncRoom\\` Durable Object.\n- Sends an initial snapshot, then file and delete events.\n- Last received change wins.\n\n## Filesystem Contract\n\n- Preserves \\`.git/\\`.\n- Preserves files ignored by the repo's \\`.gitignore\\`.\n- Sends regular files as base64 payloads in the sync protocol.\n\n## Output Contract\n\n- Prints room code, repo root, peer id, backend health, and concise sync events.\n- Keeps running until the socket closes or the process receives a termination signal.\n`,\n },\n {\n title: \"coderoom join\",\n aliases: [\"coderoom-join\"],\n body: `# cngkit coderoom join\n\nJoin an existing real-time repository sync room in the current directory.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit coderoom join <room-code>\n\\`\\`\\`\n\n## Backend Contract\n\nSame transport and filesystem contract as \\`cngkit coderoom share\\`. The supplied room code selects the Durable Object room.\n\n## Output Contract\n\n- Prints backend health, room code, repo root, peer id, and concise sync events.\n- Missing room code exits with a usage error.\n`,\n },\n {\n title: \"scrub\",\n aliases: [\"scrub\"],\n body: `# cngkit scrub\n\nScan a file or directory for secrets with TruffleHog. Report-only is the default. Inline masking requires \\`--yes\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit scrub [path]\ncngkit scrub [path] --yes\n\\`\\`\\`\n\n## Requirements\n\n- \\`trufflehog\\` must be available on \\`PATH\\`.\n\n## Safety Contract\n\n- Default mode does not rewrite files.\n- \\`--yes\\` rewrites detected secret values inline with \\`[CNGKIT_SECRET:<detector>:<verified|unverified>]\\` placeholders.\n- \\`--mask\\` is accepted as a compatibility alias, but still requires \\`--yes\\`.\n- Raw and redacted secret values are never printed in the report.\n`,\n },\n {\n title: \"knowledges\",\n aliases: [\"knowledges\", \"knowledge\"],\n body: `# cngkit knowledges\n\nRead the hosted Harness knowledges catalog from the Curly backend. These commands are read-only and use the generated \\`@cng/client\\` SDK against public backend routes.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> [options]\n\\`\\`\\`\n\n## Subcommands\n\n${knowledgesCommandList}\n\n## Progressive Help\n\n\\`\\`\\`bash\ncngkit knowledges <subcommand> --help\ncngkit knowledges read --help\ncngkit knowledges grep --help\ncngkit knowledges glob --help\n\\`\\`\\`\n\n## Common Examples\n\n\\`\\`\\`bash\ncngkit knowledges search \"cloudflare backend\" --limit 3\ncngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\ncngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\ncngkit knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n\n## AI-Friendly Output\n\n- Default output is line-oriented and intended to be directly usable by agents.\n- \\`read\\` prints file content with no wrapper before any truncation note.\n- \\`grep --output-mode content\\` prints \\`path:line\\` blocks.\n- \\`grep --output-mode files_with_matches\\` and \\`glob\\` print one path per line.\n- \\`--json\\` prints the typed backend data payload for machine consumption.\n`,\n },\n {\n title: \"knowledges status\",\n aliases: [\"knowledges-status\", \"status\"],\n body: `# cngkit knowledges status\n\nPrint remote Harness catalog state from \\`GET /api/harness/knowledges/catalog\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges status [--json]\n\\`\\`\\`\n\n## Output Contract\n\n- Text mode prints catalog name, file count, blob count, Vectorize binding, and latest run when present.\n- \\`--json\\` prints the backend data payload.\n`,\n },\n {\n title: \"knowledges audiences\",\n aliases: [\"knowledges-audiences\", \"audiences\"],\n body: `# cngkit knowledges audiences\n\nList valid audience filters from \\`GET /api/harness/knowledges/audiences\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges audiences [--json]\n\\`\\`\\`\n\nUse this before \\`cngkit knowledges files --audience <id>\\`.\n`,\n },\n {\n title: \"knowledges search\",\n aliases: [\"knowledges-search\", \"search\"],\n body: `# cngkit knowledges search\n\nRun semantic search against the Cloudflare Vectorize-backed Harness index.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges search <query> [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`5\\`\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges search \"cloudflare backend\" --limit 3\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges list\",\n aliases: [\"knowledges-list\", \"list\"],\n body: `# cngkit knowledges list\n\nList known subskills from \\`GET /api/harness/knowledges/subskills\\`, optionally filtered locally by query.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges list [query] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n`,\n },\n {\n title: \"knowledges files\",\n aliases: [\"knowledges-files\", \"files\"],\n body: `# cngkit knowledges files\n\nList uploaded catalog files from \\`GET /api/harness/knowledges/files\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges files [query] [--audience <id>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Defaults\n\n- \\`--limit\\`: \\`25\\`\n- \\`--audience\\`: omitted\n\nRun \\`cngkit knowledges audiences\\` to discover supported audience ids.\n`,\n },\n {\n title: \"knowledges read\",\n aliases: [\"knowledges-read\", \"read\"],\n body: `# cngkit knowledges read\n\nClaude-style read tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/read\\` and \\`HarnessReadQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges read <file-path> [--offset <n>] [--limit <n>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`file-path\\`: normalized catalog path. Shorthand paths such as \\`/libraries/lib-cloudflare/SUBSKILL.md\\` are expanded to \\`skills/knowledges/subskills/libraries/lib-cloudflare/SUBSKILL.md\\`.\n- \\`--offset\\`: zero-based starting line. Default: \\`0\\`.\n- \\`--limit\\`: maximum lines. Default in CLI: \\`200\\`. Backend max: \\`2000\\`.\n\n## Output Contract\n\n- Text mode prints only the returned file content first.\n- If truncated, a final bracketed truncation note is printed after the content.\n- \\`--json\\` prints \\`{ file_path, content, total_lines, offset, limit, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges read /libraries/lib-cloudflare/SUBSKILL.md --limit 80\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges grep\",\n aliases: [\"knowledges-grep\", \"grep\"],\n body: `# cngkit knowledges grep\n\nClaude-style grep tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/grep\\` and \\`HarnessGrepQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges grep <pattern> [--path <path>] [--include <glob>] [--output-mode <mode>] [--context <n>] [--case-insensitive] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: JavaScript regular expression source.\n- \\`--path\\`: catalog path prefix. Default: \\`/\\`.\n- \\`--include\\`: filename include filter. Default: \\`*\\`.\n- Modes: content, files_with_matches, or count.\n- \\`--output-mode\\`: \\`content\\`, \\`files_with_matches\\`, or \\`count\\`. Default: \\`content\\`.\n- \\`--context\\`: context lines around content matches. Default: \\`0\\`. Backend max: \\`20\\`.\n- \\`--case-insensitive\\`: maps to backend \\`case_insensitive=true\\`.\n\n## Output Contract\n\n- \\`content\\`: prints blocks as \\`file_path:line_number\\`, optional context lines, then \\`> matching line\\`.\n- \\`files_with_matches\\`: prints one matching file path per line.\n- \\`count\\`: prints \\`file_path: match_count\\` lines.\n- \\`--json\\` prints the typed backend response union.\n\n## Examples\n\n\\`\\`\\`bash\ncngkit knowledges grep Cloudflare --path /libraries/lib-cloudflare --output-mode files_with_matches\ncngkit knowledges grep \"Vectorize|D1\" --path /libraries/lib-cloudflare --context 2\n\\`\\`\\`\n`,\n },\n {\n title: \"knowledges glob\",\n aliases: [\"knowledges-glob\", \"glob\"],\n body: `# cngkit knowledges glob\n\nClaude-style glob tool for hosted Harness catalog files. Backed by \\`GET /api/harness/filesystem/glob\\` and \\`HarnessGlobQuerySchema\\`.\n\n## Usage\n\n\\`\\`\\`bash\ncngkit knowledges glob [pattern] [--path <path>] [--json]\n\\`\\`\\`\n\n## Inputs\n\n- \\`pattern\\`: supported glob pattern. CLI default: \\`**/*.md\\`.\n- \\`--path\\`: catalog path prefix. Default: \\`/\\`.\n\n## Supported Patterns\n\n- \\`**/*.md\\`\n- \\`**/*.SUBSKILL.md\\`\n- \\`**/SKILL.md\\`\n- \\`*.md\\`\n- \\`*.SUBSKILL.md\\`\n- \\`SKILL.md\\`\n\n## Output Contract\n\n- Text mode prints one file path per line.\n- If truncated, a final bracketed truncation note is printed.\n- \\`--json\\` prints \\`{ files, total_files, truncated }\\`.\n\n## Example\n\n\\`\\`\\`bash\ncngkit knowledges glob \"**/*.md\" --path /libraries/lib-cloudflare\n\\`\\`\\`\n`,\n },\n];\n\nconst helpTopicByAlias = new Map<string, HelpTopic>();\n\nfor (const topic of helpTopics) {\n for (const alias of topic.aliases) {\n helpTopicByAlias.set(alias, topic);\n }\n}\n\nexport function formatCngkitHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n return (helpTopicByAlias.get(normalizedTopicName) ?? helpTopicByAlias.get(\"\"))?.body.trim() ?? \"\";\n}\n\nexport function formatKnowledgesHelp(topicName?: string): string {\n const normalizedTopicName = normalizeHelpTopicName(topicName);\n const topicKey = normalizedTopicName ? `knowledges-${normalizedTopicName}` : \"knowledges\";\n return formatCngkitHelp(topicKey);\n}\n\nfunction normalizeHelpTopicName(value: string | undefined): string {\n return value?.trim().toLowerCase().replace(/\\s+/g, \"-\") ?? \"\";\n}\n","export type CommandOutput = {\n info(message: string): void;\n error(message: string): void;\n};\n\nexport const consoleOutput: CommandOutput = {\n info(message) {\n console.log(message);\n },\n error(message) {\n console.error(message);\n },\n};\n\nexport function formatError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n"],"mappings":";AAMA,IAAM,cAAc;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,IAAI;AAEX,IAAM,aAA0B;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,IAAI,YAAY,MAAM;AAAA,IAChC,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYR,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0BX;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,SAAS,CAAC,OAAO;AAAA,IACjB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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qBAAqB,WAA4B;AAC/D,QAAM,sBAAsB,uBAAuB,SAAS;AAC5D,QAAM,WAAW,sBAAsB,cAAc,mBAAmB,KAAK;AAC7E,SAAO,iBAAiB,QAAQ;AAClC;AAEA,SAAS,uBAAuB,OAAmC;AACjE,SAAO,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,QAAQ,GAAG,KAAK;AAC7D;;;AC9fO,IAAM,gBAA+B;AAAA,EAC1C,KAAK,SAAS;AACZ,YAAQ,IAAI,OAAO;AAAA,EACrB;AAAA,EACA,MAAM,SAAS;AACb,YAAQ,MAAM,OAAO;AAAA,EACvB;AACF;AAEO,SAAS,YAAY,OAAwB;AAClD,SAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;","names":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/config.ts
|
|
2
|
+
import { randomBytes, randomUUID } from "crypto";
|
|
3
|
+
import process from "process";
|
|
4
|
+
var packageVersion = "1.1.3";
|
|
5
|
+
var defaultApiBaseUrl = "https://curly.ng";
|
|
6
|
+
function resolveApiBaseUrl(options) {
|
|
7
|
+
return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;
|
|
8
|
+
}
|
|
9
|
+
function createRoomCode() {
|
|
10
|
+
return randomBytes(4).toString("hex").toUpperCase();
|
|
11
|
+
}
|
|
12
|
+
function createPeerId() {
|
|
13
|
+
return randomUUID();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
packageVersion,
|
|
18
|
+
resolveApiBaseUrl,
|
|
19
|
+
createRoomCode,
|
|
20
|
+
createPeerId
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-XWVFKUUD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"sourcesContent":["import { randomBytes, randomUUID } from \"node:crypto\";\nimport process from \"node:process\";\n\nexport const packageVersion = \"1.1.3\";\nexport const defaultApiBaseUrl = \"https://curly.ng\";\n\nexport type GlobalCommandOptions = {\n apiBaseUrl?: string;\n};\n\nexport function resolveApiBaseUrl(options: GlobalCommandOptions): string {\n return options.apiBaseUrl ?? process.env.CNGKIT_API_BASE_URL ?? defaultApiBaseUrl;\n}\n\nexport function createRoomCode(): string {\n return randomBytes(4).toString(\"hex\").toUpperCase();\n}\n\nexport function createPeerId(): string {\n return randomUUID();\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAO,aAAa;AAEb,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAM1B,SAAS,kBAAkB,SAAuC;AACvE,SAAO,QAAQ,cAAc,QAAQ,IAAI,uBAAuB;AAClE;AAEO,SAAS,iBAAyB;AACvC,SAAO,YAAY,CAAC,EAAE,SAAS,KAAK,EAAE,YAAY;AACpD;AAEO,SAAS,eAAuB;AACrC,SAAO,WAAW;AACpB;","names":[]}
|