cngkit 1.1.19 → 1.1.21
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/LICENSE +1 -1
- package/README.md +9 -9
- package/dist/chunk-52PGDSFU.js +42 -0
- package/dist/chunk-52PGDSFU.js.map +1 -0
- package/dist/{chunk-L6ZVQRSY.js → chunk-5WTRGYAO.js} +141 -52
- package/dist/chunk-5WTRGYAO.js.map +1 -0
- package/dist/{chunk-GBONV6XP.js → chunk-CVF2ODLP.js} +3 -3
- package/dist/{chunk-7SO75QXJ.js → chunk-DIJEVOVN.js} +109 -89
- package/dist/chunk-DIJEVOVN.js.map +1 -0
- package/dist/{chunk-3A6GRNEV.js → chunk-SKK2XLRZ.js} +21 -21
- package/dist/chunk-SKK2XLRZ.js.map +1 -0
- package/dist/{chunk-DBA3BZXP.js → chunk-SMTQ3W3F.js} +50 -10
- package/dist/chunk-SMTQ3W3F.js.map +1 -0
- package/dist/{chunk-TYDIBWZV.js → chunk-YJXAH7D5.js} +2 -2
- package/dist/cli.js +63 -24
- package/dist/cli.js.map +1 -1
- package/dist/commands/coderoom/index.js +3 -3
- package/dist/commands/coderoom/join.js +4 -4
- 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 +5 -5
- package/dist/commands/knowledges/cat.js +5 -5
- package/dist/commands/knowledges/files.js +5 -5
- package/dist/commands/knowledges/find.js +5 -5
- package/dist/commands/knowledges/glob.js +5 -5
- package/dist/commands/knowledges/grep.js +5 -5
- package/dist/commands/knowledges/head.js +5 -5
- package/dist/commands/knowledges/index.js +3 -3
- package/dist/commands/knowledges/list.js +5 -5
- package/dist/commands/knowledges/ls.js +5 -5
- package/dist/commands/knowledges/read.js +5 -5
- package/dist/commands/knowledges/realpath.js +6 -6
- package/dist/commands/knowledges/realpath.js.map +1 -1
- package/dist/commands/knowledges/search.js +5 -5
- package/dist/commands/knowledges/stat.js +5 -5
- package/dist/commands/knowledges/status.js +5 -5
- package/dist/commands/knowledges/tail.js +5 -5
- package/dist/commands/knowledges/tree.js +5 -5
- package/dist/commands/login.js +3 -3
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/scrub.js +37 -14
- package/dist/commands/scrub.js.map +1 -1
- package/dist/commands/transcripts.js +41 -21
- package/dist/commands/transcripts.js.map +1 -1
- package/package.json +2 -3
- package/dist/chunk-3A6GRNEV.js.map +0 -1
- package/dist/chunk-7SO75QXJ.js.map +0 -1
- package/dist/chunk-DBA3BZXP.js.map +0 -1
- package/dist/chunk-L6ZVQRSY.js.map +0 -1
- package/dist/chunk-X4E7NAN4.js +0 -26
- package/dist/chunk-X4E7NAN4.js.map +0 -1
- /package/dist/{chunk-GBONV6XP.js.map → chunk-CVF2ODLP.js.map} +0 -0
- /package/dist/{chunk-TYDIBWZV.js.map → chunk-YJXAH7D5.js.map} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/cngkit)
|
|
4
4
|
[](https://nodejs.org/)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
CNG operator CLI for shared code rooms, safe local cleanup, local agent transcript
|
|
7
7
|
inspection, and terminal access to the hosted Harness knowledge catalog.
|
|
8
8
|
|
|
9
9
|
`cngkit` is built for developers and AI agents who need practical commands that work
|
|
@@ -54,12 +54,12 @@ The CLI currently has six main jobs:
|
|
|
54
54
|
- **Transcripts**: inspect local Claude and Codex transcript files from the terminal.
|
|
55
55
|
- **Knowledges**: traverse, search, and read the hosted Harness knowledge catalog.
|
|
56
56
|
- **Hooks**: install Hookify forwarding hooks into supported AI-assisted coding tools.
|
|
57
|
-
- **Hookify**: forward local hook events
|
|
57
|
+
- **Hookify**: forward local hook events for server-side hook processing.
|
|
58
58
|
|
|
59
59
|
## Coderoom
|
|
60
60
|
|
|
61
61
|
Coderoom is a live room for quickly sharing a working tree with another developer or agent.
|
|
62
|
-
One machine starts a room, another joins with the room code, and the
|
|
62
|
+
One machine starts a room, another joins with the room code, and the backend relays
|
|
63
63
|
file changes.
|
|
64
64
|
|
|
65
65
|
Start a room:
|
|
@@ -86,7 +86,7 @@ received change wins.
|
|
|
86
86
|
|
|
87
87
|
## Harness Knowledges
|
|
88
88
|
|
|
89
|
-
The `knowledges` commands read the Cloudflare-backed Harness catalog
|
|
89
|
+
The `knowledges` commands read the Cloudflare-backed Harness catalog. They are
|
|
90
90
|
read-only and designed for AI-friendly terminal use.
|
|
91
91
|
|
|
92
92
|
Check catalog health:
|
|
@@ -150,16 +150,16 @@ cngkit --format json knowledges stat /libraries/lib-cloudflare/TOPIC.md
|
|
|
150
150
|
cngkit --format json knowledges search "vector search" --limit 5
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
Catalog
|
|
153
|
+
Catalog paths are rooted at the Harness topics folder. For example:
|
|
154
154
|
|
|
155
155
|
```text
|
|
156
156
|
/libraries/lib-cloudflare/TOPIC.md
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
-
|
|
159
|
+
means:
|
|
160
160
|
|
|
161
161
|
```text
|
|
162
|
-
|
|
162
|
+
~/.agents/topics/libraries/lib-cloudflare/TOPIC.md
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
The `knowledges` command set is stateless. It does not keep a working directory and does
|
|
@@ -228,7 +228,7 @@ does not resolve `cngkit@latest` through npm on every event.
|
|
|
228
228
|
`cngkit@latest` handlers, then reports the exact files, handler counts, and event names
|
|
229
229
|
it changed.
|
|
230
230
|
|
|
231
|
-
`hookify` is the
|
|
231
|
+
`hookify` is the hosted hook processing surface. The first command is intentionally
|
|
232
232
|
small: it reads stdin and forwards the raw payload to the backend. The backend can return
|
|
233
233
|
the hook result immediately or return a request id for workflow-backed processing; the CLI
|
|
234
234
|
polls until the final stdout, stderr, and exit code are ready.
|
|
@@ -270,7 +270,7 @@ Search recent transcript entries:
|
|
|
270
270
|
cngkit transcripts grep "deploy failed" --source all --file-limit 60 --limit 20
|
|
271
271
|
```
|
|
272
272
|
|
|
273
|
-
Transcript commands are local-only. They do not upload transcript content to
|
|
273
|
+
Transcript commands are local-only. They do not upload transcript content to the backend.
|
|
274
274
|
By default, they print user and assistant text and skip internal prompt, hook, and tool noise.
|
|
275
275
|
Use `--include-internal` when debugging transcript plumbing.
|
|
276
276
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommandOutputMessages,
|
|
3
|
+
createCommandOutput,
|
|
4
|
+
formatError
|
|
5
|
+
} from "./chunk-DIJEVOVN.js";
|
|
6
|
+
|
|
7
|
+
// src/cli/command-runner.tsx
|
|
8
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { useApp } from "ink";
|
|
10
|
+
import { jsx } from "react/jsx-runtime";
|
|
11
|
+
function CommandRunner({ run }) {
|
|
12
|
+
const { exit } = useApp();
|
|
13
|
+
const nextMessageIdRef = useRef(1);
|
|
14
|
+
const [messages, setMessages] = useState([]);
|
|
15
|
+
const appendMessage = useCallback((message) => {
|
|
16
|
+
const nextMessage = {
|
|
17
|
+
...message,
|
|
18
|
+
id: nextMessageIdRef.current
|
|
19
|
+
};
|
|
20
|
+
nextMessageIdRef.current += 1;
|
|
21
|
+
setMessages((currentMessages) => [...currentMessages, nextMessage]);
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const output = createCommandOutput({
|
|
25
|
+
appendMessage,
|
|
26
|
+
stdout: process.stdout,
|
|
27
|
+
stderr: process.stderr
|
|
28
|
+
});
|
|
29
|
+
void run(output).catch((error) => {
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
output.error(formatError(error));
|
|
32
|
+
}).finally(() => {
|
|
33
|
+
setTimeout(() => exit(), 0);
|
|
34
|
+
});
|
|
35
|
+
}, [appendMessage, exit, run]);
|
|
36
|
+
return /* @__PURE__ */ jsx(CommandOutputMessages, { messages });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
CommandRunner
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=chunk-52PGDSFU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/command-runner.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useApp } from \"ink\";\n\nimport {\n CommandOutputMessages,\n createCommandOutput,\n formatError,\n type CommandOutput,\n type CommandOutputMessage,\n type CommandOutputMessagePayload,\n} from \"../shared/output.js\";\n\ntype CommandRunnerProps = {\n readonly run: (output: CommandOutput) => Promise<void>;\n};\n\nexport function CommandRunner({ run }: CommandRunnerProps) {\n const { exit } = useApp();\n const nextMessageIdRef = useRef(1);\n const [messages, setMessages] = useState<CommandOutputMessage[]>([]);\n const appendMessage = useCallback((message: CommandOutputMessagePayload) => {\n const nextMessage: CommandOutputMessage = {\n ...message,\n id: nextMessageIdRef.current,\n };\n nextMessageIdRef.current += 1;\n setMessages((currentMessages) => [...currentMessages, nextMessage]);\n }, []);\n\n useEffect(() => {\n const output = createCommandOutput({\n appendMessage,\n stdout: process.stdout,\n stderr: process.stderr,\n });\n\n void run(output)\n .catch((error: unknown) => {\n process.exitCode = 1;\n output.error(formatError(error));\n })\n .finally(() => {\n setTimeout(() => exit(), 0);\n });\n }, [appendMessage, exit, run]);\n\n return <CommandOutputMessages messages={messages} />;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAAS,cAAc;AA6Cd;AA9BF,SAAS,cAAc,EAAE,IAAI,GAAuB;AACzD,QAAM,EAAE,KAAK,IAAI,OAAO;AACxB,QAAM,mBAAmB,OAAO,CAAC;AACjC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAiC,CAAC,CAAC;AACnE,QAAM,gBAAgB,YAAY,CAAC,YAAyC;AAC1E,UAAM,cAAoC;AAAA,MACxC,GAAG;AAAA,MACH,IAAI,iBAAiB;AAAA,IACvB;AACA,qBAAiB,WAAW;AAC5B,gBAAY,CAAC,oBAAoB,CAAC,GAAG,iBAAiB,WAAW,CAAC;AAAA,EACpE,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,UAAM,SAAS,oBAAoB;AAAA,MACjC;AAAA,MACA,QAAQ,QAAQ;AAAA,MAChB,QAAQ,QAAQ;AAAA,IAClB,CAAC;AAED,SAAK,IAAI,MAAM,EACZ,MAAM,CAAC,UAAmB;AACzB,cAAQ,WAAW;AACnB,aAAO,MAAM,YAAY,KAAK,CAAC;AAAA,IACjC,CAAC,EACA,QAAQ,MAAM;AACb,iBAAW,MAAM,KAAK,GAAG,CAAC;AAAA,IAC5B,CAAC;AAAA,EACL,GAAG,CAAC,eAAe,MAAM,GAAG,CAAC;AAE7B,SAAO,oBAAC,yBAAsB,UAAoB;AACpD;","names":[]}
|
|
@@ -7,10 +7,13 @@ import {
|
|
|
7
7
|
} from "./chunk-XQGLUQFM.js";
|
|
8
8
|
import {
|
|
9
9
|
createCngApiClient
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YJXAH7D5.js";
|
|
11
11
|
import {
|
|
12
12
|
resolveOutputFormat
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DIJEVOVN.js";
|
|
14
|
+
|
|
15
|
+
// src/features/knowledges/run-knowledges-command.ts
|
|
16
|
+
import { createElement } from "react";
|
|
14
17
|
|
|
15
18
|
// src/features/knowledges/knowledges-api.ts
|
|
16
19
|
function createKnowledgesApi(options) {
|
|
@@ -72,6 +75,7 @@ function createKnowledgesApi(options) {
|
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
// src/features/knowledges/knowledges-input.ts
|
|
78
|
+
var storedTopicsRoot = "skills/knowledges/topics";
|
|
75
79
|
function normalizeAudienceId(value) {
|
|
76
80
|
if (value === void 0) {
|
|
77
81
|
return void 0;
|
|
@@ -92,12 +96,13 @@ function normalizeAudienceId(value) {
|
|
|
92
96
|
function normalizeCatalogPath(value) {
|
|
93
97
|
const trimmed = value.trim();
|
|
94
98
|
if (trimmed === "/" || trimmed === "") {
|
|
95
|
-
return
|
|
99
|
+
return storedTopicsRoot;
|
|
96
100
|
}
|
|
97
101
|
const relativePath = trimmed.replace(/^\/+/, "");
|
|
98
|
-
if (relativePath.startsWith(
|
|
102
|
+
if (relativePath === storedTopicsRoot || relativePath.startsWith(`${storedTopicsRoot}/`)) {
|
|
99
103
|
return relativePath;
|
|
100
104
|
}
|
|
105
|
+
const topicRelativePath = relativePath.startsWith("topics/") ? relativePath.slice("topics/".length) : relativePath;
|
|
101
106
|
const [firstSegment, ...restSegments] = relativePath.split("/");
|
|
102
107
|
if (!firstSegment) {
|
|
103
108
|
return relativePath;
|
|
@@ -113,18 +118,28 @@ function normalizeCatalogPath(value) {
|
|
|
113
118
|
case "procedures":
|
|
114
119
|
case "protocols":
|
|
115
120
|
case "tools":
|
|
116
|
-
return
|
|
121
|
+
return `${storedTopicsRoot}/${firstSegment}${restSegments.length > 0 ? `/${restSegments.join("/")}` : ""}`;
|
|
117
122
|
default:
|
|
118
|
-
return
|
|
123
|
+
return `${storedTopicsRoot}/${topicRelativePath}`;
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
126
|
function normalizeFilesystemCatalogPath(value) {
|
|
122
127
|
const trimmed = value.trim();
|
|
123
128
|
if (trimmed === "/" || trimmed === "") {
|
|
124
|
-
return
|
|
129
|
+
return storedTopicsRoot;
|
|
125
130
|
}
|
|
126
131
|
return normalizeCatalogPath(trimmed);
|
|
127
132
|
}
|
|
133
|
+
function formatCatalogPathForDisplay(value) {
|
|
134
|
+
const normalized = value.replace(/\/+$/, "");
|
|
135
|
+
if (normalized === storedTopicsRoot) {
|
|
136
|
+
return "/";
|
|
137
|
+
}
|
|
138
|
+
if (normalized.startsWith(`${storedTopicsRoot}/`)) {
|
|
139
|
+
return `/${normalized.slice(storedTopicsRoot.length + 1)}`;
|
|
140
|
+
}
|
|
141
|
+
return value;
|
|
142
|
+
}
|
|
128
143
|
function normalizeGrepMode(value) {
|
|
129
144
|
if (value === void 0) {
|
|
130
145
|
return "content";
|
|
@@ -139,6 +154,102 @@ function normalizeGrepMode(value) {
|
|
|
139
154
|
}
|
|
140
155
|
}
|
|
141
156
|
|
|
157
|
+
// src/features/knowledges/knowledges-output.tsx
|
|
158
|
+
import { Box, Text } from "ink";
|
|
159
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
160
|
+
function KnowCatalogSummary({ catalog }) {
|
|
161
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
162
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
163
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "Catalog: " }),
|
|
164
|
+
catalog.name
|
|
165
|
+
] }),
|
|
166
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
167
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "Files: " }),
|
|
168
|
+
catalog.files
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
171
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "Blobs: " }),
|
|
172
|
+
catalog.blobs
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
175
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: "Database: " }),
|
|
176
|
+
catalog.database.engine,
|
|
177
|
+
" (",
|
|
178
|
+
catalog.database.binding,
|
|
179
|
+
")"
|
|
180
|
+
] })
|
|
181
|
+
] });
|
|
182
|
+
}
|
|
183
|
+
function KnowAudienceList({ audiences }) {
|
|
184
|
+
if (audiences.length === 0) {
|
|
185
|
+
return /* @__PURE__ */ jsx(Text, { color: "yellow", children: "No audiences available." });
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: audiences.map((audience) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
188
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
189
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: audience.id }),
|
|
190
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
191
|
+
" - ",
|
|
192
|
+
audience.label
|
|
193
|
+
] })
|
|
194
|
+
] }),
|
|
195
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: singleLine(audience.help) })
|
|
196
|
+
] }, audience.id)) });
|
|
197
|
+
}
|
|
198
|
+
function KnowSearchResults({
|
|
199
|
+
results
|
|
200
|
+
}) {
|
|
201
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: results.map((result, index) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
202
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
203
|
+
/* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
|
|
204
|
+
index + 1,
|
|
205
|
+
". "
|
|
206
|
+
] }),
|
|
207
|
+
/* @__PURE__ */ jsx(Text, { bold: true, children: result.title }),
|
|
208
|
+
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
209
|
+
" (",
|
|
210
|
+
result.topicName,
|
|
211
|
+
")"
|
|
212
|
+
] })
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
215
|
+
"score ",
|
|
216
|
+
result.score.toFixed(3),
|
|
217
|
+
" | ",
|
|
218
|
+
formatCatalogPathForDisplay(result.path)
|
|
219
|
+
] }),
|
|
220
|
+
/* @__PURE__ */ jsx(Text, { children: singleLine(result.description || result.contentPreview) })
|
|
221
|
+
] }, result.id)) });
|
|
222
|
+
}
|
|
223
|
+
function KnowTopicList({ topics }) {
|
|
224
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: topics.map((topic) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
225
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
226
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: topic.name }),
|
|
227
|
+
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
228
|
+
" [",
|
|
229
|
+
topic.type,
|
|
230
|
+
"]"
|
|
231
|
+
] })
|
|
232
|
+
] }),
|
|
233
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
234
|
+
topic.title,
|
|
235
|
+
" | files ",
|
|
236
|
+
topic.fileCount,
|
|
237
|
+
" | rating ",
|
|
238
|
+
topic.rating
|
|
239
|
+
] }),
|
|
240
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: singleLine(topic.description) })
|
|
241
|
+
] }, topic.id)) });
|
|
242
|
+
}
|
|
243
|
+
function KnowTopicFileList({ files }) {
|
|
244
|
+
return /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: files.map((file) => {
|
|
245
|
+
const title = file.display_title ?? file.title ?? file.topic_name ?? "Untitled";
|
|
246
|
+
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
247
|
+
/* @__PURE__ */ jsx(Text, { color: "cyan", children: formatCatalogPathForDisplay(file.path) }),
|
|
248
|
+
/* @__PURE__ */ jsx(Text, { dimColor: true, children: title })
|
|
249
|
+
] }, `${file.path}-${file.sha256}`);
|
|
250
|
+
}) });
|
|
251
|
+
}
|
|
252
|
+
|
|
142
253
|
// src/features/knowledges/run-knowledges-command.ts
|
|
143
254
|
async function runKnowStatusCommand(options, output, dependencies) {
|
|
144
255
|
const api = dependencies?.api ?? createKnowledgesApi(options);
|
|
@@ -147,13 +258,7 @@ async function runKnowStatusCommand(options, output, dependencies) {
|
|
|
147
258
|
output.raw(formatJson(response.data));
|
|
148
259
|
return;
|
|
149
260
|
}
|
|
150
|
-
|
|
151
|
-
`Catalog: ${response.data.name}`,
|
|
152
|
-
`Files: ${response.data.files}`,
|
|
153
|
-
`Blobs: ${response.data.blobs}`,
|
|
154
|
-
`Database: ${response.data.database.engine} (${response.data.database.binding})`
|
|
155
|
-
];
|
|
156
|
-
output.info(lines.join("\n"));
|
|
261
|
+
output.component(createElement(KnowCatalogSummary, { catalog: response.data }));
|
|
157
262
|
}
|
|
158
263
|
async function runKnowAudiencesCommand(options, output, dependencies) {
|
|
159
264
|
const api = dependencies?.api ?? createKnowledgesApi(options);
|
|
@@ -162,11 +267,7 @@ async function runKnowAudiencesCommand(options, output, dependencies) {
|
|
|
162
267
|
output.raw(formatJson(response.data));
|
|
163
268
|
return;
|
|
164
269
|
}
|
|
165
|
-
|
|
166
|
-
`${audience.id} - ${audience.label}`,
|
|
167
|
-
` ${singleLine(audience.help)}`
|
|
168
|
-
]);
|
|
169
|
-
output.info(lines.length > 0 ? lines.join("\n") : "No audiences available.");
|
|
270
|
+
output.component(createElement(KnowAudienceList, { audiences: response.data.audiences }));
|
|
170
271
|
}
|
|
171
272
|
async function runKnowSearchCommand(query, options, output, dependencies) {
|
|
172
273
|
if (!query) {
|
|
@@ -178,13 +279,8 @@ async function runKnowSearchCommand(query, options, output, dependencies) {
|
|
|
178
279
|
output.raw(formatJson(response.data));
|
|
179
280
|
return;
|
|
180
281
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
` score ${result.score.toFixed(3)} | ${result.path}`,
|
|
184
|
-
` ${singleLine(result.description || result.contentPreview)}`
|
|
185
|
-
]);
|
|
186
|
-
if (lines.length > 0) {
|
|
187
|
-
output.info(lines.join("\n"));
|
|
282
|
+
if (response.data.results.length > 0) {
|
|
283
|
+
output.component(createElement(KnowSearchResults, { results: response.data.results }));
|
|
188
284
|
return;
|
|
189
285
|
}
|
|
190
286
|
output.warning(`No results for "${query}".`);
|
|
@@ -204,13 +300,8 @@ async function runKnowListCommand(query, options, output, dependencies) {
|
|
|
204
300
|
output.raw(formatJson({ topics, total: topics.length }));
|
|
205
301
|
return;
|
|
206
302
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
` ${topic.title} | files ${topic.fileCount} | rating ${topic.rating}`,
|
|
210
|
-
` ${singleLine(topic.description)}`
|
|
211
|
-
]);
|
|
212
|
-
if (lines.length > 0) {
|
|
213
|
-
output.info(lines.join("\n"));
|
|
303
|
+
if (topics.length > 0) {
|
|
304
|
+
output.component(createElement(KnowTopicList, { topics }));
|
|
214
305
|
return;
|
|
215
306
|
}
|
|
216
307
|
output.warning("No matching topics.");
|
|
@@ -226,13 +317,8 @@ async function runKnowFilesCommand(query, options, output, dependencies) {
|
|
|
226
317
|
output.raw(formatJson(response.data));
|
|
227
318
|
return;
|
|
228
319
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return `${file.path}
|
|
232
|
-
${title}`;
|
|
233
|
-
});
|
|
234
|
-
if (lines.length > 0) {
|
|
235
|
-
output.info(lines.join("\n"));
|
|
320
|
+
if (response.data.files.length > 0) {
|
|
321
|
+
output.component(createElement(KnowTopicFileList, { files: response.data.files }));
|
|
236
322
|
return;
|
|
237
323
|
}
|
|
238
324
|
output.warning("No matching files.");
|
|
@@ -318,7 +404,7 @@ async function runKnowGrepCommand(pattern, options, output, dependencies) {
|
|
|
318
404
|
if (response.data.mode === "files_with_matches") {
|
|
319
405
|
const files = limit ? response.data.files.slice(0, limit) : response.data.files;
|
|
320
406
|
if (files.length > 0) {
|
|
321
|
-
output.raw(files.join("\n"));
|
|
407
|
+
output.raw(files.map(formatCatalogPathForDisplay).join("\n"));
|
|
322
408
|
return;
|
|
323
409
|
}
|
|
324
410
|
output.warning(`No files matched "${pattern}".`);
|
|
@@ -326,7 +412,9 @@ async function runKnowGrepCommand(pattern, options, output, dependencies) {
|
|
|
326
412
|
}
|
|
327
413
|
if (response.data.mode === "count") {
|
|
328
414
|
const counts = limit ? response.data.counts.slice(0, limit) : response.data.counts;
|
|
329
|
-
const lines2 = counts.map(
|
|
415
|
+
const lines2 = counts.map(
|
|
416
|
+
(count) => `${formatCatalogPathForDisplay(count.file_path)}: ${count.match_count}`
|
|
417
|
+
);
|
|
330
418
|
if (lines2.length > 0) {
|
|
331
419
|
output.raw(lines2.join("\n"));
|
|
332
420
|
return;
|
|
@@ -336,7 +424,7 @@ async function runKnowGrepCommand(pattern, options, output, dependencies) {
|
|
|
336
424
|
}
|
|
337
425
|
const matches = limit ? response.data.matches.slice(0, limit) : response.data.matches;
|
|
338
426
|
const lines = matches.flatMap((match) => [
|
|
339
|
-
`${match.file_path}:${match.line_number}`,
|
|
427
|
+
`${formatCatalogPathForDisplay(match.file_path)}:${match.line_number}`,
|
|
340
428
|
...match.context_before.map((line) => ` ${line}`),
|
|
341
429
|
`> ${match.line}`,
|
|
342
430
|
...match.context_after.map((line) => ` ${line}`)
|
|
@@ -361,7 +449,7 @@ async function runKnowGlobCommand(pattern, options, output, dependencies) {
|
|
|
361
449
|
const files = limit ? response.data.files.slice(0, limit) : response.data.files;
|
|
362
450
|
const wasClientTruncated = limit ? response.data.files.length > limit : false;
|
|
363
451
|
if (files.length > 0) {
|
|
364
|
-
output.raw(files.join("\n"));
|
|
452
|
+
output.raw(files.map(formatCatalogPathForDisplay).join("\n"));
|
|
365
453
|
} else {
|
|
366
454
|
output.warning("No matching files.");
|
|
367
455
|
}
|
|
@@ -386,7 +474,7 @@ async function runKnowLsCommand(path, options, output, dependencies) {
|
|
|
386
474
|
if (lines.length > 0) {
|
|
387
475
|
output.raw(lines.join("\n"));
|
|
388
476
|
} else {
|
|
389
|
-
output.warning(`No entries under ${response.data.path}.`);
|
|
477
|
+
output.warning(`No entries under ${formatCatalogPathForDisplay(response.data.path)}.`);
|
|
390
478
|
}
|
|
391
479
|
if (response.data.truncated) {
|
|
392
480
|
output.warning(`[truncated: ${response.data.total_entries} total entries]`);
|
|
@@ -427,7 +515,7 @@ async function runKnowFindCommand(path, options, output, dependencies) {
|
|
|
427
515
|
if (lines.length > 0) {
|
|
428
516
|
output.raw(lines.join("\n"));
|
|
429
517
|
} else {
|
|
430
|
-
output.warning(`No entries found under ${response.data.path}.`);
|
|
518
|
+
output.warning(`No entries found under ${formatCatalogPathForDisplay(response.data.path)}.`);
|
|
431
519
|
}
|
|
432
520
|
if (response.data.truncated) {
|
|
433
521
|
output.warning(`[truncated: ${response.data.total_entries} total entries]`);
|
|
@@ -451,7 +539,7 @@ async function runKnowRealpathCommand(path, options, output) {
|
|
|
451
539
|
if (!path) {
|
|
452
540
|
throw new Error("Missing path. Usage: cngkit knowledges realpath <path>");
|
|
453
541
|
}
|
|
454
|
-
const resolvedPath = normalizeFilesystemCatalogPath(path);
|
|
542
|
+
const resolvedPath = formatCatalogPathForDisplay(normalizeFilesystemCatalogPath(path));
|
|
455
543
|
if (shouldPrintJson(options)) {
|
|
456
544
|
output.raw(formatJson({ path: resolvedPath }));
|
|
457
545
|
return;
|
|
@@ -492,19 +580,20 @@ function stripRootPath(path, rootPath) {
|
|
|
492
580
|
return path;
|
|
493
581
|
}
|
|
494
582
|
function formatTreeDirectoryName(path) {
|
|
495
|
-
const normalizedPath = path.replace(/\/+$/, "");
|
|
583
|
+
const normalizedPath = formatCatalogPathForDisplay(path).replace(/\/+$/, "");
|
|
496
584
|
return normalizedPath ? `${normalizedPath}/` : "/";
|
|
497
585
|
}
|
|
498
586
|
function formatShellFilesystemEntryName(entry) {
|
|
499
587
|
return entry.type === "directory" ? `${entry.name}/` : entry.name;
|
|
500
588
|
}
|
|
501
589
|
function formatFilesystemEntryPath(entry) {
|
|
502
|
-
|
|
590
|
+
const displayPath = formatCatalogPathForDisplay(entry.path);
|
|
591
|
+
return entry.type === "directory" ? `${displayPath}/` : displayPath;
|
|
503
592
|
}
|
|
504
593
|
function formatLongFilesystemEntryLine(entry) {
|
|
505
594
|
const fields = [
|
|
506
595
|
entry.type,
|
|
507
|
-
entry.path,
|
|
596
|
+
formatCatalogPathForDisplay(entry.path),
|
|
508
597
|
...formatOptionalEntryFields([
|
|
509
598
|
["size", entry.size],
|
|
510
599
|
["files", entry.file_count],
|
|
@@ -523,7 +612,7 @@ function coerceOptionalFiniteNumber(value) {
|
|
|
523
612
|
}
|
|
524
613
|
function formatFilesystemStat(entry) {
|
|
525
614
|
const fields = [
|
|
526
|
-
["path", entry.path],
|
|
615
|
+
["path", formatCatalogPathForDisplay(entry.path)],
|
|
527
616
|
["type", entry.type],
|
|
528
617
|
["name", entry.name],
|
|
529
618
|
["depth", entry.depth],
|
|
@@ -566,4 +655,4 @@ export {
|
|
|
566
655
|
runKnowStatCommand,
|
|
567
656
|
runKnowRealpathCommand
|
|
568
657
|
};
|
|
569
|
-
//# sourceMappingURL=chunk-
|
|
658
|
+
//# sourceMappingURL=chunk-5WTRGYAO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/features/knowledges/run-knowledges-command.ts","../src/features/knowledges/knowledges-api.ts","../src/features/knowledges/knowledges-input.ts","../src/features/knowledges/knowledges-output.tsx"],"sourcesContent":["import { createElement } from \"react\";\n\nimport { renderKnowledgesHelp } from \"../../cli/help-specs.js\";\nimport type { CngApi } from \"@cng/client\";\nimport {\n coerceLimit,\n coerceOptionalNumber,\n formatJson,\n optionalJoinedArgument,\n shouldPrintJson,\n type JsonOutputOptions,\n type NumberOption,\n} from \"../../shared/command-utils.js\";\nimport { resolveOutputFormat } from \"../../shared/config.js\";\nimport type { GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\nimport { createKnowledgesApi, type KnowCommandDependencies } from \"./knowledges-api.js\";\nimport {\n formatCatalogPathForDisplay,\n normalizeAudienceId,\n normalizeCatalogPath,\n normalizeFilesystemCatalogPath,\n normalizeGrepMode,\n} from \"./knowledges-input.js\";\nimport {\n KnowAudienceList,\n KnowCatalogSummary,\n KnowSearchResults,\n KnowTopicFileList,\n KnowTopicList,\n} from \"./knowledges-output.js\";\n\nexport type KnowStatusCommandOptions = GlobalCommandOptions & JsonOutputOptions;\n\nexport type KnowAudiencesCommandOptions = GlobalCommandOptions & JsonOutputOptions;\n\nexport type KnowSearchCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n limit?: NumberOption;\n };\n\nexport type KnowListCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n limit?: NumberOption;\n };\n\nexport type KnowFilesCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n audience?: string;\n limit?: NumberOption;\n };\n\nexport type KnowReadCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n offset?: NumberOption;\n limit?: NumberOption;\n };\n\nexport type KnowCatCommandOptions = GlobalCommandOptions & JsonOutputOptions;\n\nexport type KnowHeadCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n lines?: NumberOption;\n };\n\nexport type KnowTailCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n lines?: NumberOption;\n };\n\nexport type KnowGrepCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n path?: string;\n include?: string;\n outputMode?: string;\n context?: NumberOption;\n caseInsensitive?: boolean;\n limit?: NumberOption;\n };\n\nexport type KnowGlobCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n path?: string;\n limit?: NumberOption;\n };\n\nexport type KnowLsCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n limit?: NumberOption;\n long?: boolean;\n };\n\nexport type KnowTreeCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n depth?: NumberOption;\n limit?: NumberOption;\n };\n\nexport type KnowFindCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n name?: string;\n type?: \"file\" | \"directory\";\n maxDepth?: NumberOption;\n limit?: NumberOption;\n };\n\nexport type KnowStatCommandOptions = GlobalCommandOptions & JsonOutputOptions;\n\nexport type KnowRealpathCommandOptions = GlobalCommandOptions & JsonOutputOptions;\n\nexport type KnowledgesCliOptions = KnowFilesCommandOptions &\n KnowGlobCommandOptions &\n KnowGrepCommandOptions &\n KnowCatCommandOptions &\n KnowHeadCommandOptions &\n KnowTailCommandOptions &\n KnowReadCommandOptions &\n KnowSearchCommandOptions &\n KnowLsCommandOptions &\n KnowTreeCommandOptions &\n KnowFindCommandOptions;\n\nexport async function runKnowledgesCommand(\n args: string[] | undefined,\n options: KnowledgesCliOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const [subcommand, ...subcommandArgs] = args ?? [];\n\n if (subcommand === undefined || subcommand === \"help\") {\n output.component(renderKnowledgesHelp(subcommandArgs[0]));\n return;\n }\n\n switch (subcommand) {\n case \"status\":\n return runKnowStatusCommand(options, output, dependencies);\n case \"audiences\":\n return runKnowAudiencesCommand(options, output, dependencies);\n case \"search\":\n return runKnowSearchCommand(\n optionalJoinedArgument(subcommandArgs),\n options,\n output,\n dependencies\n );\n case \"list\":\n return runKnowListCommand(\n optionalJoinedArgument(subcommandArgs),\n options,\n output,\n dependencies\n );\n case \"files\":\n return runKnowFilesCommand(\n optionalJoinedArgument(subcommandArgs),\n options,\n output,\n dependencies\n );\n case \"read\":\n return runKnowReadCommand(subcommandArgs[0], options, output, dependencies);\n case \"cat\":\n return runKnowCatCommand(subcommandArgs[0], options, output, dependencies);\n case \"head\":\n return runKnowHeadCommand(subcommandArgs[0], options, output, dependencies);\n case \"tail\":\n return runKnowTailCommand(subcommandArgs[0], options, output, dependencies);\n case \"grep\":\n return runKnowGrepCommand(\n optionalJoinedArgument(subcommandArgs),\n options,\n output,\n dependencies\n );\n case \"glob\":\n return runKnowGlobCommand(\n optionalJoinedArgument(subcommandArgs),\n options,\n output,\n dependencies\n );\n case \"ls\":\n return runKnowLsCommand(subcommandArgs[0], options, output, dependencies);\n case \"tree\":\n return runKnowTreeCommand(subcommandArgs[0], options, output, dependencies);\n case \"find\":\n return runKnowFindCommand(subcommandArgs[0], options, output, dependencies);\n case \"stat\":\n return runKnowStatCommand(subcommandArgs[0], options, output, dependencies);\n case \"realpath\":\n return runKnowRealpathCommand(subcommandArgs[0], options, output);\n default:\n throw new Error(\n \"Missing knowledges command. Usage: cngkit knowledges <status|audiences|search|list|files|read|cat|head|tail|grep|glob|ls|tree|find|stat|realpath>\"\n );\n }\n}\n\nexport async function runKnowStatusCommand(\n options: KnowStatusCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.getCatalog();\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n output.component(createElement(KnowCatalogSummary, { catalog: response.data }));\n}\n\nexport async function runKnowAudiencesCommand(\n options: KnowAudiencesCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.listAudiences();\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n output.component(createElement(KnowAudienceList, { audiences: response.data.audiences }));\n}\n\nexport async function runKnowSearchCommand(\n query: string | undefined,\n options: KnowSearchCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!query) {\n throw new Error(\"Missing search query. Usage: cngkit knowledges search <query>\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.search(query, coerceLimit(options.limit, 5));\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n if (response.data.results.length > 0) {\n output.component(createElement(KnowSearchResults, { results: response.data.results }));\n return;\n }\n\n output.warning(`No results for \"${query}\".`);\n}\n\nexport async function runKnowListCommand(\n query: string | undefined,\n options: KnowListCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.listTopics();\n const limit = coerceLimit(options.limit, 25);\n const normalizedQuery = query?.toLowerCase();\n const topics = response.data.topics\n .filter((topic) => {\n if (!normalizedQuery) {\n return true;\n }\n return [topic.name, topic.title, topic.description, topic.type]\n .join(\" \")\n .toLowerCase()\n .includes(normalizedQuery);\n })\n .slice(0, limit);\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson({ topics, total: topics.length }));\n return;\n }\n\n if (topics.length > 0) {\n output.component(createElement(KnowTopicList, { topics }));\n return;\n }\n\n output.warning(\"No matching topics.\");\n}\n\nexport async function runKnowFilesCommand(\n query: string | undefined,\n options: KnowFilesCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.listFiles({\n query,\n audience: normalizeAudienceId(options.audience),\n limit: coerceLimit(options.limit, 25),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n if (response.data.files.length > 0) {\n output.component(createElement(KnowTopicFileList, { files: response.data.files }));\n return;\n }\n\n output.warning(\"No matching files.\");\n}\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\nexport async function runKnowCatCommand(\n filePath: string | undefined,\n options: KnowCatCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!filePath) {\n throw new Error(\"Missing file_path. Usage: cngkit knowledges cat <file_path>\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.read({\n filePath: normalizeCatalogPath(filePath),\n offset: 0,\n limit: 2000,\n });\n\n outputRawContent(response.data, options, output);\n}\n\nexport async function runKnowHeadCommand(\n filePath: string | undefined,\n options: KnowHeadCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!filePath) {\n throw new Error(\"Missing file_path. Usage: cngkit knowledges head <file_path> -n 10\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.read({\n filePath: normalizeCatalogPath(filePath),\n offset: 0,\n limit: coerceLimit(options.lines, 10, 2000),\n });\n\n outputRawContent(response.data, options, output);\n}\n\nexport async function runKnowTailCommand(\n filePath: string | undefined,\n options: KnowTailCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!filePath) {\n throw new Error(\"Missing file_path. Usage: cngkit knowledges tail <file_path> -n 10\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.tail({\n filePath: normalizeCatalogPath(filePath),\n lines: coerceLimit(options.lines, 10, 2000),\n });\n\n outputRawContent(response.data, options, output);\n}\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\nexport async function runKnowGlobCommand(\n pattern: string | undefined,\n options: KnowGlobCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const limit = options.limit !== undefined ? coerceOptionalNumber(options.limit) : undefined;\n const response = await api.glob({\n pattern: pattern ?? \"**/*.md\",\n path: normalizeCatalogPath(options.path ?? \"/\"),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n const files = limit ? response.data.files.slice(0, limit) : response.data.files;\n const wasClientTruncated = limit ? response.data.files.length > limit : false;\n\n if (files.length > 0) {\n output.raw(files.map(formatCatalogPathForDisplay).join(\"\\n\"));\n } else {\n output.warning(\"No matching files.\");\n }\n if (response.data.truncated || wasClientTruncated) {\n output.warning(`[truncated: ${response.data.total_files} total files]`);\n }\n}\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\nexport async function runKnowTreeCommand(\n path: string | undefined,\n options: KnowTreeCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.tree({\n path: normalizeFilesystemCatalogPath(path ?? \"/\"),\n depth: coerceLimit(options.depth, 3, 8),\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 lines = formatFilesystemTree(response.data.path, response.data.entries);\n output.raw(lines.join(\"\\n\"));\n\n if (response.data.truncated) {\n output.warning(`[truncated: ${response.data.total_entries} total entries]`);\n }\n}\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\nexport async function runKnowStatCommand(\n path: string | undefined,\n options: KnowStatCommandOptions,\n output: CommandOutput,\n dependencies?: KnowCommandDependencies\n): Promise<void> {\n if (!path) {\n throw new Error(\"Missing path. Usage: cngkit knowledges stat <path>\");\n }\n\n const api = dependencies?.api ?? createKnowledgesApi(options);\n const response = await api.statPath({\n path: normalizeFilesystemCatalogPath(path),\n });\n\n if (shouldPrintJson(options)) {\n output.raw(formatJson(response.data));\n return;\n }\n\n output.raw(formatFilesystemStat(response.data));\n}\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\nfunction compareFilesystemEntries(\n left: CngApi.HarnessFilesystemEntry,\n right: CngApi.HarnessFilesystemEntry\n): number {\n if (left.type !== right.type) {\n return left.type === \"directory\" ? -1 : 1;\n }\n\n return left.path.localeCompare(right.path);\n}\n\nfunction outputRawContent(\n data: CngApi.HarnessReadResponse,\n options: JsonOutputOptions,\n output: CommandOutput\n): void {\n if (shouldPrintJson(options)) {\n output.raw(formatJson(data));\n return;\n }\n\n output.raw(data.content);\n}\n\nfunction formatFilesystemTree(\n rootPath: string,\n entries: CngApi.HarnessFilesystemEntry[]\n): string[] {\n const normalizedRootPath = rootPath.replace(/\\/+$/, \"\");\n const rootLine = formatTreeDirectoryName(rootPath);\n const entryLines = [...entries].sort(compareFilesystemEntries).map((entry) => {\n const relativePath = stripRootPath(entry.path, normalizedRootPath);\n const segmentCount = relativePath.split(\"/\").filter(Boolean).length;\n const indent = \" \".repeat(Math.max(segmentCount - 1, 0));\n return `${indent}${formatShellFilesystemEntryName(entry)}`;\n });\n\n return [rootLine, ...entryLines];\n}\n\nfunction stripRootPath(path: string, rootPath: string): string {\n if (path === rootPath) {\n return \"\";\n }\n\n if (rootPath && path.startsWith(`${rootPath}/`)) {\n return path.slice(rootPath.length + 1);\n }\n\n return path;\n}\n\nfunction formatTreeDirectoryName(path: string): string {\n const normalizedPath = formatCatalogPathForDisplay(path).replace(/\\/+$/, \"\");\n return normalizedPath ? `${normalizedPath}/` : \"/\";\n}\n\nfunction formatShellFilesystemEntryName(entry: CngApi.HarnessFilesystemEntry): string {\n return entry.type === \"directory\" ? `${entry.name}/` : entry.name;\n}\n\nfunction formatFilesystemEntryPath(entry: CngApi.HarnessFilesystemEntry): string {\n const displayPath = formatCatalogPathForDisplay(entry.path);\n return entry.type === \"directory\" ? `${displayPath}/` : displayPath;\n}\n\nfunction formatLongFilesystemEntryLine(entry: CngApi.HarnessFilesystemEntry): string {\n const fields = [\n entry.type,\n formatCatalogPathForDisplay(entry.path),\n ...formatOptionalEntryFields([\n [\"size\", entry.size],\n [\"files\", entry.file_count],\n [\"children\", entry.child_count],\n [\"total_size\", entry.total_size],\n [\"sha256\", entry.sha256],\n [\"asset_kind\", entry.asset_kind],\n [\"topic\", entry.topic_name],\n ]),\n ];\n\n return fields.join(\"\\t\");\n}\n\nfunction coerceOptionalFiniteNumber(value: NumberOption | undefined): number | undefined {\n const normalizedValue = coerceOptionalNumber(value);\n return normalizedValue === undefined || Number.isNaN(normalizedValue)\n ? undefined\n : Math.max(1, Math.trunc(normalizedValue));\n}\n\nfunction formatFilesystemStat(entry: CngApi.HarnessFilesystemStatResponse): string {\n const fields: Array<[string, string | number | null]> = [\n [\"path\", formatCatalogPathForDisplay(entry.path)],\n [\"type\", entry.type],\n [\"name\", entry.name],\n [\"depth\", entry.depth],\n [\"size\", entry.size],\n [\"files\", entry.file_count],\n [\"children\", entry.child_count],\n [\"total_size\", entry.total_size],\n [\"sha256\", entry.sha256],\n [\"asset_kind\", entry.asset_kind],\n [\"title\", entry.title],\n [\"topic\", entry.topic_name],\n [\"updated_at\", entry.updated_at],\n ];\n\n return formatOptionalEntryFields(fields).join(\"\\n\");\n}\n\nfunction formatOptionalEntryFields(fields: Array<[string, string | number | null]>): string[] {\n return fields.flatMap(([key, value]) => {\n if (value === null || value === \"\") {\n return [];\n }\n\n return [`${key}=${value}`];\n });\n}\n","import type { CngApi } from \"@cng/client\";\n\nimport { createCngApiClient } from \"../../shared/api-client.js\";\nimport type { GlobalCommandOptions } from \"../../shared/config.js\";\n\nexport type KnowCommandDependencies = {\n api?: KnowledgesApi;\n};\n\nexport type KnowledgesApi = {\n getCatalog(): Promise<CngApi.HarnessCatalogSummaryApiResponse>;\n listAudiences(): Promise<CngApi.HarnessAudiencesApiResponse>;\n search(query: string, limit: number): Promise<CngApi.HarnessSemanticSearchApiResponse>;\n listTopics(): Promise<CngApi.HarnessTopicsApiResponse>;\n listFiles(options: {\n query?: string;\n audience?: CngApi.HarnessAudienceId;\n limit: number;\n }): Promise<CngApi.HarnessTopicAssetsApiResponse>;\n read(options: {\n filePath: string;\n offset?: number;\n limit: number;\n }): Promise<CngApi.HarnessReadApiResponse>;\n grep(options: {\n pattern: string;\n path: string;\n include: string;\n mode: CngApi.HarnessGrepOutputMode;\n context: number;\n ignoreCase: boolean;\n }): Promise<CngApi.HarnessGrepApiResponse>;\n glob(options: { pattern: string; path: string }): Promise<CngApi.HarnessGlobApiResponse>;\n listDirectory(options: {\n path: string;\n limit: number;\n }): Promise<CngApi.HarnessFilesystemLsApiResponse>;\n tree(options: {\n path: string;\n depth: number;\n limit: number;\n }): Promise<CngApi.HarnessFilesystemTreeApiResponse>;\n find(options: {\n path: string;\n name?: string;\n type?: CngApi.HarnessFilesystemFindType;\n maxDepth?: number;\n limit: number;\n }): Promise<CngApi.HarnessFilesystemFindApiResponse>;\n tail(options: {\n filePath: string;\n lines: number;\n }): Promise<CngApi.HarnessFilesystemTailApiResponse>;\n statPath(options: { path: string }): Promise<CngApi.HarnessFilesystemStatApiResponse>;\n};\n\nexport function createKnowledgesApi(options: GlobalCommandOptions): KnowledgesApi {\n const client = createCngApiClient(options);\n\n return {\n getCatalog: () => client.harnessKnowledges.getHarnessKnowledgesCatalog(),\n listAudiences: () => client.harnessKnowledges.listHarnessKnowledgesAudiences(),\n search: (query, limit) =>\n client.harnessKnowledges.searchHarnessKnowledges({\n q: query,\n limit,\n }),\n listTopics: () => client.harnessKnowledges.listHarnessKnowledgesTopics(),\n listFiles: ({ query, audience, limit }) =>\n client.harnessKnowledges.listHarnessTopicAssets({\n ...(query ? { q: query } : {}),\n ...(audience ? { audience } : {}),\n limit,\n }),\n read: ({ filePath, offset, limit }) =>\n client.harnessFilesystem.getHarnessFilesystemRead({\n file_path: filePath,\n offset,\n limit,\n }),\n grep: ({ pattern, path, include, mode, context, ignoreCase }) =>\n client.harnessFilesystem.getHarnessFilesystemGrep({\n pattern,\n path,\n include,\n output_mode: mode,\n context,\n case_insensitive: ignoreCase ? \"true\" : undefined,\n }),\n glob: ({ pattern, path }) =>\n client.harnessFilesystem.getHarnessFilesystemGlob({\n pattern,\n path,\n }),\n listDirectory: ({ path, limit }) =>\n client.harnessFilesystem.getHarnessFilesystemLs({\n path,\n limit,\n }),\n tree: ({ path, depth, limit }) =>\n client.harnessFilesystem.getHarnessFilesystemTree({\n path,\n depth,\n limit,\n }),\n find: ({ path, name, type, maxDepth, limit }) =>\n client.harnessFilesystem.getHarnessFilesystemFind({\n path,\n ...(name ? { name } : {}),\n ...(type ? { type } : {}),\n ...(maxDepth !== undefined ? { max_depth: maxDepth } : {}),\n limit,\n }),\n tail: ({ filePath, lines }) =>\n client.harnessFilesystem.getHarnessFilesystemTail({\n file_path: filePath,\n lines,\n }),\n statPath: ({ path }) =>\n client.harnessFilesystem.getHarnessFilesystemStat({\n path,\n }),\n };\n}\n","import type { CngApi } from \"@cng/client\";\n\nconst storedTopicsRoot = \"skills/knowledges/topics\";\n\nexport function normalizeAudienceId(value: string | undefined): CngApi.HarnessAudienceId | undefined {\n if (value === undefined) {\n return undefined;\n }\n\n switch (value) {\n case \"all\":\n case \"operators\":\n case \"builders\":\n case \"researchers\":\n case \"agent-makers\":\n return value;\n default:\n throw new Error(\n `Unknown audience \"${value}\". Run cngkit knowledges audiences to see supported values.`\n );\n }\n}\n\nexport function normalizeCatalogPath(value: string): string {\n const trimmed = value.trim();\n if (trimmed === \"/\" || trimmed === \"\") {\n return storedTopicsRoot;\n }\n\n const relativePath = trimmed.replace(/^\\/+/, \"\");\n if (relativePath === storedTopicsRoot || relativePath.startsWith(`${storedTopicsRoot}/`)) {\n return relativePath;\n }\n\n const topicRelativePath = relativePath.startsWith(\"topics/\")\n ? relativePath.slice(\"topics/\".length)\n : relativePath;\n\n const [firstSegment, ...restSegments] = relativePath.split(\"/\");\n if (!firstSegment) {\n return relativePath;\n }\n\n switch (firstSegment) {\n case \"concepts\":\n case \"domains\":\n case \"formats\":\n case \"languages\":\n case \"libraries\":\n case \"patterns\":\n case \"platforms\":\n case \"procedures\":\n case \"protocols\":\n case \"tools\":\n return `${storedTopicsRoot}/${firstSegment}${restSegments.length > 0 ? `/${restSegments.join(\"/\")}` : \"\"}`;\n default:\n return `${storedTopicsRoot}/${topicRelativePath}`;\n }\n}\n\nexport function normalizeFilesystemCatalogPath(value: string): string {\n const trimmed = value.trim();\n if (trimmed === \"/\" || trimmed === \"\") {\n return storedTopicsRoot;\n }\n\n return normalizeCatalogPath(trimmed);\n}\n\nexport function formatCatalogPathForDisplay(value: string): string {\n const normalized = value.replace(/\\/+$/, \"\");\n if (normalized === storedTopicsRoot) {\n return \"/\";\n }\n\n if (normalized.startsWith(`${storedTopicsRoot}/`)) {\n return `/${normalized.slice(storedTopicsRoot.length + 1)}`;\n }\n\n return value;\n}\n\nexport function normalizeGrepMode(value: string | undefined): CngApi.HarnessGrepOutputMode {\n if (value === undefined) {\n return \"content\";\n }\n\n switch (value) {\n case \"content\":\n case \"files_with_matches\":\n case \"count\":\n return value;\n default:\n throw new Error(\"Unknown grep mode. Use one of: content, files_with_matches, count.\");\n }\n}\n","import type { CngApi } from \"@cng/client\";\nimport { Box, Text } from \"ink\";\n\nimport { singleLine } from \"../../shared/command-utils.js\";\nimport { formatCatalogPathForDisplay } from \"./knowledges-input.js\";\n\nexport function KnowCatalogSummary({ catalog }: { readonly catalog: CngApi.HarnessCatalogSummary }) {\n return (\n <Box flexDirection=\"column\">\n <Text>\n <Text bold>Catalog: </Text>\n {catalog.name}\n </Text>\n <Text>\n <Text bold>Files: </Text>\n {catalog.files}\n </Text>\n <Text>\n <Text bold>Blobs: </Text>\n {catalog.blobs}\n </Text>\n <Text>\n <Text bold>Database: </Text>\n {catalog.database.engine} ({catalog.database.binding})\n </Text>\n </Box>\n );\n}\n\nexport function KnowAudienceList({ audiences }: { readonly audiences: readonly CngApi.HarnessAudience[] }) {\n if (audiences.length === 0) {\n return <Text color=\"yellow\">No audiences available.</Text>;\n }\n\n return (\n <Box flexDirection=\"column\">\n {audiences.map((audience) => (\n <Box flexDirection=\"column\" key={audience.id} marginBottom={1}>\n <Text>\n <Text color=\"cyan\">{audience.id}</Text>\n <Text> - {audience.label}</Text>\n </Text>\n <Text dimColor>{singleLine(audience.help)}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n\nexport function KnowSearchResults({\n results,\n}: {\n readonly results: readonly CngApi.HarnessSemanticSearchResult[];\n}) {\n return (\n <Box flexDirection=\"column\">\n {results.map((result, index) => (\n <Box flexDirection=\"column\" key={result.id} marginBottom={1}>\n <Text>\n <Text color=\"cyan\">{index + 1}. </Text>\n <Text bold>{result.title}</Text>\n <Text dimColor> ({result.topicName})</Text>\n </Text>\n <Text dimColor>\n score {result.score.toFixed(3)} | {formatCatalogPathForDisplay(result.path)}\n </Text>\n <Text>{singleLine(result.description || result.contentPreview)}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n\nexport function KnowTopicList({ topics }: { readonly topics: readonly CngApi.HarnessTopicSummary[] }) {\n return (\n <Box flexDirection=\"column\">\n {topics.map((topic) => (\n <Box flexDirection=\"column\" key={topic.id} marginBottom={1}>\n <Text>\n <Text color=\"cyan\">{topic.name}</Text>\n <Text dimColor> [{topic.type}]</Text>\n </Text>\n <Text>\n {topic.title} | files {topic.fileCount} | rating {topic.rating}\n </Text>\n <Text dimColor>{singleLine(topic.description)}</Text>\n </Box>\n ))}\n </Box>\n );\n}\n\nexport function KnowTopicFileList({ files }: { readonly files: readonly CngApi.HarnessTopicAsset[] }) {\n return (\n <Box flexDirection=\"column\">\n {files.map((file) => {\n const title = file.display_title ?? file.title ?? file.topic_name ?? \"Untitled\";\n\n return (\n <Box flexDirection=\"column\" key={`${file.path}-${file.sha256}`} marginBottom={1}>\n <Text color=\"cyan\">{formatCatalogPathForDisplay(file.path)}</Text>\n <Text dimColor>{title}</Text>\n </Box>\n );\n })}\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;;;ACwDvB,SAAS,oBAAoB,SAA8C;AAChF,QAAM,SAAS,mBAAmB,OAAO;AAEzC,SAAO;AAAA,IACL,YAAY,MAAM,OAAO,kBAAkB,4BAA4B;AAAA,IACvE,eAAe,MAAM,OAAO,kBAAkB,+BAA+B;AAAA,IAC7E,QAAQ,CAAC,OAAO,UACd,OAAO,kBAAkB,wBAAwB;AAAA,MAC/C,GAAG;AAAA,MACH;AAAA,IACF,CAAC;AAAA,IACH,YAAY,MAAM,OAAO,kBAAkB,4BAA4B;AAAA,IACvE,WAAW,CAAC,EAAE,OAAO,UAAU,MAAM,MACnC,OAAO,kBAAkB,uBAAuB;AAAA,MAC9C,GAAI,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC;AAAA,MAC5B,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;AAAA,MAC/B;AAAA,IAC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AA,IACvB,CAAC,cAAc,MAAM,UAAU;AAAA,IAC/B,CAAC,SAAS,MAAM,KAAK;AAAA,IACrB,CAAC,SAAS,MAAM,UAAU;AAAA,IAC1B,CAAC,cAAc,MAAM,UAAU;AAAA,EACjC;AAEA,SAAO,0BAA0B,MAAM,EAAE,KAAK,IAAI;AACpD;AAEA,SAAS,0BAA0B,QAA2D;AAC5F,SAAO,OAAO,QAAQ,CAAC,CAAC,KAAK,KAAK,MAAM;AACtC,QAAI,UAAU,QAAQ,UAAU,IAAI;AAClC,aAAO,CAAC;AAAA,IACV;AAEA,WAAO,CAAC,GAAG,GAAG,IAAI,KAAK,EAAE;AAAA,EAC3B,CAAC;AACH;","names":["lines"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readBackendHealth
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YJXAH7D5.js";
|
|
4
4
|
import {
|
|
5
5
|
createPeerId,
|
|
6
6
|
createRoomCode,
|
|
7
7
|
resolveApiBaseUrl
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DIJEVOVN.js";
|
|
9
9
|
|
|
10
10
|
// src/features/coderoom/run-coderoom-command.ts
|
|
11
11
|
import process2 from "process";
|
|
@@ -424,4 +424,4 @@ export {
|
|
|
424
424
|
runShareCommand,
|
|
425
425
|
runJoinCommand
|
|
426
426
|
};
|
|
427
|
-
//# sourceMappingURL=chunk-
|
|
427
|
+
//# sourceMappingURL=chunk-CVF2ODLP.js.map
|