@haystackeditor/cli 0.25.1 → 0.26.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.
Files changed (97) hide show
  1. package/README.md +39 -455
  2. package/dist/capture/app-config.js +25 -1
  3. package/dist/commands/capture-brief.js +41 -32
  4. package/dist/commands/feedback.js +66 -0
  5. package/dist/commands/init-telemetry.js +53 -7
  6. package/dist/commands/init.js +7 -2
  7. package/dist/commands/lockfile-pin.js +307 -0
  8. package/dist/commands/verify.js +68 -13
  9. package/dist/index.js +27 -923
  10. package/dist/schema.js +4 -10
  11. package/dist/utils/haystack-api.js +0 -36
  12. package/package.json +1 -5
  13. package/schemas/feedback.v1.json +13 -0
  14. package/schemas/pre-verify.v2.json +240 -0
  15. package/schemas/verify-raw.v1.json +1132 -0
  16. package/schemas/verify.v2.json +655 -0
  17. package/dist/assets/hooks/agent-context/detect.ts +0 -316
  18. package/dist/assets/hooks/agent-context/format.ts +0 -100
  19. package/dist/assets/hooks/agent-context/index.ts +0 -41
  20. package/dist/assets/hooks/agent-context/parsers/claude.ts +0 -262
  21. package/dist/assets/hooks/agent-context/parsers/codex.ts +0 -416
  22. package/dist/assets/hooks/agent-context/parsers/gemini.ts +0 -155
  23. package/dist/assets/hooks/agent-context/parsers/opencode.ts +0 -174
  24. package/dist/assets/hooks/agent-context/tsconfig.json +0 -14
  25. package/dist/assets/hooks/agent-context/types.ts +0 -58
  26. package/dist/assets/hooks/llm-rules-template.md +0 -59
  27. package/dist/assets/hooks/package-lock.json +0 -598
  28. package/dist/assets/hooks/package.json +0 -12
  29. package/dist/assets/hooks/scripts/commit-msg.sh +0 -5
  30. package/dist/assets/hooks/scripts/post-commit.sh +0 -5
  31. package/dist/assets/hooks/scripts/pre-commit.sh +0 -175
  32. package/dist/assets/hooks/scripts/pre-push.sh +0 -25
  33. package/dist/assets/hooks/scripts/prepare-commit-msg.sh +0 -5
  34. package/dist/assets/hooks/truncation-checker/ast-analyzer.ts +0 -528
  35. package/dist/assets/hooks/truncation-checker/index.ts +0 -595
  36. package/dist/assets/hooks/truncation-checker/tsconfig.json +0 -13
  37. package/dist/assets/skills/map-cloud-verifier-universe/SKILL.md +0 -2051
  38. package/dist/assets/skills/map-cloud-verifier-universe/agents/openai.yaml +0 -4
  39. package/dist/assets/skills/map-cloud-verifier-universe/references/output-contract.md +0 -3411
  40. package/dist/assets/skills/map-your-system.md +0 -143
  41. package/dist/assets/skills/submit.md +0 -200
  42. package/dist/commands/ask.js +0 -20
  43. package/dist/commands/cloud-verifier-behaviors.js +0 -218
  44. package/dist/commands/cloud-verifier-data-store-census.js +0 -539
  45. package/dist/commands/cloud-verifier-data-store-drift.js +0 -158
  46. package/dist/commands/cloud-verifier-identity-census.js +0 -4060
  47. package/dist/commands/cloud-verifier-materialization.js +0 -704
  48. package/dist/commands/cloud-verifier-pascal-selector-census.js +0 -1382
  49. package/dist/commands/cloud-verifier-python-manifest-selector-census.js +0 -2015
  50. package/dist/commands/cloud-verifier-specialized-operational-census.js +0 -11432
  51. package/dist/commands/cloud-verifier-universe.js +0 -10178
  52. package/dist/commands/config.js +0 -549
  53. package/dist/commands/design-verify.js +0 -311
  54. package/dist/commands/dismiss.js +0 -159
  55. package/dist/commands/hooks.js +0 -226
  56. package/dist/commands/inbox.js +0 -137
  57. package/dist/commands/mcp.js +0 -201
  58. package/dist/commands/policy.js +0 -371
  59. package/dist/commands/pr-status.js +0 -207
  60. package/dist/commands/pr.js +0 -105
  61. package/dist/commands/prepare-universe-review.js +0 -1092
  62. package/dist/commands/production-source-deny-policy.js +0 -100
  63. package/dist/commands/request-review.js +0 -74
  64. package/dist/commands/review.js +0 -191
  65. package/dist/commands/rules.js +0 -98
  66. package/dist/commands/scaffold-provisional-universe.js +0 -806
  67. package/dist/commands/setup.js +0 -1170
  68. package/dist/commands/skills.js +0 -447
  69. package/dist/commands/submit.js +0 -745
  70. package/dist/commands/system-map.js +0 -228
  71. package/dist/commands/triage.js +0 -598
  72. package/dist/commands/webhooks.js +0 -241
  73. package/dist/states.js +0 -46
  74. package/dist/tools/detect.js +0 -832
  75. package/dist/triage/astra.js +0 -202
  76. package/dist/triage/prompts.js +0 -188
  77. package/dist/triage/runner.js +0 -200
  78. package/dist/triage/types.js +0 -7
  79. package/dist/utils/action-output.js +0 -26
  80. package/dist/utils/analysis-api.js +0 -416
  81. package/dist/utils/design-verifier-api.js +0 -294
  82. package/dist/utils/design-verifier-history.js +0 -79
  83. package/dist/utils/design-verifier-result.js +0 -424
  84. package/dist/utils/github-api.js +0 -324
  85. package/dist/utils/pending-state.js +0 -86
  86. package/dist/utils/pr-ref.js +0 -56
  87. package/dist/utils/prompter.js +0 -328
  88. package/schemas/action.v1.json +0 -22
  89. package/schemas/ask.v1.json +0 -40
  90. package/schemas/inbox.v1.json +0 -27
  91. package/schemas/pr-status.v1.json +0 -61
  92. package/schemas/pr.v1.json +0 -97
  93. package/schemas/pr.v3.json +0 -45
  94. package/schemas/setup.v1.json +0 -75
  95. package/schemas/submit.v1.json +0 -90
  96. package/schemas/triage.v1.json +0 -103
  97. package/schemas/triage.v2.json +0 -64
@@ -1,416 +0,0 @@
1
- import * as fs from 'fs';
2
- import * as path from 'path';
3
- import type {
4
- AgentContext,
5
- AgentParser,
6
- DetectionResult,
7
- InteractionTurn,
8
- ModifiedFile,
9
- TokenUsage,
10
- ToolUseInfo,
11
- } from '../types.js';
12
- import { detectAgent } from '../detect.js';
13
-
14
- const PATCH_FILE_LINE_RE = /^\*\*\* (?:Update|Add|Delete) File: (.+)$/;
15
- const PATCH_MOVE_LINE_RE = /^\*\*\* Move to: (.+)$/;
16
- const EDITING_TOOLS = new Set([
17
- 'apply_patch',
18
- 'write_file',
19
- 'edit_file',
20
- 'create_file',
21
- 'replace_file',
22
- ]);
23
- const FILE_PATH_KEYS = [
24
- 'path',
25
- 'file_path',
26
- 'filePath',
27
- 'filename',
28
- 'target_path',
29
- 'targetPath',
30
- 'new_path',
31
- 'newPath',
32
- 'old_path',
33
- 'oldPath',
34
- 'notebook_path',
35
- ];
36
- const TASK_PROMPT_SKIP_PREFIXES = [
37
- '# AGENTS.md instructions for ',
38
- '<permissions instructions>',
39
- '<app-context>',
40
- '<collaboration_mode>',
41
- '<skills_instructions>',
42
- '<environment_context>',
43
- ];
44
-
45
- interface CodexRecord {
46
- type?: string;
47
- payload?: Record<string, unknown>;
48
- }
49
-
50
- interface CodexSessionMetaPayload {
51
- id?: string;
52
- timestamp?: string;
53
- cwd?: string;
54
- cli_version?: string;
55
- git?: {
56
- branch?: string;
57
- };
58
- }
59
-
60
- interface CodexTurnContextPayload {
61
- model?: string;
62
- cwd?: string;
63
- }
64
-
65
- interface CodexTokenUsagePayload {
66
- input_tokens?: number;
67
- cached_input_tokens?: number;
68
- output_tokens?: number;
69
- }
70
-
71
- function parseLines(raw: string): CodexRecord[] {
72
- const records: CodexRecord[] = [];
73
- for (const line of raw.split('\n')) {
74
- const trimmed = line.trim();
75
- if (!trimmed) continue;
76
- try {
77
- records.push(JSON.parse(trimmed));
78
- } catch {
79
- // Skip partial lines while a session file is still being written.
80
- }
81
- }
82
- return records;
83
- }
84
-
85
- function extractTextContent(content: unknown): string {
86
- if (typeof content === 'string') return content;
87
- if (!Array.isArray(content)) return '';
88
-
89
- return content
90
- .map((part) => {
91
- if (typeof part === 'string') return part;
92
- if (
93
- part &&
94
- typeof part === 'object' &&
95
- 'text' in part &&
96
- typeof part.text === 'string'
97
- ) {
98
- return part.text;
99
- }
100
- return '';
101
- })
102
- .filter(Boolean)
103
- .join('\n');
104
- }
105
-
106
- function truncateString(value: string): string {
107
- if (value.length <= 200) return value;
108
- return value.slice(0, 200) + '... (truncated)';
109
- }
110
-
111
- function sanitizeInput(input: Record<string, unknown>): Record<string, unknown> {
112
- const sanitized: Record<string, unknown> = {};
113
- for (const [key, value] of Object.entries(input)) {
114
- if (typeof value === 'string') {
115
- sanitized[key] = truncateString(value);
116
- } else if (Array.isArray(value)) {
117
- sanitized[key] = value.map((item) =>
118
- typeof item === 'string' ? truncateString(item) : item,
119
- );
120
- } else {
121
- sanitized[key] = value;
122
- }
123
- }
124
- return sanitized;
125
- }
126
-
127
- function parseJsonObject(raw: unknown): Record<string, unknown> {
128
- if (typeof raw !== 'string' || !raw.trim()) return {};
129
- try {
130
- const parsed: unknown = JSON.parse(raw);
131
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
132
- return parsed as Record<string, unknown>;
133
- }
134
- } catch {
135
- // Ignore malformed arguments payloads.
136
- }
137
- return {};
138
- }
139
-
140
- function extractPatchFilePaths(inputText: string): string[] {
141
- const filePaths = new Set<string>();
142
-
143
- for (const line of inputText.split('\n')) {
144
- const fileMatch = line.match(PATCH_FILE_LINE_RE);
145
- if (fileMatch) {
146
- filePaths.add(fileMatch[1]);
147
- continue;
148
- }
149
-
150
- const moveMatch = line.match(PATCH_MOVE_LINE_RE);
151
- if (moveMatch) {
152
- filePaths.add(moveMatch[1]);
153
- }
154
- }
155
-
156
- return Array.from(filePaths);
157
- }
158
-
159
- function extractKnownFilePaths(input: Record<string, unknown>): string[] {
160
- const filePaths = new Set<string>();
161
-
162
- for (const key of FILE_PATH_KEYS) {
163
- const value = input[key];
164
- if (typeof value === 'string' && value.trim()) {
165
- filePaths.add(value);
166
- } else if (Array.isArray(value)) {
167
- for (const item of value) {
168
- if (typeof item === 'string' && item.trim()) {
169
- filePaths.add(item);
170
- }
171
- }
172
- }
173
- }
174
-
175
- return Array.from(filePaths);
176
- }
177
-
178
- function extractPatchInputText(
179
- input: Record<string, unknown>,
180
- rawInputText?: string,
181
- ): string {
182
- const parsedInputText = input.input;
183
- if (typeof parsedInputText === 'string' && parsedInputText.trim()) {
184
- return parsedInputText;
185
- }
186
-
187
- const parsedPatchText = input.patch;
188
- if (typeof parsedPatchText === 'string' && parsedPatchText.trim()) {
189
- return parsedPatchText;
190
- }
191
-
192
- const rawInputObject = parseJsonObject(rawInputText);
193
- const rawObjectInputText = rawInputObject.input;
194
- if (typeof rawObjectInputText === 'string' && rawObjectInputText.trim()) {
195
- return rawObjectInputText;
196
- }
197
-
198
- const rawObjectPatchText = rawInputObject.patch;
199
- if (typeof rawObjectPatchText === 'string' && rawObjectPatchText.trim()) {
200
- return rawObjectPatchText;
201
- }
202
-
203
- return typeof rawInputText === 'string' ? rawInputText : '';
204
- }
205
-
206
- function extractModifiedFiles(
207
- toolName: string,
208
- toolUseId: string,
209
- input: Record<string, unknown>,
210
- rawInputText?: string,
211
- ): ModifiedFile[] {
212
- let filePaths: string[] = [];
213
-
214
- if (toolName === 'apply_patch') {
215
- const patchInputText = extractPatchInputText(input, rawInputText);
216
- if (patchInputText) {
217
- filePaths = extractPatchFilePaths(patchInputText);
218
- }
219
- } else if (EDITING_TOOLS.has(toolName)) {
220
- filePaths = extractKnownFilePaths(input);
221
- }
222
-
223
- return filePaths.map((filePath) => ({
224
- filePath,
225
- toolName,
226
- toolUseId,
227
- }));
228
- }
229
-
230
- function getOrCreateAssistantTurn(transcript: InteractionTurn[]): InteractionTurn {
231
- const lastTurn = transcript[transcript.length - 1];
232
- if (lastTurn && lastTurn.role === 'assistant') {
233
- return lastTurn;
234
- }
235
-
236
- const turn: InteractionTurn = {
237
- turnIndex: transcript.length,
238
- role: 'assistant',
239
- content: '',
240
- modifiedFiles: [],
241
- toolUses: [],
242
- };
243
- transcript.push(turn);
244
- return turn;
245
- }
246
-
247
- function isMeaningfulTaskPrompt(content: string): boolean {
248
- const trimmed = content.trim();
249
- if (!trimmed) return false;
250
- return !TASK_PROMPT_SKIP_PREFIXES.some((prefix) => trimmed.startsWith(prefix));
251
- }
252
-
253
- function extractSessionId(sessionFilePath: string, sessionMeta?: CodexSessionMetaPayload): string {
254
- if (sessionMeta?.id) return sessionMeta.id;
255
-
256
- const basename = path.basename(sessionFilePath);
257
- const match = basename.match(
258
- /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i,
259
- );
260
- return match ? match[1] : basename.replace(/\.jsonl$/, '');
261
- }
262
-
263
- export class CodexParser implements AgentParser {
264
- async detect(repoPath: string): Promise<DetectionResult> {
265
- return detectAgent(repoPath);
266
- }
267
-
268
- async parse(
269
- sessionFilePath: string,
270
- _repoPath: string,
271
- ): Promise<AgentContext> {
272
- const raw = fs.readFileSync(sessionFilePath, 'utf-8');
273
- const records = parseLines(raw);
274
- const transcript: InteractionTurn[] = [];
275
- const fallbackUserPrompts: string[] = [];
276
- let taskPrompt = '';
277
- let sessionMeta: CodexSessionMetaPayload | undefined;
278
- let latestTurnContext: CodexTurnContextPayload | undefined;
279
- let totalUsage: TokenUsage = {
280
- inputTokens: 0,
281
- outputTokens: 0,
282
- cacheReadTokens: 0,
283
- cacheCreationTokens: 0,
284
- };
285
-
286
- for (const record of records) {
287
- if (!record.type || !record.payload) continue;
288
-
289
- if (record.type === 'session_meta') {
290
- sessionMeta = record.payload as unknown as CodexSessionMetaPayload;
291
- continue;
292
- }
293
-
294
- if (record.type === 'turn_context') {
295
- latestTurnContext = record.payload as unknown as CodexTurnContextPayload;
296
- continue;
297
- }
298
-
299
- if (record.type === 'event_msg') {
300
- const payloadType = record.payload.type;
301
- if (payloadType === 'token_count') {
302
- const usage = (
303
- record.payload.info as { total_token_usage?: CodexTokenUsagePayload } | undefined
304
- )?.total_token_usage;
305
- if (usage) {
306
- totalUsage = {
307
- inputTokens: usage.input_tokens || 0,
308
- outputTokens: usage.output_tokens || 0,
309
- cacheReadTokens: usage.cached_input_tokens || 0,
310
- cacheCreationTokens: 0,
311
- };
312
- }
313
- }
314
- continue;
315
- }
316
-
317
- if (record.type !== 'response_item') continue;
318
-
319
- const payloadType = record.payload.type;
320
- if (payloadType === 'message') {
321
- const role = record.payload.role;
322
- if (role !== 'user' && role !== 'assistant') continue;
323
-
324
- const content = extractTextContent(record.payload.content);
325
- if (role === 'user') {
326
- if (content) {
327
- fallbackUserPrompts.push(content);
328
- if (!taskPrompt && isMeaningfulTaskPrompt(content)) {
329
- taskPrompt = content;
330
- }
331
- }
332
- }
333
-
334
- transcript.push({
335
- turnIndex: transcript.length,
336
- role,
337
- content,
338
- modifiedFiles: [],
339
- toolUses: [],
340
- });
341
- continue;
342
- }
343
-
344
- if (payloadType === 'function_call') {
345
- const toolName =
346
- typeof record.payload.name === 'string' ? record.payload.name : 'unknown';
347
- const toolUseId =
348
- typeof record.payload.call_id === 'string' ? record.payload.call_id : '';
349
- const rawArguments =
350
- typeof record.payload.arguments === 'string' ? record.payload.arguments : undefined;
351
- const input = parseJsonObject(record.payload.arguments);
352
- const assistantTurn = getOrCreateAssistantTurn(transcript);
353
-
354
- assistantTurn.toolUses.push({
355
- toolName,
356
- toolUseId,
357
- input: sanitizeInput(input),
358
- });
359
- assistantTurn.modifiedFiles.push(
360
- ...extractModifiedFiles(toolName, toolUseId, input, rawArguments),
361
- );
362
- continue;
363
- }
364
-
365
- if (payloadType === 'custom_tool_call') {
366
- const toolName =
367
- typeof record.payload.name === 'string' ? record.payload.name : 'unknown';
368
- const toolUseId =
369
- typeof record.payload.call_id === 'string' ? record.payload.call_id : '';
370
- const rawInput =
371
- typeof record.payload.input === 'string' ? record.payload.input : '';
372
- const input = rawInput ? { input: rawInput } : {};
373
- const assistantTurn = getOrCreateAssistantTurn(transcript);
374
-
375
- assistantTurn.toolUses.push({
376
- toolName,
377
- toolUseId,
378
- input: sanitizeInput(input),
379
- });
380
- assistantTurn.modifiedFiles.push(
381
- ...extractModifiedFiles(toolName, toolUseId, input, rawInput),
382
- );
383
- }
384
- }
385
-
386
- if (!taskPrompt) {
387
- taskPrompt = fallbackUserPrompts.find((prompt) => prompt.trim()) || '';
388
- }
389
-
390
- const allModifiedFiles = new Set<string>();
391
- for (const turn of transcript) {
392
- for (const modifiedFile of turn.modifiedFiles) {
393
- allModifiedFiles.add(modifiedFile.filePath);
394
- }
395
- }
396
-
397
- const stat = fs.statSync(sessionFilePath);
398
-
399
- return {
400
- agent: 'codex',
401
- sessionId: extractSessionId(sessionFilePath, sessionMeta),
402
- sessionFilePath,
403
- taskPrompt,
404
- modifiedFiles: Array.from(allModifiedFiles),
405
- tokenUsage: totalUsage,
406
- transcript,
407
- metadata: {
408
- model: latestTurnContext?.model,
409
- version: sessionMeta?.cli_version,
410
- gitBranch: sessionMeta?.git?.branch,
411
- startedAt: sessionMeta?.timestamp,
412
- sessionFileModifiedAt: stat.mtime.toISOString(),
413
- },
414
- };
415
- }
416
- }
@@ -1,155 +0,0 @@
1
- import * as fs from 'fs';
2
- import type {
3
- AgentContext,
4
- AgentParser,
5
- DetectionResult,
6
- InteractionTurn,
7
- ModifiedFile,
8
- TokenUsage,
9
- ToolUseInfo,
10
- } from '../types.js';
11
- import { detectAgent } from '../detect.js';
12
-
13
- interface GeminiToolCall {
14
- id?: string;
15
- name?: string;
16
- args?: Record<string, unknown>;
17
- status?: string;
18
- }
19
-
20
- interface GeminiTokens {
21
- input?: number;
22
- output?: number;
23
- cached?: number;
24
- thought?: number;
25
- }
26
-
27
- interface GeminiMessage {
28
- id?: string;
29
- type: 'user' | 'gemini';
30
- content: string | Array<{ text: string }>;
31
- toolCalls?: GeminiToolCall[];
32
- tokens?: GeminiTokens;
33
- }
34
-
35
- interface GeminiSession {
36
- messages: GeminiMessage[];
37
- }
38
-
39
- const FILE_PATH_KEYS = ['file_path', 'path', 'filename'];
40
-
41
- function extractContent(content: string | Array<{ text: string }>): string {
42
- if (typeof content === 'string') return content;
43
- if (Array.isArray(content)) {
44
- return content.map((c) => c.text).join('\n');
45
- }
46
- return '';
47
- }
48
-
49
- function extractModifiedFiles(toolCalls?: GeminiToolCall[]): ModifiedFile[] {
50
- if (!toolCalls) return [];
51
- const files: ModifiedFile[] = [];
52
-
53
- for (const call of toolCalls) {
54
- if (!call.args) continue;
55
- for (const key of FILE_PATH_KEYS) {
56
- const val = call.args[key];
57
- if (typeof val === 'string') {
58
- files.push({
59
- filePath: val,
60
- toolName: call.name || 'unknown',
61
- toolUseId: call.id,
62
- });
63
- break;
64
- }
65
- }
66
- }
67
- return files;
68
- }
69
-
70
- function extractToolUses(toolCalls?: GeminiToolCall[]): ToolUseInfo[] {
71
- if (!toolCalls) return [];
72
- return toolCalls.map((call) => ({
73
- toolName: call.name || 'unknown',
74
- toolUseId: call.id || '',
75
- input: (call.args as Record<string, unknown>) || {},
76
- }));
77
- }
78
-
79
- export class GeminiParser implements AgentParser {
80
- async detect(repoPath: string): Promise<DetectionResult> {
81
- return detectAgent(repoPath);
82
- }
83
-
84
- async parse(
85
- sessionFilePath: string,
86
- _repoPath: string,
87
- ): Promise<AgentContext> {
88
- const raw = fs.readFileSync(sessionFilePath, 'utf-8');
89
- const session: GeminiSession = JSON.parse(raw);
90
- const messages = session.messages || [];
91
-
92
- const transcript: InteractionTurn[] = [];
93
- const totalUsage: TokenUsage = {
94
- inputTokens: 0,
95
- outputTokens: 0,
96
- };
97
-
98
- let taskPrompt = '';
99
-
100
- for (let i = 0; i < messages.length; i++) {
101
- const msg = messages[i];
102
- const role = msg.type === 'user' ? 'user' : 'assistant';
103
- const content = extractContent(msg.content);
104
-
105
- if (role === 'user' && !taskPrompt && content) {
106
- taskPrompt = content;
107
- }
108
-
109
- if (msg.tokens) {
110
- totalUsage.inputTokens += msg.tokens.input || 0;
111
- totalUsage.outputTokens += msg.tokens.output || 0;
112
- }
113
-
114
- transcript.push({
115
- turnIndex: i,
116
- role,
117
- content,
118
- modifiedFiles: role === 'assistant' ? extractModifiedFiles(msg.toolCalls) : [],
119
- tokenUsage: msg.tokens
120
- ? {
121
- inputTokens: msg.tokens.input || 0,
122
- outputTokens: msg.tokens.output || 0,
123
- }
124
- : undefined,
125
- toolUses: role === 'assistant' ? extractToolUses(msg.toolCalls) : [],
126
- });
127
- }
128
-
129
- const allModifiedFiles = new Set<string>();
130
- for (const turn of transcript) {
131
- for (const f of turn.modifiedFiles) {
132
- allModifiedFiles.add(f.filePath);
133
- }
134
- }
135
-
136
- const stat = fs.statSync(sessionFilePath);
137
- const sessionId = sessionFilePath
138
- .split('/')
139
- .pop()
140
- ?.replace(/\.json$/, '') || '';
141
-
142
- return {
143
- agent: 'gemini-cli',
144
- sessionId,
145
- sessionFilePath,
146
- taskPrompt,
147
- modifiedFiles: Array.from(allModifiedFiles),
148
- tokenUsage: totalUsage,
149
- transcript,
150
- metadata: {
151
- sessionFileModifiedAt: stat.mtime.toISOString(),
152
- },
153
- };
154
- }
155
- }