claude-simple 0.2.36 → 0.2.37
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/dist/index.html
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
|
6
6
|
<title>Claude Code</title>
|
|
7
|
-
<link rel="stylesheet" href="/style.0.2.
|
|
7
|
+
<link rel="stylesheet" href="/style.0.2.37.min.css">
|
|
8
8
|
<link rel="stylesheet" href="/highlight.min.css">
|
|
9
9
|
<script src="/marked.min.js"></script>
|
|
10
10
|
<script src="/highlight.min.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
<body class="h-dvh overflow-hidden flex flex-col bg-base-100 text-base-content">
|
|
13
13
|
<div id="root" class="flex flex-col flex-1 overflow-hidden"></div>
|
|
14
|
-
<script type="module" src="/app.0.2.
|
|
14
|
+
<script type="module" src="/app.0.2.37.min.js"></script>
|
|
15
15
|
</body>
|
|
16
16
|
</html>
|
package/package.json
CHANGED
package/src/agents/codex.js
CHANGED
|
@@ -12,6 +12,10 @@ import crypto from 'crypto';
|
|
|
12
12
|
* result (usage), complete, error
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
export function isTransientCodexNotice(msg) {
|
|
16
|
+
return /Reconnecting|Falling back|remote compact task/i.test(String(msg || ''));
|
|
17
|
+
}
|
|
18
|
+
|
|
15
19
|
function mapPermissionToMode(permissionMode) {
|
|
16
20
|
if (permissionMode == null) return 'yolo';
|
|
17
21
|
switch (permissionMode) {
|
|
@@ -244,7 +248,7 @@ export function runCodex(command, options, send, { cliPath, activeSessions }) {
|
|
|
244
248
|
}
|
|
245
249
|
case 'error': {
|
|
246
250
|
const msg = raw.message || 'codex error';
|
|
247
|
-
if (
|
|
251
|
+
if (!isTransientCodexNotice(msg)) {
|
|
248
252
|
send({ type: 'error', message: msg, agent: 'codex' });
|
|
249
253
|
}
|
|
250
254
|
break;
|
package/src/agents/sessions.js
CHANGED
|
@@ -313,36 +313,63 @@ async function findCodexRollouts(codexHome) {
|
|
|
313
313
|
return files;
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
+
const CODEX_CATALOG_FULL_SCAN_MAX = 2 * 1024 * 1024;
|
|
317
|
+
const CODEX_CATALOG_HEAD_BYTES = 256 * 1024;
|
|
318
|
+
const CODEX_LINE_PARSE_MAX = 16 * 1024;
|
|
319
|
+
|
|
316
320
|
const codexMetadata = new Map();
|
|
317
321
|
async function readCodexMeta(filePath) {
|
|
318
322
|
const stat = await fs.stat(filePath);
|
|
319
323
|
const cached = codexMetadata.get(filePath);
|
|
320
324
|
if (cached?.size === stat.size && cached?.mtimeMs === stat.mtimeMs) return cached.meta;
|
|
321
325
|
let id = null, cwd = null, ts = null, turnCount = 0;
|
|
326
|
+
// Native rollouts keep every tool payload. AgentUI / Hub never show that
|
|
327
|
+
// body, so catalog only reads a short head (session_meta is line 0).
|
|
328
|
+
const limit = stat.size > CODEX_CATALOG_FULL_SCAN_MAX
|
|
329
|
+
? Math.min(stat.size, CODEX_CATALOG_HEAD_BYTES)
|
|
330
|
+
: stat.size;
|
|
322
331
|
try {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
if (limit > 0) {
|
|
333
|
+
const stream = fsSync.createReadStream(filePath, { start: 0, end: limit - 1 });
|
|
334
|
+
let pending = Buffer.alloc(0);
|
|
335
|
+
let skip = false;
|
|
336
|
+
for await (const chunk of stream) {
|
|
337
|
+
pending = pending.length ? Buffer.concat([pending, chunk]) : chunk;
|
|
338
|
+
let start = 0;
|
|
339
|
+
let end;
|
|
340
|
+
while ((end = pending.indexOf(10, start)) !== -1) {
|
|
341
|
+
const len = end - start;
|
|
342
|
+
const overflow = skip || len > CODEX_LINE_PARSE_MAX;
|
|
343
|
+
skip = false;
|
|
344
|
+
if (!overflow) {
|
|
345
|
+
const line = pending.subarray(start, end).toString('utf8');
|
|
346
|
+
const head = line.slice(0, 400);
|
|
347
|
+
if (/"type"\s*:\s*"(?:session_meta|turn_context)"/.test(head) ||
|
|
348
|
+
/"(?:role|type)"\s*:\s*"(?:user|user_message)"/.test(head)) {
|
|
349
|
+
try {
|
|
350
|
+
const d = JSON.parse(line);
|
|
351
|
+
if (d.type === 'session_meta' && d.payload) {
|
|
352
|
+
id = d.payload.id || id;
|
|
353
|
+
cwd = d.payload.cwd || cwd;
|
|
354
|
+
ts = d.payload.timestamp || d.timestamp || ts;
|
|
355
|
+
}
|
|
356
|
+
if (d.type === 'event_msg' && d.payload?.type === 'user_message') turnCount += 1;
|
|
357
|
+
else if (d.type === 'response_item' && d.payload?.role === 'user') turnCount += 1;
|
|
358
|
+
else if (d.type === 'turn_context' && d.payload?.turn_index != null) {
|
|
359
|
+
const idx = Number(d.payload.turn_index) + 1;
|
|
360
|
+
if (idx > turnCount) turnCount = idx;
|
|
361
|
+
}
|
|
362
|
+
} catch {}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
start = end + 1;
|
|
336
366
|
}
|
|
337
|
-
|
|
338
|
-
if (
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
// last turn_index + 1 is a better total; bump max
|
|
342
|
-
const idx = Number(d.payload.turn_index) + 1;
|
|
343
|
-
if (idx > turnCount) turnCount = idx;
|
|
367
|
+
pending = pending.subarray(start);
|
|
368
|
+
if (pending.length > CODEX_LINE_PARSE_MAX) {
|
|
369
|
+
skip = true;
|
|
370
|
+
pending = Buffer.alloc(0);
|
|
344
371
|
}
|
|
345
|
-
}
|
|
372
|
+
}
|
|
346
373
|
}
|
|
347
374
|
} catch {}
|
|
348
375
|
// Fallback: parse id from filename rollout-...-<uuid>.jsonl
|
|
@@ -472,11 +499,13 @@ async function updateCodexTranscript(filePath, entry, stat) {
|
|
|
472
499
|
let start = 0;
|
|
473
500
|
let end;
|
|
474
501
|
while ((end = pending.indexOf(10, start)) !== -1) {
|
|
475
|
-
const
|
|
476
|
-
entry.offset +=
|
|
502
|
+
const lineBytes = end - start;
|
|
503
|
+
entry.offset += lineBytes + 1;
|
|
477
504
|
start = end + 1;
|
|
478
|
-
//
|
|
479
|
-
//
|
|
505
|
+
// Tool outputs are multi-MB JSONL lines. AgentUI does not render them
|
|
506
|
+
// and Hub must not receive them — skip without materializing the body.
|
|
507
|
+
if (lineBytes > 64 * 1024) continue;
|
|
508
|
+
const line = pending.subarray(start - lineBytes - 1, end).toString('utf8');
|
|
480
509
|
const head = line.slice(0, 400);
|
|
481
510
|
if (!/"type"\s*:\s*"(?:response_item|event_msg)"/.test(head) ||
|
|
482
511
|
!/"type"\s*:\s*"(?:message|agent_message|function_call|command_execution|custom_tool_call|task_started|task_complete|turn_aborted)"/.test(head)) continue;
|
|
File without changes
|
|
File without changes
|