@clagentic/console 1.12.0-beta.3 → 1.13.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 +7 -1
- package/bin/cli.js +18 -15
- package/lib/agent-roster-ws.js +38 -13
- package/lib/agent-roster.js +111 -12
- package/lib/agents.js +68 -33
- package/lib/atomic-install.js +334 -0
- package/lib/build-changes.js +33 -4
- package/lib/build-sha.json +2 -2
- package/lib/build-update-offer.js +12 -0
- package/lib/chat-width.js +31 -0
- package/lib/cli/agent-usage.js +126 -0
- package/lib/cli/arg-validation.js +1 -1
- package/lib/cli/compact-output.js +69 -0
- package/lib/cli/ipc-subcommands.js +92 -67
- package/lib/cli/output.js +28 -0
- package/lib/cli/restart-verb.js +132 -0
- package/lib/cli/schedule-input-subcommands.js +45 -8
- package/lib/cli/session-subcommands.js +37 -11
- package/lib/cli/settings-subcommands.js +74 -0
- package/lib/cli-transcript-title.js +56 -3
- package/lib/client-files.js +79 -0
- package/lib/daemon.js +100 -28
- package/lib/default-avatar-color.js +4 -0
- package/lib/drain.js +58 -10
- package/lib/mcp-tool-input.js +2 -2
- package/lib/model-families.js +49 -1
- package/lib/notify/type-registry.js +4 -0
- package/lib/notify/types.js +7 -4
- package/lib/pages.js +13 -63
- package/lib/permission-summary.js +12 -16
- package/lib/plan-usage-reader.js +70 -0
- package/lib/project-connection.js +4 -2
- package/lib/project-filesystem.js +6 -7
- package/lib/project-notifications.js +55 -8
- package/lib/project-prompt-expiry-settings.js +42 -0
- package/lib/project-sessions.js +52 -0
- package/lib/project-settings-gate.js +98 -0
- package/lib/project-user-mention.js +3 -2
- package/lib/project.js +1 -1
- package/lib/prompt-expiry-settings.js +49 -0
- package/lib/prompt-expiry.js +24 -3
- package/lib/prompt-kinds/codecs.js +6 -2
- package/lib/public/app.js +36 -36
- package/lib/public/css/admin.css +156 -170
- package/lib/public/css/agent-messages.css +24 -24
- package/lib/public/css/agent-picker.css +90 -38
- package/lib/public/css/agent-roster.css +61 -27
- package/lib/public/css/at-agents.css +10 -10
- package/lib/public/css/base.css +207 -184
- package/lib/public/css/chat-layout.css +228 -0
- package/lib/public/css/command-palette.css +86 -88
- package/lib/public/css/diagnostics.css +78 -204
- package/lib/public/css/diff.css +10 -10
- package/lib/public/css/filebrowser.css +32 -60
- package/lib/public/css/home-hub.css +100 -100
- package/lib/public/css/icon-strip.css +195 -238
- package/lib/public/css/input.css +191 -212
- package/lib/public/css/login-panel.css +16 -16
- package/lib/public/css/loop.css +96 -187
- package/lib/public/css/mention.css +49 -110
- package/lib/public/css/menus.css +162 -169
- package/lib/public/css/messages.css +49 -123
- package/lib/public/css/mobile-nav.css +207 -264
- package/lib/public/css/notifications-center.css +45 -124
- package/lib/public/css/overlay.css +269 -0
- package/lib/public/css/overlays.css +134 -156
- package/lib/public/css/playbook.css +41 -41
- package/lib/public/css/profile.css +43 -112
- package/lib/public/css/rewind.css +112 -112
- package/lib/public/css/scheduler-modal.css +27 -135
- package/lib/public/css/scheduler.css +204 -210
- package/lib/public/css/server-settings.css +173 -239
- package/lib/public/css/session-search.css +20 -20
- package/lib/public/css/settings-nav.css +197 -0
- package/lib/public/css/sidebar.css +213 -304
- package/lib/public/css/skills.css +121 -135
- package/lib/public/css/sticky-notes.css +114 -200
- package/lib/public/css/stt.css +17 -26
- package/lib/public/css/team-panel.css +36 -36
- package/lib/public/css/team-view.css +9 -9
- package/lib/public/css/title-bar.css +83 -100
- package/lib/public/css/tooltip.css +10 -10
- package/lib/public/css/user-settings.css +78 -131
- package/lib/public/css/user-shell.css +125 -29
- package/lib/public/index.html +178 -177
- package/lib/public/manifest.json +0 -2
- package/lib/public/modules/admin.js +54 -92
- package/lib/public/modules/agent-avatar.js +134 -3
- package/lib/public/modules/agent-messages.js +2 -1
- package/lib/public/modules/agent-picker.js +23 -21
- package/lib/public/modules/agent-roster-groups.js +128 -0
- package/lib/public/modules/agent-roster.js +40 -11
- package/lib/public/modules/app-connection.js +13 -1
- package/lib/public/modules/app-cursors.js +9 -9
- package/lib/public/modules/app-favicon.js +8 -16
- package/lib/public/modules/app-header.js +28 -19
- package/lib/public/modules/app-history-replay.js +67 -4
- package/lib/public/modules/app-home-hub.js +15 -0
- package/lib/public/modules/app-loop-ui.js +41 -47
- package/lib/public/modules/app-loop-wizard.js +9 -10
- package/lib/public/modules/app-messages.js +32 -36
- package/lib/public/modules/app-misc.js +22 -92
- package/lib/public/modules/app-modals.js +98 -0
- package/lib/public/modules/app-notifications.js +124 -135
- package/lib/public/modules/app-panels.js +28 -32
- package/lib/public/modules/app-projects.js +30 -40
- package/lib/public/modules/app-rate-limit.js +26 -9
- package/lib/public/modules/app-rendering.js +128 -110
- package/lib/public/modules/app-skills-install.js +6 -4
- package/lib/public/modules/assistant-identity.js +55 -0
- package/lib/public/modules/at-agents.js +3 -0
- package/lib/public/modules/build-guard.js +25 -11
- package/lib/public/modules/chat-width-choice.js +75 -0
- package/lib/public/modules/chat-width-prefs.js +52 -0
- package/lib/public/modules/chat-width.js +102 -0
- package/lib/public/modules/collapsible-text.js +36 -4
- package/lib/public/modules/command-palette.js +28 -34
- package/lib/public/modules/context-sources.js +3 -5
- package/lib/public/modules/diagnostics.js +130 -129
- package/lib/public/modules/info-panel.js +31 -0
- package/lib/public/modules/injected-identity.js +8 -8
- package/lib/public/modules/input-list-menu.js +39 -0
- package/lib/public/modules/input.js +22 -21
- package/lib/public/modules/markdown.js +10 -11
- package/lib/public/modules/mcp-ui.js +4 -14
- package/lib/public/modules/mention.js +100 -229
- package/lib/public/modules/message-header.js +80 -0
- package/lib/public/modules/message-participants.js +39 -0
- package/lib/public/modules/mobile-action-sheet.js +46 -0
- package/lib/public/modules/mobile-nav-sheet.js +104 -0
- package/lib/public/modules/model-families.js +41 -4
- package/lib/public/modules/note-order.js +39 -0
- package/lib/public/modules/notifications.js +35 -52
- package/lib/public/modules/overlay-history.js +73 -19
- package/lib/public/modules/overlay-menu.js +123 -0
- package/lib/public/modules/overlay-modal.js +186 -0
- package/lib/public/modules/overlay-registry.js +392 -0
- package/lib/public/modules/overlay-stack.js +110 -0
- package/lib/public/modules/overlay.js +117 -0
- package/lib/public/modules/popover-position.js +18 -2
- package/lib/public/modules/preference-sync.js +28 -0
- package/lib/public/modules/profile.js +24 -49
- package/lib/public/modules/project-settings.js +27 -172
- package/lib/public/modules/prompt-expiry-controls.js +46 -0
- package/lib/public/modules/prompt-kinds/command-summary.js +149 -0
- package/lib/public/modules/prompt-kinds/permission.js +70 -92
- package/lib/public/modules/prompts.js +1 -2
- package/lib/public/modules/qrcode.js +6 -21
- package/lib/public/modules/queued-button.js +15 -2
- package/lib/public/modules/rewind.js +9 -3
- package/lib/public/modules/schedule-time.js +32 -7
- package/lib/public/modules/scheduled-outbox.js +51 -18
- package/lib/public/modules/scheduler-config.js +87 -127
- package/lib/public/modules/scheduler.js +29 -26
- package/lib/public/modules/serialized-save.js +79 -0
- package/lib/public/modules/server-settings.js +75 -65
- package/lib/public/modules/session-grants.js +16 -19
- package/lib/public/modules/session-list-avatars.js +98 -0
- package/lib/public/modules/session-vendor-state.js +86 -0
- package/lib/public/modules/settings-access.js +35 -0
- package/lib/public/modules/settings-hub.js +125 -0
- package/lib/public/modules/settings-nav.js +182 -0
- package/lib/public/modules/shell-line.js +24 -0
- package/lib/public/modules/sidebar-mobile.js +151 -195
- package/lib/public/modules/sidebar-projects.js +88 -129
- package/lib/public/modules/sidebar-sessions.js +66 -34
- package/lib/public/modules/sidebar.js +2 -2
- package/lib/public/modules/skills.js +11 -26
- package/lib/public/modules/sticky-notes.js +19 -16
- package/lib/public/modules/stt.js +9 -23
- package/lib/public/modules/terminal.js +86 -90
- package/lib/public/modules/theme-choice.js +126 -0
- package/lib/public/modules/theme-colors.js +19 -0
- package/lib/public/modules/theme-prefs.js +121 -0
- package/lib/public/modules/theme.js +227 -605
- package/lib/public/modules/tool-palette.js +7 -17
- package/lib/public/modules/tools.js +8 -10
- package/lib/public/modules/user-settings.js +59 -115
- package/lib/public/modules/user-shell.js +9 -2
- package/lib/public/modules/utils.js +10 -12
- package/lib/public/modules/vendor-picker.js +4 -2
- package/lib/public/modules/vendor-registry.js +1 -2
- package/lib/public/style.css +3 -1
- package/lib/public/sw.js +9 -2
- package/lib/public/theme-core.js +411 -0
- package/lib/request-body.js +70 -0
- package/lib/sdk-bridge.js +227 -88
- package/lib/sdk-message-processor.js +44 -16
- package/lib/server-admin.js +198 -200
- package/lib/server-auth.js +16 -13
- package/lib/server-dm.js +4 -3
- package/lib/server-settings.js +177 -130
- package/lib/server.js +87 -36
- package/lib/session-background-tasks.js +79 -0
- package/lib/session-directory.js +138 -13
- package/lib/session-input-ipc.js +2 -0
- package/lib/session-input.js +39 -5
- package/lib/session-list-avatars.js +16 -0
- package/lib/session-reclaim.js +37 -25
- package/lib/session-vendor.js +37 -0
- package/lib/sessions.js +99 -34
- package/lib/settings-ipc.js +60 -0
- package/lib/settings-registry.js +86 -0
- package/lib/terminal-manager.js +17 -5
- package/lib/theme-files.js +132 -0
- package/lib/theme-seed.js +136 -0
- package/lib/themes/clagentic-dark.json +13 -6
- package/lib/themes/clagentic-light.json +12 -5
- package/lib/updater.js +6 -4
- package/lib/usage-store.js +97 -10
- package/lib/users-preferences.js +118 -19
- package/lib/users.js +19 -10
- package/lib/vendor-catalog.js +130 -0
- package/lib/ws-schema.js +4 -2
- package/lib/yoke/adapters/claude.js +81 -1
- package/lib/yoke/adapters/codex-user-shell.js +87 -23
- package/lib/yoke/adapters/codex.js +89 -5
- package/lib/yoke/codex-binary.js +59 -0
- package/package.json +1 -1
- package/scripts/check-test-count.js +5 -0
- package/scripts/install-local-test.js +50 -9
- package/scripts/write-build-sha.js +18 -2
- package/lib/public/css/channel-layout.css +0 -329
- package/lib/themes/ayu-light.json +0 -9
- package/lib/themes/catppuccin-latte.json +0 -9
- package/lib/themes/catppuccin-mocha.json +0 -9
- package/lib/themes/dracula.json +0 -9
- package/lib/themes/everforest-light.json +0 -9
- package/lib/themes/everforest.json +0 -9
- package/lib/themes/github-light.json +0 -9
- package/lib/themes/gruvbox-dark.json +0 -9
- package/lib/themes/gruvbox-light.json +0 -9
- package/lib/themes/monokai.json +0 -9
- package/lib/themes/nord-light.json +0 -9
- package/lib/themes/nord.json +0 -9
- package/lib/themes/one-dark.json +0 -9
- package/lib/themes/one-light.json +0 -9
- package/lib/themes/rose-pine-dawn.json +0 -9
- package/lib/themes/rose-pine.json +0 -9
- package/lib/themes/solarized-dark.json +0 -9
- package/lib/themes/solarized-light.json +0 -9
- package/lib/themes/tokyo-night-light.json +0 -9
- package/lib/themes/tokyo-night.json +0 -9
|
@@ -10,7 +10,9 @@ import { getWs, setWs } from './ws-ref.js';
|
|
|
10
10
|
import { getMessagesEl, getStatusDot } from './dom-refs.js';
|
|
11
11
|
import { sessionActivity, indicatorClass } from './activity-state.js';
|
|
12
12
|
import { userAvatarUrl } from './avatar.js';
|
|
13
|
+
import { AVATAR_REQUEST_SIZE } from './message-header.js';
|
|
13
14
|
import { showConfirm } from './app-misc.js';
|
|
15
|
+
import { showOverlay } from './overlay.js';
|
|
14
16
|
// renderUserStrip is now reactive via store subscriber in sidebar-users.js
|
|
15
17
|
import { renderIconStrip } from './sidebar-projects.js';
|
|
16
18
|
import { updateCrossProjectBlink, stopUrgentBlink } from './app-favicon.js';
|
|
@@ -22,7 +24,7 @@ import { resetFileBrowser } from './filebrowser.js';
|
|
|
22
24
|
import { closeArchive } from './sticky-notes.js';
|
|
23
25
|
import { isSchedulerOpen, closeScheduler, resetScheduler } from './scheduler.js';
|
|
24
26
|
import { connect, cancelReconnect, setStatus } from './app-connection.js';
|
|
25
|
-
import { setTurnCounter, setPrependAnchor, setActivityEl, setIsUserScrolledUp, hideSuggestionChips, resetCurrentFullText, resetStreamState } from './app-rendering.js';
|
|
27
|
+
import { setTurnCounter, setPrependAnchor, setActivityEl, setIsUserScrolledUp, hideSuggestionChips, resetCurrentFullText, resetStreamState, resetTranscriptParticipants } from './app-rendering.js';
|
|
26
28
|
import { resetToolState, enableMainInput, resetTurnMetaCost, clearPromptStates } from './tools.js';
|
|
27
29
|
import { clearPendingImages } from './input.js';
|
|
28
30
|
import { clearAllMentionActive } from './sidebar-users.js';
|
|
@@ -47,6 +49,7 @@ var pendingRemoveName = null;
|
|
|
47
49
|
|
|
48
50
|
// Add-project modal state
|
|
49
51
|
var addProjectModal = null;
|
|
52
|
+
var addProjectHandle = null;
|
|
50
53
|
var addProjectInput = null;
|
|
51
54
|
var addProjectCreateInput = null;
|
|
52
55
|
var addProjectCloneInput = null;
|
|
@@ -98,7 +101,7 @@ export function initProjects() {
|
|
|
98
101
|
}
|
|
99
102
|
});
|
|
100
103
|
|
|
101
|
-
addProjectModal.querySelector(".
|
|
104
|
+
addProjectModal.querySelector(".overlay-modal-dialog").addEventListener("click", function (e) {
|
|
102
105
|
if (e.target === addProjectInput || addProjectInput.contains(e.target)) return;
|
|
103
106
|
if (e.target === addProjectSuggestions || addProjectSuggestions.contains(e.target)) return;
|
|
104
107
|
addProjectSuggestions.classList.add("hidden");
|
|
@@ -161,33 +164,21 @@ export function initProjects() {
|
|
|
161
164
|
submitAddProject();
|
|
162
165
|
return;
|
|
163
166
|
}
|
|
164
|
-
|
|
165
|
-
if (e.key === "Escape") {
|
|
166
|
-
e.preventDefault();
|
|
167
|
-
closeAddProjectModal();
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
167
|
});
|
|
171
168
|
|
|
172
|
-
// Enter key on create/clone inputs
|
|
169
|
+
// Enter key on create/clone inputs; Escape and the scrim close the modal through
|
|
170
|
+
// the shared overlay component.
|
|
173
171
|
addProjectCreateInput.addEventListener("keydown", function (e) {
|
|
174
172
|
if (e.key === "Enter") { e.preventDefault(); submitAddProject(); }
|
|
175
|
-
if (e.key === "Escape") { e.preventDefault(); closeAddProjectModal(); }
|
|
176
173
|
});
|
|
177
174
|
|
|
178
175
|
addProjectCloneInput.addEventListener("keydown", function (e) {
|
|
179
176
|
if (e.key === "Enter") { e.preventDefault(); submitAddProject(); }
|
|
180
|
-
if (e.key === "Escape") { e.preventDefault(); closeAddProjectModal(); }
|
|
181
177
|
});
|
|
182
178
|
|
|
183
179
|
addProjectOk.addEventListener("click", function () { submitAddProject(); });
|
|
184
180
|
addProjectCancel.addEventListener("click", function () { closeAddProjectModal(); });
|
|
185
181
|
|
|
186
|
-
// Close on backdrop click
|
|
187
|
-
addProjectModal.querySelector(".confirm-backdrop").addEventListener("click", function () {
|
|
188
|
-
closeAddProjectModal();
|
|
189
|
-
});
|
|
190
|
-
|
|
191
182
|
// Project list add button
|
|
192
183
|
var projectListAddBtn = document.getElementById("project-list-add");
|
|
193
184
|
if (projectListAddBtn) {
|
|
@@ -262,13 +253,11 @@ export function updateProjectList(msg) {
|
|
|
262
253
|
if (msg.dmConversations) store.set({ cachedDmConversations: msg.dmConversations });
|
|
263
254
|
// renderUserStrip is handled by the store subscriber
|
|
264
255
|
var st2 = store.snap();
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
try { localStorage.setItem("clagentic_my_user", JSON.stringify({ displayName: refreshedMyUser.displayName, username: refreshedMyUser.username, avatarStyle: refreshedMyUser.avatarStyle, avatarSeed: refreshedMyUser.avatarSeed, avatarCustom: refreshedMyUser.avatarCustom })); } catch(e) {}
|
|
271
|
-
}
|
|
256
|
+
var refreshedMyUser = st2.cachedAllUsers.find(function (u) { return u.id === st2.myUserId; });
|
|
257
|
+
if (refreshedMyUser) {
|
|
258
|
+
document.body.dataset.myDisplayName = refreshedMyUser.displayName || refreshedMyUser.username || "";
|
|
259
|
+
document.body.dataset.myAvatarUrl = userAvatarUrl(refreshedMyUser, AVATAR_REQUEST_SIZE);
|
|
260
|
+
try { localStorage.setItem("clagentic_my_user", JSON.stringify({ displayName: refreshedMyUser.displayName, username: refreshedMyUser.username, avatarStyle: refreshedMyUser.avatarStyle, avatarSeed: refreshedMyUser.avatarSeed, avatarCustom: refreshedMyUser.avatarCustom })); } catch(e) {}
|
|
272
261
|
}
|
|
273
262
|
// Render my avatar (always present, hidden behind user-island)
|
|
274
263
|
var meEl = document.getElementById("icon-strip-me");
|
|
@@ -463,7 +452,9 @@ export function resetClientState() {
|
|
|
463
452
|
stopUrgentBlink();
|
|
464
453
|
// Clear vendor state so the incoming model_info for the new project is never
|
|
465
454
|
// blocked by a lock that was set during the previous project's session.
|
|
466
|
-
store.set({ currentVendor: null, vendorSelectionLocked: false, codexApproval: null, codexSandbox: null, codexWebSearch: null });
|
|
455
|
+
store.set({ currentVendor: null, currentAgentName: null, vendorSelectionLocked: false, codexApproval: null, codexSandbox: null, codexWebSearch: null });
|
|
456
|
+
// The transcript is gone, so is everyone who had spoken in it.
|
|
457
|
+
resetTranscriptParticipants();
|
|
467
458
|
// NOTE: session list reset is NOT done here. resetClientState() is also called
|
|
468
459
|
// from session_switched (within-project session switching) where the session
|
|
469
460
|
// list must be preserved. Session list clearing is done only in switchProject()
|
|
@@ -570,38 +561,31 @@ export function handleRemoveProjectCheckResult(msg) {
|
|
|
570
561
|
function showRemoveProjectTaskDialog(slug, name, taskCount) {
|
|
571
562
|
var otherProjects = cachedProjects.filter(function (p) { return p.slug !== slug; });
|
|
572
563
|
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
modal.innerHTML =
|
|
576
|
-
'<div class="remove-project-task-backdrop"></div>' +
|
|
577
|
-
'<div class="remove-project-task-dialog">' +
|
|
578
|
-
'<div class="remove-project-task-title">Remove project "' + (name || slug) + '"</div>' +
|
|
564
|
+
var content =
|
|
565
|
+
'<div class="remove-project-task-title">Remove project "' + escapeHtml(name || slug) + '"</div>' +
|
|
579
566
|
'<div class="remove-project-task-text">This project has <strong>' + taskCount + '</strong> task' + (taskCount > 1 ? 's' : '') + '/schedule' + (taskCount > 1 ? 's' : '') + '.</div>' +
|
|
580
567
|
'<div class="remove-project-task-options">' +
|
|
581
568
|
(otherProjects.length > 0
|
|
582
569
|
? '<div class="remove-project-task-label">Move tasks to:</div>' +
|
|
583
570
|
'<select class="remove-project-task-select" id="rpt-move-target">' +
|
|
584
571
|
otherProjects.map(function (p) {
|
|
585
|
-
return '<option value="' + p.slug + '">' + (p.title || p.project || p.slug) + '</option>';
|
|
572
|
+
return '<option value="' + escapeHtml(p.slug) + '">' + escapeHtml(p.title || p.project || p.slug) + '</option>';
|
|
586
573
|
}).join("") +
|
|
587
574
|
'</select>' +
|
|
588
575
|
'<button class="remove-project-task-btn move" id="rpt-move-btn">Move & Remove</button>'
|
|
589
576
|
: '') +
|
|
590
577
|
'<button class="remove-project-task-btn delete" id="rpt-delete-btn">Delete all & Remove</button>' +
|
|
591
578
|
'<button class="remove-project-task-btn cancel" id="rpt-cancel-btn">Cancel</button>' +
|
|
592
|
-
'</div>'
|
|
593
|
-
'</div>';
|
|
579
|
+
'</div>';
|
|
594
580
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
var backdrop = modal.querySelector(".remove-project-task-backdrop");
|
|
581
|
+
var handle = showOverlay({ kind: "modal", dialogClass: "remove-project-task-dialog", content: content });
|
|
582
|
+
var modal = handle.el;
|
|
598
583
|
var moveBtn = modal.querySelector("#rpt-move-btn");
|
|
599
584
|
var deleteBtn = modal.querySelector("#rpt-delete-btn");
|
|
600
585
|
var cancelBtn = modal.querySelector("#rpt-cancel-btn");
|
|
601
586
|
var selectEl = modal.querySelector("#rpt-move-target");
|
|
602
587
|
|
|
603
|
-
function close() {
|
|
604
|
-
backdrop.addEventListener("click", close);
|
|
588
|
+
function close() { handle.close(); }
|
|
605
589
|
cancelBtn.addEventListener("click", close);
|
|
606
590
|
|
|
607
591
|
if (moveBtn) {
|
|
@@ -713,7 +697,7 @@ function switchAddProjectMode(mode) {
|
|
|
713
697
|
}
|
|
714
698
|
|
|
715
699
|
export function openAddProjectModal() {
|
|
716
|
-
|
|
700
|
+
addProjectHandle = showOverlay({ kind: "modal", el: addProjectModal, onRemove: resetAddProjectModal });
|
|
717
701
|
addProjectCreateInput.value = "";
|
|
718
702
|
addProjectCloneInput.value = "";
|
|
719
703
|
addProjectError.classList.add("hidden");
|
|
@@ -803,7 +787,13 @@ function renderRemovedProjectsList() {
|
|
|
803
787
|
}
|
|
804
788
|
|
|
805
789
|
export function closeAddProjectModal() {
|
|
806
|
-
|
|
790
|
+
if (addProjectHandle && addProjectHandle.isOpen()) addProjectHandle.close();
|
|
791
|
+
else resetAddProjectModal();
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
// Runs when the modal closes, however (Escape, the scrim, the close control or a
|
|
795
|
+
// button), so what was typed does not outlive it.
|
|
796
|
+
function resetAddProjectModal() {
|
|
807
797
|
addProjectInput.value = "";
|
|
808
798
|
addProjectCreateInput.value = "";
|
|
809
799
|
addProjectCloneInput.value = "";
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { iconHtml, refreshIcons } from './icons.js';
|
|
5
5
|
import { store } from './store.js';
|
|
6
|
+
import { showOverlay } from './overlay.js';
|
|
6
7
|
import { clearScheduleDelay, setScheduleDelayForSession, clearScheduleDelayForSession, restoreScheduleDelayUi, refreshScheduleControls } from './input.js';
|
|
7
8
|
import { isSonnetModel, isOpusModel } from './model-families.js';
|
|
8
9
|
import {
|
|
@@ -29,6 +30,7 @@ var rateLimitUsageEl = null;
|
|
|
29
30
|
var rateLimitTickTimer = null;
|
|
30
31
|
var _rateLimitUsageLastHtml = null; // guard against redundant innerHTML + refreshIcons()
|
|
31
32
|
var fastModeIndicatorEl = null;
|
|
33
|
+
var rateLimitNoticeClose = null; // closes the notice on screen, if any
|
|
32
34
|
|
|
33
35
|
function currentSessionId() {
|
|
34
36
|
return store.get('activeSessionId');
|
|
@@ -135,19 +137,34 @@ function updateRateLimitIndicator(msg) {
|
|
|
135
137
|
|
|
136
138
|
function showRateLimitPopover(text, isRejected) {
|
|
137
139
|
if (!rateLimitIndicatorEl) return;
|
|
138
|
-
// Remove existing popover
|
|
139
|
-
var old = rateLimitIndicatorEl.querySelector(".rate-limit-popover");
|
|
140
|
-
if (old) old.remove();
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
141
|
+
// A new notice replaces the one on screen. Passive notices are outside the
|
|
142
|
+
// one-open stack, so the older is closed here.
|
|
143
|
+
if (rateLimitNoticeClose) rateLimitNoticeClose();
|
|
144
|
+
|
|
145
|
+
var card = document.createElement("div");
|
|
146
|
+
card.textContent = text;
|
|
147
|
+
var pop = showOverlay({
|
|
148
|
+
kind: "popover",
|
|
149
|
+
passive: true,
|
|
150
|
+
el: card,
|
|
151
|
+
className: "rate-limit-popover" + (isRejected ? " rejected" : ""),
|
|
152
|
+
anchor: rateLimitIndicatorEl,
|
|
153
|
+
placement: "below-center",
|
|
154
|
+
gap: 8,
|
|
155
|
+
// Stays under its header pill at phone width rather than centred over the transcript.
|
|
156
|
+
mobile: false,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
rateLimitNoticeClose = pop.close;
|
|
146
160
|
|
|
147
161
|
// Auto-dismiss after 5s
|
|
148
162
|
setTimeout(function () {
|
|
149
|
-
pop.classList.add("fade-out");
|
|
150
|
-
setTimeout(function () {
|
|
163
|
+
pop.el.classList.add("fade-out");
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
pop.close();
|
|
166
|
+
if (rateLimitNoticeClose === pop.close) rateLimitNoticeClose = null;
|
|
167
|
+
}, 300);
|
|
151
168
|
}, 5000);
|
|
152
169
|
}
|
|
153
170
|
|
|
@@ -11,13 +11,16 @@ import { userAvatarUrl } from './avatar.js';
|
|
|
11
11
|
import { injectedSenderName, injectedLabel, injectedSessionNote } from './injected-label.js';
|
|
12
12
|
import { buildCollapsibleText, needsCollapse, isNonTypedInput } from './collapsible-text.js';
|
|
13
13
|
import { resolveInjectedIdentity } from './injected-identity.js';
|
|
14
|
-
import { applyIdentityAvatar } from './agent-avatar.js';
|
|
14
|
+
import { applyIdentityAvatar, createAgentAvatar } from './agent-avatar.js';
|
|
15
15
|
import { getProjectAgents } from './at-agents.js';
|
|
16
16
|
import { closeToolGroup } from './tools.js';
|
|
17
17
|
import { showImageModal, showPasteModal } from './app-misc.js';
|
|
18
18
|
import { sendMessage, hasSendableContent } from './input.js';
|
|
19
|
-
import { getChatLayout } from './theme.js';
|
|
20
19
|
import { getScheduledMsgEl } from './app-rate-limit.js';
|
|
20
|
+
import { buildMessageHeader, AVATAR_REQUEST_SIZE } from './message-header.js';
|
|
21
|
+
import { noteHuman, resetHumans, MULTI_HUMAN_CLASS } from './message-participants.js';
|
|
22
|
+
import { assistantIdentity, composerPlaceholder } from './assistant-identity.js';
|
|
23
|
+
import { listedVendor, placeholderNeedsRecompute } from './session-vendor-state.js';
|
|
21
24
|
|
|
22
25
|
import { VENDOR_AVATARS, VENDOR_NAMES, gatedButtonAttrs } from './vendor-registry.js';
|
|
23
26
|
export { VENDOR_AVATARS, VENDOR_NAMES };
|
|
@@ -39,6 +42,28 @@ export function resetCurrentFullText(v) {
|
|
|
39
42
|
currentFullTextLocal = v || "";
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
// Raw markdown of each finalized assistant message, so an older page that
|
|
46
|
+
// continues the reply can be stitched in and the whole text re-rendered.
|
|
47
|
+
var finalizedText = new WeakMap();
|
|
48
|
+
export function getFinalizedText(el) { return finalizedText.get(el) || ""; }
|
|
49
|
+
export function setFinalizedText(el, text) { finalizedText.set(el, text); }
|
|
50
|
+
|
|
51
|
+
// The raw text a message holds right now, streamed-but-undrawn text included.
|
|
52
|
+
// An async render of a snapshot compares against this to learn whether a newer
|
|
53
|
+
// delta or render has changed the message since the snapshot was taken.
|
|
54
|
+
export function getLiveMessageText(el) {
|
|
55
|
+
if (store.get('currentMsgEl') === el) return currentFullTextLocal + streamBuffer;
|
|
56
|
+
return finalizedText.get(el) || "";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Draws rendered markdown into a message body the way a finished reply is
|
|
60
|
+
// drawn: highlighted code and mermaid diagrams.
|
|
61
|
+
export function applyRenderedHtml(contentEl, html) {
|
|
62
|
+
contentEl.innerHTML = html;
|
|
63
|
+
highlightCodeBlocks(contentEl);
|
|
64
|
+
renderMermaidBlocks(contentEl);
|
|
65
|
+
}
|
|
66
|
+
|
|
42
67
|
// Drops undrawn stream text and in-flight render bookkeeping. Without this a
|
|
43
68
|
// reset (reconnect, session or project switch) leaves buffered text that is
|
|
44
69
|
// then drawn in front of the next replayed block.
|
|
@@ -165,12 +190,15 @@ export function disarmStickyBottom() {
|
|
|
165
190
|
}
|
|
166
191
|
|
|
167
192
|
export function initRendering() {
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
193
|
+
// The placeholder names the page's vendor, else the session list's vendor for
|
|
194
|
+
// the active session, so it follows all three inputs.
|
|
195
|
+
store.subscribe(['currentVendor', 'activeSessionId', 'sessionVendors'], function (state, prev) {
|
|
196
|
+
// Every session_list stores a new sessionVendors map, so the map's identity
|
|
197
|
+
// says nothing: only a change of the vendor the active session shows redraws.
|
|
198
|
+
if (placeholderNeedsRecompute(state, prev)) {
|
|
171
199
|
var inputEl = document.getElementById("input");
|
|
172
200
|
if (inputEl) {
|
|
173
|
-
inputEl.placeholder =
|
|
201
|
+
inputEl.placeholder = composerPlaceholder(function (k) { return store.get(k); });
|
|
174
202
|
}
|
|
175
203
|
}
|
|
176
204
|
});
|
|
@@ -188,10 +216,28 @@ export function setIsUserScrolledUp(v) { isUserScrolledUp = v; }
|
|
|
188
216
|
|
|
189
217
|
// --- Rendering functions ---
|
|
190
218
|
|
|
219
|
+
// Elements that stay below newer output until they leave (queued messages the
|
|
220
|
+
// agent has not taken in yet), in the order they were added.
|
|
221
|
+
var bottomEls = [];
|
|
222
|
+
|
|
223
|
+
export function keepAtBottom(el) {
|
|
224
|
+
if (bottomEls.indexOf(el) === -1) bottomEls.push(el);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function releaseFromBottom(el) {
|
|
228
|
+
var at = bottomEls.indexOf(el);
|
|
229
|
+
if (at !== -1) bottomEls.splice(at, 1);
|
|
230
|
+
}
|
|
231
|
+
|
|
191
232
|
export function addToMessages(el) {
|
|
192
233
|
var messagesEl = getMessagesEl();
|
|
193
234
|
if (prependAnchor) messagesEl.insertBefore(el, prependAnchor);
|
|
194
235
|
else messagesEl.appendChild(el);
|
|
236
|
+
// An entry the list no longer holds (the list was cleared) is dropped, not redrawn.
|
|
237
|
+
bottomEls = bottomEls.filter(function (b) {
|
|
238
|
+
return Array.prototype.indexOf.call(messagesEl.children, b) !== -1;
|
|
239
|
+
});
|
|
240
|
+
for (var i = 0; i < bottomEls.length; i++) messagesEl.appendChild(bottomEls[i]);
|
|
195
241
|
var _sme = getScheduledMsgEl();
|
|
196
242
|
if (_sme && el !== _sme && _sme.parentNode === messagesEl) {
|
|
197
243
|
messagesEl.appendChild(_sme);
|
|
@@ -258,32 +304,33 @@ export function ensureAssistantBlock() {
|
|
|
258
304
|
var grouped = shouldGroupMessage("msg-assistant");
|
|
259
305
|
if (grouped) _el.classList.add("grouped");
|
|
260
306
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
307
|
+
// A session cast as a named agent shows that agent and its roster avatar;
|
|
308
|
+
// a session with no agent shows the vendor.
|
|
309
|
+
var identity = assistantIdentity(
|
|
310
|
+
store.get('currentVendor'),
|
|
311
|
+
store.get('currentAgentName'),
|
|
312
|
+
listedVendor(store.get('sessionVendors'), store.get('activeSessionId'))
|
|
313
|
+
);
|
|
314
|
+
var avi;
|
|
315
|
+
if (identity.agentKey) {
|
|
316
|
+
avi = createAgentAvatar(identity.agentKey, AVATAR_REQUEST_SIZE, "dm-bubble-avatar dm-bubble-avatar-agent");
|
|
317
|
+
} else if (!identity.avatarUrl) {
|
|
318
|
+
// No vendor is known: a blank avatar, never another vendor's picture.
|
|
319
|
+
avi = document.createElement("span");
|
|
320
|
+
avi.className = "dm-bubble-avatar dm-bubble-avatar-agent";
|
|
321
|
+
} else {
|
|
322
|
+
avi = document.createElement("img");
|
|
323
|
+
avi.className = "dm-bubble-avatar dm-bubble-avatar-agent";
|
|
324
|
+
avi.src = identity.avatarUrl;
|
|
325
|
+
avi.alt = "";
|
|
326
|
+
}
|
|
327
|
+
var head = buildMessageHeader({ side: "other", avatarEl: avi, name: identity.name, time: getMsgTime() });
|
|
328
|
+
_el.appendChild(head.el);
|
|
281
329
|
|
|
282
330
|
var mdDiv = document.createElement("div");
|
|
283
331
|
mdDiv.className = "md-content";
|
|
284
332
|
mdDiv.dir = "auto";
|
|
285
|
-
|
|
286
|
-
_el.appendChild(contentWrap);
|
|
333
|
+
_el.appendChild(mdDiv);
|
|
287
334
|
addToMessages(_el);
|
|
288
335
|
currentFullTextLocal = "";
|
|
289
336
|
store.set({ currentMsgEl: _el, currentFullText: "" });
|
|
@@ -335,7 +382,7 @@ export function addCopyHandler(msgEl, rawText) {
|
|
|
335
382
|
resetTimer = setTimeout(reset, 3000);
|
|
336
383
|
} else {
|
|
337
384
|
clearTimeout(resetTimer);
|
|
338
|
-
copyToClipboard(rawText).then(function () {
|
|
385
|
+
copyToClipboard(finalizedText.get(msgEl) || rawText).then(function () {
|
|
339
386
|
msgEl.classList.remove("copy-primed");
|
|
340
387
|
msgEl.classList.add("copy-done");
|
|
341
388
|
hint.textContent = "Grabbed!";
|
|
@@ -461,9 +508,7 @@ export function finalizeAssistantBlock() {
|
|
|
461
508
|
renderMarkdownAsync(textToRender).then(function (html) {
|
|
462
509
|
setTimeout(function () {
|
|
463
510
|
if (contentEl.isConnected) {
|
|
464
|
-
contentEl
|
|
465
|
-
highlightCodeBlocks(contentEl);
|
|
466
|
-
renderMermaidBlocks(contentEl);
|
|
511
|
+
applyRenderedHtml(contentEl, html);
|
|
467
512
|
// Only re-arm sticky-bottom for live turns. During replay,
|
|
468
513
|
// history_done owns the sticky-bottom arm. Per-turn arms from
|
|
469
514
|
// replayed finalizeAssistantBlock callbacks keep extending the
|
|
@@ -480,6 +525,7 @@ export function finalizeAssistantBlock() {
|
|
|
480
525
|
renderMermaidBlocks(contentEl);
|
|
481
526
|
}
|
|
482
527
|
if (textToRender) {
|
|
528
|
+
finalizedText.set(msgEl, textToRender);
|
|
483
529
|
addCopyHandler(msgEl, textToRender);
|
|
484
530
|
}
|
|
485
531
|
closeToolGroup();
|
|
@@ -501,7 +547,12 @@ export function addUserMessage(text, images, pastes, fromUserId, fromUserName, i
|
|
|
501
547
|
var div = document.createElement("div");
|
|
502
548
|
div.className = "msg-user" + (isOtherUser ? " msg-user-other" : "") + (injected ? " msg-user-injected" : "");
|
|
503
549
|
div.dataset.turn = ++turnCounter;
|
|
504
|
-
|
|
550
|
+
// Who has typed in this transcript decides what the viewer's own header shows
|
|
551
|
+
// (time only until a second person speaks); the stylesheet reads the class.
|
|
552
|
+
if (!injected) {
|
|
553
|
+
var speakerCount = noteHuman(isOtherUser ? fromUserId : (myUserId || fromUserId));
|
|
554
|
+
getMessagesEl().classList.toggle(MULTI_HUMAN_CLASS, speakerCount >= 2);
|
|
555
|
+
}
|
|
505
556
|
var bubble = document.createElement("div");
|
|
506
557
|
bubble.className = "bubble";
|
|
507
558
|
bubble.dir = "auto";
|
|
@@ -579,7 +630,7 @@ export function addUserMessage(text, images, pastes, fromUserId, fromUserName, i
|
|
|
579
630
|
var _displayName;
|
|
580
631
|
var _injectedIdentity = null;
|
|
581
632
|
if (injected) {
|
|
582
|
-
_injectedIdentity = resolveInjectedIdentity(injected, fromUserId, getProjectAgents(),
|
|
633
|
+
_injectedIdentity = resolveInjectedIdentity(injected, fromUserId, getProjectAgents(), AVATAR_REQUEST_SIZE);
|
|
583
634
|
_displayName = _injectedIdentity.name;
|
|
584
635
|
} else if (isOtherUser) {
|
|
585
636
|
_targetUser = cachedAllUsers.find(function (u) { return u.id === fromUserId; });
|
|
@@ -595,40 +646,50 @@ export function addUserMessage(text, images, pastes, fromUserId, fromUserName, i
|
|
|
595
646
|
}
|
|
596
647
|
}
|
|
597
648
|
|
|
598
|
-
var
|
|
599
|
-
avi
|
|
600
|
-
if (_injectedIdentity) {
|
|
601
|
-
|
|
649
|
+
var aviClass = "dm-bubble-avatar" + (isOtherUser ? " dm-bubble-avatar-other" : " dm-bubble-avatar-me");
|
|
650
|
+
var avi;
|
|
651
|
+
if (_injectedIdentity && _injectedIdentity.systemKind) {
|
|
652
|
+
// A console automation draws its fixed system icon, never a seeded robot.
|
|
653
|
+
avi = createAgentAvatar(null, AVATAR_REQUEST_SIZE, aviClass, null, { systemKind: _injectedIdentity.systemKind });
|
|
654
|
+
} else if (_injectedIdentity) {
|
|
655
|
+
avi = document.createElement("img");
|
|
656
|
+
avi.className = aviClass;
|
|
657
|
+
applyIdentityAvatar(avi, _injectedIdentity, AVATAR_REQUEST_SIZE);
|
|
602
658
|
} else {
|
|
659
|
+
avi = document.createElement("img");
|
|
660
|
+
avi.className = aviClass;
|
|
603
661
|
avi.src = isOtherUser
|
|
604
|
-
? userAvatarUrl(_targetUser || { id: fromUserId },
|
|
605
|
-
: (document.body.dataset.myAvatarUrl || userAvatarUrl(_targetUser || { id: myUserId },
|
|
662
|
+
? userAvatarUrl(_targetUser || { id: fromUserId }, AVATAR_REQUEST_SIZE)
|
|
663
|
+
: (document.body.dataset.myAvatarUrl || userAvatarUrl(_targetUser || { id: myUserId }, AVATAR_REQUEST_SIZE));
|
|
606
664
|
}
|
|
607
|
-
div.appendChild(avi);
|
|
608
665
|
|
|
609
|
-
var
|
|
610
|
-
|
|
666
|
+
var actions = document.createElement("div");
|
|
667
|
+
actions.className = "msg-actions";
|
|
668
|
+
actions.innerHTML =
|
|
669
|
+
'<button class="msg-action-btn msg-action-copy" type="button" title="Copy">' + iconHtml("copy") + '</button>' +
|
|
670
|
+
'<button class="msg-action-btn msg-action-fork" type="button" ' + gatedButtonAttrs("fork", "Fork") + '>' + iconHtml("git-branch") + '</button>' +
|
|
671
|
+
'<button class="msg-action-btn msg-action-rewind msg-user-rewind-btn" type="button" ' + gatedButtonAttrs("rewind", "Rewind") + '>' + iconHtml("rotate-ccw") + '</button>' +
|
|
672
|
+
'<button class="msg-action-btn msg-action-hidden msg-action-edit" type="button" title="Edit">' + iconHtml("pencil") + '</button>';
|
|
611
673
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
674
|
+
// One header line: the other-speaker side reads avatar, name, label, time; the
|
|
675
|
+
// viewer's own side is the same line mirrored by CSS. Collapse sits in the
|
|
676
|
+
// header, and so do the actions, so the message has no row of its own for them.
|
|
677
|
+
var head = buildMessageHeader({
|
|
678
|
+
side: isOtherUser ? "other" : "own",
|
|
679
|
+
avatarEl: avi,
|
|
680
|
+
name: _displayName,
|
|
681
|
+
label: injected ? injectedLabel(injected) : null,
|
|
682
|
+
time: getMsgTime(),
|
|
683
|
+
control: firedCollapse ? firedCollapse.button : null,
|
|
684
|
+
actions: actions,
|
|
685
|
+
});
|
|
623
686
|
if (injected) {
|
|
624
|
-
var labelEl = document.createElement("div");
|
|
625
|
-
labelEl.className = "injected-label";
|
|
626
|
-
labelEl.textContent = injectedLabel(injected);
|
|
627
|
-
contentWrap.appendChild(labelEl);
|
|
628
687
|
// The full sender session id: on hover (title) and on tap, which a phone has
|
|
629
688
|
// no hover for. Not part of the label itself.
|
|
630
689
|
var sessionNote = injectedSessionNote(injected);
|
|
631
|
-
if (sessionNote) {
|
|
690
|
+
if (sessionNote && head.nameEl && head.labelEl) {
|
|
691
|
+
var nameSpan = head.nameEl;
|
|
692
|
+
var labelEl = head.labelEl;
|
|
632
693
|
nameSpan.title = sessionNote;
|
|
633
694
|
nameSpan.dataset.senderSession = injected.senderSessionId;
|
|
634
695
|
nameSpan.classList.add("dm-bubble-name-tappable");
|
|
@@ -636,25 +697,12 @@ export function addUserMessage(text, images, pastes, fromUserId, fromUserName, i
|
|
|
636
697
|
var shown = labelEl.dataset.showSession === "1";
|
|
637
698
|
labelEl.dataset.showSession = shown ? "0" : "1";
|
|
638
699
|
labelEl.textContent = injectedLabel(injected) + (shown ? "" : " · " + sessionNote);
|
|
700
|
+
labelEl.title = labelEl.textContent;
|
|
639
701
|
});
|
|
640
702
|
}
|
|
641
703
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
firedCollapse.button.classList.add("collapsible-toggle-fired");
|
|
645
|
-
contentWrap.appendChild(firedCollapse.button);
|
|
646
|
-
}
|
|
647
|
-
div.appendChild(contentWrap);
|
|
648
|
-
|
|
649
|
-
var actions = document.createElement("div");
|
|
650
|
-
actions.className = "msg-actions";
|
|
651
|
-
actions.innerHTML =
|
|
652
|
-
'<span class="msg-action-time">' + getMsgTime() + '</span>' +
|
|
653
|
-
'<button class="msg-action-btn msg-action-copy" type="button" title="Copy">' + iconHtml("copy") + '</button>' +
|
|
654
|
-
'<button class="msg-action-btn msg-action-fork" type="button" ' + gatedButtonAttrs("fork", "Fork") + '>' + iconHtml("git-branch") + '</button>' +
|
|
655
|
-
'<button class="msg-action-btn msg-action-rewind msg-user-rewind-btn" type="button" ' + gatedButtonAttrs("rewind", "Rewind") + '>' + iconHtml("rotate-ccw") + '</button>' +
|
|
656
|
-
'<button class="msg-action-btn msg-action-hidden msg-action-edit" type="button" title="Edit">' + iconHtml("pencil") + '</button>';
|
|
657
|
-
div.appendChild(actions);
|
|
704
|
+
div.appendChild(head.el);
|
|
705
|
+
div.appendChild(bubble);
|
|
658
706
|
|
|
659
707
|
actions.querySelector(".msg-action-copy").addEventListener("click", function () {
|
|
660
708
|
var self = this;
|
|
@@ -753,42 +801,12 @@ export function addContextOverflowMessage(msg) {
|
|
|
753
801
|
scrollToBottom();
|
|
754
802
|
}
|
|
755
803
|
|
|
756
|
-
//
|
|
757
|
-
|
|
758
|
-
export function
|
|
759
|
-
|
|
760
|
-
removePreThinking();
|
|
761
|
-
var vendor = store.get('currentVendor') || "claude";
|
|
762
|
-
var vendorAvatar = VENDOR_AVATARS[vendor] || VENDOR_AVATARS.claude;
|
|
763
|
-
var vendorName = VENDOR_NAMES[vendor] || VENDOR_NAMES.claude;
|
|
764
|
-
doShowPreThinking(vendorName, vendorAvatar);
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
export function removePreThinking() {
|
|
804
|
+
// The transcript was cleared (session or project switch): nobody has spoken in
|
|
805
|
+
// the new one yet, so the viewer's own header goes back to time only.
|
|
806
|
+
export function resetTranscriptParticipants() {
|
|
807
|
+
resetHumans();
|
|
768
808
|
var messagesEl = getMessagesEl();
|
|
769
|
-
if (
|
|
770
|
-
var els = messagesEl.querySelectorAll(".channel-pre-thinking");
|
|
771
|
-
for (var i = 0; i < els.length; i++) {
|
|
772
|
-
els[i].remove();
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
function doShowPreThinking(name, avatar) {
|
|
777
|
-
var _el = document.createElement("div");
|
|
778
|
-
_el.className = "thinking-item channel-thinking channel-pre-thinking";
|
|
779
|
-
_el.innerHTML =
|
|
780
|
-
'<img class="dm-bubble-avatar" src="' + escapeHtml(avatar) + '" alt="" style="display:block">' +
|
|
781
|
-
'<div class="dm-bubble-content">' +
|
|
782
|
-
'<div class="dm-bubble-header"><span class="dm-bubble-name">' + escapeHtml(name) + '</span></div>' +
|
|
783
|
-
'<div class="thinking-dots"><span></span><span></span><span></span></div>' +
|
|
784
|
-
'</div>';
|
|
785
|
-
if (activityEl && activityEl.parentNode) {
|
|
786
|
-
activityEl.parentNode.insertBefore(_el, activityEl);
|
|
787
|
-
} else {
|
|
788
|
-
addToMessages(_el);
|
|
789
|
-
}
|
|
790
|
-
refreshIcons(_el);
|
|
791
|
-
scrollToBottom();
|
|
809
|
+
if (messagesEl) messagesEl.classList.remove(MULTI_HUMAN_CLASS);
|
|
792
810
|
}
|
|
793
811
|
|
|
794
812
|
// --- Ghost suggestion (prompt recommendation as ghost text) ---
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
import { refreshIcons, iconHtml } from './icons.js';
|
|
5
5
|
import { escapeHtml } from './utils.js';
|
|
6
6
|
import { store } from './store.js';
|
|
7
|
+
import { showOverlay } from './overlay.js';
|
|
7
8
|
|
|
8
9
|
// --- Module-owned state (not in store) ---
|
|
9
10
|
var skillInstallModal = null;
|
|
11
|
+
var skillInstallHandle = null;
|
|
10
12
|
var skillInstallTitle = null;
|
|
11
13
|
var skillInstallReason = null;
|
|
12
14
|
var skillInstallList = null;
|
|
@@ -34,7 +36,6 @@ export function initSkillInstall() {
|
|
|
34
36
|
skillInstallStatus = document.getElementById("skill-install-status");
|
|
35
37
|
|
|
36
38
|
skillInstallCancel.addEventListener("click", onSkillInstallDismiss);
|
|
37
|
-
skillInstallModal.querySelector(".confirm-backdrop").addEventListener("click", onSkillInstallDismiss);
|
|
38
39
|
|
|
39
40
|
skillInstallOk.addEventListener("click", function () {
|
|
40
41
|
if (skillInstallDone) {
|
|
@@ -116,11 +117,12 @@ function renderSkillInstallDialog(opts, missing) {
|
|
|
116
117
|
// distinct cancel label so it's clear this won't abort the action.
|
|
117
118
|
skillInstallSkippable = hasOutdated && !hasMissing;
|
|
118
119
|
skillInstallCancel.textContent = skillInstallSkippable ? "Skip" : "Cancel";
|
|
119
|
-
|
|
120
|
+
// Escape, the scrim and the close control dismiss it the way Cancel does.
|
|
121
|
+
skillInstallHandle = showOverlay({ kind: "modal", el: skillInstallModal, onDismiss: onSkillInstallDismiss });
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
function hideSkillInstallModal() {
|
|
123
|
-
|
|
125
|
+
if (skillInstallHandle) skillInstallHandle.close();
|
|
124
126
|
skillInstallCallback = null;
|
|
125
127
|
pendingSkillInstalls = [];
|
|
126
128
|
skillInstalling = false;
|
|
@@ -128,7 +130,7 @@ function hideSkillInstallModal() {
|
|
|
128
130
|
skillInstallSkippable = false;
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
// Cancel
|
|
133
|
+
// Cancel, Escape, scrim and close-control handler. For "missing" skills the feature genuinely
|
|
132
134
|
// cannot run without them, so dismiss = drop the callback (existing behavior).
|
|
133
135
|
// For "outdated"-only prompts the feature still works on the old version, so
|
|
134
136
|
// dismiss = remember the choice for this browser session and proceed with cb.
|