@clagentic/console 1.10.0-beta.4 → 1.11.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/README.md +14 -0
- package/bin/cli.js +15 -3
- package/lib/agents.js +1 -55
- package/lib/bash-auto-approve.js +133 -0
- package/lib/build-identity.js +23 -5
- package/lib/build-sha.json +2 -2
- package/lib/build-update-check.js +0 -62
- package/lib/build-update-offer.js +23 -13
- package/lib/build-update-restart.js +59 -43
- package/lib/cli/schedule-input-subcommands.js +327 -0
- package/lib/cli/session-subcommands.js +100 -17
- package/lib/client-build-id.js +56 -0
- package/lib/daemon.js +20 -5
- package/lib/injected-sender.js +225 -0
- package/lib/message-sender-record.js +133 -0
- package/lib/pending-prompts.js +55 -0
- package/lib/permission-mode-policy.js +63 -0
- package/lib/permission-summary.js +67 -0
- package/lib/project-connection.js +2 -1
- package/lib/project-external-trigger.js +9 -1
- package/lib/project-loop.js +26 -20
- package/lib/project-prompt-responses.js +20 -14
- package/lib/project-sessions.js +73 -21
- package/lib/project-user-message.js +18 -47
- package/lib/project.js +36 -62
- package/lib/public/app.js +3 -5
- package/lib/public/css/channel-layout.css +20 -0
- package/lib/public/css/diagnostics.css +7 -0
- package/lib/public/css/input.css +78 -0
- package/lib/public/css/menus.css +17 -0
- package/lib/public/modules/app-connection.js +18 -1
- package/lib/public/modules/app-messages.js +19 -17
- package/lib/public/modules/app-panels.js +9 -2
- package/lib/public/modules/app-rate-limit.js +63 -87
- package/lib/public/modules/app-rendering.js +37 -6
- package/lib/public/modules/at-agents.js +8 -0
- package/lib/public/modules/build-guard.js +61 -0
- package/lib/public/modules/build-update-detail.js +1 -4
- package/lib/public/modules/diagnostics.js +98 -9
- package/lib/public/modules/injected-identity.js +78 -0
- package/lib/public/modules/injected-label.js +62 -0
- package/lib/public/modules/input.js +64 -114
- package/lib/public/modules/mode-options.js +19 -16
- package/lib/public/modules/rate-limit-state.js +47 -22
- package/lib/public/modules/schedule-panel.js +234 -0
- package/lib/public/modules/schedule-time.js +193 -0
- package/lib/public/modules/scheduled-input-actions.js +19 -0
- package/lib/runtime-env.js +4 -0
- package/lib/scheduled-input/ipc.js +92 -0
- package/lib/scheduled-input/rate-limit-resume.js +53 -0
- package/lib/scheduled-input/records.js +350 -0
- package/lib/scheduled-input/service.js +743 -0
- package/lib/scheduled-input/store.js +132 -0
- package/lib/scheduled-input/ws.js +194 -0
- package/lib/sdk-bridge.js +137 -152
- package/lib/sdk-message-processor.js +13 -5
- package/lib/sdk-skill-discovery.js +17 -0
- package/lib/sender-ref.js +109 -0
- package/lib/server.js +28 -8
- package/lib/session-directory.js +224 -0
- package/lib/session-file-scan.js +55 -0
- package/lib/session-input-ipc.js +20 -0
- package/lib/session-input.js +355 -19
- package/lib/session-name-holder.js +82 -0
- package/lib/session-resume.js +1 -0
- package/lib/sessions.js +44 -0
- package/lib/turn-initiator.js +6 -2
- package/lib/ws-schema.js +15 -7
- package/lib/yoke/adapters/claude-worker.js +3 -1
- package/lib/yoke/adapters/claude.js +13 -7
- package/lib/yoke/adapters/codex.js +18 -5
- package/lib/yoke/adapters/permission-relay.js +9 -0
- package/lib/yoke/interface.js +7 -1
- package/package.json +1 -1
- package/scripts/check-test-count.js +1 -1
- package/scripts/install-local-test.js +45 -1
- package/scripts/postinstall.js +1 -0
package/lib/project.js
CHANGED
|
@@ -18,6 +18,7 @@ var { attachLoop } = require("./project-loop");
|
|
|
18
18
|
var { attachFileWatch } = require("./project-file-watch");
|
|
19
19
|
var { attachHTTP } = require("./project-http");
|
|
20
20
|
var { attachImage } = require("./project-image");
|
|
21
|
+
var injectedSender = require("./injected-sender");
|
|
21
22
|
var { attachKnowledge } = require("./project-knowledge");
|
|
22
23
|
var { attachFilesystem } = require("./project-filesystem");
|
|
23
24
|
var { safePath, safeClaudePath, createFileAccess } = require("./project-file-scope");
|
|
@@ -26,6 +27,8 @@ var { createProjectAccess } = require("./project-access");
|
|
|
26
27
|
var { createExtensionCommands } = require("./extension-commands");
|
|
27
28
|
var { ownValue, putOwn } = require("./prompt-kinds/codecs");
|
|
28
29
|
var { isKnownVendor } = require("./yoke");
|
|
30
|
+
var { savedModeOrDefault } = require("./permission-mode-policy");
|
|
31
|
+
var { logField } = require("./log-field");
|
|
29
32
|
var { attachSessions } = require("./project-sessions");
|
|
30
33
|
var { attachUserMessage } = require("./project-user-message");
|
|
31
34
|
var { attachConnection } = require("./project-connection");
|
|
@@ -34,11 +37,12 @@ var { attachMcp } = require("./project-mcp");
|
|
|
34
37
|
var { createLocalMcp } = require("./mcp-local");
|
|
35
38
|
var { attachTeam } = require("./project-team");
|
|
36
39
|
var runtimeEnv = require("./runtime-env");
|
|
37
|
-
var {
|
|
40
|
+
var { createRateLimitResume } = require("./scheduled-input/rate-limit-resume");
|
|
38
41
|
var mcpToolSchema = require("./mcp-tool-schema");
|
|
39
42
|
var { reclaimIdleAdapters } = require("./idle-adapter-reaper");
|
|
40
43
|
var sessionCapabilities = require("./session-capabilities");
|
|
41
44
|
var sessionReclaim = require("./session-reclaim");
|
|
45
|
+
var clientBuildId = require("./client-build-id");
|
|
42
46
|
var { buildVendorRegistryMessage } = require("./vendor-registry-message");
|
|
43
47
|
// project-notifications is attached globally in server.js, passed via opts.notificationsModule
|
|
44
48
|
|
|
@@ -180,7 +184,11 @@ function createProjectContext(opts) {
|
|
|
180
184
|
// --- Image engine (delegated to project-image.js) ---
|
|
181
185
|
var _image = attachImage({ cwd: cwd, slug: slug });
|
|
182
186
|
var imagesDir = _image.imagesDir;
|
|
183
|
-
|
|
187
|
+
// The one transform every history replay and live fan-out passes entries
|
|
188
|
+
// through, so injected messages are attributed on every path.
|
|
189
|
+
function hydrateImageRefs(entry) {
|
|
190
|
+
return _image.hydrateImageRefs(injectedSender.forClient(entry));
|
|
191
|
+
}
|
|
184
192
|
var saveImageFile = _image.saveImageFile;
|
|
185
193
|
|
|
186
194
|
// --- OS-level user isolation helper ---
|
|
@@ -439,6 +447,10 @@ function createProjectContext(opts) {
|
|
|
439
447
|
},
|
|
440
448
|
onSessionDone: onSessionDone,
|
|
441
449
|
onSessionDeleted: onSessionDeleted,
|
|
450
|
+
// The scheduled inputs bound to a deleted session end with it.
|
|
451
|
+
onSessionRemoved: function (session) {
|
|
452
|
+
if (scheduledInput) scheduledInput.sessionEnded(slug, session);
|
|
453
|
+
},
|
|
442
454
|
historyInMemMax: historyInMemMax,
|
|
443
455
|
getNotificationsModule: function () { return _notifications; },
|
|
444
456
|
onProcessingChanged: onProcessingChanged,
|
|
@@ -453,6 +465,14 @@ function createProjectContext(opts) {
|
|
|
453
465
|
var _projMode = typeof opts.onGetProjectDefaultMode === "function" ? opts.onGetProjectDefaultMode(slug) : null;
|
|
454
466
|
var _srvMode = typeof opts.onGetServerDefaultMode === "function" ? opts.onGetServerDefaultMode() : null;
|
|
455
467
|
sm._savedDefaultMode = (_projMode && _projMode.mode) || (_srvMode && _srvMode.mode) || "default";
|
|
468
|
+
// A saved default (daemon.json, hand-edited or from an older build) goes
|
|
469
|
+
// through the same check as a client's request. The vendor check is left to
|
|
470
|
+
// query start: no vendor has reported its capabilities yet.
|
|
471
|
+
var _savedMode = savedModeOrDefault(sm._savedDefaultMode, { skipPermissionsAllowed: dangerouslySkipPermissions });
|
|
472
|
+
if (_savedMode.error) {
|
|
473
|
+
console.warn("[project] saved default permission mode " + logField(sm._savedDefaultMode) + " refused in " + slug + " (" + _savedMode.error + "); using default");
|
|
474
|
+
}
|
|
475
|
+
sm._savedDefaultMode = _savedMode.mode;
|
|
456
476
|
// Immediately apply the saved default so config_state on connect reflects it
|
|
457
477
|
// before the SDK has warmed up and fired system/init.
|
|
458
478
|
if (sm._savedDefaultMode) sm.currentPermissionMode = sm._savedDefaultMode;
|
|
@@ -601,9 +621,8 @@ function createProjectContext(opts) {
|
|
|
601
621
|
onTurnDone: null,
|
|
602
622
|
onTeamCreate: function (teamId, cliSessionId, cwd) { _team.onTeamCreate(teamId, cliSessionId, cwd); },
|
|
603
623
|
onTeamDelete: function () { _team.onTeamDelete(); },
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
},
|
|
624
|
+
scheduleRateLimitResume: function (session, resetsAt) { rateLimitResume.schedule(session, resetsAt); },
|
|
625
|
+
hasRateLimitResume: function (session) { return rateLimitResume.has(session); },
|
|
607
626
|
getAutoContinueSetting: function (session) {
|
|
608
627
|
if (session && session.ownerId) {
|
|
609
628
|
return usersModule.getAutoContinue(session.ownerId);
|
|
@@ -709,55 +728,16 @@ function createProjectContext(opts) {
|
|
|
709
728
|
return sm.sessions.get(ws._clagenticActiveSession) || null;
|
|
710
729
|
}
|
|
711
730
|
|
|
712
|
-
// ---
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
clearTimeout(session.scheduledMessage.timer);
|
|
718
|
-
}
|
|
719
|
-
var isPastReset = resetsAt <= Date.now();
|
|
720
|
-
var schedDelay = isPastReset ? 5000 : Math.max(0, resetsAt - Date.now()) + 60000; // +1min buffer after reset, or 5s for immediate
|
|
721
|
-
var sendsAt = Date.now() + schedDelay;
|
|
722
|
-
var schedEntry = {
|
|
723
|
-
type: "scheduled_message_queued",
|
|
724
|
-
text: text,
|
|
725
|
-
resetsAt: sendsAt,
|
|
726
|
-
scheduledAt: Date.now(),
|
|
727
|
-
localId: session.localId,
|
|
728
|
-
};
|
|
729
|
-
sm.sendAndRecord(session, schedEntry);
|
|
730
|
-
session.scheduledMessage = {
|
|
731
|
-
text: text,
|
|
732
|
-
resetsAt: resetsAt,
|
|
733
|
-
timer: setTimeout(function () {
|
|
734
|
-
session.scheduledMessage = null;
|
|
735
|
-
if (session.destroying) return;
|
|
736
|
-
console.log("[project] Scheduled message firing for session " + session.localId);
|
|
737
|
-
sm.sendAndRecord(session, { type: "scheduled_message_sent", localId: session.localId });
|
|
738
|
-
var schedUserMsg = { type: "user_message", text: text, _ts: Date.now() };
|
|
739
|
-
// lr-2ea2a7: routes through the shared history-cap helper (see grep-guard test).
|
|
740
|
-
sm.recordHistoryEntry(session, schedUserMsg, true);
|
|
741
|
-
sm.appendToSessionFile(session, schedUserMsg);
|
|
742
|
-
sendToSession(session.localId, schedUserMsg);
|
|
743
|
-
session.isProcessing = true;
|
|
744
|
-
onProcessingChanged();
|
|
745
|
-
sendToSession(session.localId, { type: "status", status: "processing" });
|
|
746
|
-
sdk.startQuery(session, text, null, ensureProjectAccessForSession(session), INITIATORS.SCHEDULED);
|
|
747
|
-
sm.broadcastSessionList();
|
|
748
|
-
}, schedDelay),
|
|
749
|
-
};
|
|
750
|
-
}
|
|
731
|
+
// --- Scheduled input (lib/scheduled-input/) ---
|
|
732
|
+
// The daemon-wide service owns every scheduled input, a person's and an
|
|
733
|
+
// agent's alike; this project only hands it the rate-limit resume. A context
|
|
734
|
+
// built without one (unit harnesses) schedules nothing.
|
|
735
|
+
var scheduledInput = opts.scheduledInput || null;
|
|
751
736
|
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
session.scheduledMessage = null;
|
|
757
|
-
session.rateLimitAutoContinuePending = false;
|
|
758
|
-
sm.sendAndRecord(session, { type: "scheduled_message_cancelled", localId: session.localId });
|
|
759
|
-
}
|
|
760
|
-
}
|
|
737
|
+
// The automatic "continue" after a rate limit: one once record on the session,
|
|
738
|
+
// timed after the limit resets. This is the only caller that adds the
|
|
739
|
+
// post-reset buffer (lib/scheduled-input/rate-limit-resume.js).
|
|
740
|
+
var rateLimitResume = createRateLimitResume({ service: scheduledInput, slug: slug });
|
|
761
741
|
|
|
762
742
|
// opts.canAccessProject(userId, slug, proof) is wired by server.js for every real
|
|
763
743
|
// project; a context built without it (unit harnesses) has no access policy
|
|
@@ -990,8 +970,6 @@ function createProjectContext(opts) {
|
|
|
990
970
|
broadcastHubSchedules: broadcastHubSchedules,
|
|
991
971
|
fetchVersion: fetchVersion,
|
|
992
972
|
isNewer: isNewer,
|
|
993
|
-
scheduleMessage: scheduleMessage,
|
|
994
|
-
cancelScheduledMessage: cancelScheduledMessage,
|
|
995
973
|
getProjectOwnerId: function () { return projectOwnerId; },
|
|
996
974
|
setProjectOwnerId: function (id) { projectOwnerId = id; },
|
|
997
975
|
getUpdateChannel: function () { return updateChannel; },
|
|
@@ -1036,8 +1014,7 @@ function createProjectContext(opts) {
|
|
|
1036
1014
|
mayAnswerExtensionCommand: extensionCommands.mayAnswer,
|
|
1037
1015
|
sendExtensionCommandAny: sendExtensionCommandAny,
|
|
1038
1016
|
requestTabContext: requestTabContext,
|
|
1039
|
-
|
|
1040
|
-
cancelScheduledMessage: cancelScheduledMessage,
|
|
1017
|
+
scheduledInput: scheduledInput,
|
|
1041
1018
|
loadContextSources: loadContextSources,
|
|
1042
1019
|
saveContextSources: saveContextSources,
|
|
1043
1020
|
escapeRegex: escapeRegex,
|
|
@@ -1252,10 +1229,6 @@ function createProjectContext(opts) {
|
|
|
1252
1229
|
clearTimeout(session.autoContinueTimer);
|
|
1253
1230
|
session.autoContinueTimer = null;
|
|
1254
1231
|
}
|
|
1255
|
-
if (session.scheduledMessage && session.scheduledMessage.timer) {
|
|
1256
|
-
clearTimeout(session.scheduledMessage.timer);
|
|
1257
|
-
session.scheduledMessage = null;
|
|
1258
|
-
}
|
|
1259
1232
|
if (session.abortController) {
|
|
1260
1233
|
try { session.abortController.abort(); } catch (e) {}
|
|
1261
1234
|
}
|
|
@@ -1367,7 +1340,7 @@ function createProjectContext(opts) {
|
|
|
1367
1340
|
// Each client is sent the project list it is allowed to see.
|
|
1368
1341
|
for (var ws of clients) {
|
|
1369
1342
|
var visibleProjects = getProjectList(ws._clagenticUser ? ws._clagenticUser.id : null, projectAccess.authOf(ws));
|
|
1370
|
-
sendTo(ws, { type: "info", cwd: cwd, slug: slug, project: title || project, version: currentVersion, debug: !!debug, osUsers: osUsers, lanHost: lanHost, projectCount: visibleProjects.length, projects: visibleProjects, projectOwnerId: projectOwnerId });
|
|
1343
|
+
sendTo(ws, { type: "info", cwd: cwd, slug: slug, project: title || project, version: currentVersion, buildId: clientBuildId.get(), debug: !!debug, osUsers: osUsers, lanHost: lanHost, projectCount: visibleProjects.length, projects: visibleProjects, projectOwnerId: projectOwnerId });
|
|
1371
1344
|
}
|
|
1372
1345
|
}
|
|
1373
1346
|
|
|
@@ -1427,6 +1400,7 @@ function createProjectContext(opts) {
|
|
|
1427
1400
|
},
|
|
1428
1401
|
onProcessingChanged: onProcessingChanged,
|
|
1429
1402
|
getLinuxUserForSession: getLinuxUserForSession,
|
|
1403
|
+
ensureProjectAccessForSession: ensureProjectAccessForSession,
|
|
1430
1404
|
// Ends the adapters' runtimes that nothing is using (see idle-adapter-reaper.js).
|
|
1431
1405
|
reclaimIdleAdapters: function (idleMs) {
|
|
1432
1406
|
return reclaimIdleAdapters(adapters, idleMs);
|
package/lib/public/app.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { openMobileSheet, updateMobileProjectsTabBadge } from './modules/sidebar-mobile.js';
|
|
19
19
|
import { initRewind, setRewindMode, showRewindModal, clearPendingRewindUuid, addRewindButton, onRewindComplete, onRewindError } from './modules/rewind.js';
|
|
20
20
|
import { initNotifications, showDoneNotification, playDoneSound, isNotifAlertEnabled, isNotifSoundEnabled } from './modules/notifications.js';
|
|
21
|
-
import { initInput, clearPendingImages, handleInputSync, autoResize, builtinCommands, sendMessage, hasSendableContent,
|
|
21
|
+
import { initInput, clearPendingImages, handleInputSync, autoResize, builtinCommands, sendMessage, hasSendableContent, setScheduleDelayMs, clearScheduleDelay } from './modules/input.js';
|
|
22
22
|
import { initQrCode, triggerShare } from './modules/qrcode.js';
|
|
23
23
|
import { initFileBrowser, loadRootDirectory, refreshTree, handleFsList, handleFsRead, handleDirChanged, refreshIfOpen, handleFileChanged, handleFileHistory, handleGitDiff, handleFileAt, closeFileViewer, resetFileBrowser } from './modules/filebrowser.js';
|
|
24
24
|
import { getPendingNavigate } from './modules/pending-navigate.js';
|
|
@@ -50,7 +50,7 @@ import { initConnection, connect as _connConnect, setStatus as _connSetStatus, s
|
|
|
50
50
|
import { processMessage as _msgProcessMessage } from './modules/app-messages.js';
|
|
51
51
|
import { getWs as _getWsRef, setWs as _setWsRef } from './modules/ws-ref.js';
|
|
52
52
|
import { initHomeHub, showHomeHub as _hubShowHomeHub, hideHomeHub as _hubHideHomeHub, handleHubSchedules as _hubHandleHubSchedules, renderHomeHub as _hubRenderHomeHub, isHomeHubVisible } from './modules/app-home-hub.js';
|
|
53
|
-
import { initRateLimit, handleRateLimitEvent as _rlHandleRateLimitEvent, updateRateLimitUsage as _rlUpdateRateLimitUsage,
|
|
53
|
+
import { initRateLimit, handleRateLimitEvent as _rlHandleRateLimitEvent, updateRateLimitUsage as _rlUpdateRateLimitUsage, handleFastModeState as _rlHandleFastModeState, getScheduledMsgEl, resetRateLimitState } from './modules/app-rate-limit.js';
|
|
54
54
|
import { initCursors, handleRemoteCursorMove as _curHandleRemoteCursorMove, handleRemoteCursorLeave as _curHandleRemoteCursorLeave, handleRemoteSelection as _curHandleRemoteSelection, clearRemoteCursors as _curClearRemoteCursors, initCursorToggle } from './modules/app-cursors.js';
|
|
55
55
|
import { initFavicon, initActivityFooter, updateFavicon as _favUpdateFavicon, setSendBtnMode as _favSetSendBtnMode, blinkIO as _favBlinkIO, blinkSessionDot as _favBlinkSessionDot, updateCrossProjectBlink as _favUpdateCrossProjectBlink, startUrgentBlink as _favStartUrgentBlink, stopUrgentBlink as _favStopUrgentBlink, setActivity as _favSetActivity, drawFaviconAnimFrame as _favDrawFaviconAnimFrame } from './modules/app-favicon.js';
|
|
56
56
|
import { initHeader, closeSessionInfoPopover as _hdrCloseSessionInfoPopover, updateHistorySentinel as _hdrUpdateHistorySentinel, requestMoreHistory as _hdrRequestMoreHistory, prependOlderHistory as _hdrPrependOlderHistory } from './modules/app-header.js';
|
|
@@ -588,7 +588,7 @@ import { initDiagnostics } from './modules/diagnostics.js';
|
|
|
588
588
|
// AskUserQuestion, PermissionRequest, Plan, Todo, Thinking, Tool items -> modules/tools.js
|
|
589
589
|
|
|
590
590
|
// --- DOM: Messages (delegated to app-rendering.js) ---
|
|
591
|
-
function addUserMessage(text, images, pastes, fromUserId, fromUserName) { _renAddUserMessage(text, images, pastes, fromUserId, fromUserName); }
|
|
591
|
+
function addUserMessage(text, images, pastes, fromUserId, fromUserName, injected) { _renAddUserMessage(text, images, pastes, fromUserId, fromUserName, injected); }
|
|
592
592
|
function getMsgTime() { return _renGetMsgTime(); }
|
|
593
593
|
function shouldGroupMessage(senderClass) { return _renShouldGroupMessage(senderClass); }
|
|
594
594
|
function ensureAssistantBlock() { return _renEnsureAssistantBlock(); }
|
|
@@ -608,8 +608,6 @@ import { initDiagnostics } from './modules/diagnostics.js';
|
|
|
608
608
|
// --- Rate Limit / Scheduled Messages / Fast Mode (delegated to app-rate-limit.js) ---
|
|
609
609
|
function handleRateLimitEvent(msg) { _rlHandleRateLimitEvent(msg); }
|
|
610
610
|
function updateRateLimitUsage(msg) { _rlUpdateRateLimitUsage(msg); }
|
|
611
|
-
function addScheduledMessageBubble(text, resetsAt) { _rlAddScheduledMessageBubble(text, resetsAt); }
|
|
612
|
-
function removeScheduledMessageBubble() { _rlRemoveScheduledMessageBubble(); }
|
|
613
611
|
function handleFastModeState(state) { _rlHandleFastModeState(state); }
|
|
614
612
|
|
|
615
613
|
// --- Prompt suggestion chips (delegated to app-rendering.js) ---
|
|
@@ -71,6 +71,9 @@ body.wide-view .dm-bubble-avatar {
|
|
|
71
71
|
font-size: 15px;
|
|
72
72
|
color: var(--text);
|
|
73
73
|
}
|
|
74
|
+
.dm-bubble-name-tappable {
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
74
77
|
.dm-bubble-time {
|
|
75
78
|
font-size: 12px;
|
|
76
79
|
color: var(--text-dimmer);
|
|
@@ -84,6 +87,23 @@ body.wide-view .dm-bubble-avatar {
|
|
|
84
87
|
background: var(--bg-elevated, var(--bg-hover));
|
|
85
88
|
border-radius: 20px 20px 20px 4px;
|
|
86
89
|
}
|
|
90
|
+
/* The base rule above right-aligns every .msg-user content column (the local
|
|
91
|
+
user's own bubble). Another sender's content is left-aligned in bubble view,
|
|
92
|
+
beside its avatar; channel view already left-aligns every row. */
|
|
93
|
+
.msg-user-other .dm-bubble-content {
|
|
94
|
+
align-items: flex-start;
|
|
95
|
+
}
|
|
96
|
+
/* Injected by another process, not typed by anyone in this chat. The dashed
|
|
97
|
+
frame belongs to bubble view; a channel row is unframed text. */
|
|
98
|
+
body:not(.wide-view) .msg-user-injected .bubble {
|
|
99
|
+
border: 1px dashed var(--text-dimmer);
|
|
100
|
+
}
|
|
101
|
+
.msg-user-injected .injected-label {
|
|
102
|
+
font-size: 12px;
|
|
103
|
+
color: var(--text-dimmer);
|
|
104
|
+
margin: 2px 0 4px;
|
|
105
|
+
overflow-wrap: anywhere;
|
|
106
|
+
}
|
|
87
107
|
.msg-user-other .dm-bubble-avatar-other {
|
|
88
108
|
display: block;
|
|
89
109
|
}
|
|
@@ -259,6 +259,13 @@
|
|
|
259
259
|
margin-left: 6px;
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
+
/* Shown beside a restart button whose click could not be sent. */
|
|
263
|
+
.build-update-send-failed {
|
|
264
|
+
margin-top: 4px;
|
|
265
|
+
font-size: 11px;
|
|
266
|
+
color: var(--error, #FF4D6A);
|
|
267
|
+
}
|
|
268
|
+
|
|
262
269
|
/* Empty state */
|
|
263
270
|
.diagnostics-empty {
|
|
264
271
|
padding: 20px 14px;
|
package/lib/public/css/input.css
CHANGED
|
@@ -1202,6 +1202,84 @@
|
|
|
1202
1202
|
color: inherit;
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
1205
|
+
/* Schedule panel: opened by the clock button */
|
|
1206
|
+
.schedule-panel {
|
|
1207
|
+
position: fixed;
|
|
1208
|
+
z-index: 60;
|
|
1209
|
+
width: 300px;
|
|
1210
|
+
max-width: calc(100vw - 16px);
|
|
1211
|
+
box-sizing: border-box;
|
|
1212
|
+
padding: 10px;
|
|
1213
|
+
display: flex;
|
|
1214
|
+
flex-direction: column;
|
|
1215
|
+
gap: 8px;
|
|
1216
|
+
background: var(--bg-alt);
|
|
1217
|
+
border: 1px solid var(--border);
|
|
1218
|
+
border-radius: 12px;
|
|
1219
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
|
|
1220
|
+
color: var(--text);
|
|
1221
|
+
font-size: 13px;
|
|
1222
|
+
}
|
|
1223
|
+
.schedule-panel.hidden { display: none; }
|
|
1224
|
+
.schedule-tabs { display: flex; gap: 4px; }
|
|
1225
|
+
.schedule-tab {
|
|
1226
|
+
flex: 1;
|
|
1227
|
+
padding: 4px 8px;
|
|
1228
|
+
border: 1px solid var(--border);
|
|
1229
|
+
border-radius: 8px;
|
|
1230
|
+
background: none;
|
|
1231
|
+
color: var(--text-dimmer);
|
|
1232
|
+
font: inherit;
|
|
1233
|
+
cursor: pointer;
|
|
1234
|
+
}
|
|
1235
|
+
.schedule-tab.active {
|
|
1236
|
+
color: var(--accent);
|
|
1237
|
+
border-color: var(--accent);
|
|
1238
|
+
background: color-mix(in srgb, var(--accent) 12%, transparent);
|
|
1239
|
+
}
|
|
1240
|
+
.schedule-section { display: flex; flex-direction: column; gap: 6px; }
|
|
1241
|
+
.schedule-section.hidden { display: none; }
|
|
1242
|
+
.schedule-row { display: flex; align-items: center; gap: 6px; }
|
|
1243
|
+
.schedule-row-label { min-width: 40px; color: var(--text-dimmer); }
|
|
1244
|
+
.schedule-row-unit { color: var(--text-dimmer); }
|
|
1245
|
+
.schedule-time-input {
|
|
1246
|
+
padding: 2px 4px;
|
|
1247
|
+
border: 1px solid var(--border);
|
|
1248
|
+
border-radius: 6px;
|
|
1249
|
+
background: var(--bg);
|
|
1250
|
+
color: var(--text);
|
|
1251
|
+
font-size: 12px;
|
|
1252
|
+
outline: none;
|
|
1253
|
+
}
|
|
1254
|
+
.schedule-time-input:focus { border-color: var(--accent); }
|
|
1255
|
+
.schedule-note { color: var(--text-dimmer); font-size: 12px; }
|
|
1256
|
+
.schedule-preview { min-height: 1.4em; color: var(--accent); }
|
|
1257
|
+
.schedule-preview.error { color: var(--error); }
|
|
1258
|
+
.schedule-actions { display: flex; align-items: center; gap: 8px; }
|
|
1259
|
+
.schedule-arm {
|
|
1260
|
+
padding: 4px 12px;
|
|
1261
|
+
border: none;
|
|
1262
|
+
border-radius: 8px;
|
|
1263
|
+
background: var(--accent);
|
|
1264
|
+
color: var(--bg);
|
|
1265
|
+
font: inherit;
|
|
1266
|
+
font-weight: 600;
|
|
1267
|
+
cursor: pointer;
|
|
1268
|
+
}
|
|
1269
|
+
.schedule-arm:disabled { opacity: 0.4; cursor: default; }
|
|
1270
|
+
.schedule-hint { color: var(--text-dimmer); font-size: 12px; }
|
|
1271
|
+
.schedule-list-title { color: var(--text-dimmer); font-size: 12px; }
|
|
1272
|
+
.schedule-list { display: flex; flex-direction: column; gap: 6px; }
|
|
1273
|
+
.schedule-list-row {
|
|
1274
|
+
display: flex;
|
|
1275
|
+
flex-direction: column;
|
|
1276
|
+
gap: 2px;
|
|
1277
|
+
padding: 6px 8px;
|
|
1278
|
+
border: 1px solid var(--border);
|
|
1279
|
+
border-radius: 8px;
|
|
1280
|
+
}
|
|
1281
|
+
.schedule-list-text { word-break: break-word; }
|
|
1282
|
+
|
|
1205
1283
|
/* Scheduled message bubble: accent-tinted user bubble */
|
|
1206
1284
|
.scheduled-msg-wrap .bubble {
|
|
1207
1285
|
background: color-mix(in srgb, var(--accent) 18%, var(--user-bubble, var(--bg-alt)));
|
package/lib/public/css/menus.css
CHANGED
|
@@ -493,6 +493,7 @@
|
|
|
493
493
|
border-radius: 12px;
|
|
494
494
|
padding: 4px 0;
|
|
495
495
|
min-width: 220px;
|
|
496
|
+
max-width: calc(100vw - 16px);
|
|
496
497
|
max-height: min(600px, calc(100vh - 120px));
|
|
497
498
|
overflow-y: auto;
|
|
498
499
|
box-shadow: 0 4px 16px rgba(var(--shadow-rgb), 0.4);
|
|
@@ -567,6 +568,22 @@
|
|
|
567
568
|
.config-radio-item:hover { background: rgba(var(--overlay-rgb),0.05); color: var(--text); }
|
|
568
569
|
.config-radio-item.active { color: var(--accent); font-weight: 600; }
|
|
569
570
|
|
|
571
|
+
/* Mode entries carry a one-line hint under the label. The hint wraps and the
|
|
572
|
+
item is capped so the popover never grows past a phone viewport. */
|
|
573
|
+
.config-mode-item {
|
|
574
|
+
flex-direction: column;
|
|
575
|
+
align-items: flex-start;
|
|
576
|
+
gap: 2px;
|
|
577
|
+
max-width: 280px;
|
|
578
|
+
}
|
|
579
|
+
.config-mode-hint {
|
|
580
|
+
font-size: 11px;
|
|
581
|
+
font-weight: 400;
|
|
582
|
+
color: var(--text-dimmer);
|
|
583
|
+
white-space: normal;
|
|
584
|
+
line-height: 1.35;
|
|
585
|
+
}
|
|
586
|
+
|
|
570
587
|
/* lr-f22787: same catalog-sourced marker as .settings-model-catalog-badge
|
|
571
588
|
(server-settings.css), for the session-chip model picker surface. */
|
|
572
589
|
.config-model-catalog-badge {
|
|
@@ -17,6 +17,7 @@ import { closeDmUserPicker } from './sidebar-users.js';
|
|
|
17
17
|
import { openDm } from './app-dm.js';
|
|
18
18
|
import { getPaletteVersion } from './command-palette.js';
|
|
19
19
|
import { sessionActivity, indicatorClass } from './activity-state.js';
|
|
20
|
+
import { createBuildGuard, showReloadBanner } from './build-guard.js';
|
|
20
21
|
|
|
21
22
|
var reconnectTimer = null;
|
|
22
23
|
var reconnectDelay = 100;
|
|
@@ -38,6 +39,19 @@ var overlayGraceTimer = null;
|
|
|
38
39
|
var STALE_VERSION_THRESHOLD = 3;
|
|
39
40
|
var staleVersionStreak = 0;
|
|
40
41
|
|
|
42
|
+
// Build-identity guard: the version watchdog above cannot see a restart onto a
|
|
43
|
+
// new build that keeps the same package version, and only runs while
|
|
44
|
+
// disconnected. This compares the daemon's build id on every connect.
|
|
45
|
+
var buildGuard = createBuildGuard({
|
|
46
|
+
hasUnsent: hasSendableContent,
|
|
47
|
+
reload: function () { location.reload(); },
|
|
48
|
+
showBanner: function () { showReloadBanner(document, function () { location.reload(); }); },
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function observeBuildInfo(info) {
|
|
52
|
+
return buildGuard.observeInfo(info);
|
|
53
|
+
}
|
|
54
|
+
|
|
41
55
|
// Message types that warrant a visible IO blink. Everything else is
|
|
42
56
|
// background infrastructure traffic (presence, rate-limit accounting,
|
|
43
57
|
// cursor relay, session list updates, input echo) that does not need
|
|
@@ -435,7 +449,10 @@ export function scheduleReconnect() {
|
|
|
435
449
|
}
|
|
436
450
|
return res.ok ? res.json().catch(function () { return null; }) : null;
|
|
437
451
|
}).then(function (info) {
|
|
438
|
-
if (info)
|
|
452
|
+
if (info) {
|
|
453
|
+
observeBuildInfo(info);
|
|
454
|
+
checkStaleVersion(info);
|
|
455
|
+
}
|
|
439
456
|
}).catch(function () {});
|
|
440
457
|
connect();
|
|
441
458
|
}, reconnectDelay);
|
|
@@ -34,7 +34,7 @@ import { handlePaletteSessionSwitch, setPaletteVersion } from './command-palette
|
|
|
34
34
|
import { handleAgentsList, handleAgentFavoriteToggled } from './agent-picker.js';
|
|
35
35
|
import { handleProjectAgentsList, requestProjectAgents } from './at-agents.js';
|
|
36
36
|
import { handleFindInSessionResults } from './session-search.js';
|
|
37
|
-
import { handleInputSync, autoResize, resetAutoResize, builtinCommands
|
|
37
|
+
import { handleInputSync, autoResize, resetAutoResize, builtinCommands } from './input.js';
|
|
38
38
|
import { startThinking, appendThinking, stopThinking, resetThinkingGroup, createToolItem, updateToolExecuting, updateToolResult, markAllToolsDone, closeToolGroup, removeToolFromGroup, resetToolState, getTools, getPlanContent, setPlanContent, renderPlanBanner, renderPlanCard, getTodoTools, handleTodoWrite, handleTaskCreate, handleTaskUpdate, applyDeadSessionTodoCompaction, isPlanFilePath, enableMainInput, addTurnMeta, updateSubagentActivity, addSubagentToolEntry, markSubagentDone, initSubagentStop, updateSubagentProgress, updateSubagentTaskStatus, applyPromptMessage, hasPendingPrompts } from './tools.js';
|
|
39
39
|
import { showDoneNotification, playDoneSound, isNotifAlertEnabled, isNotifSoundEnabled } from './notifications.js';
|
|
40
40
|
import { handleFsRead, refreshIfOpen } from './filebrowser.js';
|
|
@@ -53,15 +53,16 @@ import { handleMcpServersState } from './mcp-ui.js';
|
|
|
53
53
|
import { handleLoopRegistryUpdated, handleScheduleRunStarted, handleScheduleRunFinished, handleLoopScheduled, isSchedulerOpen, enterCraftingMode, exitCraftingMode, handleLoopRegistryFiles } from './scheduler.js';
|
|
54
54
|
|
|
55
55
|
// --- App module imports ---
|
|
56
|
+
import { injectedFromMessage } from './injected-label.js';
|
|
56
57
|
import { scrollToBottom, addToMessages, addUserMessage, addSystemMessage, appendDelta, finalizeAssistantBlock, addConflictMessage, addContextOverflowMessage, showSuggestionChips, removePreThinking } from './app-rendering.js';
|
|
57
58
|
import { startUrgentBlink, stopUrgentBlink, blinkSessionDot, updateCrossProjectBlink, reconcileActivityFooter } from './app-favicon.js';
|
|
58
|
-
import { setStatus } from './app-connection.js';
|
|
59
|
+
import { setStatus, observeBuildInfo } from './app-connection.js';
|
|
59
60
|
import { getModelEffortLevels, accumulateUsage, setSessionUsage, updateUsagePanel, accumulateContext, updateContextPanel, renderCtxPopover, updateStatusPanel } from './app-panels.js';
|
|
60
61
|
import { updateProjectList, resetClientState, showUpdateAvailable, handleRemoveProjectCheckResult, handleRemoveProjectResult, handleBrowseDirResult, handleAddProjectResult, handleCloneProgress } from './app-projects.js';
|
|
61
62
|
import { updateHistorySentinel, prependOlderHistory } from './app-header.js';
|
|
62
63
|
import { hideHomeHub, handleHubSchedules, handleHubRecentSessions } from './app-home-hub.js';
|
|
63
64
|
import { openDm, enterDmMode, exitDmMode, appendDmMessage, showDmTypingIndicator } from './app-dm.js';
|
|
64
|
-
import { handleRateLimitEvent, updateRateLimitUsage,
|
|
65
|
+
import { handleRateLimitEvent, updateRateLimitUsage, applyScheduledInputList, handleFastModeState, restoreRateLimitStateForSession, forgetSessionRateLimitState } from './app-rate-limit.js';
|
|
65
66
|
import { handleRemoteCursorMove, handleRemoteCursorLeave, handleRemoteSelection, clearRemoteCursors } from './app-cursors.js';
|
|
66
67
|
import { showLoopBanner, updateLoopBanner, updateLoopInputVisibility, updateLoopPendingBanner, showRalphApprovalBar, updateRalphApprovalStatus, openRalphPreviewModal, showExecModal, updateExecModalStatus } from './app-loop-ui.js';
|
|
67
68
|
import { handleSkillInstallWs } from './app-skills-install.js';
|
|
@@ -69,7 +70,7 @@ import { handleSessionGrants } from './session-grants.js';
|
|
|
69
70
|
import { handleNotificationsState, handleNotificationCreated, handleNotificationDismissed, handleNotificationDismissedAll, showUpdateBanner } from './app-notifications.js';
|
|
70
71
|
import { handleMentionStart, handleMentionActivity, handleMentionStream, handleMentionDone, handleMentionError, renderMentionUser, renderMentionResponse, renderUserMention } from './mention.js';
|
|
71
72
|
import { handleTeamState, handleTeamMemberUpdate, handleTeamTaskUpdate, handleTeamMessage as handleTeamMsg, handleTeamGone } from './team-panel.js';
|
|
72
|
-
import { addDiagnostic, refreshDiagnostic, retractDiagnostics } from './diagnostics.js';
|
|
73
|
+
import { addDiagnostic, refreshDiagnostic, retractDiagnostics, settleBuildUpdateRequest } from './diagnostics.js';
|
|
73
74
|
import { handleHistoryMeta, handleHistoryDone } from './app-history-replay.js';
|
|
74
75
|
import { shouldApplyActivityEdge } from './activity-latch.js';
|
|
75
76
|
import { deriveSessionListProcessing } from './activity-state.js';
|
|
@@ -180,6 +181,7 @@ registerHandlers({
|
|
|
180
181
|
var tbProjectName = document.getElementById("title-bar-project-name");
|
|
181
182
|
if (tbProjectName) tbProjectName.textContent = msg.title || store.get('projectName');
|
|
182
183
|
updatePageTitle();
|
|
184
|
+
observeBuildInfo(msg);
|
|
183
185
|
if (msg.version) {
|
|
184
186
|
setPaletteVersion(msg.version);
|
|
185
187
|
var serverVersionEl = document.getElementById("settings-server-version");
|
|
@@ -654,7 +656,8 @@ registerHandlers({
|
|
|
654
656
|
renderPlanCard(msg.planContent);
|
|
655
657
|
addUserMessage("Execute the following plan. Do NOT re-enter plan mode — just implement it step by step.", msg.images || null, msg.pastes || null, msg.from, msg.fromName);
|
|
656
658
|
} else {
|
|
657
|
-
|
|
659
|
+
// Injected input names its sender; it never takes the local user's place.
|
|
660
|
+
addUserMessage(msg.text, msg.images || null, msg.pastes || null, msg.from, msg.fromName, injectedFromMessage(msg));
|
|
658
661
|
}
|
|
659
662
|
},
|
|
660
663
|
|
|
@@ -1018,25 +1021,22 @@ registerHandlers({
|
|
|
1018
1021
|
rate_limit: handleRateLimitEvent,
|
|
1019
1022
|
rate_limit_usage: updateRateLimitUsage,
|
|
1020
1023
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1024
|
+
// The session's armed scheduled inputs, in full, after every change. This is
|
|
1025
|
+
// the only source of the bubbles, the panel list and the clock button; msg.localId
|
|
1026
|
+
// names the session, which may not be the one on screen (lr-0827ba).
|
|
1027
|
+
scheduled_input_list: applyScheduledInputList,
|
|
1028
|
+
|
|
1029
|
+
// The original scheduled-message names, still sent for a browser running an
|
|
1030
|
+
// older client; this client takes its state from scheduled_input_list alone.
|
|
1031
|
+
scheduled_message_queued: function () {},
|
|
1027
1032
|
|
|
1028
1033
|
scheduled_message_sent: function (msg) {
|
|
1029
|
-
clearScheduledMessage(msg.localId);
|
|
1030
1034
|
if (msg.localId == null || msg.localId === store.get('activeSessionId')) {
|
|
1031
|
-
setScheduleBtnDisabled(false);
|
|
1032
1035
|
setStatus("processing");
|
|
1033
1036
|
}
|
|
1034
1037
|
},
|
|
1035
1038
|
|
|
1036
|
-
scheduled_message_cancelled: function (
|
|
1037
|
-
clearScheduledMessage(msg.localId);
|
|
1038
|
-
if (msg.localId == null || msg.localId === store.get('activeSessionId')) setScheduleBtnDisabled(false);
|
|
1039
|
-
},
|
|
1039
|
+
scheduled_message_cancelled: function () {},
|
|
1040
1040
|
|
|
1041
1041
|
auto_continue_scheduled: function (msg) {
|
|
1042
1042
|
// Scheduler auto-continue, just show info
|
|
@@ -1306,6 +1306,8 @@ registerHandlers({
|
|
|
1306
1306
|
retractDiagnostics(msg.source);
|
|
1307
1307
|
},
|
|
1308
1308
|
|
|
1309
|
+
restart_for_build_update_result: settleBuildUpdateRequest,
|
|
1310
|
+
|
|
1309
1311
|
daemon_config: function (msg) {
|
|
1310
1312
|
if (msg.config && msg.config.headless) store.set({ isHeadlessMode: true });
|
|
1311
1313
|
updateDaemonConfig(msg.config);
|
|
@@ -271,10 +271,17 @@ function rebuildModeList() {
|
|
|
271
271
|
for (var i = 0; i < options.length; i++) {
|
|
272
272
|
var opt = options[i];
|
|
273
273
|
var btn = document.createElement("button");
|
|
274
|
-
btn.className = "config-radio-item";
|
|
274
|
+
btn.className = "config-radio-item config-mode-item";
|
|
275
275
|
if (opt.value === store.get('currentMode')) btn.classList.add("active");
|
|
276
276
|
btn.dataset.mode = opt.value;
|
|
277
|
-
|
|
277
|
+
var labelEl = document.createElement("span");
|
|
278
|
+
labelEl.className = "config-mode-label";
|
|
279
|
+
labelEl.textContent = opt.label;
|
|
280
|
+
var hintEl = document.createElement("span");
|
|
281
|
+
hintEl.className = "config-mode-hint";
|
|
282
|
+
hintEl.textContent = opt.hint;
|
|
283
|
+
btn.appendChild(labelEl);
|
|
284
|
+
btn.appendChild(hintEl);
|
|
278
285
|
btn.addEventListener("click", function () {
|
|
279
286
|
var mode = this.dataset.mode;
|
|
280
287
|
var ws = getWs();
|