@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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// agent-roster-groups.js - the three groups the Team view's Agents section is
|
|
2
|
+
// drawn in, and the leading mark of a row that has no operator-chosen avatar.
|
|
3
|
+
//
|
|
4
|
+
// The server (lib/agent-roster.js) says which group each identity belongs to,
|
|
5
|
+
// read from what the vendors reported (lib/vendor-catalog.js); nothing here
|
|
6
|
+
// names a model, a helper or a vendor. An entry whose group is missing or
|
|
7
|
+
// unknown is a named agent, so nothing is ever dropped from the view.
|
|
8
|
+
//
|
|
9
|
+
// DOM-light: builders only, no app state, no icon library import. The caller
|
|
10
|
+
// resolves the <i data-lucide> placeholders with refreshIcons once placed.
|
|
11
|
+
|
|
12
|
+
export var GROUP = { AGENT: "agent", HELPER: "helper", MODEL: "model" };
|
|
13
|
+
|
|
14
|
+
// Named agents are always open; the other two groups start collapsed.
|
|
15
|
+
export var GROUPS = [
|
|
16
|
+
{ id: GROUP.AGENT, title: "Named agents", collapsible: false },
|
|
17
|
+
{ id: GROUP.HELPER, title: "Built-in helpers", collapsible: true },
|
|
18
|
+
{ id: GROUP.MODEL, title: "Models", collapsible: true },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
// The glyph a row with no chosen avatar and no vendor logo shows, per group.
|
|
22
|
+
var GLYPH_ICON = { helper: "wrench", model: "cpu", agent: "bot" };
|
|
23
|
+
|
|
24
|
+
/** Splits the roster into {agent, helper, model}, keeping each list's order. */
|
|
25
|
+
export function partitionRoster(agents) {
|
|
26
|
+
var out = { agent: [], helper: [], model: [] };
|
|
27
|
+
(Array.isArray(agents) ? agents : []).forEach(function (a) {
|
|
28
|
+
var group = a && (a.group === GROUP.HELPER || a.group === GROUP.MODEL) ? a.group : GROUP.AGENT;
|
|
29
|
+
out[group].push(a);
|
|
30
|
+
});
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* What a redraw depends on: each agent's key, avatar choice, group and vendor
|
|
36
|
+
* (the vendor picks a model's logo) and the project and source of each place,
|
|
37
|
+
* without any sighting time (they change on every use). While a picker is open,
|
|
38
|
+
* a roster that differs only in times does not redraw it, so a seed being typed
|
|
39
|
+
* is not lost; one that gains or loses a place does.
|
|
40
|
+
*/
|
|
41
|
+
export function choicesSignature(list) {
|
|
42
|
+
return JSON.stringify((list || []).map(function (a) {
|
|
43
|
+
var places = (a.places || []).map(function (p) { return [p.project || null, p.source || null]; });
|
|
44
|
+
return [a.key, a.avatar || null, a.group || null, a.vendor || null, places];
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function el(tag, className, text) {
|
|
49
|
+
var node = document.createElement(tag);
|
|
50
|
+
if (className) node.className = className;
|
|
51
|
+
if (text !== undefined && text !== null) node.textContent = text;
|
|
52
|
+
return node;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The mark of a helper or model row that has no chosen avatar: a model shows the
|
|
57
|
+
* logo of the vendor whose list held it (logoUrl, from the agent registry), and
|
|
58
|
+
* falls back to a neutral chip icon when the registry holds none; a helper shows
|
|
59
|
+
* the neutral tool icon, never the robot.
|
|
60
|
+
* @param {string} group "helper" or "model"
|
|
61
|
+
* @param {?string} logoUrl
|
|
62
|
+
* @param {number} size
|
|
63
|
+
*/
|
|
64
|
+
export function buildGroupMark(group, logoUrl, size) {
|
|
65
|
+
if (group === GROUP.MODEL && logoUrl) {
|
|
66
|
+
var img = el("img", "ar-avatar ar-logo");
|
|
67
|
+
img.alt = "";
|
|
68
|
+
img.width = size;
|
|
69
|
+
img.height = size;
|
|
70
|
+
img.src = logoUrl;
|
|
71
|
+
img.setAttribute("data-ar-mark", "logo");
|
|
72
|
+
return img;
|
|
73
|
+
}
|
|
74
|
+
var glyph = el("span", "ar-avatar ar-glyph");
|
|
75
|
+
glyph.setAttribute("data-ar-mark", group === GROUP.HELPER ? "tool" : "neutral");
|
|
76
|
+
glyph.setAttribute("role", "img");
|
|
77
|
+
var icon = document.createElement("i");
|
|
78
|
+
icon.setAttribute("data-lucide", GLYPH_ICON[group] || GLYPH_ICON.agent);
|
|
79
|
+
glyph.appendChild(icon);
|
|
80
|
+
return glyph;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The avatar of one row. A chosen avatar shows in every group (deps.chosen says
|
|
85
|
+
* whether the operator picked one, deps.plain draws it); without one a named
|
|
86
|
+
* agent keeps its seeded robot (deps.plain too), a helper shows the neutral tool
|
|
87
|
+
* icon and a model the logo of the vendor whose list held it.
|
|
88
|
+
* @param {{key: string, group?: string, vendor?: ?string}} agent
|
|
89
|
+
* @param {number} size
|
|
90
|
+
* @param {{chosen: function(string): boolean, plain: function(string, number): Element,
|
|
91
|
+
* logoFor: function(string): ?string}} deps
|
|
92
|
+
*/
|
|
93
|
+
export function buildRowAvatar(agent, size, deps) {
|
|
94
|
+
var grouped = agent.group === GROUP.HELPER || agent.group === GROUP.MODEL;
|
|
95
|
+
if (grouped && !deps.chosen(agent.key)) {
|
|
96
|
+
return buildGroupMark(agent.group, agent.vendor ? deps.logoFor(agent.vendor) || null : null, size);
|
|
97
|
+
}
|
|
98
|
+
return deps.plain(agent.key, size);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* One group: a heading with its count, then its rows. A collapsible group is a
|
|
103
|
+
* toggle button; its rows are only built when it is expanded.
|
|
104
|
+
* @param {{id: string, title: string, collapsible: boolean}} group
|
|
105
|
+
* @param {Array<Element>} rows
|
|
106
|
+
* @param {{count: number, expanded: boolean, onToggle: function()}} state
|
|
107
|
+
* count is how many identities the group holds, shown even while collapsed
|
|
108
|
+
*/
|
|
109
|
+
export function buildGroupSection(group, rows, state) {
|
|
110
|
+
var section = el("section", "ar-group ar-group-" + group.id);
|
|
111
|
+
section.setAttribute("data-ar-group", group.id);
|
|
112
|
+
var label = group.title + " (" + state.count + ")";
|
|
113
|
+
if (group.collapsible) {
|
|
114
|
+
var toggle = el("button", "ar-group-toggle", label);
|
|
115
|
+
toggle.setAttribute("type", "button");
|
|
116
|
+
toggle.setAttribute("aria-expanded", state.expanded ? "true" : "false");
|
|
117
|
+
toggle.addEventListener("click", state.onToggle);
|
|
118
|
+
section.appendChild(toggle);
|
|
119
|
+
} else {
|
|
120
|
+
section.appendChild(el("h3", "ar-group-title", label));
|
|
121
|
+
}
|
|
122
|
+
if (!group.collapsible || state.expanded) {
|
|
123
|
+
var list = el("div", "ar-list");
|
|
124
|
+
rows.forEach(function (row) { list.appendChild(row); });
|
|
125
|
+
section.appendChild(list);
|
|
126
|
+
}
|
|
127
|
+
return section;
|
|
128
|
+
}
|
|
@@ -14,12 +14,20 @@
|
|
|
14
14
|
import { getWs } from "./ws-ref.js";
|
|
15
15
|
import { registerTeamSection, isSectionContainerShown } from "./team-view.js";
|
|
16
16
|
import { relativeTime } from "./relative-time.js";
|
|
17
|
-
import { setAgentAvatars, refreshAgentAvatars, createAgentAvatar } from "./agent-avatar.js";
|
|
17
|
+
import { setAgentAvatars, refreshAgentAvatars, createAgentAvatar, agentAvatarChoice } from "./agent-avatar.js";
|
|
18
18
|
import { buildAvatarPicker } from "./agent-avatar-picker.js";
|
|
19
|
+
import { GROUPS, partitionRoster, choicesSignature, buildRowAvatar, buildGroupSection } from "./agent-roster-groups.js";
|
|
20
|
+
import { VENDOR_AVATARS } from "./vendor-registry.js";
|
|
21
|
+
import { setClaudeModelFamilies } from "./model-families.js";
|
|
22
|
+
import { refreshIcons } from "./icons.js";
|
|
19
23
|
|
|
20
24
|
var SECTION_ID = "agent-roster";
|
|
21
25
|
var AVATAR_SIZE = 40;
|
|
22
26
|
|
|
27
|
+
// The two lower groups start collapsed; what the operator opens stays open
|
|
28
|
+
// across redraws.
|
|
29
|
+
var expandedGroups = Object.create(null);
|
|
30
|
+
|
|
23
31
|
var agents = null;
|
|
24
32
|
var pickerKey = null;
|
|
25
33
|
var failure = null;
|
|
@@ -63,18 +71,28 @@ function choose(key, ref) {
|
|
|
63
71
|
send({ type: "agent_avatar_set", key: key, avatar: ref });
|
|
64
72
|
}
|
|
65
73
|
|
|
74
|
+
// The logo of a model's vendor is the agent registry's icon for that vendor.
|
|
75
|
+
var avatarDeps = {
|
|
76
|
+
chosen: function (key) { return !!agentAvatarChoice(key); },
|
|
77
|
+
plain: function (key, size) { return createAgentAvatar(key, size, "ar-avatar"); },
|
|
78
|
+
logoFor: function (vendor) { return VENDOR_AVATARS[vendor] || null; },
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
function buildAvatar(agent) {
|
|
82
|
+
return buildRowAvatar(agent, AVATAR_SIZE, avatarDeps);
|
|
83
|
+
}
|
|
84
|
+
|
|
66
85
|
function renderRow(agent) {
|
|
67
86
|
var open = agent.key === pickerKey;
|
|
68
87
|
var row = el("div", "ar-row" + (open ? " open" : ""));
|
|
69
88
|
row.setAttribute("data-agent-key", agent.key);
|
|
70
89
|
|
|
71
90
|
var head = el("div", "ar-head");
|
|
72
|
-
head.appendChild(
|
|
91
|
+
head.appendChild(buildAvatar(agent));
|
|
73
92
|
|
|
74
93
|
var main = el("div", "ar-main");
|
|
75
94
|
main.appendChild(el("div", "ar-name", agent.key));
|
|
76
95
|
var seen = el("div", "ar-seen");
|
|
77
|
-
seen.appendChild(el("span", "ar-first", "First seen " + timeText(agent.firstSeen)));
|
|
78
96
|
seen.appendChild(el("span", "ar-last", "Last seen " + timeText(agent.lastSeen)));
|
|
79
97
|
main.appendChild(seen);
|
|
80
98
|
var places = el("div", "ar-places");
|
|
@@ -109,9 +127,18 @@ function paint() {
|
|
|
109
127
|
container.appendChild(empty);
|
|
110
128
|
return;
|
|
111
129
|
}
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
var parts = partitionRoster(list);
|
|
131
|
+
GROUPS.forEach(function (group) {
|
|
132
|
+
var members = parts[group.id];
|
|
133
|
+
if (!members.length) return;
|
|
134
|
+
var rows = group.collapsible && !expandedGroups[group.id] ? [] : members.map(renderRow);
|
|
135
|
+
container.appendChild(buildGroupSection(group, rows, {
|
|
136
|
+
count: members.length,
|
|
137
|
+
expanded: !!expandedGroups[group.id],
|
|
138
|
+
onToggle: function () { expandedGroups[group.id] = !expandedGroups[group.id]; paint(); },
|
|
139
|
+
}));
|
|
140
|
+
});
|
|
141
|
+
refreshIcons(container);
|
|
115
142
|
}
|
|
116
143
|
|
|
117
144
|
function renderSection(container) {
|
|
@@ -124,16 +151,18 @@ registerTeamSection({ id: SECTION_ID, title: "Agents", render: renderSection });
|
|
|
124
151
|
|
|
125
152
|
// --- Messages from the server ---
|
|
126
153
|
|
|
127
|
-
// The
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
|
|
154
|
+
// The Claude model families come from the models the Claude vendor reported
|
|
155
|
+
// (its alias entries); the literal in model-families.js applies until it has.
|
|
156
|
+
function applyCatalogFamilies(catalog) {
|
|
157
|
+
(Array.isArray(catalog) ? catalog : []).forEach(function (entry) {
|
|
158
|
+
if (entry && entry.vendor === "claude") setClaudeModelFamilies(entry.models);
|
|
159
|
+
});
|
|
132
160
|
}
|
|
133
161
|
|
|
134
162
|
export function handleAgentRoster(msg) {
|
|
135
163
|
var before = choicesSignature(agents);
|
|
136
164
|
agents = Array.isArray(msg.agents) ? msg.agents : [];
|
|
165
|
+
applyCatalogFamilies(msg.catalog);
|
|
137
166
|
setAgentAvatars(agents);
|
|
138
167
|
refreshAgentAvatars();
|
|
139
168
|
if (activeContainer && !isSectionContainerShown(activeContainer)) activeContainer = null;
|
|
@@ -79,9 +79,20 @@ var _blinkTypes = {
|
|
|
79
79
|
rate_limit: true,
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
+
// The boot watchdog in index.html marks the overlay data-state="boot-error"
|
|
83
|
+
// when the app failed to start; nothing here may overwrite that state.
|
|
84
|
+
function isBootError() {
|
|
85
|
+
return !!connectOverlay && connectOverlay.getAttribute("data-state") === "boot-error";
|
|
86
|
+
}
|
|
87
|
+
|
|
82
88
|
export function initConnection() {
|
|
83
89
|
connectOverlay = document.getElementById("connect-overlay");
|
|
84
90
|
|
|
91
|
+
// The static overlay text says the app is loading; once this runs the app
|
|
92
|
+
// has booted, so any overlay shown from here on is a reconnect.
|
|
93
|
+
var bootMsgEl = document.getElementById("connect-overlay-msg");
|
|
94
|
+
if (bootMsgEl && !isBootError()) bootMsgEl.textContent = "Reconnecting to server…";
|
|
95
|
+
|
|
85
96
|
var signinBtn = document.getElementById("connect-overlay-signin-btn");
|
|
86
97
|
if (signinBtn) {
|
|
87
98
|
signinBtn.addEventListener("click", function () {
|
|
@@ -115,7 +126,7 @@ export function initConnection() {
|
|
|
115
126
|
}
|
|
116
127
|
|
|
117
128
|
// Connected state changed
|
|
118
|
-
if (state.connected !== prev.connected) {
|
|
129
|
+
if (state.connected !== prev.connected && !isBootError()) {
|
|
119
130
|
var sendBtn = getSendBtn();
|
|
120
131
|
if (state.connected) {
|
|
121
132
|
// Cancel any pending grace timer — reconnected before overlay was needed
|
|
@@ -260,6 +271,7 @@ function handleUnauthenticated() {
|
|
|
260
271
|
if (overlayGraceTimer) { clearTimeout(overlayGraceTimer); overlayGraceTimer = null; }
|
|
261
272
|
setStatus("disconnected");
|
|
262
273
|
stopLogoAnimation();
|
|
274
|
+
if (isBootError()) return;
|
|
263
275
|
var msgEl = document.getElementById("connect-overlay-msg");
|
|
264
276
|
if (msgEl) msgEl.textContent = "Session expired — sign in again.";
|
|
265
277
|
var signinBtn = document.getElementById("connect-overlay-signin-btn");
|
|
@@ -44,7 +44,7 @@ function createCursorElement(userId, displayName, color, avatarStyle, avatarSeed
|
|
|
44
44
|
wrapper.className = "remote-cursor";
|
|
45
45
|
wrapper.dataset.userId = userId;
|
|
46
46
|
wrapper.style.position = "absolute";
|
|
47
|
-
wrapper.style.zIndex = "
|
|
47
|
+
wrapper.style.zIndex = "var(--z-cursor)";
|
|
48
48
|
wrapper.style.pointerEvents = "none";
|
|
49
49
|
wrapper.style.display = "none";
|
|
50
50
|
wrapper.style.transition = "left 30ms linear, top 30ms linear";
|
|
@@ -56,11 +56,11 @@ function createCursorElement(userId, displayName, color, avatarStyle, avatarSeed
|
|
|
56
56
|
svg.setAttribute("height", "20");
|
|
57
57
|
svg.setAttribute("viewBox", "0 0 16 20");
|
|
58
58
|
svg.style.display = "block";
|
|
59
|
-
svg.style.filter = "drop-shadow(0 1px 2px rgba(
|
|
59
|
+
svg.style.filter = "drop-shadow(0 1px 2px rgba(var(--shadow-rgb), 0.3))";
|
|
60
60
|
var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
61
61
|
path.setAttribute("d", "M0 0 L0 16 L4.5 12 L8 19 L10.5 18 L7 11 L13 11 Z");
|
|
62
62
|
path.setAttribute("fill", color);
|
|
63
|
-
path.
|
|
63
|
+
path.style.stroke = "var(--bg)";
|
|
64
64
|
path.setAttribute("stroke-width", "1");
|
|
65
65
|
svg.appendChild(path);
|
|
66
66
|
wrapper.appendChild(svg);
|
|
@@ -76,14 +76,14 @@ function createCursorElement(userId, displayName, color, avatarStyle, avatarSeed
|
|
|
76
76
|
var avatarImg = document.createElement("img");
|
|
77
77
|
avatarImg.className = "remote-cursor-avatar";
|
|
78
78
|
avatarImg.src = avatarCustom ? avatarCustom : avatarUrl(avatarStyle || "thumbs", avatarSeed || userId, 16);
|
|
79
|
-
avatarImg.style.cssText = "width:14px;height:14px;border-radius:50%;background
|
|
79
|
+
avatarImg.style.cssText = "width:14px;height:14px;border-radius:50%;background:var(--bg-alt);flex-shrink:0;";
|
|
80
80
|
tag.appendChild(avatarImg);
|
|
81
81
|
|
|
82
82
|
// Name label
|
|
83
83
|
var label = document.createElement("span");
|
|
84
84
|
label.className = "remote-cursor-label";
|
|
85
85
|
label.textContent = displayName;
|
|
86
|
-
label.style.cssText = "color
|
|
86
|
+
label.style.cssText = "color:var(--on-av);font-size:11px;font-weight:500;line-height:16px;font-family:inherit;";
|
|
87
87
|
tag.appendChild(label);
|
|
88
88
|
|
|
89
89
|
wrapper.appendChild(tag);
|
|
@@ -151,11 +151,11 @@ function createOffscreenIndicator(userId, displayName, color) {
|
|
|
151
151
|
btn.dataset.userId = userId;
|
|
152
152
|
btn.style.cssText =
|
|
153
153
|
"position:absolute;left:50%;transform:translateX(-50%);" +
|
|
154
|
-
"z-index:
|
|
155
|
-
"background:" + color + ";color
|
|
154
|
+
"z-index:calc(var(--z-cursor) + 1);display:none;cursor:pointer;border:none;outline:none;" +
|
|
155
|
+
"background:" + color + ";color:var(--on-av);font-size:11px;font-weight:500;" +
|
|
156
156
|
"padding:3px 10px 3px 8px;border-radius:12px;white-space:nowrap;" +
|
|
157
157
|
"font-family:inherit;line-height:16px;opacity:0.9;" +
|
|
158
|
-
"box-shadow:0 2px 8px rgba(
|
|
158
|
+
"box-shadow:0 2px 8px rgba(var(--shadow-rgb), 0.2);pointer-events:auto;" +
|
|
159
159
|
"transition:opacity 0.15s;";
|
|
160
160
|
btn.addEventListener("mouseenter", function () { btn.style.opacity = "1"; });
|
|
161
161
|
btn.addEventListener("mouseleave", function () { btn.style.opacity = "0.9"; });
|
|
@@ -302,7 +302,7 @@ export function handleRemoteSelection(msg) {
|
|
|
302
302
|
highlight.className = "remote-selection";
|
|
303
303
|
highlight.dataset.userId = userId;
|
|
304
304
|
highlight.style.cssText =
|
|
305
|
-
"position:absolute;pointer-events:none;z-index:
|
|
305
|
+
"position:absolute;pointer-events:none;z-index:calc(var(--z-cursor) - 1);" +
|
|
306
306
|
"background:" + color + ";" +
|
|
307
307
|
"opacity:0.2;" +
|
|
308
308
|
"border-radius:2px;" +
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { refreshIcons } from './icons.js';
|
|
5
5
|
import { store } from './store.js';
|
|
6
6
|
import { getSendBtn, getStatusDot } from './dom-refs.js';
|
|
7
|
-
import { onThemeChange
|
|
7
|
+
import { onThemeChange } from './theme.js';
|
|
8
8
|
import { getActivityEl, setActivityEl, addToMessages, scrollToBottom } from './app-rendering.js';
|
|
9
9
|
|
|
10
10
|
// --- Module-owned state ---
|
|
@@ -253,15 +253,9 @@ export function setActivity(text) {
|
|
|
253
253
|
// other. There is now exactly one source; this subscriber and the
|
|
254
254
|
// project-icon dot (sidebar-projects.js) both derive from it.
|
|
255
255
|
//
|
|
256
|
-
//
|
|
257
|
-
//
|
|
258
|
-
//
|
|
259
|
-
// theme.js getChatLayout/setChatLayout), so this must not fight
|
|
260
|
-
// .channel-pre-thinking for the same bottom-of-transcript slot in channel
|
|
261
|
-
// layout. (lr-5edd64 comment #3: in channel layout this subscriber's raise/
|
|
262
|
-
// clear is inert by this same gate — the channel footer's own presence
|
|
263
|
-
// widget, .channel-pre-thinking, is driven separately and unaffected by
|
|
264
|
-
// this change.)
|
|
256
|
+
// There is one layout, so this footer is the only working indicator: the
|
|
257
|
+
// separate pre-thinking widget the channel layout drew is gone, and a turn that
|
|
258
|
+
// has started and is not yet answered shows exactly this one.
|
|
265
259
|
export function initActivityFooter() {
|
|
266
260
|
store.subscribe(['processing'], function (state, prev) {
|
|
267
261
|
if (state.processing === prev.processing) return;
|
|
@@ -295,12 +289,10 @@ export function initActivityFooter() {
|
|
|
295
289
|
// updates that happen to carry the same 'processing' value along for the
|
|
296
290
|
// ride.
|
|
297
291
|
export function reconcileActivityFooter() {
|
|
298
|
-
if (
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
setActivity(null);
|
|
303
|
-
}
|
|
292
|
+
if (store.get('processing')) {
|
|
293
|
+
setActivity("thinking");
|
|
294
|
+
} else {
|
|
295
|
+
setActivity(null);
|
|
304
296
|
}
|
|
305
297
|
}
|
|
306
298
|
|
|
@@ -8,10 +8,11 @@ import { getWs } from './ws-ref.js';
|
|
|
8
8
|
import { getMessagesEl } from './dom-refs.js';
|
|
9
9
|
import { getActivityEl, setActivityEl, getTurnCounter, setTurnCounter, getPrependAnchor, setPrependAnchor, finalizeAssistantBlock, resetCurrentFullText } from './app-rendering.js';
|
|
10
10
|
import { processMessage } from './app-messages.js';
|
|
11
|
+
import { canStitchDeltaRun, splitTrailingDeltaRun, stitchIntoTopMessage } from './app-history-replay.js';
|
|
11
12
|
import { saveToolState, resetToolState, restoreToolState } from './tools.js';
|
|
12
13
|
import { getSessionUsage, setSessionUsage, getContextData, setContextData, updateContextPanel, updateUsagePanel } from './app-panels.js';
|
|
13
14
|
import { onHistoryPrepended as onSessionSearchHistoryPrepended } from './session-search.js';
|
|
14
|
-
import {
|
|
15
|
+
import { showOverlay } from './overlay.js';
|
|
15
16
|
import { initKeepAliveButton } from './keep-alive.js';
|
|
16
17
|
|
|
17
18
|
// --- Module-owned state ---
|
|
@@ -68,10 +69,9 @@ export function initHeader() {
|
|
|
68
69
|
if (headerInfoBtn) {
|
|
69
70
|
headerInfoBtn.addEventListener("click", function (e) {
|
|
70
71
|
e.stopPropagation();
|
|
71
|
-
if (sessionInfoPopover) { closeSessionInfoPopover(); return; }
|
|
72
|
+
if (sessionInfoPopover && sessionInfoPopover.isOpen()) { closeSessionInfoPopover(); return; }
|
|
72
73
|
|
|
73
|
-
var
|
|
74
|
-
pop.className = "session-info-popover";
|
|
74
|
+
var rows = [];
|
|
75
75
|
|
|
76
76
|
function addRow(label, value) {
|
|
77
77
|
var val = value == null ? "-" : String(value);
|
|
@@ -89,7 +89,7 @@ export function initHeader() {
|
|
|
89
89
|
setTimeout(function () { btn.innerHTML = iconHtml("copy"); refreshIcons(); }, 1200);
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
rows.push(row);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
var s = store.snap();
|
|
@@ -103,26 +103,23 @@ export function initHeader() {
|
|
|
103
103
|
addRow("Resume", resumeCmd);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
document.body.appendChild(pop);
|
|
107
|
-
sessionInfoPopover = pop;
|
|
108
|
-
refreshIcons();
|
|
109
|
-
|
|
110
106
|
// Four-edge clamp (lr-a10a): the prior right-only clamp could leave
|
|
111
107
|
// the popover's bottom edge off-screen on short viewports.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
108
|
+
sessionInfoPopover = showOverlay({
|
|
109
|
+
kind: "popover",
|
|
110
|
+
className: "session-info-popover",
|
|
111
|
+
content: rows,
|
|
112
|
+
anchor: headerInfoBtn,
|
|
113
|
+
opener: headerInfoBtn,
|
|
114
|
+
placement: "below",
|
|
115
|
+
});
|
|
119
116
|
});
|
|
120
117
|
}
|
|
121
118
|
}
|
|
122
119
|
|
|
123
120
|
export function closeSessionInfoPopover() {
|
|
124
121
|
if (sessionInfoPopover) {
|
|
125
|
-
sessionInfoPopover.
|
|
122
|
+
sessionInfoPopover.close();
|
|
126
123
|
sessionInfoPopover = null;
|
|
127
124
|
}
|
|
128
125
|
}
|
|
@@ -232,14 +229,26 @@ export function prependOlderHistory(items, meta) {
|
|
|
232
229
|
// rendering pipeline, so it remains a stable reference across the batch.
|
|
233
230
|
var siblingBeforeAnchor = anchorEl ? anchorEl.previousSibling : messagesEl.lastChild;
|
|
234
231
|
|
|
232
|
+
// The page's trailing delta records may continue the reply whose first
|
|
233
|
+
// message is the one already at the top; they are stitched into it below
|
|
234
|
+
// rather than rendered as a second headed message.
|
|
235
|
+
var stitched = canStitchDeltaRun(anchorEl) ? splitTrailingDeltaRun(items) : null;
|
|
236
|
+
var pageItems = stitched ? stitched.head : items;
|
|
237
|
+
|
|
235
238
|
// Process each item through the rendering pipeline
|
|
236
|
-
for (var i = 0; i <
|
|
237
|
-
processMessage(
|
|
239
|
+
for (var i = 0; i < pageItems.length; i++) {
|
|
240
|
+
processMessage(pageItems[i]);
|
|
238
241
|
}
|
|
239
242
|
|
|
240
243
|
// Finalize any open assistant block from the batch
|
|
241
244
|
finalizeAssistantBlock();
|
|
242
245
|
|
|
246
|
+
// A stitch adds no new message, so a stitch-only page settles under the same
|
|
247
|
+
// rule as any page that rendered nothing new: it auto-advances below.
|
|
248
|
+
if (stitched && stitched.lead) {
|
|
249
|
+
savedFullText = stitchIntoTopMessage(anchorEl, savedMsgEl, savedFullText, stitched.lead);
|
|
250
|
+
}
|
|
251
|
+
|
|
243
252
|
// Clear prepend mode
|
|
244
253
|
setPrependAnchor(null);
|
|
245
254
|
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
// original switch.
|
|
11
11
|
|
|
12
12
|
import { store } from './store.js';
|
|
13
|
-
import { renderMarkdown, highlightCodeBlocksBatched, renderMermaidBlocks } from './markdown.js';
|
|
13
|
+
import { renderMarkdown, renderMarkdownAsync, highlightCodeBlocksBatched, renderMermaidBlocks } from './markdown.js';
|
|
14
14
|
import { getPendingNavigate, peekPendingNavigate } from './pending-navigate.js';
|
|
15
|
-
import { armStickyBottom, disarmStickyBottom, scrollToBottom, finalizeAssistantBlock } from './app-rendering.js';
|
|
15
|
+
import { armStickyBottom, disarmStickyBottom, scrollToBottom, finalizeAssistantBlock, flushStreamBuffer, getFinalizedText, setFinalizedText, getLiveMessageText, applyRenderedHtml } from './app-rendering.js';
|
|
16
16
|
import { applyDeadSessionTodoCompaction, markAllToolsDone } from './tools.js';
|
|
17
17
|
import { accumulateContext, updateContextPanel, updateUsagePanel, getSessionUsage } from './app-panels.js';
|
|
18
18
|
import { stopUrgentBlink } from './app-favicon.js';
|
|
@@ -42,6 +42,64 @@ export function handleHistoryMeta(msg, updateHistorySentinelFn) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// One assistant reply is a run of consecutive "delta" records. The server
|
|
46
|
+
// trims the in-memory history at a fixed count, so the run whose first message
|
|
47
|
+
// is already rendered at the top can continue into the tail of the next older
|
|
48
|
+
// page. Rendering that tail as its own message would show a second header, so
|
|
49
|
+
// it is split off and stitched into the top message instead. The top message
|
|
50
|
+
// can only be the run's own message when it is an assistant message, which is
|
|
51
|
+
// all the client can see of the boundary.
|
|
52
|
+
export function canStitchDeltaRun(topEl) {
|
|
53
|
+
return !!(topEl && topEl.classList && topEl.classList.contains("msg-assistant"));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Splits the trailing delta records off an older page. `lead` is their text in
|
|
57
|
+
// order; `head` is the rest of the page, to render normally.
|
|
58
|
+
export function splitTrailingDeltaRun(items) {
|
|
59
|
+
var cut = items.length;
|
|
60
|
+
while (cut > 0 && items[cut - 1] && items[cut - 1].type === "delta" && typeof items[cut - 1].text === "string") cut--;
|
|
61
|
+
var lead = "";
|
|
62
|
+
for (var i = cut; i < items.length; i++) lead += items[i].text;
|
|
63
|
+
return { head: items.slice(0, cut), lead: lead };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Puts `lead` in front of the text of the already-rendered message `el` and
|
|
67
|
+
// redraws it, keeping one header. Returns the merged text.
|
|
68
|
+
// The render is async, so the write is skipped when the message no longer holds
|
|
69
|
+
// the merged text: a delta or a later stitch changed it, and whichever changed
|
|
70
|
+
// it redraws the message from its own full text, so nothing is lost.
|
|
71
|
+
export function stitchLeadingText(el, existingText, lead) {
|
|
72
|
+
var merged = lead + existingText;
|
|
73
|
+
var contentEl = el.querySelector(".md-content");
|
|
74
|
+
if (contentEl) {
|
|
75
|
+
renderMarkdownAsync(merged).then(function (html) {
|
|
76
|
+
setTimeout(function () {
|
|
77
|
+
if (!contentEl.isConnected) return;
|
|
78
|
+
if (getLiveMessageText(el) !== merged) return;
|
|
79
|
+
applyRenderedHtml(contentEl, html);
|
|
80
|
+
}, 0);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return merged;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Stitches `lead` into a finalized top message.
|
|
87
|
+
export function stitchIntoFinalized(el, lead) {
|
|
88
|
+
var merged = stitchLeadingText(el, getFinalizedText(el), lead);
|
|
89
|
+
setFinalizedText(el, merged);
|
|
90
|
+
return merged;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Stitches `lead` into the top message `el`. A message still streaming keeps its
|
|
94
|
+
// text in the live accumulator, so the merged text is returned for the caller to
|
|
95
|
+
// restore there; a finalized one keeps it in the finalized-text map. Returns the
|
|
96
|
+
// accumulator text to restore.
|
|
97
|
+
export function stitchIntoTopMessage(el, streamingEl, streamingText, lead) {
|
|
98
|
+
if (el === streamingEl) return stitchLeadingText(el, streamingText, lead);
|
|
99
|
+
stitchIntoFinalized(el, lead);
|
|
100
|
+
return streamingText;
|
|
101
|
+
}
|
|
102
|
+
|
|
45
103
|
export function handleHistoryDone(msg) {
|
|
46
104
|
var messagesEl = document.getElementById("messages");
|
|
47
105
|
store.set({ replayingHistory: false });
|
|
@@ -117,7 +175,12 @@ export function handleHistoryDone(msg) {
|
|
|
117
175
|
}
|
|
118
176
|
updateContextPanel();
|
|
119
177
|
updateUsagePanel();
|
|
120
|
-
// Render + finalize any incomplete turn from the replayed history
|
|
178
|
+
// Render + finalize any incomplete turn from the replayed history. A reply
|
|
179
|
+
// still streaming is rendered but not finalized: flushing syncs the replayed
|
|
180
|
+
// text into the store without closing the block, so the live deltas append to
|
|
181
|
+
// it instead of opening a second message with a second header.
|
|
182
|
+
var stillProcessing = !!store.get('sessionIsProcessing');
|
|
183
|
+
if (stillProcessing) flushStreamBuffer();
|
|
121
184
|
var _hs = store.snap();
|
|
122
185
|
if (_hs.currentMsgEl && _hs.currentFullText) {
|
|
123
186
|
var replayContentEl = _hs.currentMsgEl.querySelector(".md-content");
|
|
@@ -126,7 +189,7 @@ export function handleHistoryDone(msg) {
|
|
|
126
189
|
}
|
|
127
190
|
}
|
|
128
191
|
markAllToolsDone();
|
|
129
|
-
finalizeAssistantBlock();
|
|
192
|
+
if (!stillProcessing) finalizeAssistantBlock();
|
|
130
193
|
stopUrgentBlink();
|
|
131
194
|
// Scroll to tool element if navigating from file edit history.
|
|
132
195
|
// nav/hasNavTarget are declared above (early arm block).
|
|
@@ -12,6 +12,9 @@ import { openSchedulerToTab } from './scheduler.js';
|
|
|
12
12
|
import { exitDmMode } from './app-dm.js';
|
|
13
13
|
import { openCommandPalette } from './command-palette.js';
|
|
14
14
|
import { sessionActivity, indicatorClass } from './activity-state.js';
|
|
15
|
+
import {
|
|
16
|
+
sessionListAvatarsEnabled, onSessionListAvatarsChange, createSessionAgentAvatar
|
|
17
|
+
} from './session-list-avatars.js';
|
|
15
18
|
|
|
16
19
|
function $hub(id) { return document.getElementById(id); }
|
|
17
20
|
|
|
@@ -447,7 +450,15 @@ export function handleHubSchedules(msg) {
|
|
|
447
450
|
}
|
|
448
451
|
}
|
|
449
452
|
|
|
453
|
+
var lastRecentSessionsMsg = null;
|
|
454
|
+
|
|
455
|
+
// Switching "Avatars in session list" redraws the rows already on the page.
|
|
456
|
+
onSessionListAvatarsChange(function () {
|
|
457
|
+
if (lastRecentSessionsMsg) handleHubRecentSessions(lastRecentSessionsMsg);
|
|
458
|
+
});
|
|
459
|
+
|
|
450
460
|
export function handleHubRecentSessions(msg) {
|
|
461
|
+
lastRecentSessionsMsg = msg;
|
|
451
462
|
var sessions = msg.sessions || [];
|
|
452
463
|
var list = document.getElementById("hub-recent-sessions-list");
|
|
453
464
|
if (!list) return;
|
|
@@ -496,6 +507,10 @@ export function handleHubRecentSessions(msg) {
|
|
|
496
507
|
'<span class="hub-recent-title">' + escapeHtml(sess.title) + '</span>' +
|
|
497
508
|
agentBadge +
|
|
498
509
|
'<span class="hub-recent-time">' + timeStr + '</span>';
|
|
510
|
+
// With avatars on, the agent's avatar sits before the title; the name pill stays.
|
|
511
|
+
if (sess.agentName && sessionListAvatarsEnabled()) {
|
|
512
|
+
item.insertBefore(createSessionAgentAvatar(sess.agentName), item.querySelector(".hub-recent-title"));
|
|
513
|
+
}
|
|
499
514
|
item.addEventListener("click", function () {
|
|
500
515
|
var currentSlug = store.get('currentSlug');
|
|
501
516
|
if (sess.projectSlug && sess.projectSlug !== currentSlug) {
|