@clagentic/console 1.2.0 → 1.3.0-beta.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.
- package/lib/project-filesystem.js +9 -0
- package/lib/project-loop.js +47 -1
- package/lib/project.js +21 -1
- package/lib/public/css/home-hub.css +72 -0
- package/lib/public/css/overlays.css +54 -0
- package/lib/public/index.html +11 -0
- package/lib/public/modules/app-connection.js +3 -0
- package/lib/public/modules/app-home-hub.js +62 -1
- package/lib/public/modules/app-messages.js +46 -17
- package/lib/public/modules/app-panels.js +26 -3
- package/lib/public/modules/app-rendering.js +13 -3
- package/lib/public/modules/settings-defaults.js +14 -2
- package/lib/public/modules/sidebar-mobile.js +33 -13
- package/lib/server.js +8 -2
- package/lib/sessions.js +30 -6
- package/lib/ws-schema.js +4 -2
- package/lib/yoke/adapters/claude.js +106 -154
- package/lib/yoke/adapters/codex.js +55 -9
- package/package.json +1 -2
|
@@ -26,6 +26,7 @@ function attachFilesystem(ctx) {
|
|
|
26
26
|
var sendTo = ctx.sendTo;
|
|
27
27
|
var safePath = ctx.safePath;
|
|
28
28
|
var safeAbsPath = ctx.safeAbsPath;
|
|
29
|
+
var safeClaudePath = ctx.safeClaudePath;
|
|
29
30
|
var getOsUserInfoForWs = ctx.getOsUserInfoForWs;
|
|
30
31
|
var startFileWatch = ctx.startFileWatch;
|
|
31
32
|
var stopFileWatch = ctx.stopFileWatch;
|
|
@@ -58,6 +59,10 @@ function attachFilesystem(ctx) {
|
|
|
58
59
|
if (!fsDir && getOsUserInfoForWs(ws)) {
|
|
59
60
|
fsDir = safeAbsPath(msg.path);
|
|
60
61
|
}
|
|
62
|
+
// Allow read-only access to paths within ~/.claude/ (e.g. plans/)
|
|
63
|
+
if (!fsDir && safeClaudePath) {
|
|
64
|
+
fsDir = safeClaudePath(msg.path);
|
|
65
|
+
}
|
|
61
66
|
if (!fsDir) {
|
|
62
67
|
sendTo(ws, { type: "fs_list_result", path: msg.path, entries: [], error: "Access denied" });
|
|
63
68
|
return true;
|
|
@@ -150,6 +155,10 @@ function attachFilesystem(ctx) {
|
|
|
150
155
|
if (!fsFile && getOsUserInfoForWs(ws)) {
|
|
151
156
|
fsFile = safeAbsPath(msg.path);
|
|
152
157
|
}
|
|
158
|
+
// Allow read-only access to paths within ~/.claude/ (e.g. plans/)
|
|
159
|
+
if (!fsFile && safeClaudePath) {
|
|
160
|
+
fsFile = safeClaudePath(msg.path);
|
|
161
|
+
}
|
|
153
162
|
if (!fsFile) {
|
|
154
163
|
sendTo(ws, { type: "fs_read_result", path: msg.path, error: "Access denied" });
|
|
155
164
|
return true;
|
package/lib/project-loop.js
CHANGED
|
@@ -11,7 +11,8 @@ var usersModule = require("./users");
|
|
|
11
11
|
*
|
|
12
12
|
* ctx fields:
|
|
13
13
|
* cwd, slug, sm, sdk, send, sendTo, sendToSession, pushModule,
|
|
14
|
-
* getHubSchedules,
|
|
14
|
+
* getHubSchedules, getAllProjectSessions, getStatus,
|
|
15
|
+
* getLinuxUserForSession, onProcessingChanged,
|
|
15
16
|
* hydrateImageRefs
|
|
16
17
|
*/
|
|
17
18
|
function attachLoop(ctx) {
|
|
@@ -25,6 +26,8 @@ function attachLoop(ctx) {
|
|
|
25
26
|
var pushModule = ctx.pushModule;
|
|
26
27
|
var notificationsModule = ctx.notificationsModule;
|
|
27
28
|
var getHubSchedules = ctx.getHubSchedules;
|
|
29
|
+
var getAllProjectSessions = ctx.getAllProjectSessions;
|
|
30
|
+
var getStatus = ctx.getStatus;
|
|
28
31
|
var getLinuxUserForSession = ctx.getLinuxUserForSession;
|
|
29
32
|
var onProcessingChanged = ctx.onProcessingChanged;
|
|
30
33
|
var hydrateImageRefs = ctx.hydrateImageRefs;
|
|
@@ -1139,6 +1142,49 @@ function attachLoop(ctx) {
|
|
|
1139
1142
|
return true;
|
|
1140
1143
|
}
|
|
1141
1144
|
|
|
1145
|
+
// --- Hub: cross-project recent sessions ---
|
|
1146
|
+
if (msg.type === "hub_recent_sessions_list") {
|
|
1147
|
+
// Other-project sessions (already have _projectTitle set by getAllProjectSessions)
|
|
1148
|
+
// getAllProjectSessions returns annotated shallow copies (not live objects).
|
|
1149
|
+
// Each copy carries _projectTitle, _projectSlug, _projectIcon from server.js.
|
|
1150
|
+
// We then append the current project's own sessions below with self metadata.
|
|
1151
|
+
var otherSessions = getAllProjectSessions ? getAllProjectSessions() : [];
|
|
1152
|
+
var selfStatus = getStatus ? getStatus() : {};
|
|
1153
|
+
var selfSlug = selfStatus.slug || slug;
|
|
1154
|
+
var selfTitle = selfStatus.title || selfStatus.project || selfSlug;
|
|
1155
|
+
var selfIcon = selfStatus.icon || null;
|
|
1156
|
+
var allSessions = otherSessions.slice();
|
|
1157
|
+
sm.sessions.forEach(function (s) {
|
|
1158
|
+
if (!s.hidden) {
|
|
1159
|
+
allSessions.push(Object.assign({}, s, {
|
|
1160
|
+
_projectSlug: selfSlug,
|
|
1161
|
+
_projectTitle: selfTitle,
|
|
1162
|
+
_projectIcon: selfIcon,
|
|
1163
|
+
}));
|
|
1164
|
+
}
|
|
1165
|
+
});
|
|
1166
|
+
// Sort newest-first by lastActivity
|
|
1167
|
+
allSessions.sort(function (a, b) {
|
|
1168
|
+
return (b.lastActivity || b.createdAt || 0) - (a.lastActivity || a.createdAt || 0);
|
|
1169
|
+
});
|
|
1170
|
+
var top10 = allSessions.slice(0, 10);
|
|
1171
|
+
var mapped = top10.map(function (s) {
|
|
1172
|
+
return {
|
|
1173
|
+
id: s.localId,
|
|
1174
|
+
title: s.title || "New Session",
|
|
1175
|
+
lastActivity: s.lastActivity || s.createdAt || 0,
|
|
1176
|
+
projectSlug: s._projectSlug || selfSlug,
|
|
1177
|
+
projectTitle: s._projectTitle || selfTitle,
|
|
1178
|
+
projectIcon: s._projectIcon || null,
|
|
1179
|
+
vendor: s.vendor || null,
|
|
1180
|
+
agentName: s.agentName || null,
|
|
1181
|
+
isProcessing: !!s.isProcessing,
|
|
1182
|
+
};
|
|
1183
|
+
});
|
|
1184
|
+
sendTo(ws, { type: "hub_recent_sessions", sessions: mapped });
|
|
1185
|
+
return true;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1142
1188
|
// --- Loop Registry messages ---
|
|
1143
1189
|
if (msg.type === "loop_registry_list") {
|
|
1144
1190
|
sendTo(ws, { type: "loop_registry_updated", records: getHubSchedules() });
|
package/lib/project.js
CHANGED
|
@@ -121,6 +121,23 @@ function safeAbsPath(requested) {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
// Resolve an absolute path within the Claude Code data directory (~/.claude/).
|
|
125
|
+
// Used as read-only fallback so plan files and other Claude-owned paths that live
|
|
126
|
+
// outside the project cwd (e.g. ~/.claude/plans/) can be previewed in the file viewer.
|
|
127
|
+
function safeClaudePath(requested) {
|
|
128
|
+
if (!requested) return null;
|
|
129
|
+
var claudeDir = path.join(require("./config").REAL_HOME, ".claude");
|
|
130
|
+
var resolved = path.resolve(requested);
|
|
131
|
+
if (resolved !== claudeDir && !resolved.startsWith(claudeDir + path.sep)) return null;
|
|
132
|
+
try {
|
|
133
|
+
var real = fs.realpathSync(resolved);
|
|
134
|
+
if (real !== claudeDir && !real.startsWith(claudeDir + path.sep)) return null;
|
|
135
|
+
return real;
|
|
136
|
+
} catch (e) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
124
141
|
/**
|
|
125
142
|
* Create a project context — per-project state and handlers.
|
|
126
143
|
* opts: { cwd, slug, title, pushModule, debug, dangerouslySkipPermissions, currentVersion }
|
|
@@ -583,6 +600,8 @@ function createProjectContext(opts) {
|
|
|
583
600
|
pushModule: pushModule,
|
|
584
601
|
notificationsModule: _notifications,
|
|
585
602
|
getHubSchedules: getHubSchedules,
|
|
603
|
+
getAllProjectSessions: getAllProjectSessions,
|
|
604
|
+
getStatus: getStatus,
|
|
586
605
|
getLinuxUserForSession: getLinuxUserForSession,
|
|
587
606
|
onProcessingChanged: onProcessingChanged,
|
|
588
607
|
hydrateImageRefs: hydrateImageRefs,
|
|
@@ -969,6 +988,7 @@ function createProjectContext(opts) {
|
|
|
969
988
|
sendTo: sendTo,
|
|
970
989
|
safePath: safePath,
|
|
971
990
|
safeAbsPath: safeAbsPath,
|
|
991
|
+
safeClaudePath: safeClaudePath,
|
|
972
992
|
getOsUserInfoForWs: getOsUserInfoForWs,
|
|
973
993
|
startFileWatch: startFileWatch,
|
|
974
994
|
stopFileWatch: stopFileWatch,
|
|
@@ -1324,5 +1344,5 @@ function createProjectContext(opts) {
|
|
|
1324
1344
|
};
|
|
1325
1345
|
}
|
|
1326
1346
|
|
|
1327
|
-
module.exports = { createProjectContext: createProjectContext, safePath: safePath, validateEnvString: validateEnvString };
|
|
1347
|
+
module.exports = { createProjectContext: createProjectContext, safePath: safePath, safeClaudePath: safeClaudePath, validateEnvString: validateEnvString };
|
|
1328
1348
|
|
|
@@ -420,6 +420,78 @@
|
|
|
420
420
|
height: 14px;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
+
/* --- Recent Sessions --- */
|
|
424
|
+
.hub-recent-sessions {
|
|
425
|
+
animation: hubCardIn 0.4s ease 0.2s both;
|
|
426
|
+
}
|
|
427
|
+
.hub-recent-sessions-list {
|
|
428
|
+
display: flex;
|
|
429
|
+
flex-direction: column;
|
|
430
|
+
gap: 2px;
|
|
431
|
+
}
|
|
432
|
+
.hub-recent-item {
|
|
433
|
+
display: flex;
|
|
434
|
+
align-items: center;
|
|
435
|
+
gap: 10px;
|
|
436
|
+
padding: 8px 10px;
|
|
437
|
+
border-radius: 8px;
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
transition: background 0.15s ease;
|
|
440
|
+
}
|
|
441
|
+
.hub-recent-item:hover {
|
|
442
|
+
background: rgba(var(--overlay-rgb), 0.06);
|
|
443
|
+
}
|
|
444
|
+
.hub-recent-project-icon {
|
|
445
|
+
font-size: 14px;
|
|
446
|
+
width: 20px;
|
|
447
|
+
text-align: center;
|
|
448
|
+
flex-shrink: 0;
|
|
449
|
+
}
|
|
450
|
+
.hub-recent-project-icon--blank {
|
|
451
|
+
width: 20px;
|
|
452
|
+
height: 20px;
|
|
453
|
+
border-radius: 4px;
|
|
454
|
+
background: rgba(var(--overlay-rgb), 0.08);
|
|
455
|
+
display: inline-block;
|
|
456
|
+
vertical-align: middle;
|
|
457
|
+
}
|
|
458
|
+
.hub-recent-title {
|
|
459
|
+
font-size: 13px;
|
|
460
|
+
color: var(--text);
|
|
461
|
+
flex: 1;
|
|
462
|
+
min-width: 0;
|
|
463
|
+
overflow: hidden;
|
|
464
|
+
text-overflow: ellipsis;
|
|
465
|
+
white-space: nowrap;
|
|
466
|
+
}
|
|
467
|
+
.hub-recent-agent {
|
|
468
|
+
font-size: 10px;
|
|
469
|
+
font-weight: 600;
|
|
470
|
+
color: var(--accent);
|
|
471
|
+
background: var(--accent-12);
|
|
472
|
+
padding: 1px 6px;
|
|
473
|
+
border-radius: 6px;
|
|
474
|
+
flex-shrink: 0;
|
|
475
|
+
max-width: 70px;
|
|
476
|
+
overflow: hidden;
|
|
477
|
+
text-overflow: ellipsis;
|
|
478
|
+
white-space: nowrap;
|
|
479
|
+
}
|
|
480
|
+
.hub-recent-time {
|
|
481
|
+
font-size: 11px;
|
|
482
|
+
color: var(--text-dimmer);
|
|
483
|
+
flex-shrink: 0;
|
|
484
|
+
font-variant-numeric: tabular-nums;
|
|
485
|
+
min-width: 52px;
|
|
486
|
+
text-align: right;
|
|
487
|
+
}
|
|
488
|
+
.hub-recent-empty {
|
|
489
|
+
font-size: 13px;
|
|
490
|
+
color: var(--text-dimmer);
|
|
491
|
+
text-align: center;
|
|
492
|
+
padding: 16px 8px;
|
|
493
|
+
}
|
|
494
|
+
|
|
423
495
|
/* Hide user island when hub is visible */
|
|
424
496
|
#main-area:has(#home-hub:not(.hidden)) ~ #user-island,
|
|
425
497
|
#layout-body:has(#home-hub:not(.hidden)) #user-island {
|
|
@@ -1235,6 +1235,60 @@ button.top-bar-pill.pill-accent:hover { background: color-mix(in srgb, var(--acc
|
|
|
1235
1235
|
animation: spin 0.6s linear infinite;
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
|
+
/* --- Session replay loading indicator --- */
|
|
1239
|
+
#replay-loading {
|
|
1240
|
+
position: absolute;
|
|
1241
|
+
top: 0;
|
|
1242
|
+
left: 0;
|
|
1243
|
+
right: 0;
|
|
1244
|
+
display: flex;
|
|
1245
|
+
flex-direction: column;
|
|
1246
|
+
align-items: center;
|
|
1247
|
+
gap: 10px;
|
|
1248
|
+
padding: 20px 16px 16px;
|
|
1249
|
+
pointer-events: none;
|
|
1250
|
+
z-index: 10;
|
|
1251
|
+
animation: replayFadeIn 0.15s ease;
|
|
1252
|
+
}
|
|
1253
|
+
#replay-loading.hidden {
|
|
1254
|
+
display: none;
|
|
1255
|
+
}
|
|
1256
|
+
@keyframes replayFadeIn {
|
|
1257
|
+
from { opacity: 0; }
|
|
1258
|
+
to { opacity: 1; }
|
|
1259
|
+
}
|
|
1260
|
+
.replay-loading-bar {
|
|
1261
|
+
width: 100%;
|
|
1262
|
+
max-width: 320px;
|
|
1263
|
+
height: 3px;
|
|
1264
|
+
border-radius: 2px;
|
|
1265
|
+
background: var(--border-subtle);
|
|
1266
|
+
overflow: hidden;
|
|
1267
|
+
position: relative;
|
|
1268
|
+
}
|
|
1269
|
+
.replay-loading-bar::after {
|
|
1270
|
+
content: "";
|
|
1271
|
+
position: absolute;
|
|
1272
|
+
top: 0;
|
|
1273
|
+
left: -40%;
|
|
1274
|
+
width: 40%;
|
|
1275
|
+
height: 100%;
|
|
1276
|
+
background: var(--accent);
|
|
1277
|
+
border-radius: 2px;
|
|
1278
|
+
animation: replayBarSlide 1.2s ease-in-out infinite;
|
|
1279
|
+
}
|
|
1280
|
+
@keyframes replayBarSlide {
|
|
1281
|
+
0% { left: -40%; }
|
|
1282
|
+
100% { left: 100%; }
|
|
1283
|
+
}
|
|
1284
|
+
.replay-loading-label {
|
|
1285
|
+
font-size: 11px;
|
|
1286
|
+
font-weight: 500;
|
|
1287
|
+
color: var(--text-dimmer);
|
|
1288
|
+
letter-spacing: 0.3px;
|
|
1289
|
+
font-family: var(--font-mono);
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1238
1292
|
/* --- Connect overlay --- */
|
|
1239
1293
|
#connect-overlay {
|
|
1240
1294
|
position: fixed;
|
package/lib/public/index.html
CHANGED
|
@@ -174,6 +174,13 @@
|
|
|
174
174
|
<div class="hub-week-strip" id="hub-week-strip"></div>
|
|
175
175
|
</div>
|
|
176
176
|
|
|
177
|
+
<div class="hub-card hub-recent-sessions">
|
|
178
|
+
<div class="hub-card-header">
|
|
179
|
+
<span class="hub-card-title">Recent Sessions</span>
|
|
180
|
+
</div>
|
|
181
|
+
<div class="hub-recent-sessions-list" id="hub-recent-sessions-list"></div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
177
184
|
</div>
|
|
178
185
|
</div>
|
|
179
186
|
<div id="sidebar-column">
|
|
@@ -274,6 +281,10 @@
|
|
|
274
281
|
<p id="connect-overlay-msg">Reconnecting to server…</p>
|
|
275
282
|
</div>
|
|
276
283
|
<div id="sticky-notes-container" class="hidden"></div>
|
|
284
|
+
<div id="replay-loading" class="hidden">
|
|
285
|
+
<div class="replay-loading-bar"></div>
|
|
286
|
+
<span class="replay-loading-label">Loading session…</span>
|
|
287
|
+
</div>
|
|
277
288
|
<div id="messages"></div>
|
|
278
289
|
|
|
279
290
|
<div id="info-panels">
|
|
@@ -72,6 +72,9 @@ export function initConnection() {
|
|
|
72
72
|
stopLogoAnimation();
|
|
73
73
|
} else {
|
|
74
74
|
if (sendBtn) sendBtn.disabled = true;
|
|
75
|
+
// Clear any in-progress replay indicator — history_done won't fire on disconnect.
|
|
76
|
+
var replayEl = document.getElementById("replay-loading");
|
|
77
|
+
if (replayEl) replayEl.classList.add("hidden");
|
|
75
78
|
// Delay showing the overlay by 600ms — absorbs brief AP switches and
|
|
76
79
|
// sub-second network hiccups without flashing the full-screen animation.
|
|
77
80
|
if (overlayGraceTimer) clearTimeout(overlayGraceTimer);
|
|
@@ -219,6 +219,20 @@ function formatScheduleTime(ts) {
|
|
|
219
219
|
return DAY_NAMES[d.getDay()] + " " + timeStr;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
function formatRelativeTime(ts) {
|
|
223
|
+
if (!ts) return "";
|
|
224
|
+
var diff = Date.now() - ts;
|
|
225
|
+
var m = Math.floor(diff / 60000);
|
|
226
|
+
if (m < 1) return "just now";
|
|
227
|
+
if (m < 60) return m + "m ago";
|
|
228
|
+
var h = Math.floor(m / 60);
|
|
229
|
+
if (h < 24) return h + "h ago";
|
|
230
|
+
var d = Math.floor(h / 24);
|
|
231
|
+
if (d === 1) return "yesterday";
|
|
232
|
+
if (d < 7) return d + "d ago";
|
|
233
|
+
return Math.floor(d / 7) + "w ago";
|
|
234
|
+
}
|
|
235
|
+
|
|
222
236
|
export function renderHomeHub(projects) {
|
|
223
237
|
// Greeting + weather tooltip
|
|
224
238
|
updateGreetingWeather();
|
|
@@ -387,6 +401,52 @@ export function handleHubSchedules(msg) {
|
|
|
387
401
|
}
|
|
388
402
|
}
|
|
389
403
|
|
|
404
|
+
export function handleHubRecentSessions(msg) {
|
|
405
|
+
var sessions = msg.sessions || [];
|
|
406
|
+
var list = document.getElementById("hub-recent-sessions-list");
|
|
407
|
+
if (!list) return;
|
|
408
|
+
list.innerHTML = "";
|
|
409
|
+
if (sessions.length === 0) {
|
|
410
|
+
var emptyDiv = document.createElement("div");
|
|
411
|
+
emptyDiv.className = "hub-recent-empty";
|
|
412
|
+
emptyDiv.textContent = "No recent sessions";
|
|
413
|
+
list.appendChild(emptyDiv);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
sessions.forEach(function (sess) {
|
|
417
|
+
var item = document.createElement("div");
|
|
418
|
+
item.className = "hub-recent-item";
|
|
419
|
+
var iconHtml = sess.projectIcon
|
|
420
|
+
? '<span class="hub-recent-project-icon">' + escapeHtml(sess.projectIcon) + '</span>'
|
|
421
|
+
: '<span class="hub-recent-project-icon hub-recent-project-icon--blank"></span>';
|
|
422
|
+
var timeStr = formatRelativeTime(sess.lastActivity);
|
|
423
|
+
var agentBadge = sess.agentName
|
|
424
|
+
? '<span class="hub-recent-agent">' + escapeHtml(sess.agentName) + '</span>'
|
|
425
|
+
: '';
|
|
426
|
+
item.innerHTML =
|
|
427
|
+
iconHtml +
|
|
428
|
+
'<span class="hub-recent-title">' + escapeHtml(sess.title) + '</span>' +
|
|
429
|
+
agentBadge +
|
|
430
|
+
'<span class="hub-recent-time">' + timeStr + '</span>';
|
|
431
|
+
item.addEventListener("click", function () {
|
|
432
|
+
var currentSlug = store.get('currentSlug');
|
|
433
|
+
if (sess.projectSlug && sess.projectSlug !== currentSlug) {
|
|
434
|
+
// Store the target session ID so the session_list handler can drain it
|
|
435
|
+
// once the new project's WS is confirmed open — same pattern as
|
|
436
|
+
// pending-notif-session in app-notifications.js.
|
|
437
|
+
try { sessionStorage.setItem("pending-hub-session", String(sess.id)); } catch (e) {}
|
|
438
|
+
switchProject(sess.projectSlug);
|
|
439
|
+
} else {
|
|
440
|
+
if (getWs() && getWs().readyState === 1) {
|
|
441
|
+
getWs().send(JSON.stringify({ type: "switch_session", id: sess.id }));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
hideHomeHub();
|
|
445
|
+
});
|
|
446
|
+
list.appendChild(item);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
|
|
390
450
|
function startTipRotation() {} // removed: tip section no longer shown
|
|
391
451
|
function stopTipRotation() {}
|
|
392
452
|
|
|
@@ -401,9 +461,10 @@ export function showHomeHub() {
|
|
|
401
461
|
}
|
|
402
462
|
// Fetch weather silently (once)
|
|
403
463
|
fetchWeather();
|
|
404
|
-
// Request cross-project schedules
|
|
464
|
+
// Request cross-project schedules and recent sessions
|
|
405
465
|
if (getWs() && getWs().readyState === 1) {
|
|
406
466
|
getWs().send(JSON.stringify({ type: "hub_schedules_list" }));
|
|
467
|
+
getWs().send(JSON.stringify({ type: "hub_recent_sessions_list" }));
|
|
407
468
|
}
|
|
408
469
|
renderHomeHub(getCachedProjects());
|
|
409
470
|
startTipRotation();
|
|
@@ -8,7 +8,7 @@ import { getWs } from './ws-ref.js';
|
|
|
8
8
|
// --- Leaf module imports ---
|
|
9
9
|
import { showToast } from './utils.js';
|
|
10
10
|
import { refreshIcons, iconHtml } from './icons.js';
|
|
11
|
-
import { renderMarkdown, highlightCodeBlocks, renderMermaidBlocks } from './markdown.js';
|
|
11
|
+
import { renderMarkdown, highlightCodeBlocks, highlightCodeBlocksBatched, renderMermaidBlocks } from './markdown.js';
|
|
12
12
|
import { updatePageTitle } from './sidebar.js';
|
|
13
13
|
import { renderSessionList, updateSessionPresence, populateCliSessionList, handleSearchResults, updateSessionBadge } from './sidebar-sessions.js';
|
|
14
14
|
import { updateDmBadge, renderSidebarPresence, setMentionActive, renderUserStrip } from './sidebar-users.js';
|
|
@@ -39,7 +39,7 @@ import { setStatus } from './app-connection.js';
|
|
|
39
39
|
import { getModelEffortLevels, accumulateUsage, getSessionUsage, setSessionUsage, updateUsagePanel, accumulateContext, updateContextPanel, renderCtxPopover, updateStatusPanel } from './app-panels.js';
|
|
40
40
|
import { updateProjectList, resetClientState, showUpdateAvailable, handleRemoveProjectCheckResult, handleRemoveProjectResult, handleBrowseDirResult, handleAddProjectResult, handleCloneProgress } from './app-projects.js';
|
|
41
41
|
import { updateHistorySentinel, prependOlderHistory } from './app-header.js';
|
|
42
|
-
import { hideHomeHub, handleHubSchedules } from './app-home-hub.js';
|
|
42
|
+
import { hideHomeHub, handleHubSchedules, handleHubRecentSessions } from './app-home-hub.js';
|
|
43
43
|
import { openDm, enterDmMode, exitDmMode, appendDmMessage, showDmTypingIndicator } from './app-dm.js';
|
|
44
44
|
import { handleRateLimitEvent, updateRateLimitUsage, addScheduledMessageBubble, removeScheduledMessageBubble, handleFastModeState } from './app-rate-limit.js';
|
|
45
45
|
import { handleRemoteCursorMove, handleRemoteCursorLeave, handleRemoteSelection, clearRemoteCursors } from './app-cursors.js';
|
|
@@ -53,6 +53,7 @@ var messagesEl = document.getElementById("messages");
|
|
|
53
53
|
var headerTitleEl = document.getElementById("header-title");
|
|
54
54
|
var inputEl = document.getElementById("input");
|
|
55
55
|
var connectOverlay = document.getElementById("connect-overlay");
|
|
56
|
+
var replayLoadingEl = document.getElementById("replay-loading");
|
|
56
57
|
|
|
57
58
|
export function processMessage(msg) {
|
|
58
59
|
// Preserve original timestamp from history replay
|
|
@@ -61,6 +62,7 @@ export function processMessage(msg) {
|
|
|
61
62
|
switch (msg.type) {
|
|
62
63
|
case "history_meta":
|
|
63
64
|
store.set({ historyFrom: msg.from, historyTotal: msg.total, replayingHistory: true });
|
|
65
|
+
if (replayLoadingEl) replayLoadingEl.classList.remove("hidden");
|
|
64
66
|
updateHistorySentinel();
|
|
65
67
|
// Arm sticky-bottom at the START of replay so the scroll listener's
|
|
66
68
|
// "user scrolled up" detection is suppressed for the entire history
|
|
@@ -78,6 +80,7 @@ export function processMessage(msg) {
|
|
|
78
80
|
|
|
79
81
|
case "history_done":
|
|
80
82
|
store.set({ replayingHistory: false });
|
|
83
|
+
if (replayLoadingEl) replayLoadingEl.classList.add("hidden");
|
|
81
84
|
// Arm sticky-bottom FIRST so the ResizeObserver is watching before the
|
|
82
85
|
// bulk DOM mutations below (syntax highlighting, mermaid, todo
|
|
83
86
|
// compaction) displace the scroll position. Arming after those writes
|
|
@@ -88,29 +91,35 @@ export function processMessage(msg) {
|
|
|
88
91
|
var nav = getPendingNavigate();
|
|
89
92
|
var hasNavTarget = nav && (nav.toolId || nav.assistantUuid);
|
|
90
93
|
if (!hasNavTarget) {
|
|
91
|
-
//
|
|
92
|
-
//
|
|
93
|
-
//
|
|
94
|
+
// Scale the quiet window with history depth. A 20-item threshold
|
|
95
|
+
// (old code) gave identical 2000ms to sessions with 21 and 1000
|
|
96
|
+
// items. The scaled formula gives fast disarm for small sessions
|
|
97
|
+
// and up to 3000ms for very large ones (≥500 events), without
|
|
98
|
+
// a hard ceiling that cuts off still-settling content on mobile.
|
|
94
99
|
var historyLen = store.get('historyTotal') || 0;
|
|
95
|
-
var quietMs = historyLen
|
|
100
|
+
var quietMs = Math.min(Math.max(500, Math.round(historyLen * 2.5)), 3000);
|
|
96
101
|
armStickyBottom(quietMs, true); // force: history replay must scroll to bottom
|
|
97
102
|
}
|
|
98
103
|
// Batched syntax highlight + mermaid pass for the entire replayed
|
|
99
104
|
// transcript. Per-message highlights are skipped during replay
|
|
100
|
-
// (see markdown.js)
|
|
101
|
-
//
|
|
105
|
+
// (see markdown.js). Uses requestIdleCallback batching to avoid
|
|
106
|
+
// blocking the main thread — the old synchronous highlightCodeBlocks()
|
|
107
|
+
// fired hljs on every code block at once, each triggering a
|
|
108
|
+
// ResizeObserver callback that reset the sticky-bottom quiet timer,
|
|
109
|
+
// keeping the scroll pinned and the UI unresponsive for several
|
|
110
|
+
// seconds on large sessions (especially on mobile). The completion
|
|
111
|
+
// callback re-arms once after all blocks are done.
|
|
102
112
|
if (messagesEl) {
|
|
103
|
-
|
|
104
|
-
renderMermaidBlocks(messagesEl);
|
|
105
|
-
// Re-arm after highlight batch completes — Highlight.js defers work
|
|
106
|
-
// via requestAnimationFrame, so the actual DOM updates may happen
|
|
107
|
-
// after the synchronous call returns. This re-arm catches the deferred
|
|
108
|
-
// work on slow browsers.
|
|
109
|
-
setTimeout(function () {
|
|
113
|
+
highlightCodeBlocksBatched(messagesEl, function () {
|
|
110
114
|
if (!store.get('processing')) {
|
|
111
|
-
armStickyBottom(500, true); // force:
|
|
115
|
+
armStickyBottom(500, true); // force: re-pin after all blocks settle
|
|
112
116
|
}
|
|
113
|
-
}
|
|
117
|
+
});
|
|
118
|
+
renderMermaidBlocks(messagesEl);
|
|
119
|
+
// NOTE: The old 300ms setTimeout re-arm is removed. The batched
|
|
120
|
+
// highlight completion callback above replaces it. The 300ms timer
|
|
121
|
+
// was a workaround for Highlight.js deferred work that no longer
|
|
122
|
+
// applies with the idle-callback batching path.
|
|
114
123
|
}
|
|
115
124
|
// Compact dead-session todo widgets (unfinished items will never
|
|
116
125
|
// resolve — the agent isn't coming back) so they don't anchor
|
|
@@ -405,6 +414,10 @@ export function processMessage(msg) {
|
|
|
405
414
|
handleHubSchedules(msg);
|
|
406
415
|
break;
|
|
407
416
|
|
|
417
|
+
case "hub_recent_sessions":
|
|
418
|
+
handleHubRecentSessions(msg);
|
|
419
|
+
break;
|
|
420
|
+
|
|
408
421
|
case "input_sync":
|
|
409
422
|
if (!store.get('dmMode')) handleInputSync(msg.text);
|
|
410
423
|
break;
|
|
@@ -412,6 +425,20 @@ export function processMessage(msg) {
|
|
|
412
425
|
case "session_list":
|
|
413
426
|
renderSessionList(msg.sessions || []);
|
|
414
427
|
handlePaletteSessionSwitch();
|
|
428
|
+
// Drain pending hub cross-project session switch (set by handleHubRecentSessions
|
|
429
|
+
// when switching to a session in a different project). Fires here because
|
|
430
|
+
// session_list is the first reliable post-connect message that guarantees
|
|
431
|
+
// the WS is open and the session roster is populated.
|
|
432
|
+
try {
|
|
433
|
+
var _pendingHubSess = sessionStorage.getItem("pending-hub-session");
|
|
434
|
+
if (_pendingHubSess) {
|
|
435
|
+
sessionStorage.removeItem("pending-hub-session");
|
|
436
|
+
var _phWs = getWs();
|
|
437
|
+
if (_phWs && _phWs.readyState === 1) {
|
|
438
|
+
_phWs.send(JSON.stringify({ type: "switch_session", id: parseInt(_pendingHubSess, 10) }));
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
} catch (e) {}
|
|
415
442
|
break;
|
|
416
443
|
|
|
417
444
|
case "agents_list":
|
|
@@ -462,6 +489,8 @@ export function processMessage(msg) {
|
|
|
462
489
|
|
|
463
490
|
case "session_switched":
|
|
464
491
|
hideHomeHub();
|
|
492
|
+
// Clear any stale replay indicator from a prior interrupted switch
|
|
493
|
+
if (replayLoadingEl) replayLoadingEl.classList.add("hidden");
|
|
465
494
|
// Save draft from outgoing session
|
|
466
495
|
var _prevSid = store.get('activeSessionId');
|
|
467
496
|
if (_prevSid && inputEl.value) {
|
|
@@ -420,7 +420,7 @@ export function initPanels() {
|
|
|
420
420
|
if (vendorBtnCodex) vendorBtnCodex.addEventListener("click", function() { onVendorClick("codex"); });
|
|
421
421
|
|
|
422
422
|
// --- Reactive UI sync ---
|
|
423
|
-
store.subscribe(['availableVendors', 'installedVendors', 'currentVendor', 'richContextUsage', 'ctxPopoverVisible', 'currentModel', 'currentMode', 'currentEffort', 'currentBetas', 'currentThinking'], function (state, prev) {
|
|
423
|
+
store.subscribe(['availableVendors', 'installedVendors', 'currentVendor', 'richContextUsage', 'ctxPopoverVisible', 'currentModel', 'currentModels', 'currentMode', 'currentEffort', 'currentBetas', 'currentThinking'], function (state, prev) {
|
|
424
424
|
// Vendor toggle state
|
|
425
425
|
if (state.availableVendors !== prev.availableVendors ||
|
|
426
426
|
state.installedVendors !== prev.installedVendors ||
|
|
@@ -447,6 +447,7 @@ export function initPanels() {
|
|
|
447
447
|
|
|
448
448
|
// config chip
|
|
449
449
|
if (state.currentModel !== prev.currentModel ||
|
|
450
|
+
state.currentModels !== prev.currentModels ||
|
|
450
451
|
state.currentMode !== prev.currentMode ||
|
|
451
452
|
state.currentEffort !== prev.currentEffort ||
|
|
452
453
|
state.currentBetas !== prev.currentBetas ||
|
|
@@ -613,10 +614,11 @@ export function updateConfigChip() {
|
|
|
613
614
|
|
|
614
615
|
// Vendor-specific sections
|
|
615
616
|
var isClaude = vendor === "claude";
|
|
616
|
-
// MODE
|
|
617
|
+
// MODE and BETA are Claude-only
|
|
617
618
|
if (configModeList && configModeList.parentElement) configModeList.parentElement.style.display = isClaude ? "" : "none";
|
|
619
|
+
// THINKING: driven by per-model supportsThinking flag (falls back to vendor check)
|
|
618
620
|
rebuildThinkingSection();
|
|
619
|
-
if (configThinkingSection) configThinkingSection.style.display =
|
|
621
|
+
if (configThinkingSection) configThinkingSection.style.display = getModelSupportsThinking() ? "" : "none";
|
|
620
622
|
// BETA section deprecated (1M context is now standard)
|
|
621
623
|
if (configBetaSection) configBetaSection.style.display = "none";
|
|
622
624
|
// APPROVAL, SANDBOX, WEB SEARCH are Codex-only
|
|
@@ -635,6 +637,27 @@ export function getModelSupportsEffort() {
|
|
|
635
637
|
return true;
|
|
636
638
|
}
|
|
637
639
|
|
|
640
|
+
/**
|
|
641
|
+
* Returns true if the currently selected model supports extended thinking.
|
|
642
|
+
* Defaults to the vendor-level check (Claude = yes, Codex = no) when no
|
|
643
|
+
* model-level capability flag is available.
|
|
644
|
+
*/
|
|
645
|
+
export function getModelSupportsThinking() {
|
|
646
|
+
var s = store.snap();
|
|
647
|
+
var vendor = s.currentVendor || "claude";
|
|
648
|
+
var defaultSupportsThinking = vendor === "claude"; // vendor-level fallback
|
|
649
|
+
if (!s.currentModels || s.currentModels.length === 0) return defaultSupportsThinking;
|
|
650
|
+
for (var i = 0; i < s.currentModels.length; i++) {
|
|
651
|
+
if (s.currentModels[i].value === s.currentModel) {
|
|
652
|
+
if (Object.prototype.hasOwnProperty.call(s.currentModels[i], "supportsThinking")) {
|
|
653
|
+
return !!s.currentModels[i].supportsThinking;
|
|
654
|
+
}
|
|
655
|
+
return defaultSupportsThinking;
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
return defaultSupportsThinking;
|
|
659
|
+
}
|
|
660
|
+
|
|
638
661
|
export function getModelEffortLevels() {
|
|
639
662
|
var s = store.snap();
|
|
640
663
|
var vendor = s.currentVendor || "claude";
|
|
@@ -423,6 +423,11 @@ export function finalizeAssistantBlock() {
|
|
|
423
423
|
flushStreamBuffer();
|
|
424
424
|
var msgEl = store.get('currentMsgEl');
|
|
425
425
|
var textToRender = currentFullTextLocal;
|
|
426
|
+
// Capture replay state synchronously before any async work — by the time
|
|
427
|
+
// the async callback fires, replayingHistory may have already been cleared
|
|
428
|
+
// by history_done. wasReplaying lets the callback know not to arm
|
|
429
|
+
// sticky-bottom (history_done owns that arm during replay).
|
|
430
|
+
var wasReplaying = store.get('replayingHistory');
|
|
426
431
|
|
|
427
432
|
// Clear state before async work — subsequent messages must not inherit
|
|
428
433
|
// this block's el or text.
|
|
@@ -441,9 +446,14 @@ export function finalizeAssistantBlock() {
|
|
|
441
446
|
contentEl.innerHTML = html;
|
|
442
447
|
highlightCodeBlocks(contentEl);
|
|
443
448
|
renderMermaidBlocks(contentEl);
|
|
444
|
-
//
|
|
445
|
-
//
|
|
446
|
-
|
|
449
|
+
// Only re-arm sticky-bottom for live turns. During replay,
|
|
450
|
+
// history_done owns the sticky-bottom arm. Per-turn arms from
|
|
451
|
+
// replayed finalizeAssistantBlock callbacks keep extending the
|
|
452
|
+
// quiet window after history is done, leaving the user scroll-
|
|
453
|
+
// pinned for several extra seconds on large sessions.
|
|
454
|
+
if (!wasReplaying) {
|
|
455
|
+
armStickyBottom(500);
|
|
456
|
+
}
|
|
447
457
|
}
|
|
448
458
|
}, 0);
|
|
449
459
|
});
|
|
@@ -21,17 +21,29 @@ export var THINKING_OPTIONS = [
|
|
|
21
21
|
];
|
|
22
22
|
|
|
23
23
|
export var MODEL_DESCRIPTIONS = {
|
|
24
|
+
// Claude families
|
|
24
25
|
"default": "Automatically selects the best model for the task.",
|
|
25
26
|
"sonnet": "Fast and capable. Great balance of speed and intelligence.",
|
|
26
27
|
"haiku": "Fastest model. Best for quick tasks and simple questions.",
|
|
27
28
|
"opus": "Most powerful model. Best for complex reasoning and analysis.",
|
|
29
|
+
// Codex/OpenAI families
|
|
30
|
+
"gpt-5.4": "Latest GPT-5.4. Highest capability and reasoning.",
|
|
31
|
+
"gpt-5.4-mini": "Faster, lighter GPT-5.4 variant. Great for most coding tasks.",
|
|
32
|
+
"gpt-5.3-codex": "GPT-5.3 Codex. Strong at agentic coding and tool use.",
|
|
33
|
+
"gpt-5.3-codex-spark": "Lean GPT-5.3 Codex. Optimized for speed.",
|
|
34
|
+
"gpt-5.2": "GPT-5.2. Solid all-around performance.",
|
|
28
35
|
};
|
|
29
36
|
|
|
30
37
|
export function getModelDesc(model) {
|
|
31
38
|
if (!model) return "";
|
|
32
39
|
var lower = (model.value || model).toLowerCase();
|
|
33
|
-
|
|
34
|
-
|
|
40
|
+
// Exact match first to avoid "gpt-5.4" matching "gpt-5.4-mini"
|
|
41
|
+
if (MODEL_DESCRIPTIONS[lower]) return MODEL_DESCRIPTIONS[lower];
|
|
42
|
+
// Substring match for family names (e.g. "sonnet", "opus", "haiku")
|
|
43
|
+
// Sort keys longest-first so more-specific keys win (gpt-5.3-codex-spark > gpt-5.3-codex)
|
|
44
|
+
var keys = Object.keys(MODEL_DESCRIPTIONS).sort(function(a, b) { return b.length - a.length; });
|
|
45
|
+
for (var i = 0; i < keys.length; i++) {
|
|
46
|
+
if (lower.indexOf(keys[i]) !== -1) return MODEL_DESCRIPTIONS[keys[i]];
|
|
35
47
|
}
|
|
36
48
|
return "";
|
|
37
49
|
}
|
|
@@ -99,6 +99,9 @@ export function openMobileSheet(type) {
|
|
|
99
99
|
refreshIcons();
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
// Duration must match the .closing animation in mobile-nav.css
|
|
103
|
+
var SHEET_CLOSE_MS = 230;
|
|
104
|
+
|
|
102
105
|
function closeMobileSheet() {
|
|
103
106
|
var sheet = document.getElementById("mobile-sheet");
|
|
104
107
|
if (!sheet || sheet.classList.contains("hidden")) return;
|
|
@@ -117,7 +120,21 @@ function closeMobileSheet() {
|
|
|
117
120
|
setTimeout(function () {
|
|
118
121
|
sheet.classList.add("hidden");
|
|
119
122
|
sheet.classList.remove("closing", "sheet-files");
|
|
120
|
-
},
|
|
123
|
+
}, SHEET_CLOSE_MS);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Close the sheet and run fn after the close animation completes.
|
|
127
|
+
// Use this for session/project switches so the history replay flood
|
|
128
|
+
// doesn't begin while the sheet slide-down is still animating.
|
|
129
|
+
function closeMobileSheetThen(fn) {
|
|
130
|
+
var sheet = document.getElementById("mobile-sheet");
|
|
131
|
+
if (!sheet || sheet.classList.contains("hidden")) {
|
|
132
|
+
// Already closed — run immediately
|
|
133
|
+
if (fn) fn();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
closeMobileSheet();
|
|
137
|
+
setTimeout(fn, SHEET_CLOSE_MS);
|
|
121
138
|
}
|
|
122
139
|
|
|
123
140
|
function renderSheetProjects(listEl) {
|
|
@@ -497,11 +514,12 @@ function createMobileSessionItem(s) {
|
|
|
497
514
|
|
|
498
515
|
(function (id) {
|
|
499
516
|
el.addEventListener("click", function () {
|
|
500
|
-
if (getWs() && store.get('connected')) {
|
|
501
|
-
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
502
|
-
}
|
|
503
517
|
if (dismissOverlayPanels) dismissOverlayPanels();
|
|
504
|
-
|
|
518
|
+
closeMobileSheetThen(function () {
|
|
519
|
+
if (getWs() && store.get('connected')) {
|
|
520
|
+
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
521
|
+
}
|
|
522
|
+
});
|
|
505
523
|
});
|
|
506
524
|
})(s.id);
|
|
507
525
|
|
|
@@ -535,11 +553,12 @@ function createMobileLoopChild(s) {
|
|
|
535
553
|
|
|
536
554
|
(function (id) {
|
|
537
555
|
el.addEventListener("click", function () {
|
|
538
|
-
if (getWs() && store.get('connected')) {
|
|
539
|
-
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
540
|
-
}
|
|
541
556
|
if (dismissOverlayPanels) dismissOverlayPanels();
|
|
542
|
-
|
|
557
|
+
closeMobileSheetThen(function () {
|
|
558
|
+
if (getWs() && store.get('connected')) {
|
|
559
|
+
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
560
|
+
}
|
|
561
|
+
});
|
|
543
562
|
});
|
|
544
563
|
})(s.id);
|
|
545
564
|
|
|
@@ -1102,11 +1121,12 @@ function renderSearchResults(container, query) {
|
|
|
1102
1121
|
|
|
1103
1122
|
(function (id) {
|
|
1104
1123
|
el.addEventListener("click", function () {
|
|
1105
|
-
if (getWs() && store.get('connected')) {
|
|
1106
|
-
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
1107
|
-
}
|
|
1108
1124
|
if (dismissOverlayPanels) dismissOverlayPanels();
|
|
1109
|
-
|
|
1125
|
+
closeMobileSheetThen(function () {
|
|
1126
|
+
if (getWs() && store.get('connected')) {
|
|
1127
|
+
getWs().send(JSON.stringify({ type: "switch_session", id: id }));
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1110
1130
|
});
|
|
1111
1131
|
})(s.id);
|
|
1112
1132
|
|
package/lib/server.js
CHANGED
|
@@ -955,10 +955,16 @@ function createServer(opts) {
|
|
|
955
955
|
var pSm = pCtx.getSessionManager();
|
|
956
956
|
if (!pSm) return;
|
|
957
957
|
var projectTitle = status.title || status.project || pSlug;
|
|
958
|
+
var projectIcon = status.icon || null;
|
|
958
959
|
pSm.sessions.forEach(function (s) {
|
|
959
960
|
if (!s.hidden && s.history && s.history.length > 0) {
|
|
960
|
-
|
|
961
|
-
|
|
961
|
+
// Push a shallow copy annotated with project metadata rather than
|
|
962
|
+
// mutating the live session object with transient UI fields.
|
|
963
|
+
allSessions.push(Object.assign({}, s, {
|
|
964
|
+
_projectTitle: projectTitle,
|
|
965
|
+
_projectSlug: pSlug,
|
|
966
|
+
_projectIcon: projectIcon,
|
|
967
|
+
}));
|
|
962
968
|
}
|
|
963
969
|
});
|
|
964
970
|
});
|
package/lib/sessions.js
CHANGED
|
@@ -460,11 +460,32 @@ function createSessionManager(opts) {
|
|
|
460
460
|
// scroll-up via the existing pagination path.
|
|
461
461
|
var HISTORY_PAGE_SIZE = 100;
|
|
462
462
|
|
|
463
|
+
// Scan backward from the END of history (hard-capped at HISTORY_PAGE_SIZE) to
|
|
464
|
+
// find the most recent user_message. This ensures the initial replay window
|
|
465
|
+
// always starts at a clean turn boundary rather than mid-stream, regardless of
|
|
466
|
+
// how large the most recent turn is. For a session whose last user_message is
|
|
467
|
+
// at index N near the end, this returns N → typically ~10-100 events replayed
|
|
468
|
+
// instead of thousands.
|
|
469
|
+
function findLastTurnStart(history) {
|
|
470
|
+
var searchFloor = Math.max(0, history.length - HISTORY_PAGE_SIZE);
|
|
471
|
+
for (var i = history.length - 1; i >= searchFloor; i--) {
|
|
472
|
+
if (history[i] && history[i].type === "user_message") return i;
|
|
473
|
+
}
|
|
474
|
+
// No turn boundary found within the window — hard-cap at searchFloor.
|
|
475
|
+
return searchFloor;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Scan backward from targetIndex (capped at HISTORY_PAGE_SIZE below it) to find
|
|
479
|
+
// the nearest user_message turn boundary. Used by load_more_history scroll-up
|
|
480
|
+
// pagination to align the prepended page to a clean turn start. Falls back to
|
|
481
|
+
// targetIndex if no boundary is found within the window — a partial turn at
|
|
482
|
+
// the top is preferable to an unbounded backward scan.
|
|
463
483
|
function findTurnBoundary(history, targetIndex) {
|
|
464
|
-
|
|
484
|
+
var searchFloor = Math.max(0, targetIndex - HISTORY_PAGE_SIZE);
|
|
485
|
+
for (var i = targetIndex; i >= searchFloor; i--) {
|
|
465
486
|
if (history[i] && history[i].type === "user_message") return i;
|
|
466
487
|
}
|
|
467
|
-
return
|
|
488
|
+
return targetIndex;
|
|
468
489
|
}
|
|
469
490
|
|
|
470
491
|
function replayHistory(session, fromIndex, targetWs, transform) {
|
|
@@ -477,7 +498,12 @@ function createSessionManager(opts) {
|
|
|
477
498
|
if (total <= HISTORY_PAGE_SIZE) {
|
|
478
499
|
fromIndex = 0;
|
|
479
500
|
} else {
|
|
480
|
-
|
|
501
|
+
// Start from the most recent complete turn within the PAGE_SIZE window.
|
|
502
|
+
// max() ensures we never go past the hard floor even if the last turn
|
|
503
|
+
// start somehow lands below it.
|
|
504
|
+
var hardFloor = Math.max(0, total - HISTORY_PAGE_SIZE);
|
|
505
|
+
var lastTurn = findLastTurnStart(session.history);
|
|
506
|
+
fromIndex = Math.max(hardFloor, lastTurn);
|
|
481
507
|
}
|
|
482
508
|
}
|
|
483
509
|
|
|
@@ -487,9 +513,6 @@ function createSessionManager(opts) {
|
|
|
487
513
|
var _item = session.history[i];
|
|
488
514
|
// Skip internal bookkeeping entries not meant for the UI
|
|
489
515
|
if (_item && _item.type === "digest_checkpoint") continue;
|
|
490
|
-
if (_item && (_item.type === "mention_user" || _item.type === "mention_response")) {
|
|
491
|
-
console.log("[DEBUG replayHistory] sending mention at index=" + i + " from=" + fromIndex + " total=" + total + " type=" + _item.type + " mate=" + (_item.mateName || ""));
|
|
492
|
-
}
|
|
493
516
|
_send(transform ? transform(_item) : _item);
|
|
494
517
|
}
|
|
495
518
|
|
|
@@ -1087,6 +1110,7 @@ function createSessionManager(opts) {
|
|
|
1087
1110
|
sendAndRecord: doSendAndRecord,
|
|
1088
1111
|
sendToSession: doSendToSession,
|
|
1089
1112
|
findTurnBoundary: findTurnBoundary,
|
|
1113
|
+
findLastTurnStart: findLastTurnStart,
|
|
1090
1114
|
replayHistory: replayHistory,
|
|
1091
1115
|
searchSessions: searchSessions,
|
|
1092
1116
|
searchSessionContent: searchSessionContent,
|
package/lib/ws-schema.js
CHANGED
|
@@ -443,8 +443,10 @@ var schema = {
|
|
|
443
443
|
// Schedules (hub-level)
|
|
444
444
|
// -----------------------------------------------------------------------
|
|
445
445
|
"schedule_create": { direction: "c2s", handler: "lib/project-loop.js", description: "Create a new schedule" },
|
|
446
|
-
"hub_schedules_list":
|
|
447
|
-
"hub_schedules":
|
|
446
|
+
"hub_schedules_list": { direction: "c2s", handler: "lib/project-loop.js", description: "Request the hub schedules list" },
|
|
447
|
+
"hub_schedules": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Hub schedules list" },
|
|
448
|
+
"hub_recent_sessions_list": { direction: "c2s", handler: "lib/project-loop.js", description: "Request cross-project recent sessions for hub" },
|
|
449
|
+
"hub_recent_sessions": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Cross-project recent sessions list for hub" },
|
|
448
450
|
"schedule_run_started": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "A scheduled run has started" },
|
|
449
451
|
"schedule_run_finished": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "A scheduled run has finished" },
|
|
450
452
|
|
|
@@ -971,6 +971,107 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool)
|
|
|
971
971
|
}
|
|
972
972
|
|
|
973
973
|
|
|
974
|
+
// --- Model enrichment ---
|
|
975
|
+
// Maps raw string model IDs returned by stream.supportedModels() into rich
|
|
976
|
+
// objects with displayName, supportsEffort, supportedEffortLevels, and
|
|
977
|
+
// supportsThinking capability flags. The downstream model_info WS message
|
|
978
|
+
// carries these objects so the UI can drive visibility without vendor checks.
|
|
979
|
+
|
|
980
|
+
var CLAUDE_EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
981
|
+
|
|
982
|
+
// Canonical display-name table. Keys are substrings of the model ID (lowercased).
|
|
983
|
+
// Order matters: more-specific keys (e.g. "opus-4") must precede family keys (e.g. "opus").
|
|
984
|
+
var CLAUDE_MODEL_DISPLAY_NAMES = [
|
|
985
|
+
// Opus 4.x family
|
|
986
|
+
{ key: "claude-opus-4-5", label: "Opus 4.5" },
|
|
987
|
+
{ key: "claude-opus-4-6", label: "Opus 4.6" },
|
|
988
|
+
{ key: "claude-opus-4", label: "Opus 4" },
|
|
989
|
+
{ key: "claude-opus-3-7", label: "Opus 3.7" },
|
|
990
|
+
{ key: "claude-opus-3-5", label: "Opus 3.5" },
|
|
991
|
+
{ key: "claude-opus-3", label: "Opus 3" },
|
|
992
|
+
// Sonnet 4.x
|
|
993
|
+
{ key: "claude-sonnet-4-5", label: "Sonnet 4.5" },
|
|
994
|
+
{ key: "claude-sonnet-4-6", label: "Sonnet 4.6" },
|
|
995
|
+
{ key: "claude-sonnet-4", label: "Sonnet 4" },
|
|
996
|
+
{ key: "claude-sonnet-3-7", label: "Sonnet 3.7" },
|
|
997
|
+
{ key: "claude-sonnet-3-5", label: "Sonnet 3.5" },
|
|
998
|
+
{ key: "claude-sonnet-3", label: "Sonnet 3" },
|
|
999
|
+
// Haiku 4.x
|
|
1000
|
+
{ key: "claude-haiku-3-5", label: "Haiku 3.5" },
|
|
1001
|
+
{ key: "claude-haiku-3", label: "Haiku 3" },
|
|
1002
|
+
// Generic family fallbacks
|
|
1003
|
+
{ key: "opus", label: "Opus" },
|
|
1004
|
+
{ key: "sonnet", label: "Sonnet" },
|
|
1005
|
+
{ key: "haiku", label: "Haiku" },
|
|
1006
|
+
];
|
|
1007
|
+
|
|
1008
|
+
function claudeDisplayName(modelId) {
|
|
1009
|
+
var lower = modelId.toLowerCase();
|
|
1010
|
+
// Strip pinned-version suffix like "[1m]"
|
|
1011
|
+
var clean = lower.replace(/\[.*?\]$/, "").trim();
|
|
1012
|
+
for (var i = 0; i < CLAUDE_MODEL_DISPLAY_NAMES.length; i++) {
|
|
1013
|
+
if (clean.indexOf(CLAUDE_MODEL_DISPLAY_NAMES[i].key) !== -1) {
|
|
1014
|
+
return CLAUDE_MODEL_DISPLAY_NAMES[i].label;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
// Fallback: strip "claude-" prefix, title-case remainder
|
|
1018
|
+
return modelId.replace(/^claude-/i, "");
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
function claudeModelSupportsThinking(modelId) {
|
|
1022
|
+
// Haiku models do not support extended thinking
|
|
1023
|
+
var lower = (modelId || "").toLowerCase();
|
|
1024
|
+
return lower.indexOf("haiku") === -1;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
// Models known to support effort control. Currently all Claude 4.x opus/sonnet
|
|
1028
|
+
// models support effort; haiku does not (no reasoning). Defaults to true for
|
|
1029
|
+
// unknown models so new releases are not accidentally silenced.
|
|
1030
|
+
function claudeModelSupportsEffort(modelId) {
|
|
1031
|
+
var lower = (modelId || "").toLowerCase();
|
|
1032
|
+
if (lower.indexOf("haiku") !== -1) return false;
|
|
1033
|
+
return true;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Enrich a raw model ID string (or passthrough if already object) into a rich
|
|
1038
|
+
* model descriptor object.
|
|
1039
|
+
* @param {string|object} model
|
|
1040
|
+
* @returns {{ value, displayName, supportsEffort, supportedEffortLevels, supportsThinking }}
|
|
1041
|
+
*/
|
|
1042
|
+
function enrichClaudeModel(model) {
|
|
1043
|
+
// Already a rich object — passthrough but ensure all fields present
|
|
1044
|
+
if (model && typeof model === "object") {
|
|
1045
|
+
var v = model.value || "";
|
|
1046
|
+
return {
|
|
1047
|
+
value: v,
|
|
1048
|
+
displayName: model.displayName || claudeDisplayName(v),
|
|
1049
|
+
supportsEffort: Object.prototype.hasOwnProperty.call(model, "supportsEffort") ? model.supportsEffort : claudeModelSupportsEffort(v),
|
|
1050
|
+
supportedEffortLevels: model.supportedEffortLevels || CLAUDE_EFFORT_LEVELS,
|
|
1051
|
+
supportsThinking: Object.prototype.hasOwnProperty.call(model, "supportsThinking") ? model.supportsThinking : claudeModelSupportsThinking(v),
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
// Plain string
|
|
1055
|
+
var value = String(model || "");
|
|
1056
|
+
return {
|
|
1057
|
+
value: value,
|
|
1058
|
+
displayName: claudeDisplayName(value),
|
|
1059
|
+
supportsEffort: claudeModelSupportsEffort(value),
|
|
1060
|
+
supportedEffortLevels: CLAUDE_EFFORT_LEVELS,
|
|
1061
|
+
supportsThinking: claudeModelSupportsThinking(value),
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
function enrichClaudeModels(models) {
|
|
1066
|
+
if (!models || !models.length) return models;
|
|
1067
|
+
var result = [];
|
|
1068
|
+
for (var i = 0; i < models.length; i++) {
|
|
1069
|
+
result.push(enrichClaudeModel(models[i]));
|
|
1070
|
+
}
|
|
1071
|
+
return result;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
|
|
974
1075
|
// --- Adapter factory ---
|
|
975
1076
|
|
|
976
1077
|
function resolveClaudeBinaryPath() {
|
|
@@ -1025,91 +1126,6 @@ function createClaudeAdapter(opts) {
|
|
|
1025
1126
|
// Path to worker script (sdk-bridge uses this to spawn worker processes)
|
|
1026
1127
|
workerScriptPath: workerScriptPath,
|
|
1027
1128
|
|
|
1028
|
-
/**
|
|
1029
|
-
* Initialize the adapter. Performs SDK warmup to discover models, skills, etc.
|
|
1030
|
-
* If linuxUser is provided (via initOpts.linuxUser), delegates to a worker process.
|
|
1031
|
-
*
|
|
1032
|
-
* @param {object} initOpts
|
|
1033
|
-
* @param {string} [initOpts.cwd]
|
|
1034
|
-
* @param {boolean} [initOpts.dangerouslySkipPermissions]
|
|
1035
|
-
* @param {string} [initOpts.linuxUser] - OS user for worker isolation
|
|
1036
|
-
* @returns {Promise<{ models, defaultModel, skills, slashCommands, fastModeState, capabilities }>}
|
|
1037
|
-
*/
|
|
1038
|
-
init: async function(initOpts) {
|
|
1039
|
-
var linuxUser = initOpts && initOpts.linuxUser;
|
|
1040
|
-
if (linuxUser) {
|
|
1041
|
-
return initViaWorker(linuxUser, initOpts);
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
var sdk = await loadSDK();
|
|
1045
|
-
var ac = new AbortController();
|
|
1046
|
-
var mq = createMessageQueue();
|
|
1047
|
-
mq.push({ type: "user", message: { role: "user", content: [{ type: "text", text: "hi" }] } });
|
|
1048
|
-
mq.end();
|
|
1049
|
-
|
|
1050
|
-
var warmupOptions = {
|
|
1051
|
-
cwd: (initOpts && initOpts.cwd) || _cwd,
|
|
1052
|
-
settingSources: ["user", "project", "local"],
|
|
1053
|
-
abortController: ac,
|
|
1054
|
-
settings: { disableAllHooks: true },
|
|
1055
|
-
};
|
|
1056
|
-
if (_claudeBinaryPath) warmupOptions.pathToClaudeCodeExecutable = _claudeBinaryPath;
|
|
1057
|
-
|
|
1058
|
-
if (initOpts && initOpts.dangerouslySkipPermissions) {
|
|
1059
|
-
warmupOptions.permissionMode = "bypassPermissions";
|
|
1060
|
-
warmupOptions.allowDangerouslySkipPermissions = true;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
var result = {
|
|
1064
|
-
models: [],
|
|
1065
|
-
defaultModel: "",
|
|
1066
|
-
skills: [],
|
|
1067
|
-
slashCommands: [],
|
|
1068
|
-
fastModeState: null,
|
|
1069
|
-
capabilities: {
|
|
1070
|
-
thinking: true,
|
|
1071
|
-
betas: true,
|
|
1072
|
-
rewind: true,
|
|
1073
|
-
sessionResume: true,
|
|
1074
|
-
promptSuggestions: true,
|
|
1075
|
-
elicitation: true,
|
|
1076
|
-
fileCheckpointing: true,
|
|
1077
|
-
contextCompacting: true,
|
|
1078
|
-
toolPolicy: ["ask", "allow-all"],
|
|
1079
|
-
},
|
|
1080
|
-
};
|
|
1081
|
-
|
|
1082
|
-
try {
|
|
1083
|
-
var stream = sdk.query({ prompt: mq, options: warmupOptions });
|
|
1084
|
-
|
|
1085
|
-
for await (var msg of stream) {
|
|
1086
|
-
if (msg.type === "system" && msg.subtype === "init") {
|
|
1087
|
-
result.skills = msg.skills || [];
|
|
1088
|
-
result.defaultModel = msg.model || "";
|
|
1089
|
-
result.slashCommands = msg.slash_commands || [];
|
|
1090
|
-
result.fastModeState = msg.fast_mode_state || null;
|
|
1091
|
-
|
|
1092
|
-
try {
|
|
1093
|
-
var models = await stream.supportedModels();
|
|
1094
|
-
result.models = models || [];
|
|
1095
|
-
_cachedModels = result.models;
|
|
1096
|
-
} catch (e) {
|
|
1097
|
-
// supportedModels may fail, models list will be empty
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
ac.abort();
|
|
1101
|
-
break;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
} catch (e) {
|
|
1105
|
-
if (e && e.name !== "AbortError" && !(e.message && e.message.indexOf("aborted") !== -1)) {
|
|
1106
|
-
throw e;
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
return result;
|
|
1111
|
-
},
|
|
1112
|
-
|
|
1113
1129
|
/**
|
|
1114
1130
|
* Return cached list of supported models.
|
|
1115
1131
|
* @returns {Promise<string[]>}
|
|
@@ -1391,76 +1407,10 @@ function createClaudeAdapter(opts) {
|
|
|
1391
1407
|
return handle;
|
|
1392
1408
|
}
|
|
1393
1409
|
|
|
1394
|
-
// --- Worker warmup (internal) ---
|
|
1395
|
-
|
|
1396
|
-
async function initViaWorker(linuxUser, initOpts) {
|
|
1397
|
-
var worker;
|
|
1398
|
-
try {
|
|
1399
|
-
worker = spawnWorker(linuxUser, workerScriptPath, (initOpts && initOpts.cwd) || _cwd);
|
|
1400
|
-
} catch (e) {
|
|
1401
|
-
throw new Error("Failed to spawn warmup worker for " + linuxUser + ": " + (e.message || e));
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
var result = await new Promise(function(resolve, reject) {
|
|
1405
|
-
var warmupDone = false;
|
|
1406
|
-
|
|
1407
|
-
worker.onMessage(function(msg) {
|
|
1408
|
-
if (msg.type === "warmup_done" && !warmupDone) {
|
|
1409
|
-
warmupDone = true;
|
|
1410
|
-
var r = msg.result || {};
|
|
1411
|
-
resolve({
|
|
1412
|
-
models: r.models || [],
|
|
1413
|
-
defaultModel: r.model || "",
|
|
1414
|
-
skills: r.skills || [],
|
|
1415
|
-
slashCommands: r.slashCommands || [],
|
|
1416
|
-
fastModeState: r.fastModeState || null,
|
|
1417
|
-
capabilities: {
|
|
1418
|
-
thinking: true,
|
|
1419
|
-
betas: true,
|
|
1420
|
-
rewind: true,
|
|
1421
|
-
sessionResume: true,
|
|
1422
|
-
promptSuggestions: true,
|
|
1423
|
-
elicitation: true,
|
|
1424
|
-
fileCheckpointing: true,
|
|
1425
|
-
contextCompacting: true,
|
|
1426
|
-
toolPolicy: ["ask", "allow-all"],
|
|
1427
|
-
},
|
|
1428
|
-
});
|
|
1429
|
-
worker.kill();
|
|
1430
|
-
} else if (msg.type === "warmup_error" && !warmupDone) {
|
|
1431
|
-
warmupDone = true;
|
|
1432
|
-
worker.kill();
|
|
1433
|
-
reject(new Error(msg.error || "Warmup failed"));
|
|
1434
|
-
}
|
|
1435
|
-
});
|
|
1436
|
-
|
|
1437
|
-
// Handle case where worker fails to connect
|
|
1438
|
-
worker.readyPromise.catch(function(e) {
|
|
1439
|
-
if (!warmupDone) {
|
|
1440
|
-
warmupDone = true;
|
|
1441
|
-
cleanupWorker(worker);
|
|
1442
|
-
reject(new Error("Warmup worker failed to connect: " + (e.message || e)));
|
|
1443
|
-
}
|
|
1444
|
-
});
|
|
1445
|
-
});
|
|
1446
|
-
|
|
1447
|
-
// Wait for worker to be ready, then send warmup command
|
|
1448
|
-
// This is inside the Promise above, but we need readyPromise first
|
|
1449
|
-
// Actually, let's restructure: wait for ready, then send warmup
|
|
1450
|
-
// The Promise constructor above registers message handlers, but we need
|
|
1451
|
-
// to await readyPromise separately.
|
|
1452
|
-
|
|
1453
|
-
// Rethinking: the Promise above is returned directly. We need to await
|
|
1454
|
-
// readyPromise before sending warmup. Let me use a different approach.
|
|
1455
|
-
|
|
1456
|
-
return result;
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
// Override initViaWorker to properly sequence ready + warmup
|
|
1460
1410
|
adapter.init = async function(initOpts) {
|
|
1461
1411
|
var linuxUser = initOpts && initOpts.linuxUser;
|
|
1462
1412
|
if (!linuxUser) {
|
|
1463
|
-
// In-process warmup
|
|
1413
|
+
// In-process warmup
|
|
1464
1414
|
var sdk = await loadSDK();
|
|
1465
1415
|
var ac = new AbortController();
|
|
1466
1416
|
var mq = createMessageQueue();
|
|
@@ -1511,7 +1461,7 @@ function createClaudeAdapter(opts) {
|
|
|
1511
1461
|
|
|
1512
1462
|
try {
|
|
1513
1463
|
var models = await stream.supportedModels();
|
|
1514
|
-
result.models = models || [];
|
|
1464
|
+
result.models = enrichClaudeModels(models || []);
|
|
1515
1465
|
_cachedModels = result.models;
|
|
1516
1466
|
} catch (e) {
|
|
1517
1467
|
// supportedModels may fail, models list will be empty
|
|
@@ -1560,8 +1510,10 @@ function createClaudeAdapter(opts) {
|
|
|
1560
1510
|
if (msg.type === "warmup_done" && !warmupDone) {
|
|
1561
1511
|
warmupDone = true;
|
|
1562
1512
|
var r = msg.result || {};
|
|
1513
|
+
var enrichedModels = enrichClaudeModels(r.models || []);
|
|
1514
|
+
_cachedModels = enrichedModels;
|
|
1563
1515
|
resolve({
|
|
1564
|
-
models:
|
|
1516
|
+
models: enrichedModels,
|
|
1565
1517
|
defaultModel: r.model || "",
|
|
1566
1518
|
skills: r.skills || [],
|
|
1567
1519
|
slashCommands: r.slashCommands || [],
|
|
@@ -1051,6 +1051,57 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1051
1051
|
return handle;
|
|
1052
1052
|
}
|
|
1053
1053
|
|
|
1054
|
+
// --- Model enrichment ---
|
|
1055
|
+
// Curated model descriptors for Codex/OpenAI models. These are used as the
|
|
1056
|
+
// authoritative list after init because the Codex app-server does not expose a
|
|
1057
|
+
// models/list endpoint. Update this table when OpenAI releases new models.
|
|
1058
|
+
//
|
|
1059
|
+
// supportsEffort: whether the model accepts an effort/reasoning-effort parameter
|
|
1060
|
+
// supportedEffortLevels: ordered list of valid effort values for the model
|
|
1061
|
+
// supportsThinking: whether extended thinking UI should be shown (Codex uses effort
|
|
1062
|
+
// as its equivalent of thinking depth; the thinking toggle itself is Claude-only)
|
|
1063
|
+
|
|
1064
|
+
var CODEX_EFFORT_LEVELS = ["minimal", "low", "medium", "high", "xhigh"];
|
|
1065
|
+
var CODEX_EFFORT_LEVELS_STANDARD = ["low", "medium", "high"]; // models without xhigh/minimal
|
|
1066
|
+
|
|
1067
|
+
var CODEX_DEFAULT_MODELS = [
|
|
1068
|
+
{
|
|
1069
|
+
value: "gpt-5.4",
|
|
1070
|
+
displayName: "GPT-5.4",
|
|
1071
|
+
supportsEffort: true,
|
|
1072
|
+
supportedEffortLevels: CODEX_EFFORT_LEVELS,
|
|
1073
|
+
supportsThinking: false,
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
value: "gpt-5.4-mini",
|
|
1077
|
+
displayName: "GPT-5.4 Mini",
|
|
1078
|
+
supportsEffort: true,
|
|
1079
|
+
supportedEffortLevels: CODEX_EFFORT_LEVELS_STANDARD,
|
|
1080
|
+
supportsThinking: false,
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
value: "gpt-5.3-codex",
|
|
1084
|
+
displayName: "GPT-5.3 Codex",
|
|
1085
|
+
supportsEffort: true,
|
|
1086
|
+
supportedEffortLevels: CODEX_EFFORT_LEVELS,
|
|
1087
|
+
supportsThinking: false,
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
value: "gpt-5.3-codex-spark",
|
|
1091
|
+
displayName: "GPT-5.3 Codex Spark",
|
|
1092
|
+
supportsEffort: true,
|
|
1093
|
+
supportedEffortLevels: CODEX_EFFORT_LEVELS_STANDARD,
|
|
1094
|
+
supportsThinking: false,
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
value: "gpt-5.2",
|
|
1098
|
+
displayName: "GPT-5.2",
|
|
1099
|
+
supportsEffort: true,
|
|
1100
|
+
supportedEffortLevels: CODEX_EFFORT_LEVELS,
|
|
1101
|
+
supportsThinking: false,
|
|
1102
|
+
},
|
|
1103
|
+
];
|
|
1104
|
+
|
|
1054
1105
|
// --- Adapter factory ---
|
|
1055
1106
|
|
|
1056
1107
|
function createCodexAdapter(opts) {
|
|
@@ -1307,15 +1358,10 @@ function createCodexAdapter(opts) {
|
|
|
1307
1358
|
throw createShutdownError();
|
|
1308
1359
|
}
|
|
1309
1360
|
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
_cachedModels =
|
|
1313
|
-
|
|
1314
|
-
"gpt-5.4-mini",
|
|
1315
|
-
"gpt-5.3-codex",
|
|
1316
|
-
"gpt-5.3-codex-spark",
|
|
1317
|
-
"gpt-5.2",
|
|
1318
|
-
];
|
|
1361
|
+
// Use curated default model list. CODEX_DEFAULT_MODELS entries are already
|
|
1362
|
+
// rich descriptor objects with capability flags; no further enrichment needed.
|
|
1363
|
+
_cachedModels = CODEX_DEFAULT_MODELS.slice();
|
|
1364
|
+
console.log("[codex] App-server initialized, models: " + _cachedModels.map(function(m) { return m.value; }).join(", "));
|
|
1319
1365
|
|
|
1320
1366
|
// Discover skills: built-in Codex skills + Claude skills
|
|
1321
1367
|
var skillNames = [];
|
package/package.json
CHANGED
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.3.0-beta.1",
|
|
7
7
|
"description": "Self-hosted console for Claude Code and Codex. Multi-user, browser-based, persistent AI sessions.",
|
|
8
8
|
"bin": {
|
|
9
|
-
"clagentic": "./bin/cli.js",
|
|
10
9
|
"clagentic-console": "./bin/cli.js"
|
|
11
10
|
},
|
|
12
11
|
"scripts": {
|