context-vault 2.17.0 → 3.0.1

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 (110) hide show
  1. package/bin/cli.js +783 -108
  2. package/node_modules/@context-vault/core/dist/capture.d.ts +21 -0
  3. package/node_modules/@context-vault/core/dist/capture.d.ts.map +1 -0
  4. package/node_modules/@context-vault/core/dist/capture.js +269 -0
  5. package/node_modules/@context-vault/core/dist/capture.js.map +1 -0
  6. package/node_modules/@context-vault/core/dist/categories.d.ts +6 -0
  7. package/node_modules/@context-vault/core/dist/categories.d.ts.map +1 -0
  8. package/node_modules/@context-vault/core/dist/categories.js +50 -0
  9. package/node_modules/@context-vault/core/dist/categories.js.map +1 -0
  10. package/node_modules/@context-vault/core/dist/config.d.ts +4 -0
  11. package/node_modules/@context-vault/core/dist/config.d.ts.map +1 -0
  12. package/node_modules/@context-vault/core/dist/config.js +190 -0
  13. package/node_modules/@context-vault/core/dist/config.js.map +1 -0
  14. package/node_modules/@context-vault/core/dist/constants.d.ts +33 -0
  15. package/node_modules/@context-vault/core/dist/constants.d.ts.map +1 -0
  16. package/node_modules/@context-vault/core/dist/constants.js +23 -0
  17. package/node_modules/@context-vault/core/dist/constants.js.map +1 -0
  18. package/node_modules/@context-vault/core/dist/db.d.ts +13 -0
  19. package/node_modules/@context-vault/core/dist/db.d.ts.map +1 -0
  20. package/node_modules/@context-vault/core/dist/db.js +191 -0
  21. package/node_modules/@context-vault/core/dist/db.js.map +1 -0
  22. package/node_modules/@context-vault/core/dist/embed.d.ts +5 -0
  23. package/node_modules/@context-vault/core/dist/embed.d.ts.map +1 -0
  24. package/node_modules/@context-vault/core/dist/embed.js +78 -0
  25. package/node_modules/@context-vault/core/dist/embed.js.map +1 -0
  26. package/node_modules/@context-vault/core/dist/files.d.ts +13 -0
  27. package/node_modules/@context-vault/core/dist/files.d.ts.map +1 -0
  28. package/node_modules/@context-vault/core/dist/files.js +66 -0
  29. package/node_modules/@context-vault/core/dist/files.js.map +1 -0
  30. package/node_modules/@context-vault/core/dist/formatters.d.ts +8 -0
  31. package/node_modules/@context-vault/core/dist/formatters.d.ts.map +1 -0
  32. package/node_modules/@context-vault/core/dist/formatters.js +18 -0
  33. package/node_modules/@context-vault/core/dist/formatters.js.map +1 -0
  34. package/node_modules/@context-vault/core/dist/frontmatter.d.ts +12 -0
  35. package/node_modules/@context-vault/core/dist/frontmatter.d.ts.map +1 -0
  36. package/node_modules/@context-vault/core/dist/frontmatter.js +101 -0
  37. package/node_modules/@context-vault/core/dist/frontmatter.js.map +1 -0
  38. package/node_modules/@context-vault/core/dist/index.d.ts +10 -0
  39. package/node_modules/@context-vault/core/dist/index.d.ts.map +1 -0
  40. package/node_modules/@context-vault/core/dist/index.js +297 -0
  41. package/node_modules/@context-vault/core/dist/index.js.map +1 -0
  42. package/node_modules/@context-vault/core/dist/ingest-url.d.ts +20 -0
  43. package/node_modules/@context-vault/core/dist/ingest-url.d.ts.map +1 -0
  44. package/node_modules/@context-vault/core/dist/ingest-url.js +113 -0
  45. package/node_modules/@context-vault/core/dist/ingest-url.js.map +1 -0
  46. package/node_modules/@context-vault/core/dist/main.d.ts +14 -0
  47. package/node_modules/@context-vault/core/dist/main.d.ts.map +1 -0
  48. package/node_modules/@context-vault/core/dist/main.js +25 -0
  49. package/node_modules/@context-vault/core/dist/main.js.map +1 -0
  50. package/node_modules/@context-vault/core/dist/search.d.ts +18 -0
  51. package/node_modules/@context-vault/core/dist/search.d.ts.map +1 -0
  52. package/node_modules/@context-vault/core/dist/search.js +238 -0
  53. package/node_modules/@context-vault/core/dist/search.js.map +1 -0
  54. package/node_modules/@context-vault/core/dist/types.d.ts +176 -0
  55. package/node_modules/@context-vault/core/dist/types.d.ts.map +1 -0
  56. package/node_modules/@context-vault/core/dist/types.js +2 -0
  57. package/node_modules/@context-vault/core/dist/types.js.map +1 -0
  58. package/node_modules/@context-vault/core/package.json +66 -16
  59. package/node_modules/@context-vault/core/src/capture.ts +308 -0
  60. package/node_modules/@context-vault/core/src/categories.ts +54 -0
  61. package/node_modules/@context-vault/core/src/{core/config.js → config.ts} +34 -33
  62. package/node_modules/@context-vault/core/src/{constants.js → constants.ts} +6 -3
  63. package/node_modules/@context-vault/core/src/db.ts +229 -0
  64. package/node_modules/@context-vault/core/src/{index/embed.js → embed.ts} +10 -35
  65. package/node_modules/@context-vault/core/src/files.ts +80 -0
  66. package/node_modules/@context-vault/core/src/{capture/formatters.js → formatters.ts} +13 -11
  67. package/node_modules/@context-vault/core/src/{core/frontmatter.js → frontmatter.ts} +27 -33
  68. package/node_modules/@context-vault/core/src/index.ts +351 -0
  69. package/node_modules/@context-vault/core/src/ingest-url.ts +99 -0
  70. package/node_modules/@context-vault/core/src/main.ts +111 -0
  71. package/node_modules/@context-vault/core/src/search.ts +285 -0
  72. package/node_modules/@context-vault/core/src/types.ts +166 -0
  73. package/package.json +12 -7
  74. package/scripts/postinstall.js +1 -1
  75. package/{node_modules/@context-vault/core/src/core → src}/error-log.js +1 -15
  76. package/{node_modules/@context-vault/core/src/server → src}/helpers.js +9 -4
  77. package/src/linking.js +100 -0
  78. package/{node_modules/@context-vault/core/src/server/tools.js → src/register-tools.js} +14 -15
  79. package/src/{server/index.js → server.js} +8 -35
  80. package/src/status.js +235 -0
  81. package/{node_modules/@context-vault/core/src/core → src}/telemetry.js +9 -19
  82. package/src/temporal.js +97 -0
  83. package/{node_modules/@context-vault/core/src/server → src}/tools/context-status.js +3 -4
  84. package/{node_modules/@context-vault/core/src/server → src}/tools/create-snapshot.js +43 -75
  85. package/{node_modules/@context-vault/core/src/server → src}/tools/delete-context.js +0 -2
  86. package/{node_modules/@context-vault/core/src/server → src}/tools/get-context.js +118 -35
  87. package/{node_modules/@context-vault/core/src/server → src}/tools/ingest-project.js +5 -6
  88. package/{node_modules/@context-vault/core/src/server → src}/tools/ingest-url.js +3 -4
  89. package/{node_modules/@context-vault/core/src/server → src}/tools/list-buckets.js +4 -5
  90. package/{node_modules/@context-vault/core/src/server → src}/tools/list-context.js +3 -6
  91. package/{node_modules/@context-vault/core/src/server → src}/tools/save-context.js +41 -21
  92. package/{node_modules/@context-vault/core/src/server → src}/tools/session-start.js +9 -16
  93. package/node_modules/@context-vault/core/src/capture/file-ops.js +0 -97
  94. package/node_modules/@context-vault/core/src/capture/import-pipeline.js +0 -46
  95. package/node_modules/@context-vault/core/src/capture/importers.js +0 -387
  96. package/node_modules/@context-vault/core/src/capture/index.js +0 -236
  97. package/node_modules/@context-vault/core/src/capture/ingest-url.js +0 -252
  98. package/node_modules/@context-vault/core/src/consolidation/index.js +0 -112
  99. package/node_modules/@context-vault/core/src/core/categories.js +0 -72
  100. package/node_modules/@context-vault/core/src/core/files.js +0 -108
  101. package/node_modules/@context-vault/core/src/core/status.js +0 -350
  102. package/node_modules/@context-vault/core/src/index/db.js +0 -416
  103. package/node_modules/@context-vault/core/src/index/index.js +0 -522
  104. package/node_modules/@context-vault/core/src/index.js +0 -66
  105. package/node_modules/@context-vault/core/src/retrieve/index.js +0 -500
  106. package/node_modules/@context-vault/core/src/server/tools/submit-feedback.js +0 -55
  107. package/node_modules/@context-vault/core/src/sync/sync.js +0 -235
  108. package/src/hooks/post-tool-call.mjs +0 -62
  109. package/src/hooks/session-end.mjs +0 -492
  110. /package/{node_modules/@context-vault/core/src/server → src}/tools/clear-context.js +0 -0
@@ -1,492 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { readFileSync, existsSync, unlinkSync } from "node:fs";
4
- import { join } from "node:path";
5
- import { homedir } from "node:os";
6
- import { basename } from "node:path";
7
- import { execSync, execFileSync } from "node:child_process";
8
-
9
- function readStdin() {
10
- return new Promise((resolve) => {
11
- let data = "";
12
- process.stdin.on("data", (chunk) => (data += chunk));
13
- process.stdin.on("end", () => resolve(data));
14
- setTimeout(() => resolve(data), 5000);
15
- });
16
- }
17
-
18
- function detectProject(cwd) {
19
- if (!cwd) return null;
20
- try {
21
- const remote = execSync("git remote get-url origin 2>/dev/null", {
22
- cwd,
23
- encoding: "utf-8",
24
- timeout: 3000,
25
- stdio: ["pipe", "pipe", "pipe"],
26
- }).trim();
27
- if (remote) {
28
- const match = remote.match(/\/([^/]+?)(?:\.git)?$/);
29
- if (match) return match[1];
30
- }
31
- } catch {}
32
- return basename(cwd);
33
- }
34
-
35
- export function parseTranscript(transcriptPath) {
36
- const filesRead = new Set();
37
- const filesModified = new Set();
38
- const searchPatterns = new Set();
39
- const toolCounts = {};
40
- let startTime = null;
41
- let endTime = null;
42
-
43
- if (!transcriptPath || !existsSync(transcriptPath)) {
44
- return {
45
- filesRead,
46
- filesModified,
47
- searchPatterns,
48
- toolCounts,
49
- startTime,
50
- endTime,
51
- };
52
- }
53
-
54
- let lines;
55
- try {
56
- const raw = readFileSync(transcriptPath, "utf-8");
57
- lines = raw.split("\n").filter((l) => l.trim());
58
- } catch {
59
- return {
60
- filesRead,
61
- filesModified,
62
- searchPatterns,
63
- toolCounts,
64
- startTime,
65
- endTime,
66
- };
67
- }
68
-
69
- return parseTranscriptLines(lines);
70
- }
71
-
72
- export function parseTranscriptLines(lines) {
73
- const filesRead = new Set();
74
- const filesModified = new Set();
75
- const searchPatterns = new Set();
76
- const toolCounts = {};
77
- let startTime = null;
78
- let endTime = null;
79
-
80
- for (const line of lines) {
81
- let entry;
82
- try {
83
- entry = typeof line === "string" ? JSON.parse(line) : line;
84
- } catch {
85
- continue;
86
- }
87
-
88
- if (entry.timestamp) {
89
- const ts = new Date(entry.timestamp);
90
- if (!isNaN(ts.getTime())) {
91
- if (!startTime || ts < startTime) startTime = ts;
92
- if (!endTime || ts > endTime) endTime = ts;
93
- }
94
- }
95
-
96
- const msg = entry.message;
97
- if (!msg) continue;
98
-
99
- const contentBlocks = msg.content;
100
- if (!Array.isArray(contentBlocks)) continue;
101
-
102
- for (const block of contentBlocks) {
103
- if (block.type === "tool_use") {
104
- const toolName = block.name || "unknown";
105
- toolCounts[toolName] = (toolCounts[toolName] || 0) + 1;
106
-
107
- const input = block.input || {};
108
-
109
- if (
110
- toolName === "Read" ||
111
- toolName === "read_file" ||
112
- toolName === "read"
113
- ) {
114
- const fp = input.file_path || input.path;
115
- if (fp) filesRead.add(fp);
116
- }
117
-
118
- if (
119
- toolName === "Write" ||
120
- toolName === "Edit" ||
121
- toolName === "write_file" ||
122
- toolName === "edit_file" ||
123
- toolName === "write" ||
124
- toolName === "edit"
125
- ) {
126
- const fp = input.file_path || input.path;
127
- if (fp) filesModified.add(fp);
128
- }
129
-
130
- if (toolName === "NotebookEdit" || toolName === "notebook_edit") {
131
- const fp = input.notebook_path || input.path;
132
- if (fp) filesModified.add(fp);
133
- }
134
-
135
- if (
136
- toolName === "Grep" ||
137
- toolName === "grep" ||
138
- toolName === "search" ||
139
- toolName === "Search"
140
- ) {
141
- const pattern = input.pattern || input.query || input.regex;
142
- if (pattern) searchPatterns.add(pattern);
143
- }
144
-
145
- if (toolName === "Glob" || toolName === "glob") {
146
- const pattern = input.pattern;
147
- if (pattern) searchPatterns.add(pattern);
148
- }
149
-
150
- if (toolName === "Bash" || toolName === "bash") {
151
- const cmd = input.command || "";
152
- const grepMatch = cmd.match(
153
- /\bgrep\s+(?:-[^\s]+\s+)*['"]?([^'"|\s]+)/,
154
- );
155
- if (grepMatch) searchPatterns.add(grepMatch[1]);
156
- const rgMatch = cmd.match(/\brg\s+(?:-[^\s]+\s+)*['"]?([^'"|\s]+)/);
157
- if (rgMatch) searchPatterns.add(rgMatch[1]);
158
- }
159
-
160
- if (toolName === "WebSearch" || toolName === "web_search") {
161
- const q = input.query;
162
- if (q) searchPatterns.add(q);
163
- }
164
- }
165
- }
166
- }
167
-
168
- return {
169
- filesRead,
170
- filesModified,
171
- searchPatterns,
172
- toolCounts,
173
- startTime,
174
- endTime,
175
- };
176
- }
177
-
178
- export function parseSessionLog(sessionId) {
179
- if (!sessionId) return null;
180
-
181
- const logFile = join(
182
- homedir(),
183
- ".context-mcp",
184
- "sessions",
185
- `${sessionId}.jsonl`,
186
- );
187
- if (!existsSync(logFile)) return null;
188
-
189
- let raw;
190
- try {
191
- raw = readFileSync(logFile, "utf-8");
192
- } catch {
193
- return null;
194
- }
195
-
196
- const lines = raw.split("\n").filter((l) => l.trim());
197
-
198
- const filesRead = new Set();
199
- const filesModified = new Set();
200
- const searchPatterns = new Set();
201
- const toolCounts = {};
202
- let startTime = null;
203
- let endTime = null;
204
-
205
- for (const line of lines) {
206
- let entry;
207
- try {
208
- entry = JSON.parse(line);
209
- } catch {
210
- continue;
211
- }
212
-
213
- if (entry.ts) {
214
- const ts = new Date(entry.ts);
215
- if (!isNaN(ts.getTime())) {
216
- if (!startTime || ts < startTime) startTime = ts;
217
- if (!endTime || ts > endTime) endTime = ts;
218
- }
219
- }
220
-
221
- const toolName = entry.tool;
222
- if (!toolName) continue;
223
-
224
- toolCounts[toolName] = (toolCounts[toolName] || 0) + 1;
225
-
226
- const input = entry.input || {};
227
-
228
- if (
229
- toolName === "Read" ||
230
- toolName === "read_file" ||
231
- toolName === "read"
232
- ) {
233
- const fp = input.file_path || input.path;
234
- if (fp) filesRead.add(fp);
235
- }
236
-
237
- if (
238
- toolName === "Write" ||
239
- toolName === "Edit" ||
240
- toolName === "write_file" ||
241
- toolName === "edit_file" ||
242
- toolName === "write" ||
243
- toolName === "edit"
244
- ) {
245
- const fp = input.file_path || input.path;
246
- if (fp) filesModified.add(fp);
247
- }
248
-
249
- if (toolName === "NotebookEdit" || toolName === "notebook_edit") {
250
- const fp = input.notebook_path || input.path;
251
- if (fp) filesModified.add(fp);
252
- }
253
-
254
- if (
255
- toolName === "Grep" ||
256
- toolName === "grep" ||
257
- toolName === "search" ||
258
- toolName === "Search"
259
- ) {
260
- const pattern = input.pattern || input.query || input.regex;
261
- if (pattern) searchPatterns.add(pattern);
262
- }
263
-
264
- if (toolName === "Glob" || toolName === "glob") {
265
- const pattern = input.pattern;
266
- if (pattern) searchPatterns.add(pattern);
267
- }
268
-
269
- if (toolName === "Bash" || toolName === "bash") {
270
- const cmd = input.command || "";
271
- const grepMatch = cmd.match(/\bgrep\s+(?:-[^\s]+\s+)*['"]?([^'"|\s]+)/);
272
- if (grepMatch) searchPatterns.add(grepMatch[1]);
273
- const rgMatch = cmd.match(/\brg\s+(?:-[^\s]+\s+)*['"]?([^'"|\s]+)/);
274
- if (rgMatch) searchPatterns.add(rgMatch[1]);
275
- }
276
-
277
- if (toolName === "WebSearch" || toolName === "web_search") {
278
- const q = input.query;
279
- if (q) searchPatterns.add(q);
280
- }
281
- }
282
-
283
- try {
284
- unlinkSync(logFile);
285
- } catch {}
286
-
287
- return {
288
- filesRead,
289
- filesModified,
290
- searchPatterns,
291
- toolCounts,
292
- startTime,
293
- endTime,
294
- };
295
- }
296
-
297
- export function formatDuration(startTime, endTime) {
298
- if (!startTime || !endTime) return null;
299
- const ms = endTime - startTime;
300
- const seconds = Math.floor(ms / 1000);
301
- if (seconds < 60) return `${seconds}s`;
302
- const minutes = Math.floor(seconds / 60);
303
- const remainSec = seconds % 60;
304
- if (minutes < 60) return `${minutes}m ${remainSec}s`;
305
- const hours = Math.floor(minutes / 60);
306
- const remainMin = minutes % 60;
307
- return `${hours}h ${remainMin}m`;
308
- }
309
-
310
- function formatList(items, max = 20) {
311
- const arr = Array.from(items);
312
- if (arr.length === 0) return "_none_";
313
- const shown = arr.slice(0, max);
314
- const lines = shown.map((p) => ` - \`${p}\``);
315
- if (arr.length > max) lines.push(` - _...and ${arr.length - max} more_`);
316
- return lines.join("\n");
317
- }
318
-
319
- function formatToolCounts(toolCounts) {
320
- const entries = Object.entries(toolCounts).sort((a, b) => b[1] - a[1]);
321
- if (entries.length === 0) return "_none_";
322
- return entries.map(([name, count]) => ` - ${name}: ${count}`).join("\n");
323
- }
324
-
325
- const INSIGHT_PATTERNS = [
326
- /★\s*(.+?)(?:\n|$)/g,
327
- /\*\*(?:Key )?[Ii]nsight[:\*]*\*?\*?\s*(.+?)(?:\n\n|\n(?=[#*-]))/gs,
328
- /\*\*(?:Key )?[Ff]inding[:\*]*\*?\*?\s*(.+?)(?:\n\n|\n(?=[#*-]))/gs,
329
- />\s*\*\*(?:Note|Important|Key)[:\*]*\*?\*?\s*(.+?)(?:\n|$)/g,
330
- ];
331
-
332
- const MAX_INSIGHTS = 10;
333
- const MAX_INSIGHT_BODY = 300;
334
-
335
- export function extractInsights(transcriptPath) {
336
- if (!transcriptPath || !existsSync(transcriptPath)) return [];
337
-
338
- let lines;
339
- try {
340
- const raw = readFileSync(transcriptPath, "utf-8");
341
- lines = raw.split("\n").filter((l) => l.trim());
342
- } catch {
343
- return [];
344
- }
345
-
346
- const insights = [];
347
-
348
- for (const line of lines) {
349
- if (insights.length >= MAX_INSIGHTS) break;
350
-
351
- let entry;
352
- try {
353
- entry = JSON.parse(line);
354
- } catch {
355
- continue;
356
- }
357
-
358
- const msg = entry.message;
359
- if (!msg || msg.role !== "assistant") continue;
360
-
361
- const contentBlocks = msg.content;
362
- if (!Array.isArray(contentBlocks)) continue;
363
-
364
- for (const block of contentBlocks) {
365
- if (insights.length >= MAX_INSIGHTS) break;
366
- if (block.type !== "text" || !block.text) continue;
367
-
368
- const text = block.text;
369
-
370
- for (const pattern of INSIGHT_PATTERNS) {
371
- if (insights.length >= MAX_INSIGHTS) break;
372
-
373
- pattern.lastIndex = 0;
374
- let match;
375
- while ((match = pattern.exec(text)) !== null) {
376
- if (insights.length >= MAX_INSIGHTS) break;
377
-
378
- const captured = match[1];
379
- if (!captured) continue;
380
-
381
- const body = captured.trim().slice(0, MAX_INSIGHT_BODY);
382
- if (!body || body.length < 10) continue;
383
-
384
- const title = body.split(/[.\n]/)[0].trim().slice(0, 80);
385
- insights.push({ title, body });
386
- }
387
- }
388
- }
389
- }
390
-
391
- return insights;
392
- }
393
-
394
- export function buildSummary({
395
- filesRead,
396
- filesModified,
397
- searchPatterns,
398
- toolCounts,
399
- startTime,
400
- endTime,
401
- insights = [],
402
- }) {
403
- const sections = ["## Session Summary"];
404
-
405
- const duration = formatDuration(startTime, endTime);
406
- if (duration) {
407
- sections.push(`- **Duration**: ${duration}`);
408
- }
409
-
410
- sections.push(
411
- `- **Files read** (${filesRead.size}):\n${formatList(filesRead)}`,
412
- );
413
- sections.push(
414
- `- **Files modified** (${filesModified.size}):\n${formatList(filesModified)}`,
415
- );
416
- sections.push(
417
- `- **Searches** (${searchPatterns.size}):\n${formatList(searchPatterns)}`,
418
- );
419
- sections.push(`- **Tools used**:\n${formatToolCounts(toolCounts)}`);
420
-
421
- if (insights.length > 0) {
422
- const lines = insights.map((ins) => ` - "${ins.body}"`);
423
- sections.push(
424
- `- **Insights captured** (${insights.length}):\n${lines.join("\n")}`,
425
- );
426
- }
427
-
428
- return sections.join("\n");
429
- }
430
-
431
- export async function main() {
432
- try {
433
- const raw = await readStdin();
434
- if (!raw.trim()) process.exit(0);
435
-
436
- let hookInput;
437
- try {
438
- hookInput = JSON.parse(raw);
439
- } catch {
440
- process.exit(0);
441
- }
442
-
443
- const { transcript_path, cwd, session_id } = hookInput;
444
- const project = detectProject(cwd);
445
-
446
- const sessionLog = parseSessionLog(session_id);
447
- const data =
448
- sessionLog && Object.values(sessionLog.toolCounts).length > 0
449
- ? sessionLog
450
- : parseTranscript(transcript_path);
451
-
452
- const totalToolCalls = Object.values(data.toolCounts).reduce(
453
- (a, b) => a + b,
454
- 0,
455
- );
456
- if (totalToolCalls === 0) {
457
- process.exit(0);
458
- }
459
-
460
- const insights = extractInsights(transcript_path);
461
- const body = buildSummary({ ...data, insights });
462
- const tags = ["session", "auto-captured"];
463
- if (project) tags.unshift(project);
464
-
465
- const title = `Session ${session_id ? session_id.slice(0, 8) : new Date().toISOString().slice(0, 10)}`;
466
-
467
- const payload = JSON.stringify({
468
- kind: "session",
469
- title,
470
- body,
471
- tags,
472
- source: "session-end-hook",
473
- });
474
-
475
- execFileSync("npx", ["context-vault", "session-capture"], {
476
- input: payload,
477
- timeout: 30000,
478
- stdio: ["pipe", "pipe", "pipe"],
479
- });
480
- } catch {
481
- // fail silently — never block session end
482
- }
483
- }
484
-
485
- const isDirectRun =
486
- process.argv[1] &&
487
- (process.argv[1].endsWith("session-end.mjs") ||
488
- process.argv[1].endsWith("session-end.js"));
489
-
490
- if (isDirectRun) {
491
- main();
492
- }