@clagentic/console 1.9.0 → 1.10.0-beta.2
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/LICENSE +117 -12
- package/LICENSES/MIT-legacy.txt +22 -0
- package/LICENSES/README.md +15 -0
- package/README.md +9 -3
- package/bin/cli.js +40 -5
- package/deploy/clagentic-console.service +10 -6
- package/lib/agent-dispatch-tool.js +20 -0
- package/lib/audit.js +3 -2
- package/lib/build-changes.js +79 -0
- package/lib/build-identity.js +192 -0
- package/lib/build-monitor.js +125 -0
- package/lib/build-sha.json +2 -2
- package/lib/build-update-check.js +138 -0
- package/lib/build-update-offer.js +141 -0
- package/lib/build-update-restart.js +142 -0
- package/lib/build-update-standing.js +184 -0
- package/lib/cli/daemon-launch.js +25 -22
- package/lib/cli/ipc-subcommands.js +6 -0
- package/lib/cli/session-subcommands.js +122 -0
- package/lib/cli-sessions.js +8 -1
- package/lib/codex-defaults.js +8 -2
- package/lib/config.js +32 -20
- package/lib/daemon-env-settings.js +84 -0
- package/lib/daemon-projects.js +57 -0
- package/lib/daemon.js +288 -205
- package/lib/drain.js +74 -17
- package/lib/env-compat.js +61 -0
- package/lib/extension-commands.js +45 -0
- package/lib/history-visibility.js +4 -0
- package/lib/idle-adapter-reaper.js +71 -0
- package/lib/link-trap.js +78 -0
- package/lib/mcp-local.js +8 -6
- package/lib/mcp-tool-input.js +116 -0
- package/lib/mcp-tool-schema.js +179 -0
- package/lib/memory-limits.js +61 -5
- package/lib/memory-setting-validate.js +65 -0
- package/lib/memory-shed.js +13 -32
- package/lib/new-work-gate.js +47 -0
- package/lib/os-users.js +5 -3
- package/lib/project-access.js +139 -0
- package/lib/project-connection.js +37 -22
- package/lib/project-external-trigger.js +166 -105
- package/lib/project-file-scope.js +172 -0
- package/lib/project-file-watch.js +86 -61
- package/lib/project-filesystem.js +144 -128
- package/lib/project-git.js +119 -0
- package/lib/project-http.js +44 -28
- package/lib/project-loop.js +17 -9
- package/lib/project-mcp.js +53 -72
- package/lib/project-message-gate.js +70 -0
- package/lib/project-notifications.js +31 -4
- package/lib/project-prompt-responses.js +217 -0
- package/lib/project-sessions.js +192 -355
- package/lib/project-user-message.js +27 -15
- package/lib/project.js +212 -147
- package/lib/projects-dir.js +90 -0
- package/lib/prompt-access.js +22 -0
- package/lib/prompt-kinds/answer-limits.js +15 -0
- package/lib/prompt-kinds/ask-user.js +58 -0
- package/lib/prompt-kinds/codecs.js +97 -0
- package/lib/prompt-kinds/elicitation.js +77 -0
- package/lib/prompt-kinds/extension.js +39 -0
- package/lib/prompt-kinds/index.js +68 -0
- package/lib/prompt-kinds/permission.js +114 -0
- package/lib/prompt-kinds/plan.js +79 -0
- package/lib/prompt-kinds/tool-call.js +38 -0
- package/lib/prompt-registry.js +680 -0
- package/lib/public/app.js +1 -1
- package/lib/public/css/diagnostics.css +80 -0
- package/lib/public/css/input.css +17 -3
- package/lib/public/css/menus.css +10 -0
- package/lib/public/css/messages.css +5 -0
- package/lib/public/css/rewind.css +22 -0
- package/lib/public/index.html +4 -12
- package/lib/public/modules/agent-dispatch-tool.js +9 -0
- package/lib/public/modules/app-connection.js +7 -0
- package/lib/public/modules/app-cursors.js +7 -5
- package/lib/public/modules/app-messages.js +52 -47
- package/lib/public/modules/app-notifications.js +47 -71
- package/lib/public/modules/app-panels.js +61 -59
- package/lib/public/modules/app-projects.js +2 -1
- package/lib/public/modules/app-rendering.js +4 -10
- package/lib/public/modules/build-update-detail.js +54 -0
- package/lib/public/modules/diagnostics.js +170 -20
- package/lib/public/modules/filebrowser.js +18 -16
- package/lib/public/modules/history-visibility.js +4 -0
- package/lib/public/modules/mention.js +3 -2
- package/lib/public/modules/mode-options.js +38 -0
- package/lib/public/modules/project-settings.js +19 -8
- package/lib/public/modules/prompt-banner.js +78 -0
- package/lib/public/modules/prompt-card.js +201 -0
- package/lib/public/modules/prompt-kinds/ask-user-codec.js +131 -0
- package/lib/public/modules/prompt-kinds/ask-user.js +213 -0
- package/lib/public/modules/prompt-kinds/elicitation-codec.js +343 -0
- package/lib/public/modules/prompt-kinds/elicitation.js +176 -0
- package/lib/public/modules/prompt-kinds/index.js +18 -0
- package/lib/public/modules/prompt-kinds/own-key.js +29 -0
- package/lib/public/modules/prompt-kinds/package.json +3 -0
- package/lib/public/modules/prompt-kinds/permission-choices.js +31 -0
- package/lib/public/modules/prompt-kinds/permission.js +209 -0
- package/lib/public/modules/prompt-kinds/plan.js +102 -0
- package/lib/public/modules/prompt-state.js +142 -0
- package/lib/public/modules/prompts.js +134 -0
- package/lib/public/modules/rewind.js +4 -1
- package/lib/public/modules/server-settings.js +2 -4
- package/lib/public/modules/sidebar-mobile.js +19 -9
- package/lib/public/modules/sidebar-sessions.js +21 -14
- package/lib/public/modules/sticky-notes.js +3 -2
- package/lib/public/modules/team-panel.js +5 -4
- package/lib/public/modules/tools.js +81 -906
- package/lib/public/modules/vendor-picker.js +53 -0
- package/lib/public/modules/vendor-registry.js +142 -0
- package/lib/public/sw.js +3 -1
- package/lib/rc-migrate.js +44 -0
- package/lib/runtime-env-keys.js +109 -0
- package/lib/runtime-env.js +236 -0
- package/lib/sdk-bridge.js +348 -284
- package/lib/sdk-message-processor.js +117 -146
- package/lib/sdk-skill-discovery.js +65 -60
- package/lib/server-hub-sessions.js +13 -10
- package/lib/server-palette.js +28 -19
- package/lib/server.js +156 -115
- package/lib/service-install.js +96 -0
- package/lib/session-capabilities.js +76 -0
- package/lib/session-id.js +33 -0
- package/lib/session-input-ipc.js +32 -0
- package/lib/session-input.js +379 -0
- package/lib/session-reclaim.js +284 -0
- package/lib/session-resume.js +172 -0
- package/lib/sessions.js +61 -30
- package/lib/supervisor.js +39 -0
- package/lib/turn-initiator.js +108 -0
- package/lib/users-permissions.js +9 -6
- package/lib/users.js +9 -0
- package/lib/utils.js +4 -2
- package/lib/vendor-auth.js +22 -0
- package/lib/vendor-registry-message.js +66 -0
- package/lib/ws-origin.js +99 -0
- package/lib/ws-schema.js +36 -23
- package/lib/yoke/adapters/claude-capabilities.js +38 -0
- package/lib/yoke/adapters/claude-vendor.js +34 -0
- package/lib/yoke/adapters/claude-worker.js +57 -87
- package/lib/yoke/adapters/claude.js +182 -88
- package/lib/yoke/adapters/codex-capabilities.js +40 -0
- package/lib/yoke/adapters/codex-vendor.js +46 -0
- package/lib/yoke/adapters/codex.js +462 -211
- package/lib/yoke/adapters/effort-control.js +34 -0
- package/lib/yoke/adapters/permission-relay.js +58 -0
- package/lib/yoke/adapters/worker-mcp-servers.js +81 -0
- package/lib/yoke/auth-checks.js +91 -0
- package/lib/yoke/capabilities.js +49 -0
- package/lib/yoke/codex-app-server.js +30 -56
- package/lib/yoke/codex-binary.js +254 -0
- package/lib/yoke/codex-command.js +122 -0
- package/lib/yoke/codex-protocol.js +96 -0
- package/lib/yoke/codex-version.js +135 -0
- package/lib/yoke/env-ownership.js +40 -0
- package/lib/yoke/index.js +84 -174
- package/lib/yoke/install-probe.js +136 -0
- package/lib/yoke/instructions.js +7 -11
- package/lib/yoke/interface.js +206 -4
- package/lib/yoke/package.json +1 -1
- package/lib/yoke/provider-credentials.js +96 -0
- package/lib/yoke/registry.js +377 -0
- package/package.json +12 -9
- package/scripts/check-sdk-lock-drift.js +160 -0
- package/scripts/check-test-count.js +76 -1
- package/scripts/postinstall.js +218 -136
- package/scripts/prompt-harness-history.js +202 -0
- package/scripts/verify-installed-build.js +59 -17
- package/scripts/verify-installed.js +67 -0
- package/lib/sdk-permission-ownership.js +0 -136
|
@@ -202,6 +202,63 @@
|
|
|
202
202
|
line-height: 1.4;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/* lr-e85fec: actionable button — rendered instead of the plain hint icon+text
|
|
206
|
+
above when the client has a real handler for actionable.action (e.g.
|
|
207
|
+
"Restart to apply update"). A detector with no attached actuator was the
|
|
208
|
+
whole gap this closes, so a known action gets a real control, not just a
|
|
209
|
+
label. */
|
|
210
|
+
.diagnostics-actionable-btn {
|
|
211
|
+
display: inline-flex;
|
|
212
|
+
align-items: center;
|
|
213
|
+
gap: 5px;
|
|
214
|
+
padding: 4px 10px;
|
|
215
|
+
background: var(--accent2, #4A7FE8);
|
|
216
|
+
border: none;
|
|
217
|
+
border-radius: 6px;
|
|
218
|
+
color: #fff;
|
|
219
|
+
font-size: 11px;
|
|
220
|
+
font-weight: 600;
|
|
221
|
+
cursor: pointer;
|
|
222
|
+
transition: opacity 0.15s;
|
|
223
|
+
}
|
|
224
|
+
.diagnostics-actionable-btn:hover { opacity: 0.85; }
|
|
225
|
+
.diagnostics-actionable-btn:disabled { opacity: 0.5; cursor: default; }
|
|
226
|
+
.diagnostics-actionable-btn:focus-visible {
|
|
227
|
+
outline: 2px solid var(--accent);
|
|
228
|
+
outline-offset: 1px;
|
|
229
|
+
}
|
|
230
|
+
.diagnostics-actionable-btn .lucide { width: 12px; height: 12px; }
|
|
231
|
+
|
|
232
|
+
/* A diagnostic's message may be several lines (the sessions a restart would end). */
|
|
233
|
+
.diagnostic-multiline { white-space: pre-line; }
|
|
234
|
+
|
|
235
|
+
/* Body of a "newer build installed" offer: both builds and the commits between them. */
|
|
236
|
+
.build-update-detail {
|
|
237
|
+
display: flex;
|
|
238
|
+
flex-direction: column;
|
|
239
|
+
gap: 3px;
|
|
240
|
+
margin-top: 4px;
|
|
241
|
+
font-size: 11px;
|
|
242
|
+
color: var(--text-secondary);
|
|
243
|
+
overflow-wrap: anywhere;
|
|
244
|
+
}
|
|
245
|
+
.build-update-builds { font-family: var(--font-mono, monospace); }
|
|
246
|
+
.build-update-heading { font-weight: 600; }
|
|
247
|
+
.build-update-commits {
|
|
248
|
+
margin: 0;
|
|
249
|
+
padding-left: 16px;
|
|
250
|
+
max-height: 140px;
|
|
251
|
+
overflow-y: auto;
|
|
252
|
+
}
|
|
253
|
+
.build-update-note { color: var(--text-muted); }
|
|
254
|
+
.diagnostics-actionable-btn.build-update-decline,
|
|
255
|
+
.toast-diagnostic-action-btn.build-update-decline {
|
|
256
|
+
background: transparent;
|
|
257
|
+
color: var(--text-secondary);
|
|
258
|
+
border: 1px solid var(--border, rgba(128, 128, 128, 0.4));
|
|
259
|
+
margin-left: 6px;
|
|
260
|
+
}
|
|
261
|
+
|
|
205
262
|
/* Empty state */
|
|
206
263
|
.diagnostics-empty {
|
|
207
264
|
padding: 20px 14px;
|
|
@@ -361,6 +418,29 @@
|
|
|
361
418
|
margin-top: 2px;
|
|
362
419
|
}
|
|
363
420
|
|
|
421
|
+
/* lr-e85fec: same actuator button as .diagnostics-actionable-btn, sized for
|
|
422
|
+
the toast's tighter layout — offered at the moment the operator first
|
|
423
|
+
sees the condition, not only once they open the panel. */
|
|
424
|
+
.toast-diagnostic-action-btn {
|
|
425
|
+
align-self: flex-start;
|
|
426
|
+
margin-top: 4px;
|
|
427
|
+
padding: 5px 12px;
|
|
428
|
+
background: var(--accent2, #4A7FE8);
|
|
429
|
+
border: none;
|
|
430
|
+
border-radius: 6px;
|
|
431
|
+
color: #fff;
|
|
432
|
+
font-size: 11.5px;
|
|
433
|
+
font-weight: 600;
|
|
434
|
+
cursor: pointer;
|
|
435
|
+
transition: opacity 0.15s;
|
|
436
|
+
}
|
|
437
|
+
.toast-diagnostic-action-btn:hover { opacity: 0.85; }
|
|
438
|
+
.toast-diagnostic-action-btn:disabled { opacity: 0.5; cursor: default; }
|
|
439
|
+
.toast-diagnostic-action-btn:focus-visible {
|
|
440
|
+
outline: 2px solid var(--accent);
|
|
441
|
+
outline-offset: 1px;
|
|
442
|
+
}
|
|
443
|
+
|
|
364
444
|
/* --------------------------------------------------------
|
|
365
445
|
Mobile
|
|
366
446
|
-------------------------------------------------------- */
|
package/lib/public/css/input.css
CHANGED
|
@@ -596,7 +596,8 @@
|
|
|
596
596
|
height: 30px;
|
|
597
597
|
flex-shrink: 0;
|
|
598
598
|
}
|
|
599
|
-
#vendor-toggle-wrap.hidden
|
|
599
|
+
#vendor-toggle-wrap.hidden,
|
|
600
|
+
#vendor-toggle-wrap:empty { display: none; }
|
|
600
601
|
#vendor-toggle-wrap.locked {
|
|
601
602
|
border: none;
|
|
602
603
|
height: auto;
|
|
@@ -610,7 +611,8 @@
|
|
|
610
611
|
opacity: 0.7;
|
|
611
612
|
}
|
|
612
613
|
#vendor-toggle-wrap.locked .vendor-toggle-btn.active .vendor-toggle-label { display: none; }
|
|
613
|
-
#vendor-toggle-wrap.locked .vendor-toggle-btn
|
|
614
|
+
#vendor-toggle-wrap.locked .vendor-toggle-btn { border-left: none; }
|
|
615
|
+
#vendor-toggle-wrap.locked .vendor-recheck-btn { display: none; }
|
|
614
616
|
.vendor-toggle-btn {
|
|
615
617
|
display: flex;
|
|
616
618
|
align-items: center;
|
|
@@ -625,7 +627,7 @@
|
|
|
625
627
|
transition: background 0.15s, color 0.15s;
|
|
626
628
|
white-space: nowrap;
|
|
627
629
|
}
|
|
628
|
-
.vendor-toggle-btn
|
|
630
|
+
.vendor-toggle-btn + .vendor-toggle-btn { border-left: 1px solid var(--border); }
|
|
629
631
|
.vendor-toggle-btn.active {
|
|
630
632
|
background: var(--accent-12);
|
|
631
633
|
color: var(--accent);
|
|
@@ -635,6 +637,18 @@
|
|
|
635
637
|
opacity: 0.35;
|
|
636
638
|
cursor: default;
|
|
637
639
|
}
|
|
640
|
+
.vendor-recheck-btn {
|
|
641
|
+
height: 100%;
|
|
642
|
+
padding: 0 8px;
|
|
643
|
+
border: none;
|
|
644
|
+
border-left: 1px solid var(--border);
|
|
645
|
+
background: transparent;
|
|
646
|
+
cursor: pointer;
|
|
647
|
+
font-size: 11px;
|
|
648
|
+
color: var(--text-secondary);
|
|
649
|
+
white-space: nowrap;
|
|
650
|
+
}
|
|
651
|
+
.vendor-recheck-btn:hover { color: var(--accent); }
|
|
638
652
|
.vendor-toggle-icon {
|
|
639
653
|
width: 16px;
|
|
640
654
|
height: 16px;
|
package/lib/public/css/menus.css
CHANGED
|
@@ -537,6 +537,16 @@
|
|
|
537
537
|
flex-direction: column;
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
+
/* A setting the current agent cannot support: kept in view, dimmed, with the reason. */
|
|
541
|
+
.config-unavailable-note {
|
|
542
|
+
padding: 8px 14px;
|
|
543
|
+
font-size: 12px;
|
|
544
|
+
font-style: italic;
|
|
545
|
+
color: var(--text-dimmer);
|
|
546
|
+
opacity: 0.7;
|
|
547
|
+
cursor: not-allowed;
|
|
548
|
+
}
|
|
549
|
+
|
|
540
550
|
.config-radio-item {
|
|
541
551
|
display: flex;
|
|
542
552
|
align-items: center;
|
|
@@ -225,6 +225,11 @@
|
|
|
225
225
|
|
|
226
226
|
.msg-user:hover .msg-action-btn:not(.msg-action-hidden) { opacity: 1; }
|
|
227
227
|
|
|
228
|
+
/* An action the agent cannot do stays visible, dimmed, with the reason as its title */
|
|
229
|
+
.msg-action-btn:disabled { cursor: not-allowed; }
|
|
230
|
+
.msg-user:hover .msg-action-btn:disabled:not(.msg-action-hidden) { opacity: 0.35; }
|
|
231
|
+
.msg-action-btn:disabled:hover { color: var(--text-dimmer); background: transparent; }
|
|
232
|
+
|
|
228
233
|
/* Hidden actions (fork/rewind) — created but not shown */
|
|
229
234
|
.msg-action-btn.msg-action-hidden { display: none; }
|
|
230
235
|
|
|
@@ -616,6 +616,23 @@
|
|
|
616
616
|
.permission-deny { background: transparent; border-color: var(--border); color: var(--text-muted); }
|
|
617
617
|
.permission-deny:hover { background: var(--error-8); border-color: var(--error); color: var(--error); opacity: 1; }
|
|
618
618
|
|
|
619
|
+
/* The user's own ask rule that forced the prompt. */
|
|
620
|
+
.permission-rule { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
|
|
621
|
+
|
|
622
|
+
/* An ask that must open on No: the approve choices lose their primary
|
|
623
|
+
styling and the decline choice leads. */
|
|
624
|
+
.permission-container[data-default-to-no="true"] .permission-allow,
|
|
625
|
+
.permission-container[data-default-to-no="true"] .perm-allow,
|
|
626
|
+
.permission-container[data-default-to-no="true"] .perm-allow:hover {
|
|
627
|
+
background: transparent;
|
|
628
|
+
color: var(--text-muted);
|
|
629
|
+
border-color: var(--border);
|
|
630
|
+
}
|
|
631
|
+
.permission-container[data-default-to-no="true"] [data-default-choice="true"] {
|
|
632
|
+
border-color: var(--text-dimmer);
|
|
633
|
+
color: var(--text);
|
|
634
|
+
}
|
|
635
|
+
|
|
619
636
|
/* Resolved states */
|
|
620
637
|
.permission-container.resolved .permission-btn { display: none; }
|
|
621
638
|
.permission-decision-label { font-size: 13px; font-weight: 500; }
|
|
@@ -631,6 +648,11 @@
|
|
|
631
648
|
|
|
632
649
|
.permission-container.resolved-cancelled .permission-decision-label { color: var(--text-dimmer); }
|
|
633
650
|
|
|
651
|
+
/* Awaiting server confirmation: not a final state, so no dimming */
|
|
652
|
+
.permission-sending-note { font-size: 12px; color: var(--text-muted); padding: 4px 12px 8px; }
|
|
653
|
+
.permission-sending-note.permission-note-error { color: var(--error); }
|
|
654
|
+
.permission-container.sending .permission-btn { opacity: 0.5; cursor: default; }
|
|
655
|
+
|
|
634
656
|
.permission-container.resolved { opacity: 0.5; }
|
|
635
657
|
|
|
636
658
|
/* ==========================================================================
|
package/lib/public/index.html
CHANGED
|
@@ -417,16 +417,7 @@
|
|
|
417
417
|
</div>
|
|
418
418
|
</div>
|
|
419
419
|
<div id="input-bottom-right">
|
|
420
|
-
<div id="vendor-toggle-wrap">
|
|
421
|
-
<button id="vendor-btn-claude" class="vendor-toggle-btn active" data-vendor="claude">
|
|
422
|
-
<img src="/claude-code-avatar.png" class="vendor-toggle-icon" alt="Claude">
|
|
423
|
-
<span class="vendor-toggle-label">Claude Code</span>
|
|
424
|
-
</button>
|
|
425
|
-
<button id="vendor-btn-codex" class="vendor-toggle-btn" data-vendor="codex">
|
|
426
|
-
<img src="/codex-avatar.png" class="vendor-toggle-icon" alt="Codex">
|
|
427
|
-
<span class="vendor-toggle-label">Codex</span>
|
|
428
|
-
</button>
|
|
429
|
-
</div>
|
|
420
|
+
<div id="vendor-toggle-wrap"></div>
|
|
430
421
|
<div id="config-chip-wrap" class="hidden">
|
|
431
422
|
<button id="config-chip" title="Model, mode, and effort settings">
|
|
432
423
|
<i class="config-chip-icon" data-lucide="sliders-horizontal"></i>
|
|
@@ -744,6 +735,7 @@
|
|
|
744
735
|
<button class="ps-env-tab" data-tab="shared">Shared</button>
|
|
745
736
|
</div>
|
|
746
737
|
<div class="ps-env-tab-content active" data-tab="project">
|
|
738
|
+
<p class="settings-hint" id="ps-env-scope-hint" style="margin-bottom: 12px;"></p>
|
|
747
739
|
<div class="ps-env-header">
|
|
748
740
|
<button class="settings-btn-sm" id="ps-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
|
|
749
741
|
<span class="ps-save-status" id="ps-env-save-status"></span>
|
|
@@ -753,7 +745,7 @@
|
|
|
753
745
|
</div>
|
|
754
746
|
</div>
|
|
755
747
|
<div class="ps-env-tab-content" data-tab="shared">
|
|
756
|
-
<p class="settings-hint" style="margin-bottom: 12px;">Shared variables apply to
|
|
748
|
+
<p class="settings-hint" style="margin-bottom: 12px;">Shared variables apply to every session in every project. Only administrators can change them. Project-level variables take precedence where they apply. Applies to sessions started after saving.</p>
|
|
757
749
|
<div class="ps-env-header">
|
|
758
750
|
<button class="settings-btn-sm" id="ps-shared-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
|
|
759
751
|
<span class="ps-save-status" id="ps-shared-env-save-status"></span>
|
|
@@ -1302,7 +1294,7 @@
|
|
|
1302
1294
|
</div>
|
|
1303
1295
|
<div class="server-settings-section" data-section="environment">
|
|
1304
1296
|
<h2>Environment</h2>
|
|
1305
|
-
<p class="settings-hint" style="margin-bottom: 16px;">Define environment variables shared across all projects. Project-level variables take precedence over shared ones.</p>
|
|
1297
|
+
<p class="settings-hint" style="margin-bottom: 16px;">Define environment variables shared across all projects. Project-level variables take precedence over shared ones. Applies to sessions started after saving.</p>
|
|
1306
1298
|
<div class="ps-env-header">
|
|
1307
1299
|
<button class="settings-btn-sm" id="ss-env-add-btn"><i data-lucide="plus"></i> Add Variable</button>
|
|
1308
1300
|
<span class="ps-save-status" id="ss-env-save-status"></span>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Browser-side copy of lib/agent-dispatch-tool.js (the backend is CJS and the
|
|
2
|
+
// frontend is ESM, so neither can import the other). The claude CLI names the
|
|
3
|
+
// sub-agent dispatch tool "Task" in older builds and "Agent" in current ones;
|
|
4
|
+
// a test asserts both copies accept the same names.
|
|
5
|
+
export var AGENT_DISPATCH_TOOL_NAMES = ["Task", "Agent"];
|
|
6
|
+
|
|
7
|
+
export function isAgentDispatchTool(name) {
|
|
8
|
+
return typeof name === "string" && AGENT_DISPATCH_TOOL_NAMES.indexOf(name) !== -1;
|
|
9
|
+
}
|
|
@@ -8,6 +8,8 @@ import { setSendBtnMode, blinkIO } from './app-favicon.js';
|
|
|
8
8
|
import { startLogoAnimation, stopLogoAnimation } from './console-logo.js';
|
|
9
9
|
import { hasSendableContent } from './input.js';
|
|
10
10
|
import { processMessage } from './app-messages.js';
|
|
11
|
+
import { restoreUnconfirmedPrompts } from './tools.js';
|
|
12
|
+
import { restoreUnconfirmedPromptBanners } from './app-notifications.js';
|
|
11
13
|
import { flushPendingExtMessages } from './app-misc.js';
|
|
12
14
|
import { isHomeHubVisible } from './app-home-hub.js';
|
|
13
15
|
import { resetTerminals } from './terminal.js';
|
|
@@ -48,6 +50,7 @@ var _blinkTypes = {
|
|
|
48
50
|
tool_start: true,
|
|
49
51
|
tool_result: true,
|
|
50
52
|
tool_progress: true,
|
|
53
|
+
prompt_request: true,
|
|
51
54
|
permission_request: true,
|
|
52
55
|
elicitation_request: true,
|
|
53
56
|
ask_user_question: true,
|
|
@@ -172,6 +175,10 @@ export function setStatus(status) {
|
|
|
172
175
|
store.set({ processing: true });
|
|
173
176
|
} else {
|
|
174
177
|
store.set({ connected: false, processing: false });
|
|
178
|
+
// An answer sent but never confirmed cannot be trusted once the socket
|
|
179
|
+
// is gone; make its card and banner answerable again.
|
|
180
|
+
restoreUnconfirmedPrompts("Connection lost. Choose again.");
|
|
181
|
+
restoreUnconfirmedPromptBanners("Connection lost. Choose again.");
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
184
|
|
|
@@ -10,7 +10,9 @@ import { getSessionPresenceUsers } from './sidebar-sessions.js';
|
|
|
10
10
|
|
|
11
11
|
// --- Module-owned state ---
|
|
12
12
|
var cursorSharingEnabled = localStorage.getItem("cursorSharing") !== "off";
|
|
13
|
-
|
|
13
|
+
// The three tables below are keyed by ids a server message carries, so they
|
|
14
|
+
// have no prototype to answer for "constructor" or "__proto__".
|
|
15
|
+
var remoteCursors = Object.create(null); // userId -> { el, indicator, timer, lastY, active }
|
|
14
16
|
var cursorThrottleTimer = null;
|
|
15
17
|
var CURSOR_THROTTLE_MS = 30;
|
|
16
18
|
var CURSOR_HIDE_TIMEOUT = 5000;
|
|
@@ -20,10 +22,10 @@ var cursorColors = [
|
|
|
20
22
|
"#0ACF83", "#FF6D00", "#E84393", "#6C5CE7",
|
|
21
23
|
"#00B894", "#FDCB6E", "#E17055", "#74B9FF",
|
|
22
24
|
];
|
|
23
|
-
var userColorMap =
|
|
25
|
+
var userColorMap = Object.create(null);
|
|
24
26
|
var nextColorIdx = 0;
|
|
25
27
|
|
|
26
|
-
var remoteSelections =
|
|
28
|
+
var remoteSelections = Object.create(null); // userId -> { els: [], timer }
|
|
27
29
|
var selectionThrottleTimer = null;
|
|
28
30
|
var lastSelectionKey = "";
|
|
29
31
|
|
|
@@ -388,12 +390,12 @@ export function clearRemoteCursors() {
|
|
|
388
390
|
if (entry.el.parentNode) entry.el.parentNode.removeChild(entry.el);
|
|
389
391
|
if (entry.indicator && entry.indicator.parentNode) entry.indicator.parentNode.removeChild(entry.indicator);
|
|
390
392
|
}
|
|
391
|
-
remoteCursors =
|
|
393
|
+
remoteCursors = Object.create(null);
|
|
392
394
|
for (var uid2 in remoteSelections) {
|
|
393
395
|
clearRemoteSelection(uid2);
|
|
394
396
|
if (remoteSelections[uid2].timer) clearTimeout(remoteSelections[uid2].timer);
|
|
395
397
|
}
|
|
396
|
-
remoteSelections =
|
|
398
|
+
remoteSelections = Object.create(null);
|
|
397
399
|
}
|
|
398
400
|
|
|
399
401
|
export function initCursors() {
|
|
@@ -35,7 +35,7 @@ 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
37
|
import { handleInputSync, autoResize, resetAutoResize, builtinCommands, setScheduleBtnDisabled } from './input.js';
|
|
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,
|
|
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';
|
|
41
41
|
import { isProjectSettingsOpen, refreshProjectSettingsModels, handleInstructionsRead, handleInstructionsWrite, handleProjectEnv, handleProjectEnvSaved, handleProjectSharedEnv, handleProjectSharedEnvSaved, handleProjectOwnerChanged, updateLiteVisibility, handleLiteProjectStatus, handleLiteEnrollResult, handleLiteUnenrollResult } from './project-settings.js';
|
|
@@ -45,6 +45,7 @@ import { handleTermList, handleTermCreated, sendTerminalCommand, handleTermOutpu
|
|
|
45
45
|
import { updateTerminalList, handleContextSourcesState } from './context-sources.js';
|
|
46
46
|
import { handleNotesList, handleNoteCreated, handleNoteUpdated, handleNoteDeleted } from './sticky-notes.js';
|
|
47
47
|
import { handleSkillInstalled, handleSkillUninstalled } from './skills.js';
|
|
48
|
+
import { applyVendorRegistry, defaultVendorId } from './vendor-registry.js';
|
|
48
49
|
import { showRewindModal, onRewindComplete, setRewindMode, onRewindError, clearPendingRewindUuid, addRewindButton } from './rewind.js';
|
|
49
50
|
import { checkAdminAccess } from './admin.js';
|
|
50
51
|
import { showImageModal, sendExtensionCommand, handleMcpToolCallMessage } from './app-misc.js';
|
|
@@ -67,7 +68,7 @@ import { handleSkillInstallWs } from './app-skills-install.js';
|
|
|
67
68
|
import { handleNotificationsState, handleNotificationCreated, handleNotificationDismissed, handleNotificationDismissedAll, showUpdateBanner } from './app-notifications.js';
|
|
68
69
|
import { handleMentionStart, handleMentionActivity, handleMentionStream, handleMentionDone, handleMentionError, renderMentionUser, renderMentionResponse, renderUserMention } from './mention.js';
|
|
69
70
|
import { handleTeamState, handleTeamMemberUpdate, handleTeamTaskUpdate, handleTeamMessage as handleTeamMsg, handleTeamGone } from './team-panel.js';
|
|
70
|
-
import { addDiagnostic } from './diagnostics.js';
|
|
71
|
+
import { addDiagnostic, refreshDiagnostic, retractDiagnostics } from './diagnostics.js';
|
|
71
72
|
import { handleHistoryMeta, handleHistoryDone } from './app-history-replay.js';
|
|
72
73
|
import { shouldApplyActivityEdge } from './activity-latch.js';
|
|
73
74
|
import { deriveSessionListProcessing } from './activity-state.js';
|
|
@@ -85,7 +86,7 @@ var connectOverlay = document.getElementById("connect-overlay");
|
|
|
85
86
|
// halt). Do not unconditionally reassign: that would drop any
|
|
86
87
|
// registrations a circular caller already made before this module's own
|
|
87
88
|
// body reached this line.
|
|
88
|
-
var handlers = handlers ||
|
|
89
|
+
var handlers = handlers || Object.create(null);
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* Register one or more message-type handlers. Called by this module's own
|
|
@@ -101,20 +102,20 @@ var handlers = handlers || {};
|
|
|
101
102
|
* here, and this file imports back from them for their non-registry
|
|
102
103
|
* exports). Depending on which module app.js's graph reaches first, ESM's
|
|
103
104
|
* cycle-breaking semantics can run a caller's top-level registerHandlers()
|
|
104
|
-
* call before this file's own `var handlers
|
|
105
|
+
* call before this file's own `var handlers` line has executed —
|
|
105
106
|
* registerHandlers itself is always safely callable (function declarations
|
|
106
107
|
* are hoisted at instantiation), but the object it wrote into on the module
|
|
107
108
|
* scope was not yet assigned, throwing "Cannot read properties of
|
|
108
109
|
* undefined" and halting the whole app.js boot before connect() runs.
|
|
109
110
|
* Lazily initializing here (independent of module-body execution order)
|
|
110
111
|
* makes registration order-safe: the first call — whichever module makes
|
|
111
|
-
* it — creates the registry, and the `var handlers
|
|
112
|
+
* it — creates the registry, and the `var handlers` line below becomes a
|
|
112
113
|
* no-op once this module's own body eventually runs.
|
|
113
114
|
*
|
|
114
115
|
* @param {Object<string, function(Object): void>} map - type -> handler
|
|
115
116
|
*/
|
|
116
117
|
export function registerHandlers(map) {
|
|
117
|
-
if (!handlers) handlers =
|
|
118
|
+
if (!handlers) handlers = Object.create(null);
|
|
118
119
|
Object.keys(map).forEach(function (type) {
|
|
119
120
|
if (!handlers[type]) handlers[type] = [];
|
|
120
121
|
handlers[type].push(map[type]);
|
|
@@ -132,6 +133,22 @@ export function processMessage(msg) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
136
|
+
// The urgent "Input needed" alert is on exactly while some prompt, of any
|
|
137
|
+
// kind, still awaits the operator. It is derived from every prompt's state,
|
|
138
|
+
// never from the message that arrived last: settling one of two open prompts
|
|
139
|
+
// must leave the alert on for the other, and a turn ending must not hide a
|
|
140
|
+
// sub-agent prompt that outlives the turn.
|
|
141
|
+
function syncUrgentBlink() {
|
|
142
|
+
if (hasPendingPrompts()) startUrgentBlink();
|
|
143
|
+
else stopUrgentBlink();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Every operator-prompt message, of every kind and in either the current or
|
|
147
|
+
// an older recorded shape, renders through one path (tools.js -> prompts.js).
|
|
148
|
+
function handlePromptMessage(msg) {
|
|
149
|
+
if (applyPromptMessage(msg)) syncUrgentBlink();
|
|
150
|
+
}
|
|
151
|
+
|
|
135
152
|
// --- Core handlers ---
|
|
136
153
|
// Message types with no single better-fit domain module, or whose original
|
|
137
154
|
// case body already called into more than one module and needs both
|
|
@@ -274,12 +291,15 @@ registerHandlers({
|
|
|
274
291
|
}
|
|
275
292
|
if (msg.vendor && !store.get('vendorSelectionLocked')) _miUpdate.currentVendor = msg.vendor;
|
|
276
293
|
if (msg.availableVendors) _miUpdate.availableVendors = msg.availableVendors;
|
|
277
|
-
if (msg.installedVendors) _miUpdate.installedVendors = msg.installedVendors;
|
|
278
294
|
store.set(_miUpdate);
|
|
279
295
|
updateSettingsModels(_modelVal, msg.models || []);
|
|
280
296
|
refreshProjectSettingsModels();
|
|
281
297
|
},
|
|
282
298
|
|
|
299
|
+
vendor_registry: function (msg) {
|
|
300
|
+
applyVendorRegistry(msg);
|
|
301
|
+
},
|
|
302
|
+
|
|
283
303
|
config_state: function (msg) {
|
|
284
304
|
var _cs = {};
|
|
285
305
|
if (msg.model) _cs.currentModel = msg.model;
|
|
@@ -524,8 +544,8 @@ registerHandlers({
|
|
|
524
544
|
store.set({ vendorSelectionLocked: true });
|
|
525
545
|
}
|
|
526
546
|
} else if (msg.hasHistory) {
|
|
527
|
-
// Existing session without explicit vendor: reset to
|
|
528
|
-
store.set({ currentVendor:
|
|
547
|
+
// Existing session without explicit vendor: reset to the default agent
|
|
548
|
+
store.set({ currentVendor: defaultVendorId() });
|
|
529
549
|
store.set({ vendorSelectionLocked: false });
|
|
530
550
|
} else if (!msg.hasHistory) {
|
|
531
551
|
// New session without vendor: no mate vendor lookup needed
|
|
@@ -620,7 +640,7 @@ registerHandlers({
|
|
|
620
640
|
}
|
|
621
641
|
if (uuidTarget) {
|
|
622
642
|
uuidTarget.dataset.uuid = msg.uuid;
|
|
623
|
-
if (msg.messageType === "user"
|
|
643
|
+
if (msg.messageType === "user") addRewindButton(uuidTarget);
|
|
624
644
|
}
|
|
625
645
|
store.get('messageUuidMap').push({ uuid: msg.uuid, type: msg.messageType });
|
|
626
646
|
},
|
|
@@ -794,14 +814,15 @@ registerHandlers({
|
|
|
794
814
|
|
|
795
815
|
tool_executing: function (msg) {
|
|
796
816
|
if (msg.name === "AskUserQuestion" && msg.input && msg.input.questions) {
|
|
817
|
+
// The question card replaces the tool item; it is the ask_user prompt
|
|
818
|
+
// whose id is this tool call's id.
|
|
797
819
|
var askTool = getTools()[msg.id];
|
|
798
820
|
if (askTool) {
|
|
799
821
|
if (askTool.el) askTool.el.style.display = "none";
|
|
800
822
|
askTool.done = true;
|
|
801
823
|
removeToolFromGroup(msg.id);
|
|
802
824
|
}
|
|
803
|
-
|
|
804
|
-
startUrgentBlink();
|
|
825
|
+
handlePromptMessage(msg);
|
|
805
826
|
} else if (msg.name === "Write" && msg.input && isPlanFilePath(msg.input.file_path)) {
|
|
806
827
|
setPlanContent(msg.input.content || "");
|
|
807
828
|
updateToolExecuting(msg.id, msg.name, msg.input);
|
|
@@ -843,40 +864,19 @@ registerHandlers({
|
|
|
843
864
|
}
|
|
844
865
|
},
|
|
845
866
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
permission_request: function (msg) {
|
|
852
|
-
renderPermissionRequest(msg.requestId, msg.toolName, msg.toolInput, msg.decisionReason);
|
|
853
|
-
startUrgentBlink();
|
|
854
|
-
},
|
|
855
|
-
|
|
856
|
-
permission_cancel: function (msg) {
|
|
857
|
-
markPermissionCancelled(msg.requestId);
|
|
858
|
-
stopUrgentBlink();
|
|
859
|
-
},
|
|
860
|
-
|
|
861
|
-
permission_resolved: function (msg) {
|
|
862
|
-
markPermissionResolved(msg.requestId, msg.decision);
|
|
863
|
-
stopUrgentBlink();
|
|
864
|
-
},
|
|
865
|
-
|
|
866
|
-
permission_request_pending: function (msg) {
|
|
867
|
-
renderPermissionRequest(msg.requestId, msg.toolName, msg.toolInput, msg.decisionReason);
|
|
868
|
-
startUrgentBlink();
|
|
869
|
-
},
|
|
867
|
+
prompt_request: handlePromptMessage,
|
|
868
|
+
prompt_pending: handlePromptMessage,
|
|
869
|
+
prompt_resolved: handlePromptMessage,
|
|
870
|
+
prompt_cancel: handlePromptMessage,
|
|
870
871
|
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
},
|
|
872
|
+
// Older recorded shapes of the same prompt events (lib/ws-schema.js).
|
|
873
|
+
ask_user_answered: handlePromptMessage,
|
|
874
|
+
permission_request: handlePromptMessage,
|
|
875
|
+
permission_request_pending: handlePromptMessage,
|
|
876
|
+
permission_cancel: handlePromptMessage,
|
|
877
|
+
permission_resolved: handlePromptMessage,
|
|
878
|
+
elicitation_request: handlePromptMessage,
|
|
879
|
+
elicitation_resolved: handlePromptMessage,
|
|
880
880
|
|
|
881
881
|
slash_command_result: function (msg) {
|
|
882
882
|
finalizeAssistantBlock();
|
|
@@ -962,7 +962,7 @@ registerHandlers({
|
|
|
962
962
|
enableMainInput();
|
|
963
963
|
}
|
|
964
964
|
resetToolState();
|
|
965
|
-
|
|
965
|
+
syncUrgentBlink();
|
|
966
966
|
if (document.hidden) {
|
|
967
967
|
if (isNotifAlertEnabled() && !window._pushSubscription) showDoneNotification();
|
|
968
968
|
if (isNotifSoundEnabled()) playDoneSound();
|
|
@@ -1297,7 +1297,12 @@ registerHandlers({
|
|
|
1297
1297
|
// Diagnostic events from CLI stderr (stage 4/5, lr-8294, epic lr-1a52).
|
|
1298
1298
|
// Future sources (e.g. settings preflight from stage 5/5 lr-1a26) will
|
|
1299
1299
|
// also arrive via this same type — the render path must not assume CLI origin.
|
|
1300
|
-
|
|
1300
|
+
if (msg.refresh === true) refreshDiagnostic(msg);
|
|
1301
|
+
else addDiagnostic(msg);
|
|
1302
|
+
},
|
|
1303
|
+
|
|
1304
|
+
diagnostic_retract: function (msg) {
|
|
1305
|
+
retractDiagnostics(msg.source);
|
|
1301
1306
|
},
|
|
1302
1307
|
|
|
1303
1308
|
daemon_config: function (msg) {
|