tokless 0.0.0-stage → 0.4.0
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 +21 -0
- package/README.en.md +205 -0
- package/README.md +238 -2
- package/agents/tokless-coder.md +17 -0
- package/agents/tokless-reviewer.md +16 -0
- package/assets/logo.svg +15 -0
- package/bin/tokless.js +106 -0
- package/hooks.json +17 -0
- package/index.js +76 -0
- package/install.js +116 -0
- package/lib/audit.js +15 -0
- package/lib/read-guard.js +3 -0
- package/lib/skeleton.js +3 -0
- package/package.json +66 -4
- package/plugin.json +12 -0
- package/rules/AGENTS.md +20 -0
- package/scripts/read-guard-hook.js +266 -0
- package/skills/code-skeleton/SKILL.md +34 -0
- package/skills/token-audit/SKILL.md +38 -0
- package/targets/antigravity.js +150 -0
- package/targets/claude-code.js +245 -0
- package/targets/codex.js +100 -0
- package/targets/index.js +75 -0
- package/targets/shared.js +103 -0
- package/tools/agy-audit/cli.js +114 -0
- package/tools/agy-audit/lib/analyzer.js +864 -0
- package/tools/agy-audit/lib/compare.js +66 -0
- package/tools/agy-audit/lib/formatter.js +448 -0
- package/tools/agy-audit/lib/paths.js +437 -0
- package/tools/agy-audit/lib/project.js +497 -0
- package/tools/repo-skeleton/cli.js +109 -0
- package/tools/repo-skeleton/lib/skeleton.js +1511 -0
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
function getAntigravityDirs() {
|
|
8
|
+
const home = os.homedir();
|
|
9
|
+
const candidates = [
|
|
10
|
+
path.join(home, '.gemini', 'antigravity'),
|
|
11
|
+
path.join(home, '.gemini', 'antigravity-cli')
|
|
12
|
+
];
|
|
13
|
+
const existing = candidates.filter(dir => fs.existsSync(dir));
|
|
14
|
+
if (existing.length === 0) {
|
|
15
|
+
throw new Error(`Antigravity directory not found at: ${candidates.join(' or ')}`);
|
|
16
|
+
}
|
|
17
|
+
return existing;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function getAntigravityDir() {
|
|
21
|
+
return getAntigravityDirs()[0];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getBrainRoots() {
|
|
25
|
+
return getAntigravityDirs()
|
|
26
|
+
.map(dir => path.join(dir, 'brain'))
|
|
27
|
+
.filter(dir => fs.existsSync(dir));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getSummariesDbPaths() {
|
|
31
|
+
return getAntigravityDirs()
|
|
32
|
+
.map(dir => path.join(dir, 'conversation_summaries.db'))
|
|
33
|
+
.filter(dbPath => fs.existsSync(dbPath));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getSummariesDbPath() {
|
|
37
|
+
const paths = getSummariesDbPaths();
|
|
38
|
+
return paths[0] || path.join(getAntigravityDir(), 'conversation_summaries.db');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function isSafeSingleDirName(name) {
|
|
42
|
+
if (!name || name === '.' || name === '..') return false;
|
|
43
|
+
if (name.includes('/') || name.includes('\\') || name.includes('\0')) return false;
|
|
44
|
+
return path.basename(name) === name;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getConversationBrainDir(conversationId) {
|
|
48
|
+
if (typeof conversationId !== 'string' || !isSafeSingleDirName(conversationId.trim())) {
|
|
49
|
+
throw new Error(`Invalid conversation ID: "${conversationId}"`);
|
|
50
|
+
}
|
|
51
|
+
const cleanId = conversationId.trim();
|
|
52
|
+
const roots = getBrainRoots();
|
|
53
|
+
for (const root of roots) {
|
|
54
|
+
const resolvedRoot = path.resolve(root);
|
|
55
|
+
const candidate = path.resolve(resolvedRoot, cleanId);
|
|
56
|
+
if (path.dirname(candidate) !== resolvedRoot) {
|
|
57
|
+
throw new Error(`Conversation path escapes brain directory: "${conversationId}"`);
|
|
58
|
+
}
|
|
59
|
+
if (fs.existsSync(candidate)) {
|
|
60
|
+
return candidate;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const fallbackRoot = path.resolve(getAntigravityDir(), 'brain');
|
|
64
|
+
const resolved = path.resolve(fallbackRoot, cleanId);
|
|
65
|
+
if (path.dirname(resolved) !== fallbackRoot) {
|
|
66
|
+
throw new Error(`Conversation path escapes brain directory: "${conversationId}"`);
|
|
67
|
+
}
|
|
68
|
+
return resolved;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function findTranscriptInBrainDir(brainDir, allowDirectFiles = false) {
|
|
72
|
+
const candidates = [
|
|
73
|
+
{ filePath: path.join(brainDir, '.system_generated', 'logs', 'transcript_full.jsonl'), logType: 'transcript_full.jsonl' },
|
|
74
|
+
{ filePath: path.join(brainDir, '.system_generated', 'logs', 'transcript.jsonl'), logType: 'transcript.jsonl' }
|
|
75
|
+
];
|
|
76
|
+
if (allowDirectFiles) {
|
|
77
|
+
candidates.push(
|
|
78
|
+
{ filePath: path.join(brainDir, 'transcript_full.jsonl'), logType: 'transcript_full.jsonl' },
|
|
79
|
+
{ filePath: path.join(brainDir, 'transcript.jsonl'), logType: 'transcript.jsonl' }
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
for (const item of candidates) {
|
|
83
|
+
if (fs.existsSync(item.filePath) && fs.statSync(item.filePath).isFile()) {
|
|
84
|
+
return {
|
|
85
|
+
filePath: item.filePath,
|
|
86
|
+
logType: item.logType,
|
|
87
|
+
bytes: fs.statSync(item.filePath).size
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function extractConversationIdFromPath(targetPath, fallbackName) {
|
|
95
|
+
const parts = path.resolve(targetPath).split(path.sep).filter(Boolean);
|
|
96
|
+
const brainIdx = parts.lastIndexOf('brain');
|
|
97
|
+
if (brainIdx >= 0 && brainIdx + 1 < parts.length) {
|
|
98
|
+
return parts[brainIdx + 1];
|
|
99
|
+
}
|
|
100
|
+
return fallbackName;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function looksLikePath(input) {
|
|
104
|
+
return input.includes('/') || input.includes('\\') || input.endsWith('.jsonl') || input === '.' || input === '..';
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function resolveSessionTarget(idOrPrefixOrPath) {
|
|
108
|
+
if (!idOrPrefixOrPath || typeof idOrPrefixOrPath !== 'string') {
|
|
109
|
+
throw new Error('Conversation ID, prefix, or path is required.');
|
|
110
|
+
}
|
|
111
|
+
const trimmed = idOrPrefixOrPath.trim();
|
|
112
|
+
if (!trimmed) {
|
|
113
|
+
throw new Error('Conversation ID, prefix, or path is empty.');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const candidatePath = path.resolve(trimmed);
|
|
117
|
+
if (fs.existsSync(candidatePath)) {
|
|
118
|
+
const stat = fs.statSync(candidatePath);
|
|
119
|
+
if (stat.isFile() && candidatePath.toLowerCase().endsWith('.jsonl')) {
|
|
120
|
+
const conversationId = extractConversationIdFromPath(candidatePath, path.basename(candidatePath, '.jsonl'));
|
|
121
|
+
return {
|
|
122
|
+
conversationId,
|
|
123
|
+
transcriptInfo: {
|
|
124
|
+
filePath: candidatePath,
|
|
125
|
+
logType: path.basename(candidatePath),
|
|
126
|
+
bytes: stat.size
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
if (stat.isDirectory()) {
|
|
131
|
+
const info = findTranscriptInBrainDir(candidatePath, true);
|
|
132
|
+
if (info || looksLikePath(trimmed)) {
|
|
133
|
+
const conversationId = extractConversationIdFromPath(candidatePath, path.basename(candidatePath));
|
|
134
|
+
return {
|
|
135
|
+
conversationId,
|
|
136
|
+
transcriptInfo: info
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const conversationId = resolveConversationId(trimmed);
|
|
143
|
+
return {
|
|
144
|
+
conversationId,
|
|
145
|
+
transcriptInfo: getTranscriptInfo(conversationId)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function resolveConversationId(idOrPrefix) {
|
|
150
|
+
if (!idOrPrefix || typeof idOrPrefix !== 'string') {
|
|
151
|
+
throw new Error('Conversation ID or prefix is required.');
|
|
152
|
+
}
|
|
153
|
+
const trimmed = idOrPrefix.trim();
|
|
154
|
+
const query = trimmed.toLowerCase();
|
|
155
|
+
if (!query) {
|
|
156
|
+
throw new Error('Conversation ID or prefix is empty.');
|
|
157
|
+
}
|
|
158
|
+
if (!isSafeSingleDirName(trimmed)) {
|
|
159
|
+
throw new Error(`Invalid conversation ID or prefix: "${idOrPrefix}"`);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const brainRoots = getBrainRoots();
|
|
163
|
+
|
|
164
|
+
// 陷阱: 沙箱环境下 fs.readdirSync(brainRoot) 可能被 EPERM 拦截,完整会话 ID 先做 stat 直连命中
|
|
165
|
+
for (const brainRoot of brainRoots) {
|
|
166
|
+
const resolvedBrainRoot = path.resolve(brainRoot);
|
|
167
|
+
for (const candidate of new Set([trimmed, query])) {
|
|
168
|
+
const directDir = path.resolve(resolvedBrainRoot, candidate);
|
|
169
|
+
if (path.dirname(directDir) !== resolvedBrainRoot) continue;
|
|
170
|
+
try {
|
|
171
|
+
if (fs.existsSync(directDir) && fs.statSync(directDir).isDirectory()) {
|
|
172
|
+
return candidate;
|
|
173
|
+
}
|
|
174
|
+
} catch (_) {}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const prefixMatches = new Set();
|
|
179
|
+
for (const brainRoot of brainRoots) {
|
|
180
|
+
const entries = fs.readdirSync(brainRoot, { withFileTypes: true });
|
|
181
|
+
const exact = entries.find(e => e.isDirectory() && e.name.toLowerCase() === query);
|
|
182
|
+
if (exact) return exact.name;
|
|
183
|
+
|
|
184
|
+
for (const entry of entries) {
|
|
185
|
+
if (entry.isDirectory() && entry.name.toLowerCase().startsWith(query)) {
|
|
186
|
+
prefixMatches.add(entry.name);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const matches = Array.from(prefixMatches);
|
|
192
|
+
if (matches.length === 1) return matches[0];
|
|
193
|
+
if (matches.length > 1) {
|
|
194
|
+
throw new Error(`Ambiguous conversation ID prefix "${idOrPrefix}" (${matches.length} matches): ${matches.slice(0, 5).join(', ')}`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const dbMatches = new Set();
|
|
198
|
+
for (const dbPath of getSummariesDbPaths()) {
|
|
199
|
+
try {
|
|
200
|
+
const Database = require('better-sqlite3');
|
|
201
|
+
const db = new Database(dbPath, { readonly: true, fileMustExist: true });
|
|
202
|
+
const rows = db.prepare(
|
|
203
|
+
`SELECT conversation_id FROM conversation_summaries WHERE conversation_id = ? OR conversation_id LIKE ? LIMIT 10`
|
|
204
|
+
).all(idOrPrefix, `${idOrPrefix}%`);
|
|
205
|
+
db.close();
|
|
206
|
+
for (const row of rows) {
|
|
207
|
+
if (row.conversation_id.toLowerCase() === query) {
|
|
208
|
+
return row.conversation_id;
|
|
209
|
+
}
|
|
210
|
+
dbMatches.add(row.conversation_id);
|
|
211
|
+
}
|
|
212
|
+
} catch {
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const dbIds = Array.from(dbMatches);
|
|
217
|
+
if (dbIds.length === 1) return dbIds[0];
|
|
218
|
+
if (dbIds.length > 1) {
|
|
219
|
+
throw new Error(`Ambiguous conversation ID prefix "${idOrPrefix}" in DB: ${dbIds.slice(0, 5).join(', ')}`);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return idOrPrefix;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function getTranscriptInfo(conversationId) {
|
|
226
|
+
if (typeof conversationId !== 'string' || !isSafeSingleDirName(conversationId.trim())) {
|
|
227
|
+
throw new Error(`Invalid conversation ID: "${conversationId}"`);
|
|
228
|
+
}
|
|
229
|
+
const cleanId = conversationId.trim();
|
|
230
|
+
const roots = getBrainRoots();
|
|
231
|
+
for (const logName of ['transcript_full.jsonl', 'transcript.jsonl']) {
|
|
232
|
+
for (const root of roots) {
|
|
233
|
+
const brainDir = path.join(root, cleanId);
|
|
234
|
+
const logPath = path.join(brainDir, '.system_generated', 'logs', logName);
|
|
235
|
+
if (fs.existsSync(logPath) && fs.statSync(logPath).isFile()) {
|
|
236
|
+
return {
|
|
237
|
+
filePath: logPath,
|
|
238
|
+
logType: logName,
|
|
239
|
+
bytes: fs.statSync(logPath).size
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function getConversationDbPaths(conversationId) {
|
|
248
|
+
if (!conversationId || typeof conversationId !== 'string' || !isSafeSingleDirName(conversationId.trim())) {
|
|
249
|
+
return [];
|
|
250
|
+
}
|
|
251
|
+
const cleanId = conversationId.trim();
|
|
252
|
+
try {
|
|
253
|
+
return getAntigravityDirs()
|
|
254
|
+
.map(dir => path.join(dir, 'conversations', `${cleanId}.db`))
|
|
255
|
+
.filter(dbPath => fs.existsSync(dbPath) && fs.statSync(dbPath).isFile());
|
|
256
|
+
} catch {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
function parseMountedMcpBlock(mcpBlockText) {
|
|
262
|
+
const withoutFence = mcpBlockText.replace(/```[\s\S]*?```/g, '');
|
|
263
|
+
const servers = new Map();
|
|
264
|
+
let curServer = null;
|
|
265
|
+
let curMode = null;
|
|
266
|
+
|
|
267
|
+
for (const line of withoutFence.split(/\r?\n/)) {
|
|
268
|
+
const trimmed = line.trim();
|
|
269
|
+
const h = trimmed.match(/^#\s+([A-Za-z0-9._:@/-]+)$/);
|
|
270
|
+
if (h) {
|
|
271
|
+
curServer = h[1];
|
|
272
|
+
if (!servers.has(curServer)) {
|
|
273
|
+
servers.set(curServer, {
|
|
274
|
+
name: curServer,
|
|
275
|
+
prefix: `mcp_${curServer}_`,
|
|
276
|
+
eagerTools: [],
|
|
277
|
+
lazyTools: []
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
curMode = null;
|
|
281
|
+
} else if (curServer && trimmed === 'Eager:') {
|
|
282
|
+
curMode = 'eager';
|
|
283
|
+
} else if (curServer && trimmed === 'Lazy:') {
|
|
284
|
+
curMode = 'lazy';
|
|
285
|
+
} else if (curServer && curMode && /^[A-Za-z0-9._-]+$/.test(trimmed)) {
|
|
286
|
+
const entry = servers.get(curServer);
|
|
287
|
+
if (curMode === 'eager') entry.eagerTools.push(trimmed);
|
|
288
|
+
else entry.lazyTools.push(trimmed);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return Array.from(servers.values());
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function readChunkUtf8(fd, offset, length) {
|
|
295
|
+
const buf = Buffer.alloc(length);
|
|
296
|
+
const bytesRead = fs.readSync(fd, buf, 0, length, offset);
|
|
297
|
+
return buf.subarray(0, bytesRead).toString('utf8');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function inspectSessionMountedMcp(conversationId, transcriptFilePath) {
|
|
301
|
+
const candidateDbs = [];
|
|
302
|
+
if (transcriptFilePath && isSafeSingleDirName(String(conversationId || '').trim())) {
|
|
303
|
+
const parts = path.resolve(transcriptFilePath).split(path.sep);
|
|
304
|
+
const brainIdx = parts.lastIndexOf('brain');
|
|
305
|
+
if (brainIdx > 0) {
|
|
306
|
+
const agyRoot = parts.slice(0, brainIdx).join(path.sep);
|
|
307
|
+
const siblingDb = path.join(agyRoot, 'conversations', `${conversationId.trim()}.db`);
|
|
308
|
+
if (fs.existsSync(siblingDb) && fs.statSync(siblingDb).isFile()) {
|
|
309
|
+
candidateDbs.push(siblingDb);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
for (const p of getConversationDbPaths(conversationId)) {
|
|
314
|
+
if (!candidateDbs.includes(p)) candidateDbs.push(p);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
for (const dbPath of candidateDbs) {
|
|
318
|
+
let fd = null;
|
|
319
|
+
try {
|
|
320
|
+
const stat = fs.statSync(dbPath);
|
|
321
|
+
if (stat.size <= 0) continue;
|
|
322
|
+
fd = fs.openSync(dbPath, 'r');
|
|
323
|
+
|
|
324
|
+
const marker = `Conversation ID: ${conversationId}`;
|
|
325
|
+
const chunkSize = 2 * 1024 * 1024;
|
|
326
|
+
const overlap = 65536;
|
|
327
|
+
let offset = 0;
|
|
328
|
+
let foundWindow = null;
|
|
329
|
+
let relMarkerIdx = -1;
|
|
330
|
+
|
|
331
|
+
while (offset < stat.size) {
|
|
332
|
+
const len = Math.min(chunkSize, stat.size - offset);
|
|
333
|
+
const text = readChunkUtf8(fd, offset, len);
|
|
334
|
+
const idx = text.indexOf(marker);
|
|
335
|
+
if (idx !== -1) {
|
|
336
|
+
const winStart = Math.max(0, offset + idx - 49152);
|
|
337
|
+
const winEnd = Math.min(stat.size, offset + idx + 49152);
|
|
338
|
+
foundWindow = readChunkUtf8(fd, winStart, winEnd - winStart);
|
|
339
|
+
relMarkerIdx = foundWindow.indexOf(marker);
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
if (offset + len >= stat.size) break;
|
|
343
|
+
offset += chunkSize - overlap;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
fs.closeSync(fd);
|
|
347
|
+
fd = null;
|
|
348
|
+
|
|
349
|
+
if (!foundWindow || relMarkerIdx === -1) {
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
const re = /<mcp_servers>\r?\nEach MCP server has a directory[\s\S]*?<\/mcp_servers>/g;
|
|
354
|
+
let bestMatch = null;
|
|
355
|
+
let bestDist = Infinity;
|
|
356
|
+
let m;
|
|
357
|
+
while ((m = re.exec(foundWindow)) !== null) {
|
|
358
|
+
const prevChars = foundWindow.slice(Math.max(0, m.index - 40), m.index);
|
|
359
|
+
if (prevChars.includes('\\n') || prevChars.includes('\\"')) continue;
|
|
360
|
+
const dist = Math.abs(m.index - relMarkerIdx);
|
|
361
|
+
if (dist < bestDist) {
|
|
362
|
+
bestDist = dist;
|
|
363
|
+
bestMatch = m[0];
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const servers = bestMatch ? parseMountedMcpBlock(bestMatch) : [];
|
|
368
|
+
return {
|
|
369
|
+
detectedFromSessionDb: true,
|
|
370
|
+
servers
|
|
371
|
+
};
|
|
372
|
+
} catch {
|
|
373
|
+
if (fd !== null) {
|
|
374
|
+
try {
|
|
375
|
+
fs.closeSync(fd);
|
|
376
|
+
} catch {}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return {
|
|
382
|
+
detectedFromSessionDb: false,
|
|
383
|
+
servers: []
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
function getConversationMeta(conversationId) {
|
|
388
|
+
for (const dbPath of getSummariesDbPaths()) {
|
|
389
|
+
try {
|
|
390
|
+
const Database = require('better-sqlite3');
|
|
391
|
+
const db = new Database(dbPath, { readonly: true, fileMustExist: true });
|
|
392
|
+
const row = db.prepare(
|
|
393
|
+
`SELECT conversation_id, title, step_count, last_modified_time, workspace_uris, status
|
|
394
|
+
FROM conversation_summaries WHERE conversation_id = ? LIMIT 1`
|
|
395
|
+
).get(conversationId);
|
|
396
|
+
db.close();
|
|
397
|
+
if (!row) continue;
|
|
398
|
+
|
|
399
|
+
let workspace = '';
|
|
400
|
+
if (row.workspace_uris) {
|
|
401
|
+
try {
|
|
402
|
+
const list = JSON.parse(row.workspace_uris);
|
|
403
|
+
if (Array.isArray(list)) {
|
|
404
|
+
workspace = list.map(u => decodeURIComponent(u).replace(/^file:\/\/\/?/, '')).join(', ');
|
|
405
|
+
}
|
|
406
|
+
} catch {
|
|
407
|
+
workspace = decodeURIComponent(row.workspace_uris).replace(/^file:\/\/\/?/, '');
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return {
|
|
411
|
+
conversationId: row.conversation_id,
|
|
412
|
+
title: row.title || 'Untitled Session',
|
|
413
|
+
workspace,
|
|
414
|
+
lastModifiedTime: row.last_modified_time,
|
|
415
|
+
stepCount: row.step_count || 0,
|
|
416
|
+
status: row.status
|
|
417
|
+
};
|
|
418
|
+
} catch {}
|
|
419
|
+
}
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
module.exports = {
|
|
424
|
+
isSafeSingleDirName,
|
|
425
|
+
getAntigravityDir,
|
|
426
|
+
getAntigravityDirs,
|
|
427
|
+
getBrainRoots,
|
|
428
|
+
getSummariesDbPath,
|
|
429
|
+
getSummariesDbPaths,
|
|
430
|
+
getConversationBrainDir,
|
|
431
|
+
getConversationDbPaths,
|
|
432
|
+
resolveSessionTarget,
|
|
433
|
+
resolveConversationId,
|
|
434
|
+
getTranscriptInfo,
|
|
435
|
+
getConversationMeta,
|
|
436
|
+
inspectSessionMountedMcp
|
|
437
|
+
};
|