clay-server 4.0.1-beta.1 → 4.1.0-beta.10
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 +661 -21
- package/LICENSES/MIT-legacy.txt +21 -0
- package/LICENSES/README.md +7 -0
- package/README.md +2 -2
- package/bin/cli.js +1 -3
- package/lib/ask-user-request-identity.js +23 -0
- package/lib/autonomous-run-record.js +32 -0
- package/lib/autonomous-run-scheduler.js +92 -0
- package/lib/context-usage.js +47 -0
- package/lib/daemon-project-access.js +118 -0
- package/lib/daemon-projects.js +19 -5
- package/lib/daemon.js +19 -20
- package/lib/default-ai-runtime.js +117 -0
- package/lib/durable-scheduler-record.js +61 -0
- package/lib/durable-scheduler-store.js +185 -0
- package/lib/durable-scheduler.js +495 -0
- package/lib/git-cli.js +1 -0
- package/lib/issue-work-session.js +10 -0
- package/lib/issues-comments.js +40 -0
- package/lib/issues-commit-verification.js +30 -0
- package/lib/issues-mcp-server.js +27 -0
- package/lib/issues-schema.js +119 -0
- package/lib/issues-service.js +339 -0
- package/lib/issues-store.js +210 -0
- package/lib/loop-cron.js +47 -0
- package/lib/loop-durable-schedule.js +159 -0
- package/lib/loop-guidance.js +35 -0
- package/lib/loop-registry-occurrence.js +76 -0
- package/lib/model-entry.js +15 -0
- package/lib/project-ask-user.js +4 -1
- package/lib/project-autonomous-run.js +498 -0
- package/lib/project-capsule-turn.js +1 -0
- package/lib/project-connection.js +8 -1
- package/lib/project-delegated-session.js +1 -0
- package/lib/project-filesystem.js +10 -10
- package/lib/project-full-access.js +86 -0
- package/lib/project-http.js +3 -1
- package/lib/project-issue-launch.js +154 -0
- package/lib/project-issues.js +58 -0
- package/lib/project-logs-access-scope.js +94 -0
- package/lib/project-logs-mcp-server.js +8 -12
- package/lib/project-logs-query.js +3 -0
- package/lib/project-logs-service.js +86 -84
- package/lib/project-logs-store.js +5 -3
- package/lib/project-loop-interview.js +163 -0
- package/lib/project-loop.js +150 -64
- package/lib/project-message-delivery.js +4 -2
- package/lib/project-models.js +71 -3
- package/lib/project-notifications.js +1 -1
- package/lib/project-pair-autonomous-stop.js +16 -0
- package/lib/project-pair-lifecycle.js +140 -102
- package/lib/project-pair-message.js +50 -0
- package/lib/project-pair-owned-stop.js +18 -0
- package/lib/project-pair-replacement-state.js +72 -0
- package/lib/project-pair-task-control.js +277 -0
- package/lib/project-pair-usage.js +76 -0
- package/lib/project-pending-message-queue.js +328 -0
- package/lib/project-scheduled-messages.js +499 -0
- package/lib/project-scheduled-task-execution.js +236 -0
- package/lib/project-scheduled-tasks.js +481 -0
- package/lib/project-session-notes.js +11 -4
- package/lib/project-session-pair.js +123 -127
- package/lib/project-sessions.js +143 -32
- package/lib/project-tool-llm-runtime.js +48 -0
- package/lib/project-user-message.js +224 -62
- package/lib/project-worker-proposal.js +69 -58
- package/lib/project-workspace-query.js +25 -0
- package/lib/project.js +396 -73
- package/lib/public/app.js +96 -26
- package/lib/public/css/default-ai.css +33 -0
- package/lib/public/css/home-hub.css +15 -2
- package/lib/public/css/home-sidebar.css +50 -2
- package/lib/public/css/icon-strip.css +40 -0
- package/lib/public/css/input.css +160 -114
- package/lib/public/css/issues.css +101 -0
- package/lib/public/css/mates.css +0 -1
- package/lib/public/css/messages.css +19 -0
- package/lib/public/css/pane.css +98 -2
- package/lib/public/css/pending-message-queue.css +190 -0
- package/lib/public/css/rewind.css +11 -2
- package/lib/public/css/scheduled-tasks.css +122 -0
- package/lib/public/css/sticky-notes.css +24 -4
- package/lib/public/index.html +43 -150
- package/lib/public/modules/app-connection.js +3 -0
- package/lib/public/modules/app-cursors.js +29 -12
- package/lib/public/modules/app-loop-ui.js +4 -8
- package/lib/public/modules/app-message-router.js +8 -0
- package/lib/public/modules/app-messages.js +38 -22
- package/lib/public/modules/app-notifications.js +2 -0
- package/lib/public/modules/app-panels.js +9 -1
- package/lib/public/modules/app-projects.js +3 -0
- package/lib/public/modules/app-rate-limit.js +0 -179
- package/lib/public/modules/ask-user-state.js +66 -0
- package/lib/public/modules/autonomous-run.js +285 -0
- package/lib/public/modules/chat-render-runtime.js +0 -2
- package/lib/public/modules/clay-file-links.js +111 -0
- package/lib/public/modules/clay-issue-links.js +131 -0
- package/lib/public/modules/clay-log-links.js +2 -0
- package/lib/public/modules/cursor-sharing-preference.js +38 -0
- package/lib/public/modules/default-ai.js +377 -0
- package/lib/public/modules/filebrowser.js +43 -2
- package/lib/public/modules/home-sidebar.js +16 -8
- package/lib/public/modules/home-surface.js +5 -0
- package/lib/public/modules/input.js +92 -40
- package/lib/public/modules/issues-context.js +117 -0
- package/lib/public/modules/issues-render.js +29 -0
- package/lib/public/modules/issues.js +270 -0
- package/lib/public/modules/loop-interview.js +151 -0
- package/lib/public/modules/markdown.js +4 -0
- package/lib/public/modules/message-delivery.js +5 -3
- package/lib/public/modules/pending-message-image-editor.js +143 -0
- package/lib/public/modules/pending-message-queue-model.js +22 -0
- package/lib/public/modules/pending-message-queue.js +491 -0
- package/lib/public/modules/permission-hints.js +13 -0
- package/lib/public/modules/project-access.js +141 -0
- package/lib/public/modules/project-grouping.js +22 -0
- package/lib/public/modules/project-logs.js +2 -2
- package/lib/public/modules/scheduled-message-state.js +22 -0
- package/lib/public/modules/scheduled-task-edit-state.js +7 -0
- package/lib/public/modules/scheduled-task-engine.js +48 -0
- package/lib/public/modules/scheduled-task-form.js +122 -0
- package/lib/public/modules/scheduled-task-recurrence.js +46 -0
- package/lib/public/modules/scheduled-task-schedule-rule.js +115 -0
- package/lib/public/modules/scheduled-tasks.js +459 -0
- package/lib/public/modules/scheduler-config.js +6 -52
- package/lib/public/modules/scheduler.js +9 -21
- package/lib/public/modules/sidebar-mobile.js +3 -0
- package/lib/public/modules/sidebar-projects.js +14 -171
- package/lib/public/modules/sidebar.js +0 -11
- package/lib/public/modules/split-pair-ui.js +5 -0
- package/lib/public/modules/split-view.js +3 -0
- package/lib/public/modules/sticky-note-markdown.js +1 -0
- package/lib/public/modules/sticky-notes-browser.js +1 -1
- package/lib/public/modules/sticky-notes.js +117 -4
- package/lib/public/modules/terminal.js +2 -0
- package/lib/public/modules/tool-palette-order.js +3 -3
- package/lib/public/modules/tools.js +26 -5
- package/lib/public/modules/worker-proposal.js +4 -0
- package/lib/public/style.css +3 -0
- package/lib/record-revision.js +11 -0
- package/lib/schedule-rule.js +151 -0
- package/lib/schedule-validation.js +124 -0
- package/lib/scheduled-run-state.js +87 -0
- package/lib/scheduled-task-records.js +127 -0
- package/lib/scheduler.js +179 -196
- package/lib/sdk-bridge.js +191 -22
- package/lib/sdk-message-processor.js +32 -2
- package/lib/sdk-turn-queue.js +14 -0
- package/lib/server-admin.js +3 -3
- package/lib/server-cursor-sharing.js +65 -0
- package/lib/server-default-ai.js +265 -0
- package/lib/server-durable-scheduler.js +26 -0
- package/lib/server-global-ws.js +10 -0
- package/lib/server-home-chat.js +29 -9
- package/lib/server-home-clay-entry.js +4 -1
- package/lib/server-home-debate-planning.js +32 -14
- package/lib/server-home-mate-creation.js +30 -11
- package/lib/server-home-models.js +14 -6
- package/lib/server-issue-links.js +18 -0
- package/lib/server-mates.js +4 -3
- package/lib/server-palette.js +17 -14
- package/lib/server.js +247 -102
- package/lib/session-notes-mcp-server.js +2 -2
- package/lib/session-pair-factory.js +45 -4
- package/lib/session-pair-history.js +40 -0
- package/lib/session-pair-mcp-server.js +22 -4
- package/lib/session-pair-operation.js +11 -0
- package/lib/session-pair-prompts.js +31 -2
- package/lib/session-pair-query-start.js +22 -0
- package/lib/session-pair-turn-control.js +8 -3
- package/lib/session-provenance.js +1 -0
- package/lib/session-query-tool-bridge.js +52 -0
- package/lib/session-search.js +4 -1
- package/lib/session-spawn-mcp-server.js +2 -1
- package/lib/session-split-groups.js +35 -1
- package/lib/sessions.js +53 -3
- package/lib/tool-llm.js +1 -0
- package/lib/users-default-ai-preferences.js +80 -0
- package/lib/users-home-surface-preferences.js +2 -1
- package/lib/users-preferences.js +35 -0
- package/lib/users-scheduled-task-preferences.js +44 -0
- package/lib/users.js +16 -0
- package/lib/worker-proposal-control.js +69 -0
- package/lib/worker-proposal-decision.js +7 -0
- package/lib/worker-runtime-catalog.js +52 -0
- package/lib/workspace-query-access.js +3 -2
- package/lib/workspace-query-projection.js +29 -0
- package/lib/workspace-query-service.js +20 -30
- package/lib/worktree.js +8 -4
- package/lib/ws-schema.js +62 -1
- package/lib/yoke/adapters/antigravity.js +1 -0
- package/lib/yoke/adapters/claude-worker.js +22 -18
- package/lib/yoke/adapters/claude.js +85 -16
- package/lib/yoke/adapters/codex.js +28 -7
- package/lib/yoke/claude-context-usage.js +57 -0
- package/lib/yoke/claude-message-correlation.js +31 -0
- package/lib/yoke/claude-model-switch.js +15 -0
- package/lib/yoke/claude-user-input.js +2 -0
- package/lib/yoke/index.js +2 -0
- package/lib/yoke/mcp-bridge-server.js +7 -1
- package/lib/yoke/package.json +1 -1
- package/lib/yoke/session-tool-transport.js +53 -0
- package/lib/yoke/user-input.js +21 -7
- package/package.json +9 -10
- package/bin/claude-relay.js +0 -6
- package/lib/public/modules/app-loop-wizard.js +0 -439
|
@@ -14,6 +14,8 @@ import { switchProject, openAddProjectModal, getCachedProjects } from './app-pro
|
|
|
14
14
|
import { showHomeHub } from './app-home-hub.js';
|
|
15
15
|
import { getPendingTuiAttention } from './app-notifications.js';
|
|
16
16
|
import { isExternalWorktree, externalWorktreeTooltip, appendExternalWorktreeBadge } from './worktree-location.js';
|
|
17
|
+
import { groupProjects } from './project-grouping.js';
|
|
18
|
+
import { showProjectAccessPopover } from './project-access.js';
|
|
17
19
|
|
|
18
20
|
// --- Project state ---
|
|
19
21
|
var cachedProjectList = [];
|
|
@@ -22,9 +24,6 @@ var cachedCurrentSlug = null;
|
|
|
22
24
|
// --- Project context menu ---
|
|
23
25
|
var projectCtxMenu = null;
|
|
24
26
|
|
|
25
|
-
// --- Project Access Popover ---
|
|
26
|
-
var projectAccessPopover = null;
|
|
27
|
-
|
|
28
27
|
// --- Emoji picker ---
|
|
29
28
|
var emojiPickerEl = null;
|
|
30
29
|
|
|
@@ -338,149 +337,6 @@ function getProjectAbbrev(name) {
|
|
|
338
337
|
|
|
339
338
|
export { getProjectAbbrev };
|
|
340
339
|
|
|
341
|
-
// --- Project Access Popover ---
|
|
342
|
-
|
|
343
|
-
function closeAccessOnOutside(e) {
|
|
344
|
-
if (projectAccessPopover && !projectAccessPopover.contains(e.target)) closeProjectAccessPopover();
|
|
345
|
-
}
|
|
346
|
-
function closeAccessOnEscape(e) {
|
|
347
|
-
if (e.key === "Escape") closeProjectAccessPopover();
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
function closeProjectAccessPopover() {
|
|
351
|
-
if (projectAccessPopover) {
|
|
352
|
-
projectAccessPopover.remove();
|
|
353
|
-
projectAccessPopover = null;
|
|
354
|
-
document.removeEventListener("click", closeAccessOnOutside);
|
|
355
|
-
document.removeEventListener("keydown", closeAccessOnEscape);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
function showProjectAccessPopover(anchorEl, slug) {
|
|
360
|
-
closeProjectAccessPopover();
|
|
361
|
-
|
|
362
|
-
var popover = document.createElement("div");
|
|
363
|
-
popover.className = "project-access-popover";
|
|
364
|
-
popover.innerHTML = '<div class="project-access-loading">Loading...</div>';
|
|
365
|
-
popover.addEventListener("click", function (e) { e.stopPropagation(); });
|
|
366
|
-
document.body.appendChild(popover);
|
|
367
|
-
projectAccessPopover = popover;
|
|
368
|
-
|
|
369
|
-
requestAnimationFrame(function () {
|
|
370
|
-
var rect = anchorEl.getBoundingClientRect();
|
|
371
|
-
popover.style.position = "fixed";
|
|
372
|
-
popover.style.left = (rect.right + 8) + "px";
|
|
373
|
-
popover.style.top = rect.top + "px";
|
|
374
|
-
popover.style.zIndex = "9999";
|
|
375
|
-
var popRect = popover.getBoundingClientRect();
|
|
376
|
-
if (popRect.right > window.innerWidth - 8) {
|
|
377
|
-
popover.style.left = (rect.left - popRect.width - 8) + "px";
|
|
378
|
-
}
|
|
379
|
-
if (popRect.bottom > window.innerHeight - 8) {
|
|
380
|
-
popover.style.top = (window.innerHeight - popRect.height - 8) + "px";
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
|
|
384
|
-
setTimeout(function () {
|
|
385
|
-
document.addEventListener("click", closeAccessOnOutside);
|
|
386
|
-
document.addEventListener("keydown", closeAccessOnEscape);
|
|
387
|
-
}, 0);
|
|
388
|
-
|
|
389
|
-
Promise.all([
|
|
390
|
-
fetch("/api/admin/projects/" + encodeURIComponent(slug) + "/access").then(function (r) { return r.json(); }),
|
|
391
|
-
fetch("/api/admin/users").then(function (r) { return r.json(); }),
|
|
392
|
-
]).then(function (results) {
|
|
393
|
-
var access = results[0];
|
|
394
|
-
var usersData = results[1];
|
|
395
|
-
if (access.error || usersData.error) {
|
|
396
|
-
popover.innerHTML = '<div class="project-access-loading">Failed to load</div>';
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
renderAccessPopover(popover, slug, access, usersData.users || []);
|
|
400
|
-
}).catch(function () {
|
|
401
|
-
popover.innerHTML = '<div class="project-access-loading">Failed to load</div>';
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
function renderAccessPopover(popover, slug, access, allUsers) {
|
|
406
|
-
var visibility = access.visibility || "public";
|
|
407
|
-
var allowedUsers = access.allowedUsers || [];
|
|
408
|
-
var ownerId = access.ownerId;
|
|
409
|
-
|
|
410
|
-
var selectableUsers = allUsers.filter(function (u) { return u.id !== ownerId; });
|
|
411
|
-
|
|
412
|
-
var html = '';
|
|
413
|
-
html += '<div class="project-access-header">';
|
|
414
|
-
html += '<span class="project-access-title">Project Access</span>';
|
|
415
|
-
html += '<button class="project-access-close">×</button>';
|
|
416
|
-
html += '</div>';
|
|
417
|
-
|
|
418
|
-
html += '<div class="project-access-section">';
|
|
419
|
-
html += '<label class="project-access-label">Visibility</label>';
|
|
420
|
-
html += '<div class="project-access-vis-row">';
|
|
421
|
-
html += '<button class="project-access-vis-btn' + (visibility === "private" ? ' active' : '') + '" data-vis="private">';
|
|
422
|
-
html += iconHtml("lock") + ' Private';
|
|
423
|
-
html += '</button>';
|
|
424
|
-
html += '<button class="project-access-vis-btn' + (visibility === "public" ? ' active' : '') + '" data-vis="public">';
|
|
425
|
-
html += iconHtml("globe") + ' Public';
|
|
426
|
-
html += '</button>';
|
|
427
|
-
html += '</div>';
|
|
428
|
-
html += '</div>';
|
|
429
|
-
|
|
430
|
-
html += '<div class="project-access-section project-access-users-section"' + (visibility !== "private" ? ' style="display:none"' : '') + '>';
|
|
431
|
-
html += '<label class="project-access-label">Allowed Users</label>';
|
|
432
|
-
html += '<div class="project-access-user-list">';
|
|
433
|
-
for (var i = 0; i < selectableUsers.length; i++) {
|
|
434
|
-
var u = selectableUsers[i];
|
|
435
|
-
var checked = allowedUsers.indexOf(u.id) !== -1 ? " checked" : "";
|
|
436
|
-
html += '<label class="project-access-user-item">';
|
|
437
|
-
html += '<input type="checkbox" data-uid="' + u.id + '"' + checked + '>';
|
|
438
|
-
html += '<span>' + escapeHtml(u.displayName || u.username || u.id) + '</span>';
|
|
439
|
-
html += '</label>';
|
|
440
|
-
}
|
|
441
|
-
if (selectableUsers.length === 0) {
|
|
442
|
-
html += '<div class="project-access-empty">No other users</div>';
|
|
443
|
-
}
|
|
444
|
-
html += '</div>';
|
|
445
|
-
html += '</div>';
|
|
446
|
-
|
|
447
|
-
popover.innerHTML = html;
|
|
448
|
-
refreshIcons();
|
|
449
|
-
|
|
450
|
-
popover.querySelector(".project-access-close").addEventListener("click", function () {
|
|
451
|
-
closeProjectAccessPopover();
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
popover.querySelectorAll(".project-access-vis-btn").forEach(function (btn) {
|
|
455
|
-
btn.addEventListener("click", function () {
|
|
456
|
-
var newVis = btn.dataset.vis;
|
|
457
|
-
popover.querySelectorAll(".project-access-vis-btn").forEach(function (b) { b.classList.remove("active"); });
|
|
458
|
-
btn.classList.add("active");
|
|
459
|
-
var usersSection = popover.querySelector(".project-access-users-section");
|
|
460
|
-
if (usersSection) usersSection.style.display = newVis === "private" ? "" : "none";
|
|
461
|
-
fetch("/api/admin/projects/" + encodeURIComponent(slug) + "/visibility", {
|
|
462
|
-
method: "PUT",
|
|
463
|
-
headers: { "Content-Type": "application/json" },
|
|
464
|
-
body: JSON.stringify({ visibility: newVis }),
|
|
465
|
-
});
|
|
466
|
-
});
|
|
467
|
-
});
|
|
468
|
-
|
|
469
|
-
popover.querySelectorAll('.project-access-user-item input[type="checkbox"]').forEach(function (cb) {
|
|
470
|
-
cb.addEventListener("change", function () {
|
|
471
|
-
var selected = [];
|
|
472
|
-
popover.querySelectorAll('.project-access-user-item input[type="checkbox"]:checked').forEach(function (c) {
|
|
473
|
-
selected.push(c.dataset.uid);
|
|
474
|
-
});
|
|
475
|
-
fetch("/api/admin/projects/" + encodeURIComponent(slug) + "/users", {
|
|
476
|
-
method: "PUT",
|
|
477
|
-
headers: { "Content-Type": "application/json" },
|
|
478
|
-
body: JSON.stringify({ allowedUsers: selected }),
|
|
479
|
-
});
|
|
480
|
-
});
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
|
|
484
340
|
// --- Project context menu ---
|
|
485
341
|
|
|
486
342
|
export function closeProjectCtxMenu() {
|
|
@@ -603,7 +459,7 @@ function showProjectCtxMenu(anchorEl, slug, name, icon, position) {
|
|
|
603
459
|
menu.appendChild(shareItem);
|
|
604
460
|
|
|
605
461
|
// --- Manage Access ---
|
|
606
|
-
if (store.get('isMultiUserMode')
|
|
462
|
+
if (store.get('isMultiUserMode')) {
|
|
607
463
|
var isProjectOwner = store.get('myUserId') && store.get('currentProjectOwnerId') && store.get('myUserId') === store.get('currentProjectOwnerId');
|
|
608
464
|
var isAdmin = store.get('permissions') && store.get('permissions').projectSettings !== false;
|
|
609
465
|
if (isProjectOwner || isAdmin) {
|
|
@@ -624,15 +480,17 @@ function showProjectCtxMenu(anchorEl, slug, name, icon, position) {
|
|
|
624
480
|
menu.appendChild(sep2);
|
|
625
481
|
|
|
626
482
|
// --- Add Worktree ---
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
483
|
+
if (slug.indexOf("--") === -1) {
|
|
484
|
+
var wtItem = document.createElement("button");
|
|
485
|
+
wtItem.className = "project-ctx-item";
|
|
486
|
+
wtItem.innerHTML = iconHtml("git-branch") + " <span>Add Worktree</span>";
|
|
487
|
+
wtItem.addEventListener("click", function (e) {
|
|
488
|
+
e.stopPropagation();
|
|
489
|
+
closeProjectCtxMenu();
|
|
490
|
+
showWorktreeModal(slug, name || slug);
|
|
491
|
+
});
|
|
492
|
+
menu.appendChild(wtItem);
|
|
493
|
+
}
|
|
636
494
|
|
|
637
495
|
if (!store.get('permissions') || store.get('permissions').deleteProject !== false) {
|
|
638
496
|
var sep3 = document.createElement("div");
|
|
@@ -959,21 +817,6 @@ function setWtCollapsed(slug, collapsed) {
|
|
|
959
817
|
wtCollapsed[slug] = collapsed;
|
|
960
818
|
}
|
|
961
819
|
|
|
962
|
-
function groupProjects(projects) {
|
|
963
|
-
var parents = [];
|
|
964
|
-
var wtByParent = {};
|
|
965
|
-
for (var i = 0; i < projects.length; i++) {
|
|
966
|
-
var p = projects[i];
|
|
967
|
-
if (p.isWorktree && p.parentSlug) {
|
|
968
|
-
if (!wtByParent[p.parentSlug]) wtByParent[p.parentSlug] = [];
|
|
969
|
-
wtByParent[p.parentSlug].push(p);
|
|
970
|
-
} else {
|
|
971
|
-
parents.push(p);
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
return { parents: parents, wtByParent: wtByParent };
|
|
975
|
-
}
|
|
976
|
-
|
|
977
820
|
// --- Icon item creation ---
|
|
978
821
|
|
|
979
822
|
function createIconItem(p, currentSlug) {
|
|
@@ -106,17 +106,6 @@ export function initSidebar(_ctx) {
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
// --- Loop (Ralph wizard) tool-palette tile ---
|
|
110
|
-
// The tile is rendered by tool-palette.js at the stable id
|
|
111
|
-
// "loop-tool-btn"; we just wire the click to the wizard opener
|
|
112
|
-
// the same way the old header pill did.
|
|
113
|
-
var loopBtn = ctx.$("loop-tool-btn");
|
|
114
|
-
if (loopBtn) {
|
|
115
|
-
loopBtn.addEventListener("click", function () {
|
|
116
|
-
if (ctx.openRalphWizard) ctx.openRalphWizard();
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
109
|
// --- Panel switch (sessions / files / projects) ---
|
|
121
110
|
var fileBrowserBtn = ctx.$("file-browser-btn");
|
|
122
111
|
// Git has no tool-palette tile. The repository placard's More control is
|
|
@@ -242,6 +242,10 @@ export function syncPairChrome(host, split) {
|
|
|
242
242
|
}
|
|
243
243
|
var oldBadges = host.querySelectorAll(".split-pair-role, .split-pair-live, .split-pair-set-driver, .split-worker-runtime");
|
|
244
244
|
for (var bi = 0; bi < oldBadges.length; bi++) oldBadges[bi].remove();
|
|
245
|
+
var paneEls = host.querySelectorAll(".split-pane");
|
|
246
|
+
for (var paneIndex = 0; paneIndex < paneEls.length; paneIndex++) {
|
|
247
|
+
paneEls[paneIndex].classList.remove("split-pane-role-driver", "split-pane-role-worker");
|
|
248
|
+
}
|
|
245
249
|
var runtimeHeaders = host.querySelectorAll(".has-worker-runtime");
|
|
246
250
|
for (var ri = 0; ri < runtimeHeaders.length; ri++) runtimeHeaders[ri].classList.remove("has-worker-runtime");
|
|
247
251
|
host.classList.remove("split-delegating", "split-direction-right", "split-direction-left");
|
|
@@ -267,6 +271,7 @@ export function syncPairChrome(host, split) {
|
|
|
267
271
|
for (var pi = 0; pi < split.panes.length && pi < headers.length; pi++) {
|
|
268
272
|
(function (sessionId, header) {
|
|
269
273
|
var isDriver = sessionId === group.pair.driverId;
|
|
274
|
+
if (paneEls[pi]) paneEls[pi].classList.add(isDriver ? "split-pane-role-driver" : "split-pane-role-worker");
|
|
270
275
|
var role = isDriver ? "Driver" : "Split Worker";
|
|
271
276
|
var badge = document.createElement("span");
|
|
272
277
|
badge.className = "split-pair-role split-pair-role-" + role.toLowerCase().replace(/ /g, "-");
|
|
@@ -147,6 +147,7 @@ export function syncPaneTitles() {
|
|
|
147
147
|
var session = sessionById(split.panes[i].sessionId);
|
|
148
148
|
if (!session || !session.title) continue;
|
|
149
149
|
split.panes[i].title = session.title;
|
|
150
|
+
if (titleEls[i].parentNode) titleEls[i].parentNode.title = session.title;
|
|
150
151
|
if (titleEls[i].style.display !== "none") titleEls[i].textContent = session.title;
|
|
151
152
|
}
|
|
152
153
|
var accessBtns = host.querySelectorAll(".split-pane-full-access");
|
|
@@ -183,6 +184,7 @@ function createPane(pane, index) {
|
|
|
183
184
|
|
|
184
185
|
var header = document.createElement("header");
|
|
185
186
|
header.className = "split-pane-header";
|
|
187
|
+
header.title = pane.title;
|
|
186
188
|
|
|
187
189
|
var session = sessionById(pane.sessionId);
|
|
188
190
|
var vendor = (session && session.vendor) || "claude";
|
|
@@ -505,6 +507,7 @@ export function initSplitView() {
|
|
|
505
507
|
if (state.splitGroups !== prev.splitGroups) {
|
|
506
508
|
var split = state.splitPanes;
|
|
507
509
|
if (!split || !split.panes) return;
|
|
510
|
+
syncPairChrome(host, split);
|
|
508
511
|
if (split.groupId) {
|
|
509
512
|
var stillExists = state.splitGroups.some(function (group) { return group.id === split.groupId; });
|
|
510
513
|
if (!stillExists) switchNativeSession(split.panes[0].sessionId);
|
|
@@ -59,6 +59,7 @@ function nodeToMarkdown(node) {
|
|
|
59
59
|
case "P": return "\n" + inner;
|
|
60
60
|
case "A": return node.getAttribute("href") || inner;
|
|
61
61
|
case "BUTTON":
|
|
62
|
+
if (node.dataset && node.dataset.issueRef) return "`" + node.dataset.issueRef + "`";
|
|
62
63
|
if (node.classList.contains("clayos-log-link") && node.dataset && node.dataset.logRef) {
|
|
63
64
|
return "`" + node.dataset.logRef + "`";
|
|
64
65
|
}
|
|
@@ -303,7 +303,7 @@ export function closeNotesBrowser() {
|
|
|
303
303
|
var sidebarBtn = document.getElementById("sticky-notes-sidebar-btn");
|
|
304
304
|
if (sidebarBtn) sidebarBtn.classList.remove("active");
|
|
305
305
|
// The canvas comes back so the open notes are reachable again.
|
|
306
|
-
showNotes();
|
|
306
|
+
showNotes(false);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
export function isNotesBrowserOpen() {
|
|
@@ -11,9 +11,11 @@ import { enhanceClayLogLinks } from './clay-log-links.js';
|
|
|
11
11
|
import { isClosedNote, send, clampPos, clearNoteTimers, syncTitle } from './sticky-notes-shared.js';
|
|
12
12
|
import { renderNote, closeColorPicker } from './sticky-notes-card.js';
|
|
13
13
|
import { closeFormatToolbar, isFormatToolbarOpen } from './sticky-notes-editor.js';
|
|
14
|
+
import { store } from './store.js';
|
|
14
15
|
|
|
15
16
|
var notes = new Map(); // id -> { data, el }
|
|
16
17
|
var notesVisible = false;
|
|
18
|
+
var notesResizeObserver = null;
|
|
17
19
|
|
|
18
20
|
// The canvas shows open notes only. Closed notes leave the canvas and live in
|
|
19
21
|
// the browser's Closed tab until they are reopened.
|
|
@@ -37,6 +39,93 @@ function refreshBrowser() {
|
|
|
37
39
|
if (browserRefresh) browserRefresh();
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
function prefersReducedMotion() {
|
|
43
|
+
return window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function setFlightAccessibility(el, hidden) {
|
|
47
|
+
el.inert = hidden;
|
|
48
|
+
el.setAttribute("aria-hidden", hidden ? "true" : "false");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function nearestEdgeTransform(el, container) {
|
|
52
|
+
// offsetLeft/Top and offsetWidth/Height are layout geometry, unaffected by
|
|
53
|
+
// an in-flight transform. Never derive the next vector from a translated
|
|
54
|
+
// boundingClientRect or repeated hide/show cycles will accumulate distance.
|
|
55
|
+
var left = el.offsetLeft;
|
|
56
|
+
var top = el.offsetTop;
|
|
57
|
+
var width = el.offsetWidth;
|
|
58
|
+
var height = el.offsetHeight;
|
|
59
|
+
var containerWidth = container.clientWidth;
|
|
60
|
+
var containerHeight = container.clientHeight;
|
|
61
|
+
var edges = [
|
|
62
|
+
{ name: "left", distance: left, transform: "translateX(" + -(left + width + 20) + "px)" },
|
|
63
|
+
{ name: "right", distance: containerWidth - left - width, transform: "translateX(" + (containerWidth - left + 20) + "px)" },
|
|
64
|
+
{ name: "top", distance: top, transform: "translateY(" + -(top + height + 20) + "px)" },
|
|
65
|
+
{ name: "bottom", distance: containerHeight - top - height, transform: "translateY(" + (containerHeight - top + 20) + "px)" },
|
|
66
|
+
];
|
|
67
|
+
edges.sort(function (a, b) { return a.distance - b.distance; });
|
|
68
|
+
return edges[0];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function animateNote(el, hidden, immediate) {
|
|
72
|
+
if (!el || el.classList.contains("hidden")) return;
|
|
73
|
+
var container = document.getElementById("sticky-notes-container");
|
|
74
|
+
if (!container) return;
|
|
75
|
+
if (hidden) {
|
|
76
|
+
var edge = nearestEdgeTransform(el, container);
|
|
77
|
+
el.style.setProperty("--sticky-note-flight", edge.transform);
|
|
78
|
+
el.style.setProperty("--sticky-note-flight-duration", prefersReducedMotion() || immediate ? "0ms" : "240ms");
|
|
79
|
+
el.classList.add("sticky-note-flight-away");
|
|
80
|
+
setFlightAccessibility(el, true);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
el.style.setProperty("--sticky-note-flight-duration", prefersReducedMotion() || immediate ? "0ms" : "320ms");
|
|
84
|
+
el.classList.remove("sticky-note-flight-away");
|
|
85
|
+
setFlightAccessibility(el, false);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function syncFlightState(el, immediate) {
|
|
89
|
+
if (store.get("notesTemporarilyHidden")) animateNote(el, true, immediate);
|
|
90
|
+
else animateNote(el, false, immediate);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function recomputeFlightGeometry() {
|
|
94
|
+
if (!notesVisible) return;
|
|
95
|
+
reclampAllNotes();
|
|
96
|
+
if (store.get("notesTemporarilyHidden")) {
|
|
97
|
+
notes.forEach(function (entry) { if (entry && entry.el) syncFlightState(entry.el, true); });
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function syncFlightControls() {
|
|
102
|
+
var buttons = document.querySelectorAll("#sticky-notes-toggle-btn");
|
|
103
|
+
var hidden = !!store.get("notesTemporarilyHidden");
|
|
104
|
+
var label = hidden ? "Show sticky notes" : "Hide sticky notes";
|
|
105
|
+
for (var i = 0; i < buttons.length; i++) {
|
|
106
|
+
buttons[i].setAttribute("aria-label", label);
|
|
107
|
+
buttons[i].setAttribute("aria-pressed", hidden ? "true" : "false");
|
|
108
|
+
buttons[i].title = label;
|
|
109
|
+
var icon = buttons[i].querySelector("[data-lucide]");
|
|
110
|
+
if (icon) icon.setAttribute("data-lucide", hidden ? "eye" : "eye-off");
|
|
111
|
+
}
|
|
112
|
+
refreshIcons();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function toggleNotesTemporaryVisibility() {
|
|
116
|
+
var hidden = !store.get("notesTemporarilyHidden");
|
|
117
|
+
if (hidden) {
|
|
118
|
+
closeColorPicker();
|
|
119
|
+
closeFormatToolbar();
|
|
120
|
+
var active = document.activeElement;
|
|
121
|
+
var container = document.getElementById("sticky-notes-container");
|
|
122
|
+
if (container && active && container.contains(active) && active.blur) active.blur();
|
|
123
|
+
}
|
|
124
|
+
store.set({ notesTemporarilyHidden: hidden });
|
|
125
|
+
notes.forEach(function (entry) { if (entry && entry.el) syncFlightState(entry.el); });
|
|
126
|
+
syncFlightControls();
|
|
127
|
+
}
|
|
128
|
+
|
|
40
129
|
// Read-only view of every note the client knows about, for the browser pane.
|
|
41
130
|
export function listNoteData() {
|
|
42
131
|
var out = [];
|
|
@@ -67,6 +156,7 @@ function reclampAllNotes() {
|
|
|
67
156
|
var c = clampPos(curX, curY, noteW, noteH);
|
|
68
157
|
el.style.left = c.x + "px";
|
|
69
158
|
el.style.top = c.y + "px";
|
|
159
|
+
if (store.get("notesTemporarilyHidden")) syncFlightState(el, true);
|
|
70
160
|
});
|
|
71
161
|
}
|
|
72
162
|
|
|
@@ -86,17 +176,29 @@ export function initStickyNotes() {
|
|
|
86
176
|
if (notesVisible && notes.size > 0) {
|
|
87
177
|
reclampAllNotes();
|
|
88
178
|
}
|
|
179
|
+
if (store.get("notesTemporarilyHidden")) notes.forEach(function (entry) { if (entry && entry.el) syncFlightState(entry.el, true); });
|
|
89
180
|
}, 100);
|
|
90
181
|
});
|
|
91
182
|
|
|
183
|
+
var canvas = document.getElementById("sticky-notes-container");
|
|
184
|
+
if (canvas && typeof ResizeObserver === "function") {
|
|
185
|
+
notesResizeObserver = new ResizeObserver(function () {
|
|
186
|
+
recomputeFlightGeometry();
|
|
187
|
+
});
|
|
188
|
+
notesResizeObserver.observe(canvas);
|
|
189
|
+
}
|
|
190
|
+
|
|
92
191
|
}
|
|
93
192
|
|
|
94
193
|
// --- Visibility ---
|
|
95
194
|
|
|
96
|
-
export function showNotes() {
|
|
195
|
+
export function showNotes(restoreTemporary) {
|
|
97
196
|
notesVisible = true;
|
|
197
|
+
if (restoreTemporary !== false) store.set({ notesTemporarilyHidden: false });
|
|
98
198
|
var container = document.getElementById("sticky-notes-container");
|
|
99
199
|
if (container) container.classList.remove("hidden");
|
|
200
|
+
notes.forEach(function (entry) { if (entry && entry.el) syncFlightState(entry.el); });
|
|
201
|
+
syncFlightControls();
|
|
100
202
|
}
|
|
101
203
|
|
|
102
204
|
export function hideNotes() {
|
|
@@ -104,6 +206,8 @@ export function hideNotes() {
|
|
|
104
206
|
var container = document.getElementById("sticky-notes-container");
|
|
105
207
|
if (container) container.classList.add("hidden");
|
|
106
208
|
closeColorPicker();
|
|
209
|
+
notes.forEach(function (entry) { if (entry && entry.el) syncFlightState(entry.el, true); });
|
|
210
|
+
syncFlightControls();
|
|
107
211
|
}
|
|
108
212
|
|
|
109
213
|
export function createNote() {
|
|
@@ -158,6 +262,7 @@ export function handleNotesList(msg) {
|
|
|
158
262
|
var el = renderNote(data);
|
|
159
263
|
notes.set(data.id, { data: data, el: el });
|
|
160
264
|
container.appendChild(el);
|
|
265
|
+
syncFlightState(el, true);
|
|
161
266
|
created = true;
|
|
162
267
|
}
|
|
163
268
|
|
|
@@ -181,11 +286,14 @@ export function handleNotesList(msg) {
|
|
|
181
286
|
refreshBrowser();
|
|
182
287
|
|
|
183
288
|
// Auto-show only when something is actually asking for attention. A board of
|
|
184
|
-
// nothing but closed notes must not pop the canvas open.
|
|
289
|
+
// nothing but closed notes must not pop the canvas open. Temporary hiding is
|
|
290
|
+
// explicit view state and must survive reconnects and list updates.
|
|
185
291
|
if (openCount() > 0 && !notesVisible) {
|
|
186
292
|
notesVisible = true;
|
|
187
293
|
container.classList.remove("hidden");
|
|
188
294
|
}
|
|
295
|
+
if (created) reclampAllNotes();
|
|
296
|
+
syncFlightControls();
|
|
189
297
|
}
|
|
190
298
|
|
|
191
299
|
export function handleNoteCreated(msg) {
|
|
@@ -198,15 +306,18 @@ export function handleNoteCreated(msg) {
|
|
|
198
306
|
var el = renderNote(msg.note);
|
|
199
307
|
notes.set(msg.note.id, { data: msg.note, el: el });
|
|
200
308
|
container.appendChild(el);
|
|
309
|
+
syncFlightState(el, true);
|
|
201
310
|
updateBadge();
|
|
202
311
|
updateSidebarBadge();
|
|
203
312
|
refreshBrowser();
|
|
204
313
|
|
|
205
|
-
// Show container if hidden
|
|
206
|
-
if (!notesVisible) {
|
|
314
|
+
// Show container if hidden, unless the user explicitly flew the notes out.
|
|
315
|
+
if (!notesVisible && !store.get("notesTemporarilyHidden")) {
|
|
207
316
|
notesVisible = true;
|
|
208
317
|
container.classList.remove("hidden");
|
|
209
318
|
}
|
|
319
|
+
reclampAllNotes();
|
|
320
|
+
syncFlightControls();
|
|
210
321
|
}
|
|
211
322
|
|
|
212
323
|
// Patch one existing note element in place from a server payload.
|
|
@@ -258,6 +369,7 @@ function patchNote(entry, next) {
|
|
|
258
369
|
|
|
259
370
|
if (isClosedNote(next)) el.classList.add("hidden");
|
|
260
371
|
else el.classList.remove("hidden");
|
|
372
|
+
syncFlightState(el, true);
|
|
261
373
|
|
|
262
374
|
// The minimize button swaps its icon, which is the only path here that can
|
|
263
375
|
// introduce fresh Lucide markup.
|
|
@@ -288,6 +400,7 @@ export function handleNoteUpdated(msg) {
|
|
|
288
400
|
if (!entry) return;
|
|
289
401
|
|
|
290
402
|
if (patchNote(entry, msg.note)) refreshIcons();
|
|
403
|
+
reclampAllNotes();
|
|
291
404
|
|
|
292
405
|
// A close or reopen arrives as an ordinary update, so the canvas count and
|
|
293
406
|
// the browser both follow from the same message.
|
|
@@ -5,6 +5,7 @@ import { copyToClipboard } from './utils.js';
|
|
|
5
5
|
import { getTerminalTheme } from './theme.js';
|
|
6
6
|
import { getTerminalFontFamily, getTerminalFontSize, onTerminalFontChange } from './terminal-prefs.js';
|
|
7
7
|
import { createKeyToolbar } from './terminal-toolbar.js';
|
|
8
|
+
import { closeIssues } from './issues.js';
|
|
8
9
|
|
|
9
10
|
var ctx;
|
|
10
11
|
var tabs = new Map(); // termId -> { id, title, exited, xterm, fitAddon, bodyEl }
|
|
@@ -193,6 +194,7 @@ export function openTerminal() {
|
|
|
193
194
|
|
|
194
195
|
// Hide file viewer if open (also unwatches)
|
|
195
196
|
closeFileViewer();
|
|
197
|
+
closeIssues();
|
|
196
198
|
|
|
197
199
|
container.classList.remove("hidden");
|
|
198
200
|
isOpen = true;
|
|
@@ -23,10 +23,10 @@ var SESSION_TOOLS = [
|
|
|
23
23
|
{ id: "terminal-sidebar-btn", icon: "square-terminal", label: "Terminal", countId: "terminal-sidebar-count" },
|
|
24
24
|
{ id: "sticky-notes-sidebar-btn", icon: "sticky-note", label: "Sticky Notes", countId: "sticky-notes-sidebar-count" },
|
|
25
25
|
{ id: "project-logs-btn", icon: "notebook-tabs", label: "Logs", countId: "project-logs-count" },
|
|
26
|
-
{ id: "loop-tool-btn", icon: "repeat", label: "Loop" },
|
|
27
26
|
{ id: "mcp-btn", icon: "cable", label: "MCP Servers", countId: "mcp-sidebar-count" },
|
|
28
27
|
{ id: "skills-btn", icon: "puzzle", label: "Skills" },
|
|
29
|
-
{ id: "scheduler-btn", icon: "calendar-clock", label: "Scheduled
|
|
28
|
+
{ id: "scheduler-btn", icon: "calendar-clock", label: "Scheduled" },
|
|
29
|
+
{ id: "issues-btn", icon: "circle-dot", label: "Issues" },
|
|
30
30
|
];
|
|
31
31
|
|
|
32
32
|
var MATE_TOOLS = [
|
|
@@ -67,7 +67,7 @@ var LEGACY_SESSION_TOOL_IDS = {};
|
|
|
67
67
|
// the always-visible repository placard below the tool strip, so it no longer
|
|
68
68
|
// consumes an icon slot. A saved preference naming it is dropped rather than
|
|
69
69
|
// left to linger in stored order forever.
|
|
70
|
-
var RETIRED_SESSION_TOOL_IDS = ["git-sidebar-btn"];
|
|
70
|
+
var RETIRED_SESSION_TOOL_IDS = ["git-sidebar-btn", "loop-tool-btn"];
|
|
71
71
|
|
|
72
72
|
function indexOfId(list, id) {
|
|
73
73
|
for (var i = 0; i < list.length; i++) {
|