remote-codex 0.11.41 → 0.11.42
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/apps/relay-server/dist/index.js +136 -49
- package/apps/supervisor-api/dist/index.js +51 -14
- package/apps/supervisor-web/dist/assets/index-BcCLYWAf.css +1 -0
- package/apps/supervisor-web/dist/assets/index-BvxWpPKW.js +21 -0
- package/apps/supervisor-web/dist/assets/{thread-ui-xWvswa2v.js → thread-ui-BLThton-.js} +40 -38
- package/apps/supervisor-web/dist/index.html +3 -3
- package/package.json +1 -1
- package/packages/shared/src/index.ts +91 -1
- package/apps/supervisor-web/dist/assets/index-B-qj7e8G.js +0 -21
- package/apps/supervisor-web/dist/assets/index-CDFuOeJN.css +0 -1
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
11
11
|
<link rel="manifest" href="/site.webmanifest" />
|
|
12
12
|
<title>Remote Codex</title>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-BvxWpPKW.js"></script>
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-Dfg_6BLf.js">
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/ui-vendor-CuR8GHb0.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/graph-vendor-DVQUpZ8C.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/terminal-vendor-C5bTa-Ka.js">
|
|
18
18
|
<link rel="modulepreload" crossorigin href="/assets/markdown-vendor-RZk8L7-L.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/thread-ui-
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/thread-ui-BLThton-.js">
|
|
20
20
|
<link rel="stylesheet" crossorigin href="/assets/graph-vendor-C5ap-Sga.css">
|
|
21
21
|
<link rel="stylesheet" crossorigin href="/assets/terminal-vendor-Beg8tuEN.css">
|
|
22
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
22
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BcCLYWAf.css">
|
|
23
23
|
</head>
|
|
24
24
|
<body class="bg-stone-950">
|
|
25
25
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1156,7 +1156,7 @@ export interface ThreadAnsweredRequestNoteDto {
|
|
|
1156
1156
|
|
|
1157
1157
|
export interface ThreadActivityNoteDto {
|
|
1158
1158
|
id: string;
|
|
1159
|
-
kind: 'fastMode' | 'forkCreated' | 'forkSource';
|
|
1159
|
+
kind: 'fastMode' | 'goal' | 'forkCreated' | 'forkSource';
|
|
1160
1160
|
createdAt: string;
|
|
1161
1161
|
text?: string;
|
|
1162
1162
|
anchorTurnId?: string | null;
|
|
@@ -1374,6 +1374,96 @@ export interface ThreadDetailDto {
|
|
|
1374
1374
|
liveItems?: ThreadLiveItemsDto | null;
|
|
1375
1375
|
}
|
|
1376
1376
|
|
|
1377
|
+
export function prependEarlierThreadTurns(
|
|
1378
|
+
existing: ThreadDetailDto['turns'],
|
|
1379
|
+
earlier: ThreadDetailDto['turns'],
|
|
1380
|
+
) {
|
|
1381
|
+
const existingIds = new Set(existing.map((turn) => turn.id));
|
|
1382
|
+
return [...earlier.filter((turn) => !existingIds.has(turn.id)), ...existing];
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
export function mergeLatestThreadTurns(
|
|
1386
|
+
existing: ThreadDetailDto['turns'],
|
|
1387
|
+
latest: ThreadDetailDto['turns'],
|
|
1388
|
+
activeTurnId: string | null = null,
|
|
1389
|
+
) {
|
|
1390
|
+
const seenLatestIds = new Set<string>();
|
|
1391
|
+
const uniqueLatest = latest.reduceRight<ThreadDetailDto['turns']>(
|
|
1392
|
+
(turns, turn) => {
|
|
1393
|
+
if (!seenLatestIds.has(turn.id)) {
|
|
1394
|
+
seenLatestIds.add(turn.id);
|
|
1395
|
+
turns.unshift(turn);
|
|
1396
|
+
}
|
|
1397
|
+
return turns;
|
|
1398
|
+
},
|
|
1399
|
+
[],
|
|
1400
|
+
);
|
|
1401
|
+
const latestById = new Map(uniqueLatest.map((turn) => [turn.id, turn]));
|
|
1402
|
+
const latestReplacements = uniqueLatest.filter((turn) =>
|
|
1403
|
+
turn.items.some((item) => item.kind === 'userMessage'),
|
|
1404
|
+
);
|
|
1405
|
+
const replacedExistingIds = new Set<string>();
|
|
1406
|
+
const seenExistingIds = new Set<string>();
|
|
1407
|
+
const uniqueExisting = existing.reduceRight<ThreadDetailDto['turns']>(
|
|
1408
|
+
(turns, turn) => {
|
|
1409
|
+
if (!seenExistingIds.has(turn.id)) {
|
|
1410
|
+
seenExistingIds.add(turn.id);
|
|
1411
|
+
turns.unshift(turn);
|
|
1412
|
+
}
|
|
1413
|
+
return turns;
|
|
1414
|
+
},
|
|
1415
|
+
[],
|
|
1416
|
+
);
|
|
1417
|
+
|
|
1418
|
+
for (const turn of uniqueExisting) {
|
|
1419
|
+
if (latestById.has(turn.id)) {
|
|
1420
|
+
replacedExistingIds.add(turn.id);
|
|
1421
|
+
continue;
|
|
1422
|
+
}
|
|
1423
|
+
if (turn.status !== 'inProgress') {
|
|
1424
|
+
continue;
|
|
1425
|
+
}
|
|
1426
|
+
const existingPrompt = turn.items.find(
|
|
1427
|
+
(item) => item.kind === 'userMessage',
|
|
1428
|
+
)?.text.trim();
|
|
1429
|
+
const existingStartedAt = turn.startedAt
|
|
1430
|
+
? Date.parse(turn.startedAt)
|
|
1431
|
+
: Number.NaN;
|
|
1432
|
+
if (!existingPrompt || !Number.isFinite(existingStartedAt)) {
|
|
1433
|
+
continue;
|
|
1434
|
+
}
|
|
1435
|
+
const materializedReplacement = latestReplacements.find((replacement) => {
|
|
1436
|
+
const replacementPrompt = replacement.items.find(
|
|
1437
|
+
(item) => item.kind === 'userMessage',
|
|
1438
|
+
)?.text.trim();
|
|
1439
|
+
const replacementStartedAt = replacement.startedAt
|
|
1440
|
+
? Date.parse(replacement.startedAt)
|
|
1441
|
+
: Number.NaN;
|
|
1442
|
+
return (
|
|
1443
|
+
replacementPrompt === existingPrompt &&
|
|
1444
|
+
Number.isFinite(replacementStartedAt) &&
|
|
1445
|
+
Math.abs(replacementStartedAt - existingStartedAt) <= 15_000
|
|
1446
|
+
);
|
|
1447
|
+
});
|
|
1448
|
+
if (materializedReplacement) {
|
|
1449
|
+
replacedExistingIds.add(turn.id);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
const olderTurns = uniqueExisting.filter(
|
|
1454
|
+
(turn) => !latestById.has(turn.id) && !replacedExistingIds.has(turn.id),
|
|
1455
|
+
);
|
|
1456
|
+
const ordered = [...olderTurns, ...uniqueLatest];
|
|
1457
|
+
if (!activeTurnId) {
|
|
1458
|
+
return ordered;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
const activeTurn = ordered.find((turn) => turn.id === activeTurnId);
|
|
1462
|
+
return activeTurn
|
|
1463
|
+
? [...ordered.filter((turn) => turn.id !== activeTurnId), activeTurn]
|
|
1464
|
+
: ordered;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1377
1467
|
export interface ThreadExportTurnOptionDto {
|
|
1378
1468
|
turnId: string;
|
|
1379
1469
|
turnNumber: number;
|