cngkit 1.1.5 → 1.1.7
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 +7 -4
- package/dist/{chunk-TZRXQ6GR.js → chunk-EQEIX7N5.js} +3 -3
- package/dist/chunk-EQEIX7N5.js.map +1 -0
- package/dist/chunk-HUZZPV5E.js +411 -0
- package/dist/chunk-HUZZPV5E.js.map +1 -0
- package/dist/{chunk-YY2VGJ5N.js → chunk-MLKBG5YJ.js} +2 -2
- package/dist/{chunk-YY2VGJ5N.js.map → chunk-MLKBG5YJ.js.map} +1 -1
- package/dist/{chunk-UXMP5Z5P.js → chunk-QEZQGKFX.js} +13 -1364
- package/dist/{chunk-UXMP5Z5P.js.map → chunk-QEZQGKFX.js.map} +1 -1
- package/dist/chunk-QZEB4VMX.js +32 -0
- package/dist/chunk-QZEB4VMX.js.map +1 -0
- package/dist/chunk-TZKXST4G.js +291 -0
- package/dist/chunk-TZKXST4G.js.map +1 -0
- package/dist/{chunk-SSRUN6G5.js → chunk-VI5XQH3U.js} +3 -18
- package/dist/chunk-VI5XQH3U.js.map +1 -0
- package/dist/chunk-XDXRVTPK.js +18 -0
- package/dist/chunk-XDXRVTPK.js.map +1 -0
- package/dist/{chunk-SNTLRTQ2.js → chunk-Z4DDLEWR.js} +3 -3
- package/dist/chunk-Z4DDLEWR.js.map +1 -0
- package/dist/cli.js +8 -6
- package/dist/cli.js.map +1 -1
- package/dist/commands/coderoom/index.js +6 -5
- package/dist/commands/coderoom/index.js.map +1 -1
- package/dist/commands/coderoom/join.js +6 -5
- package/dist/commands/coderoom/join.js.map +1 -1
- package/dist/commands/coderoom/share.js +6 -5
- package/dist/commands/coderoom/share.js.map +1 -1
- package/dist/commands/index.js +5 -4
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/knowledges/audiences.js +8 -5
- package/dist/commands/knowledges/audiences.js.map +1 -1
- package/dist/commands/knowledges/files.js +8 -5
- package/dist/commands/knowledges/files.js.map +1 -1
- package/dist/commands/knowledges/glob.js +8 -5
- package/dist/commands/knowledges/glob.js.map +1 -1
- package/dist/commands/knowledges/grep.js +8 -5
- package/dist/commands/knowledges/grep.js.map +1 -1
- package/dist/commands/knowledges/index.js +6 -5
- package/dist/commands/knowledges/index.js.map +1 -1
- package/dist/commands/knowledges/list.js +8 -5
- package/dist/commands/knowledges/list.js.map +1 -1
- package/dist/commands/knowledges/read.js +8 -5
- package/dist/commands/knowledges/read.js.map +1 -1
- package/dist/commands/knowledges/search.js +8 -5
- package/dist/commands/knowledges/search.js.map +1 -1
- package/dist/commands/knowledges/status.js +8 -5
- package/dist/commands/knowledges/status.js.map +1 -1
- package/dist/commands/login.js +49 -6
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/scrub.js +256 -7
- package/dist/commands/scrub.js.map +1 -1
- package/dist/commands/transcripts.js +377 -6
- package/dist/commands/transcripts.js.map +1 -1
- package/package.json +15 -14
- package/dist/chunk-SNTLRTQ2.js.map +0 -1
- package/dist/chunk-SSRUN6G5.js.map +0 -1
- package/dist/chunk-TZRXQ6GR.js.map +0 -1
|
@@ -1,20 +1,391 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
coerceLimit,
|
|
3
|
+
formatJson,
|
|
4
|
+
optionalJoinedArgument,
|
|
5
|
+
singleLine
|
|
6
|
+
} from "../chunk-QZEB4VMX.js";
|
|
7
|
+
import {
|
|
8
|
+
formatCngkitHelp
|
|
9
|
+
} from "../chunk-VI5XQH3U.js";
|
|
5
10
|
import {
|
|
6
11
|
GlobalOptionsSchema,
|
|
7
12
|
TranscriptArgsSchema
|
|
8
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-MLKBG5YJ.js";
|
|
9
14
|
import {
|
|
10
15
|
CommandRunner
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-Z4DDLEWR.js";
|
|
17
|
+
import "../chunk-XDXRVTPK.js";
|
|
13
18
|
import "../chunk-PZ5AY32C.js";
|
|
14
19
|
|
|
15
20
|
// src/commands/transcripts.tsx
|
|
16
21
|
import { option } from "pastel";
|
|
17
22
|
import { z } from "zod";
|
|
23
|
+
|
|
24
|
+
// src/features/transcripts/reader.ts
|
|
25
|
+
import { promises as fs } from "fs";
|
|
26
|
+
import os from "os";
|
|
27
|
+
import path from "path";
|
|
28
|
+
var TranscriptSourceNames = ["codex", "claude"];
|
|
29
|
+
async function listTranscriptRecords(options2) {
|
|
30
|
+
const files = await discoverTranscriptFiles(options2.source);
|
|
31
|
+
const records = await Promise.all(files.slice(0, options2.limit).map(readTranscriptRecord));
|
|
32
|
+
return records;
|
|
33
|
+
}
|
|
34
|
+
async function readTranscriptEntries(options2) {
|
|
35
|
+
const file = await resolveTranscriptFile(options2.source, options2.target);
|
|
36
|
+
const entries = await readEntriesFromFile(file, options2.includeInternal);
|
|
37
|
+
return entries.slice(Math.max(0, entries.length - options2.limit));
|
|
38
|
+
}
|
|
39
|
+
async function grepTranscriptEntries(options2) {
|
|
40
|
+
const files = await discoverTranscriptFiles(options2.source);
|
|
41
|
+
const normalizedQuery = options2.query.toLowerCase();
|
|
42
|
+
const matches = [];
|
|
43
|
+
for (const file of files.slice(0, options2.fileLimit)) {
|
|
44
|
+
const entries = await readEntriesFromFile(file, options2.includeInternal);
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
if (entry.text.toLowerCase().includes(normalizedQuery)) {
|
|
47
|
+
matches.push(entry);
|
|
48
|
+
}
|
|
49
|
+
if (matches.length >= options2.limit) {
|
|
50
|
+
return matches;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return matches;
|
|
55
|
+
}
|
|
56
|
+
async function discoverTranscriptFiles(source) {
|
|
57
|
+
const sources = source === "all" ? TranscriptSourceNames : [source];
|
|
58
|
+
const records = await Promise.all(sources.flatMap((sourceName) => sourceRoots(sourceName)));
|
|
59
|
+
return records.flat().sort((left, right) => right.updatedAt.localeCompare(left.updatedAt));
|
|
60
|
+
}
|
|
61
|
+
function sourceRoots(source) {
|
|
62
|
+
if (source === "codex") {
|
|
63
|
+
return [
|
|
64
|
+
discoverJsonlFiles("codex", expandHome("~/.codex/sessions")),
|
|
65
|
+
discoverJsonlFiles("codex", expandHome("~/.codex/archived_sessions"))
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
return [
|
|
69
|
+
discoverJsonlFiles("claude", expandHome("~/.claude/projects")),
|
|
70
|
+
discoverJsonlFiles("claude", expandHome("~/.claude/history.jsonl"))
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
async function discoverJsonlFiles(source, rootPath) {
|
|
74
|
+
const stat = await statIfExists(rootPath);
|
|
75
|
+
if (!stat) {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
78
|
+
if (stat.isFile()) {
|
|
79
|
+
return [await recordFromPath(source, rootPath, stat.mtime)];
|
|
80
|
+
}
|
|
81
|
+
const records = [];
|
|
82
|
+
const entries = await fs.readdir(rootPath, { withFileTypes: true });
|
|
83
|
+
for (const entry of entries) {
|
|
84
|
+
const entryPath = path.join(rootPath, entry.name);
|
|
85
|
+
if (entry.isDirectory()) {
|
|
86
|
+
records.push(...await discoverJsonlFiles(source, entryPath));
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
90
|
+
const entryStat = await fs.stat(entryPath);
|
|
91
|
+
records.push(await recordFromPath(source, entryPath, entryStat.mtime));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return records;
|
|
95
|
+
}
|
|
96
|
+
async function recordFromPath(source, filePath, mtime) {
|
|
97
|
+
return {
|
|
98
|
+
source,
|
|
99
|
+
filePath,
|
|
100
|
+
updatedAt: mtime.toISOString()
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async function readTranscriptRecord(record) {
|
|
104
|
+
const metadata = await readMetadataFromFile(record.source, record.filePath);
|
|
105
|
+
return {
|
|
106
|
+
...record,
|
|
107
|
+
...metadata
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
async function readMetadataFromFile(source, filePath) {
|
|
111
|
+
const lines = await readJsonlLines(filePath, 80);
|
|
112
|
+
for (const line of lines) {
|
|
113
|
+
const parsed = parseJsonObject(line);
|
|
114
|
+
if (!parsed) {
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (source === "codex") {
|
|
118
|
+
const payload = asObject(parsed.payload);
|
|
119
|
+
if (parsed.type === "session_meta" && payload) {
|
|
120
|
+
return {
|
|
121
|
+
cwd: readString(payload.cwd),
|
|
122
|
+
sessionId: readString(payload.session_id) ?? readString(payload.id),
|
|
123
|
+
title: readString(payload.cwd)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (source === "claude") {
|
|
128
|
+
const message = asObject(parsed.message);
|
|
129
|
+
const role = readString(message?.role) ?? readString(parsed.type);
|
|
130
|
+
const content = message ? extractContentText(message.content) : readString(parsed.content);
|
|
131
|
+
if (content && (role === "user" || role === "assistant")) {
|
|
132
|
+
return {
|
|
133
|
+
cwd: readString(parsed.cwd) ?? readString(parsed.project),
|
|
134
|
+
sessionId: readString(parsed.sessionId),
|
|
135
|
+
title: truncateSingleLine(content, 120)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
sessionId: path.basename(filePath, ".jsonl")
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async function resolveTranscriptFile(source, target) {
|
|
145
|
+
const expandedTarget = expandHome(target);
|
|
146
|
+
const directStat = await statIfExists(expandedTarget);
|
|
147
|
+
if (directStat?.isFile()) {
|
|
148
|
+
return recordFromPath(detectSourceFromPath(expandedTarget), expandedTarget, directStat.mtime);
|
|
149
|
+
}
|
|
150
|
+
const files = await discoverTranscriptFiles(source);
|
|
151
|
+
const normalizedTarget = target.toLowerCase();
|
|
152
|
+
const match = files.find((file) => {
|
|
153
|
+
return file.filePath.toLowerCase().includes(normalizedTarget) || file.sessionId?.toLowerCase().includes(normalizedTarget);
|
|
154
|
+
});
|
|
155
|
+
if (!match) {
|
|
156
|
+
throw new Error(`No transcript matched "${target}". Run cngkit transcripts list first.`);
|
|
157
|
+
}
|
|
158
|
+
return match;
|
|
159
|
+
}
|
|
160
|
+
async function readEntriesFromFile(record, includeInternal) {
|
|
161
|
+
const content = await fs.readFile(record.filePath, "utf8");
|
|
162
|
+
const entries = [];
|
|
163
|
+
for (const line of content.split("\n")) {
|
|
164
|
+
if (!line.trim()) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
const parsed = parseJsonObject(line);
|
|
168
|
+
if (!parsed) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const entry = record.source === "codex" ? parseCodexEntry(record, parsed, includeInternal) : parseClaudeEntry(record, parsed, includeInternal);
|
|
172
|
+
if (entry) {
|
|
173
|
+
entries.push(entry);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return entries;
|
|
177
|
+
}
|
|
178
|
+
function parseCodexEntry(record, parsed, includeInternal) {
|
|
179
|
+
const payload = asObject(parsed.payload);
|
|
180
|
+
if (!payload || parsed.type !== "response_item") {
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
183
|
+
const role = readString(payload.role);
|
|
184
|
+
if (!role || !includeInternal && role !== "user" && role !== "assistant") {
|
|
185
|
+
return void 0;
|
|
186
|
+
}
|
|
187
|
+
const text = extractContentText(payload.content);
|
|
188
|
+
if (!text) {
|
|
189
|
+
return void 0;
|
|
190
|
+
}
|
|
191
|
+
return {
|
|
192
|
+
source: record.source,
|
|
193
|
+
filePath: record.filePath,
|
|
194
|
+
timestamp: readString(parsed.timestamp),
|
|
195
|
+
role,
|
|
196
|
+
text
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function parseClaudeEntry(record, parsed, includeInternal) {
|
|
200
|
+
const message = asObject(parsed.message);
|
|
201
|
+
const role = readString(message?.role) ?? readString(parsed.type);
|
|
202
|
+
if (!role || !includeInternal && role !== "user" && role !== "assistant") {
|
|
203
|
+
return void 0;
|
|
204
|
+
}
|
|
205
|
+
const text = message ? extractContentText(message.content) : readString(parsed.content);
|
|
206
|
+
if (!text) {
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
source: record.source,
|
|
211
|
+
filePath: record.filePath,
|
|
212
|
+
timestamp: readString(parsed.timestamp),
|
|
213
|
+
role,
|
|
214
|
+
text
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function extractContentText(value) {
|
|
218
|
+
if (typeof value === "string") {
|
|
219
|
+
return value;
|
|
220
|
+
}
|
|
221
|
+
if (!Array.isArray(value)) {
|
|
222
|
+
return void 0;
|
|
223
|
+
}
|
|
224
|
+
const parts = value.flatMap((item) => {
|
|
225
|
+
if (typeof item === "string") {
|
|
226
|
+
return [item];
|
|
227
|
+
}
|
|
228
|
+
const objectItem = asObject(item);
|
|
229
|
+
if (!objectItem) {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
return [readString(objectItem.text), readString(objectItem.content)].filter(
|
|
233
|
+
(part) => Boolean(part)
|
|
234
|
+
);
|
|
235
|
+
});
|
|
236
|
+
return parts.length > 0 ? parts.join("\n") : void 0;
|
|
237
|
+
}
|
|
238
|
+
async function readJsonlLines(filePath, limit) {
|
|
239
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
240
|
+
return content.split("\n").filter(Boolean).slice(0, limit);
|
|
241
|
+
}
|
|
242
|
+
async function statIfExists(filePath) {
|
|
243
|
+
try {
|
|
244
|
+
return await fs.stat(filePath);
|
|
245
|
+
} catch (error) {
|
|
246
|
+
if (isNodeError(error) && error.code === "ENOENT") {
|
|
247
|
+
return void 0;
|
|
248
|
+
}
|
|
249
|
+
throw error;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function parseJsonObject(line) {
|
|
253
|
+
try {
|
|
254
|
+
const parsed = JSON.parse(line);
|
|
255
|
+
return asObject(parsed);
|
|
256
|
+
} catch {
|
|
257
|
+
return void 0;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function asObject(value) {
|
|
261
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
262
|
+
return value;
|
|
263
|
+
}
|
|
264
|
+
return void 0;
|
|
265
|
+
}
|
|
266
|
+
function readString(value) {
|
|
267
|
+
return typeof value === "string" && value.trim() ? value : void 0;
|
|
268
|
+
}
|
|
269
|
+
function isNodeError(error) {
|
|
270
|
+
return error instanceof Error && "code" in error;
|
|
271
|
+
}
|
|
272
|
+
function expandHome(value) {
|
|
273
|
+
if (value === "~") {
|
|
274
|
+
return os.homedir();
|
|
275
|
+
}
|
|
276
|
+
if (value.startsWith("~/")) {
|
|
277
|
+
return path.join(os.homedir(), value.slice(2));
|
|
278
|
+
}
|
|
279
|
+
return value;
|
|
280
|
+
}
|
|
281
|
+
function detectSourceFromPath(filePath) {
|
|
282
|
+
return filePath.includes(`${path.sep}.claude${path.sep}`) ? "claude" : "codex";
|
|
283
|
+
}
|
|
284
|
+
function truncateSingleLine(value, maxLength) {
|
|
285
|
+
const line = value.replace(/\s+/g, " ").trim();
|
|
286
|
+
return line.length > maxLength ? `${line.slice(0, maxLength - 1)}...` : line;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// src/features/transcripts/run-transcript-command.ts
|
|
290
|
+
async function runTranscriptCommand(args2, options2, output) {
|
|
291
|
+
const [action = "list", ...actionArgs] = args2 ?? [];
|
|
292
|
+
const source = normalizeTranscriptSource(options2.source);
|
|
293
|
+
const limit = coerceLimit(options2.limit, action === "list" ? 12 : 80, 500);
|
|
294
|
+
const includeInternal = options2.includeInternal === true;
|
|
295
|
+
switch (action) {
|
|
296
|
+
case "help":
|
|
297
|
+
output.info(formatCngkitHelp("transcripts"));
|
|
298
|
+
return;
|
|
299
|
+
case "list": {
|
|
300
|
+
const records = await listTranscriptRecords({ source, limit });
|
|
301
|
+
if (options2.json) {
|
|
302
|
+
output.info(formatJson({ records }));
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
output.info(formatTranscriptRecords(records));
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
case "read": {
|
|
309
|
+
const target = actionArgs[0];
|
|
310
|
+
if (!target) {
|
|
311
|
+
throw new Error("Missing transcript target. Usage: cngkit transcripts read <path-or-id>");
|
|
312
|
+
}
|
|
313
|
+
const entries = await readTranscriptEntries({
|
|
314
|
+
source,
|
|
315
|
+
target,
|
|
316
|
+
limit,
|
|
317
|
+
includeInternal
|
|
318
|
+
});
|
|
319
|
+
if (options2.json) {
|
|
320
|
+
output.info(formatJson({ entries }));
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
output.info(formatTranscriptEntries(entries));
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
case "grep": {
|
|
327
|
+
const query = optionalJoinedArgument(actionArgs);
|
|
328
|
+
if (!query) {
|
|
329
|
+
throw new Error("Missing query. Usage: cngkit transcripts grep <query>");
|
|
330
|
+
}
|
|
331
|
+
const entries = await grepTranscriptEntries({
|
|
332
|
+
source,
|
|
333
|
+
query,
|
|
334
|
+
limit,
|
|
335
|
+
fileLimit: coerceLimit(options2.fileLimit, 60, 5e3),
|
|
336
|
+
includeInternal
|
|
337
|
+
});
|
|
338
|
+
if (options2.json) {
|
|
339
|
+
output.info(formatJson({ entries }));
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
output.info(formatTranscriptEntries(entries));
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
default:
|
|
346
|
+
throw new Error("Unknown transcripts command. Usage: cngkit transcripts <list|read|grep>");
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function formatTranscriptRecords(records) {
|
|
350
|
+
if (records.length === 0) {
|
|
351
|
+
return "No transcript files found.";
|
|
352
|
+
}
|
|
353
|
+
return records.map((record, index) => {
|
|
354
|
+
const title = record.title ? `
|
|
355
|
+
${singleLine(record.title)}` : "";
|
|
356
|
+
const cwd = record.cwd ? `
|
|
357
|
+
cwd ${record.cwd}` : "";
|
|
358
|
+
const session = record.sessionId ? `
|
|
359
|
+
session ${record.sessionId}` : "";
|
|
360
|
+
return `${index + 1}. ${record.source} ${record.updatedAt}
|
|
361
|
+
${record.filePath}${session}${cwd}${title}`;
|
|
362
|
+
}).join("\n");
|
|
363
|
+
}
|
|
364
|
+
function formatTranscriptEntries(entries) {
|
|
365
|
+
if (entries.length === 0) {
|
|
366
|
+
return "No transcript entries found.";
|
|
367
|
+
}
|
|
368
|
+
return entries.map((entry) => {
|
|
369
|
+
const when = entry.timestamp ? ` ${entry.timestamp}` : "";
|
|
370
|
+
return `[${entry.source}] ${entry.role}${when}
|
|
371
|
+
${entry.text.trim()}`;
|
|
372
|
+
}).join("\n\n");
|
|
373
|
+
}
|
|
374
|
+
function normalizeTranscriptSource(value) {
|
|
375
|
+
if (value === void 0) {
|
|
376
|
+
return "all";
|
|
377
|
+
}
|
|
378
|
+
switch (value) {
|
|
379
|
+
case "all":
|
|
380
|
+
case "codex":
|
|
381
|
+
case "claude":
|
|
382
|
+
return value;
|
|
383
|
+
default:
|
|
384
|
+
throw new Error("Unknown transcript source. Use one of: all, codex, claude.");
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// src/commands/transcripts.tsx
|
|
18
389
|
import { jsx } from "react/jsx-runtime";
|
|
19
390
|
var description = "List, read, and grep local Claude/Codex transcript JSONL files";
|
|
20
391
|
var args = TranscriptArgsSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/transcripts.tsx"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { GlobalOptionsSchema, TranscriptArgsSchema } from \"../cli-options.js\";\nimport { runTranscriptCommand, type TranscriptCommandOptions } from \"../command-actions.js\";\nimport { CommandRunner } from \"../ink/command-runner.js\";\n\nexport const description = \"List, read, and grep local Claude/Codex transcript JSONL files\";\nexport const args = TranscriptArgsSchema;\nexport const options = GlobalOptionsSchema.extend({\n source: z\n .enum([\"all\", \"codex\", \"claude\"])\n .optional()\n .describe(\n option({\n description: \"Transcript source. Default: all\",\n valueDescription: \"all|codex|claude\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum records or entries\",\n valueDescription: \"n\",\n })\n ),\n fileLimit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum recent files to scan for grep\",\n valueDescription: \"n\",\n })\n ),\n includeInternal: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Include developer/system/internal transcript entries\",\n })\n ),\n json: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Print raw JSON\",\n })\n ),\n});\n\ntype TranscriptsCommandProps = {\n readonly args: string[];\n readonly options: TranscriptCommandOptions;\n};\n\nexport default function TranscriptsCommand({ args, options }: TranscriptsCommandProps) {\n return <CommandRunner run={(output) => runTranscriptCommand(args, options, output)} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;AA4DT;AAtDF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,oBAAoB,OAAO;AAAA,EAChD,QAAQ,EACL,KAAK,CAAC,OAAO,SAAS,QAAQ,CAAC,EAC/B,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,OAAO,EACJ,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,WAAW,EACR,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,iBAAiB,EACd,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACF,MAAM,EACH,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,mBAAoC,EAAE,MAAAA,OAAM,SAAAC,SAAQ,GAA4B;AACrF,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,qBAAqBD,OAAMC,UAAS,MAAM,GAAG;AACtF;","names":["args","options"]}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/transcripts.tsx","../../src/features/transcripts/reader.ts","../../src/features/transcripts/run-transcript-command.ts"],"sourcesContent":["import { option } from \"pastel\";\nimport { z } from \"zod\";\n\nimport { GlobalOptionsSchema, TranscriptArgsSchema } from \"../cli/options.js\";\nimport { runTranscriptCommand, type TranscriptCommandOptions } from \"../features/transcripts/run-transcript-command.js\";\nimport { CommandRunner } from \"../cli/command-runner.js\";\n\nexport const description = \"List, read, and grep local Claude/Codex transcript JSONL files\";\nexport const args = TranscriptArgsSchema;\nexport const options = GlobalOptionsSchema.extend({\n source: z\n .enum([\"all\", \"codex\", \"claude\"])\n .optional()\n .describe(\n option({\n description: \"Transcript source. Default: all\",\n valueDescription: \"all|codex|claude\",\n })\n ),\n limit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum records or entries\",\n valueDescription: \"n\",\n })\n ),\n fileLimit: z\n .number()\n .optional()\n .describe(\n option({\n description: \"Maximum recent files to scan for grep\",\n valueDescription: \"n\",\n })\n ),\n includeInternal: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Include developer/system/internal transcript entries\",\n })\n ),\n json: z\n .boolean()\n .optional()\n .describe(\n option({\n description: \"Print raw JSON\",\n })\n ),\n});\n\ntype TranscriptsCommandProps = {\n readonly args: string[];\n readonly options: TranscriptCommandOptions;\n};\n\nexport default function TranscriptsCommand({ args, options }: TranscriptsCommandProps) {\n return <CommandRunner run={(output) => runTranscriptCommand(args, options, output)} />;\n}\n","import { promises as fs } from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nexport const TranscriptSourceNames = [\"codex\", \"claude\"] as const;\n\nexport type TranscriptSourceName = (typeof TranscriptSourceNames)[number];\nexport type TranscriptScopeName = TranscriptSourceName | \"all\";\n\nexport type TranscriptRecord = {\n readonly source: TranscriptSourceName;\n readonly filePath: string;\n readonly updatedAt: string;\n readonly sessionId?: string;\n readonly cwd?: string;\n readonly title?: string;\n};\n\nexport type TranscriptEntry = {\n readonly source: TranscriptSourceName;\n readonly filePath: string;\n readonly timestamp?: string;\n readonly role: string;\n readonly text: string;\n};\n\nexport type TranscriptListOptions = {\n readonly source: TranscriptScopeName;\n readonly limit: number;\n};\n\nexport type TranscriptReadOptions = {\n readonly source: TranscriptScopeName;\n readonly target: string;\n readonly limit: number;\n readonly includeInternal: boolean;\n};\n\nexport type TranscriptGrepOptions = {\n readonly source: TranscriptScopeName;\n readonly query: string;\n readonly limit: number;\n readonly fileLimit: number;\n readonly includeInternal: boolean;\n};\n\ntype JsonObject = Record<string, unknown>;\n\nexport async function listTranscriptRecords(\n options: TranscriptListOptions\n): Promise<TranscriptRecord[]> {\n const files = await discoverTranscriptFiles(options.source);\n const records = await Promise.all(files.slice(0, options.limit).map(readTranscriptRecord));\n return records;\n}\n\nexport async function readTranscriptEntries(\n options: TranscriptReadOptions\n): Promise<TranscriptEntry[]> {\n const file = await resolveTranscriptFile(options.source, options.target);\n const entries = await readEntriesFromFile(file, options.includeInternal);\n return entries.slice(Math.max(0, entries.length - options.limit));\n}\n\nexport async function grepTranscriptEntries(\n options: TranscriptGrepOptions\n): Promise<TranscriptEntry[]> {\n const files = await discoverTranscriptFiles(options.source);\n const normalizedQuery = options.query.toLowerCase();\n const matches: TranscriptEntry[] = [];\n\n for (const file of files.slice(0, options.fileLimit)) {\n const entries = await readEntriesFromFile(file, options.includeInternal);\n\n for (const entry of entries) {\n if (entry.text.toLowerCase().includes(normalizedQuery)) {\n matches.push(entry);\n }\n\n if (matches.length >= options.limit) {\n return matches;\n }\n }\n }\n\n return matches;\n}\n\nasync function discoverTranscriptFiles(source: TranscriptScopeName): Promise<TranscriptRecord[]> {\n const sources = source === \"all\" ? TranscriptSourceNames : [source];\n const records = await Promise.all(sources.flatMap((sourceName) => sourceRoots(sourceName)));\n return records\n .flat()\n .sort((left, right) => right.updatedAt.localeCompare(left.updatedAt));\n}\n\nfunction sourceRoots(source: TranscriptSourceName): Promise<TranscriptRecord[]>[] {\n if (source === \"codex\") {\n return [\n discoverJsonlFiles(\"codex\", expandHome(\"~/.codex/sessions\")),\n discoverJsonlFiles(\"codex\", expandHome(\"~/.codex/archived_sessions\")),\n ];\n }\n\n return [\n discoverJsonlFiles(\"claude\", expandHome(\"~/.claude/projects\")),\n discoverJsonlFiles(\"claude\", expandHome(\"~/.claude/history.jsonl\")),\n ];\n}\n\nasync function discoverJsonlFiles(\n source: TranscriptSourceName,\n rootPath: string\n): Promise<TranscriptRecord[]> {\n const stat = await statIfExists(rootPath);\n if (!stat) {\n return [];\n }\n\n if (stat.isFile()) {\n return [await recordFromPath(source, rootPath, stat.mtime)];\n }\n\n const records: TranscriptRecord[] = [];\n const entries = await fs.readdir(rootPath, { withFileTypes: true });\n\n for (const entry of entries) {\n const entryPath = path.join(rootPath, entry.name);\n if (entry.isDirectory()) {\n records.push(...(await discoverJsonlFiles(source, entryPath)));\n continue;\n }\n\n if (entry.isFile() && entry.name.endsWith(\".jsonl\")) {\n const entryStat = await fs.stat(entryPath);\n records.push(await recordFromPath(source, entryPath, entryStat.mtime));\n }\n }\n\n return records;\n}\n\nasync function recordFromPath(\n source: TranscriptSourceName,\n filePath: string,\n mtime: Date\n): Promise<TranscriptRecord> {\n return {\n source,\n filePath,\n updatedAt: mtime.toISOString(),\n };\n}\n\nasync function readTranscriptRecord(record: TranscriptRecord): Promise<TranscriptRecord> {\n const metadata = await readMetadataFromFile(record.source, record.filePath);\n return {\n ...record,\n ...metadata,\n };\n}\n\nasync function readMetadataFromFile(\n source: TranscriptSourceName,\n filePath: string\n): Promise<Pick<TranscriptRecord, \"cwd\" | \"sessionId\" | \"title\">> {\n const lines = await readJsonlLines(filePath, 80);\n\n for (const line of lines) {\n const parsed = parseJsonObject(line);\n if (!parsed) {\n continue;\n }\n\n if (source === \"codex\") {\n const payload = asObject(parsed.payload);\n if (parsed.type === \"session_meta\" && payload) {\n return {\n cwd: readString(payload.cwd),\n sessionId: readString(payload.session_id) ?? readString(payload.id),\n title: readString(payload.cwd),\n };\n }\n }\n\n if (source === \"claude\") {\n const message = asObject(parsed.message);\n const role = readString(message?.role) ?? readString(parsed.type);\n const content = message ? extractContentText(message.content) : readString(parsed.content);\n if (content && (role === \"user\" || role === \"assistant\")) {\n return {\n cwd: readString(parsed.cwd) ?? readString(parsed.project),\n sessionId: readString(parsed.sessionId),\n title: truncateSingleLine(content, 120),\n };\n }\n }\n }\n\n return {\n sessionId: path.basename(filePath, \".jsonl\"),\n };\n}\n\nasync function resolveTranscriptFile(\n source: TranscriptScopeName,\n target: string\n): Promise<TranscriptRecord> {\n const expandedTarget = expandHome(target);\n const directStat = await statIfExists(expandedTarget);\n if (directStat?.isFile()) {\n return recordFromPath(detectSourceFromPath(expandedTarget), expandedTarget, directStat.mtime);\n }\n\n const files = await discoverTranscriptFiles(source);\n const normalizedTarget = target.toLowerCase();\n const match = files.find((file) => {\n return (\n file.filePath.toLowerCase().includes(normalizedTarget) ||\n file.sessionId?.toLowerCase().includes(normalizedTarget)\n );\n });\n\n if (!match) {\n throw new Error(`No transcript matched \"${target}\". Run cngkit transcripts list first.`);\n }\n\n return match;\n}\n\nasync function readEntriesFromFile(\n record: TranscriptRecord,\n includeInternal: boolean\n): Promise<TranscriptEntry[]> {\n const content = await fs.readFile(record.filePath, \"utf8\");\n const entries: TranscriptEntry[] = [];\n\n for (const line of content.split(\"\\n\")) {\n if (!line.trim()) {\n continue;\n }\n\n const parsed = parseJsonObject(line);\n if (!parsed) {\n continue;\n }\n\n const entry =\n record.source === \"codex\"\n ? parseCodexEntry(record, parsed, includeInternal)\n : parseClaudeEntry(record, parsed, includeInternal);\n\n if (entry) {\n entries.push(entry);\n }\n }\n\n return entries;\n}\n\nfunction parseCodexEntry(\n record: TranscriptRecord,\n parsed: JsonObject,\n includeInternal: boolean\n): TranscriptEntry | undefined {\n const payload = asObject(parsed.payload);\n if (!payload || parsed.type !== \"response_item\") {\n return undefined;\n }\n\n const role = readString(payload.role);\n if (!role || (!includeInternal && role !== \"user\" && role !== \"assistant\")) {\n return undefined;\n }\n\n const text = extractContentText(payload.content);\n if (!text) {\n return undefined;\n }\n\n return {\n source: record.source,\n filePath: record.filePath,\n timestamp: readString(parsed.timestamp),\n role,\n text,\n };\n}\n\nfunction parseClaudeEntry(\n record: TranscriptRecord,\n parsed: JsonObject,\n includeInternal: boolean\n): TranscriptEntry | undefined {\n const message = asObject(parsed.message);\n const role = readString(message?.role) ?? readString(parsed.type);\n\n if (!role || (!includeInternal && role !== \"user\" && role !== \"assistant\")) {\n return undefined;\n }\n\n const text = message ? extractContentText(message.content) : readString(parsed.content);\n if (!text) {\n return undefined;\n }\n\n return {\n source: record.source,\n filePath: record.filePath,\n timestamp: readString(parsed.timestamp),\n role,\n text,\n };\n}\n\nfunction extractContentText(value: unknown): string | undefined {\n if (typeof value === \"string\") {\n return value;\n }\n\n if (!Array.isArray(value)) {\n return undefined;\n }\n\n const parts = value.flatMap((item) => {\n if (typeof item === \"string\") {\n return [item];\n }\n\n const objectItem = asObject(item);\n if (!objectItem) {\n return [];\n }\n\n return [readString(objectItem.text), readString(objectItem.content)].filter(\n (part): part is string => Boolean(part)\n );\n });\n\n return parts.length > 0 ? parts.join(\"\\n\") : undefined;\n}\n\nasync function readJsonlLines(filePath: string, limit: number): Promise<string[]> {\n const content = await fs.readFile(filePath, \"utf8\");\n return content.split(\"\\n\").filter(Boolean).slice(0, limit);\n}\n\nasync function statIfExists(filePath: string) {\n try {\n return await fs.stat(filePath);\n } catch (error) {\n if (isNodeError(error) && error.code === \"ENOENT\") {\n return undefined;\n }\n throw error;\n }\n}\n\nfunction parseJsonObject(line: string): JsonObject | undefined {\n try {\n const parsed: unknown = JSON.parse(line);\n return asObject(parsed);\n } catch {\n return undefined;\n }\n}\n\nfunction asObject(value: unknown): JsonObject | undefined {\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return value as JsonObject;\n }\n return undefined;\n}\n\nfunction readString(value: unknown): string | undefined {\n return typeof value === \"string\" && value.trim() ? value : undefined;\n}\n\nfunction isNodeError(error: unknown): error is NodeJS.ErrnoException {\n return error instanceof Error && \"code\" in error;\n}\n\nfunction expandHome(value: string): string {\n if (value === \"~\") {\n return os.homedir();\n }\n if (value.startsWith(\"~/\")) {\n return path.join(os.homedir(), value.slice(2));\n }\n return value;\n}\n\nfunction detectSourceFromPath(filePath: string): TranscriptSourceName {\n return filePath.includes(`${path.sep}.claude${path.sep}`) ? \"claude\" : \"codex\";\n}\n\nfunction truncateSingleLine(value: string, maxLength: number): string {\n const line = value.replace(/\\s+/g, \" \").trim();\n return line.length > maxLength ? `${line.slice(0, maxLength - 1)}...` : line;\n}\n","import { formatCngkitHelp } from \"../../cli/help-specs.js\";\nimport {\n coerceLimit,\n formatJson,\n optionalJoinedArgument,\n singleLine,\n type JsonOutputOptions,\n type NumberOption,\n} from \"../../shared/command-utils.js\";\nimport type { GlobalCommandOptions } from \"../../shared/config.js\";\nimport type { CommandOutput } from \"../../shared/output.js\";\nimport {\n grepTranscriptEntries,\n listTranscriptRecords,\n readTranscriptEntries,\n type TranscriptEntry,\n type TranscriptRecord,\n type TranscriptScopeName,\n} from \"./reader.js\";\n\nexport type TranscriptCommandOptions = GlobalCommandOptions &\n JsonOutputOptions & {\n source?: string;\n limit?: NumberOption;\n fileLimit?: NumberOption;\n includeInternal?: boolean;\n };\n\nexport async function runTranscriptCommand(\n args: string[] | undefined,\n options: TranscriptCommandOptions,\n output: CommandOutput\n): Promise<void> {\n const [action = \"list\", ...actionArgs] = args ?? [];\n const source = normalizeTranscriptSource(options.source);\n const limit = coerceLimit(options.limit, action === \"list\" ? 12 : 80, 500);\n const includeInternal = options.includeInternal === true;\n\n switch (action) {\n case \"help\":\n output.info(formatCngkitHelp(\"transcripts\"));\n return;\n case \"list\": {\n const records = await listTranscriptRecords({ source, limit });\n if (options.json) {\n output.info(formatJson({ records }));\n return;\n }\n\n output.info(formatTranscriptRecords(records));\n return;\n }\n case \"read\": {\n const target = actionArgs[0];\n if (!target) {\n throw new Error(\"Missing transcript target. Usage: cngkit transcripts read <path-or-id>\");\n }\n\n const entries = await readTranscriptEntries({\n source,\n target,\n limit,\n includeInternal,\n });\n\n if (options.json) {\n output.info(formatJson({ entries }));\n return;\n }\n\n output.info(formatTranscriptEntries(entries));\n return;\n }\n case \"grep\": {\n const query = optionalJoinedArgument(actionArgs);\n if (!query) {\n throw new Error(\"Missing query. Usage: cngkit transcripts grep <query>\");\n }\n\n const entries = await grepTranscriptEntries({\n source,\n query,\n limit,\n fileLimit: coerceLimit(options.fileLimit, 60, 5000),\n includeInternal,\n });\n\n if (options.json) {\n output.info(formatJson({ entries }));\n return;\n }\n\n output.info(formatTranscriptEntries(entries));\n return;\n }\n default:\n throw new Error(\"Unknown transcripts command. Usage: cngkit transcripts <list|read|grep>\");\n }\n}\n\nfunction formatTranscriptRecords(records: TranscriptRecord[]): string {\n if (records.length === 0) {\n return \"No transcript files found.\";\n }\n\n return records\n .map((record, index) => {\n const title = record.title ? `\\n ${singleLine(record.title)}` : \"\";\n const cwd = record.cwd ? `\\n cwd ${record.cwd}` : \"\";\n const session = record.sessionId ? `\\n session ${record.sessionId}` : \"\";\n return `${index + 1}. ${record.source} ${record.updatedAt}\\n ${record.filePath}${session}${cwd}${title}`;\n })\n .join(\"\\n\");\n}\n\nfunction formatTranscriptEntries(entries: TranscriptEntry[]): string {\n if (entries.length === 0) {\n return \"No transcript entries found.\";\n }\n\n return entries\n .map((entry) => {\n const when = entry.timestamp ? ` ${entry.timestamp}` : \"\";\n return `[${entry.source}] ${entry.role}${when}\\n${entry.text.trim()}`;\n })\n .join(\"\\n\\n\");\n}\n\nfunction normalizeTranscriptSource(value: string | undefined): TranscriptScopeName {\n if (value === undefined) {\n return \"all\";\n }\n\n switch (value) {\n case \"all\":\n case \"codex\":\n case \"claude\":\n return value;\n default:\n throw new Error(\"Unknown transcript source. Use one of: all, codex, claude.\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,SAAS;;;ACDlB,SAAS,YAAY,UAAU;AAC/B,OAAO,QAAQ;AACf,OAAO,UAAU;AAEV,IAAM,wBAAwB,CAAC,SAAS,QAAQ;AA4CvD,eAAsB,sBACpBA,UAC6B;AAC7B,QAAM,QAAQ,MAAM,wBAAwBA,SAAQ,MAAM;AAC1D,QAAM,UAAU,MAAM,QAAQ,IAAI,MAAM,MAAM,GAAGA,SAAQ,KAAK,EAAE,IAAI,oBAAoB,CAAC;AACzF,SAAO;AACT;AAEA,eAAsB,sBACpBA,UAC4B;AAC5B,QAAM,OAAO,MAAM,sBAAsBA,SAAQ,QAAQA,SAAQ,MAAM;AACvE,QAAM,UAAU,MAAM,oBAAoB,MAAMA,SAAQ,eAAe;AACvE,SAAO,QAAQ,MAAM,KAAK,IAAI,GAAG,QAAQ,SAASA,SAAQ,KAAK,CAAC;AAClE;AAEA,eAAsB,sBACpBA,UAC4B;AAC5B,QAAM,QAAQ,MAAM,wBAAwBA,SAAQ,MAAM;AAC1D,QAAM,kBAAkBA,SAAQ,MAAM,YAAY;AAClD,QAAM,UAA6B,CAAC;AAEpC,aAAW,QAAQ,MAAM,MAAM,GAAGA,SAAQ,SAAS,GAAG;AACpD,UAAM,UAAU,MAAM,oBAAoB,MAAMA,SAAQ,eAAe;AAEvE,eAAW,SAAS,SAAS;AAC3B,UAAI,MAA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A,EACrE,CAAC,EACA,KAAK,MAAM;AAChB;AAEA,SAAS,0BAA0B,OAAgD;AACjF,MAAI,UAAU,QAAW;AACvB,WAAO;AAAA,EACT;AAEA,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT;AACE,YAAM,IAAI,MAAM,4DAA4D;AAAA,EAChF;AACF;;;AFhFS;AAtDF,IAAM,cAAc;AACpB,IAAM,OAAO;AACb,IAAM,UAAU,oBAAoB,OAAO;AAAA,EAChD,QAAQ,EACL,KAAK,CAAC,OAAO,SAAS,QAAQ,CAAC,EAC/B,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,OAAO,EACJ,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,WAAW,EACR,OAAO,EACP,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,MACb,kBAAkB;AAAA,IACpB,CAAC;AAAA,EACH;AAAA,EACF,iBAAiB,EACd,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACF,MAAM,EACH,QAAQ,EACR,SAAS,EACT;AAAA,IACC,OAAO;AAAA,MACL,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACJ,CAAC;AAOc,SAAR,mBAAoC,EAAE,MAAAC,OAAM,SAAAC,SAAQ,GAA4B;AACrF,SAAO,oBAAC,iBAAc,KAAK,CAAC,WAAW,qBAAqBD,OAAMC,UAAS,MAAM,GAAG;AACtF;","names":["options","args","options","args","options"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cngkit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7",
|
|
4
4
|
"description": "Opinionated Curly.ng CLI kit for Coderoom collaboration and website tooling.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,6 +16,17 @@
|
|
|
16
16
|
"type": "custom",
|
|
17
17
|
"url": "https://curly.ng/support"
|
|
18
18
|
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup --config tsup.config.ts && chmod +x dist/cli.js",
|
|
21
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
22
|
+
"dev": "tsx src/cli.ts",
|
|
23
|
+
"format": "prettier --write README.md src tsconfig.json tsup.config.ts package.json",
|
|
24
|
+
"lint": "eslint src",
|
|
25
|
+
"prepublishOnly": "pnpm run build && pnpm run smoke",
|
|
26
|
+
"smoke": "node dist/cli.js --help && node dist/cli.js --version && node dist/cli.js help && node dist/cli.js help knowledges && node dist/cli.js help coderoom && node dist/cli.js help transcripts && node dist/cli.js login --help && node dist/cli.js coderoom --help && node dist/cli.js coderoom share --help && node dist/cli.js coderoom join --help && node dist/cli.js scrub --help && node dist/cli.js transcripts --help && node dist/cli.js knowledges --help && node dist/cli.js knowledges audiences --help && node dist/cli.js knowledges search --help && node dist/cli.js knowledges read --help && node dist/cli.js knowledges grep --help && node dist/cli.js knowledges glob --help && node dist/cli.js knowledges list --help && node dist/cli.js knowledges files --help && node dist/cli.js knowledges status --help",
|
|
27
|
+
"smoke:docker": "bash scripts/smoke-docker.sh",
|
|
28
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
|
+
},
|
|
19
30
|
"publishConfig": {
|
|
20
31
|
"access": "public"
|
|
21
32
|
},
|
|
@@ -33,6 +44,7 @@
|
|
|
33
44
|
"zod": "^4.4.3"
|
|
34
45
|
},
|
|
35
46
|
"devDependencies": {
|
|
47
|
+
"@cng/client": "workspace:*",
|
|
36
48
|
"@types/node": "^20",
|
|
37
49
|
"@types/react": "^19.2.17",
|
|
38
50
|
"@types/ws": "^8.18.1",
|
|
@@ -40,17 +52,6 @@
|
|
|
40
52
|
"prettier": "^3.8.1",
|
|
41
53
|
"tsup": "^8.5.0",
|
|
42
54
|
"tsx": "^4.21.0",
|
|
43
|
-
"typescript": "5.9.3"
|
|
44
|
-
"@cng/client": "0.1.0"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsup --config tsup.config.ts && chmod +x dist/cli.js",
|
|
48
|
-
"clean": "rm -rf dist *.tsbuildinfo",
|
|
49
|
-
"dev": "tsx src/cli.ts",
|
|
50
|
-
"format": "prettier --write README.md src tsconfig.json tsup.config.ts package.json",
|
|
51
|
-
"lint": "eslint src",
|
|
52
|
-
"smoke": "node dist/cli.js --help && node dist/cli.js --version && node dist/cli.js help && node dist/cli.js help knowledges && node dist/cli.js help coderoom && node dist/cli.js help transcripts && node dist/cli.js login --help && node dist/cli.js coderoom --help && node dist/cli.js coderoom share --help && node dist/cli.js coderoom join --help && node dist/cli.js scrub --help && node dist/cli.js transcripts --help && node dist/cli.js knowledges --help && node dist/cli.js knowledges audiences --help && node dist/cli.js knowledges search --help && node dist/cli.js knowledges read --help && node dist/cli.js knowledges grep --help && node dist/cli.js knowledges glob --help && node dist/cli.js knowledges list --help && node dist/cli.js knowledges files --help && node dist/cli.js knowledges status --help",
|
|
53
|
-
"smoke:docker": "bash scripts/smoke-docker.sh",
|
|
54
|
-
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
55
|
+
"typescript": "5.9.3"
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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,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D;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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.5\";\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":[]}
|