clay-server 5.2.0-beta.1 → 5.2.0-beta.11
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 +0 -4
- package/lib/account-auth-socket.js +1 -0
- package/lib/builtin-mates.js +19 -16
- package/lib/bundled-skills/clay-agent-browser/SKILL.md +6 -2
- package/lib/canonical-clay-record-authority.js +15 -0
- package/lib/canonical-clay-scheduling-authority.js +19 -0
- package/lib/claude-hook-installer.js +1 -239
- package/lib/claude-jsonl-watcher.js +1 -204
- package/lib/clay-control-presentation-binding.js +96 -0
- package/lib/clay-control-presentation.js +128 -0
- package/lib/clay-control-target-projection.js +26 -0
- package/lib/clay-mate-chat-receipts.js +26 -0
- package/lib/clay-mate-chat.js +88 -0
- package/lib/clay-mate-knowledge-input.js +26 -0
- package/lib/clay-mate-knowledge.js +95 -0
- package/lib/clay-mate-lifecycle.js +95 -0
- package/lib/clay-product-control-input.js +33 -0
- package/lib/clay-product-control-tools.js +52 -0
- package/lib/clay-product-control.js +250 -0
- package/lib/clay-project-lifecycle.js +154 -0
- package/lib/clay-project-record-input.js +44 -0
- package/lib/clay-project-records.js +84 -0
- package/lib/clay-scheduling-input.js +21 -0
- package/lib/clay-scheduling-receipts.js +26 -0
- package/lib/clay-scheduling.js +119 -0
- package/lib/clay-screen-controls.js +104 -0
- package/lib/clay-skill-install.js +1 -33
- package/lib/clay-vendor-usage.js +44 -0
- package/lib/clay-workspace-controls.js +84 -0
- package/lib/clay-workspace-input.js +17 -0
- package/lib/clay-workspace-receipts.js +26 -0
- package/lib/cli-sessions.js +1 -300
- package/lib/codex-defaults.js +1 -28
- package/lib/context-usage.js +3 -2
- package/lib/contextual-screen-snapshot.js +38 -0
- package/lib/daemon-project-access.js +11 -0
- package/lib/daemon-project-lifecycle-callbacks.js +15 -0
- package/lib/daemon-project-lifecycle.js +262 -0
- package/lib/daemon-projects.js +1 -1
- package/lib/daemon.js +78 -276
- package/lib/default-ai-runtime.js +4 -8
- package/lib/dm-digest-cursor.js +120 -0
- package/lib/email-mcp-server.js +1 -1
- package/lib/github-star-count.js +147 -0
- package/lib/issues-service.js +29 -15
- package/lib/kiro-defaults.js +1 -22
- package/lib/knowledge-db-import-validation.js +46 -0
- package/lib/knowledge-db-import.js +99 -0
- package/lib/knowledge-db-service.js +24 -33
- package/lib/knowledge-db-storage-nedb-maintenance.js +99 -0
- package/lib/knowledge-db-storage-nedb.js +66 -0
- package/lib/knowledge-db-storage.js +72 -0
- package/lib/knowledge-db-validation.js +0 -0
- package/lib/knowledge-document-index.js +2 -1
- package/lib/knowledge-file-store.js +7 -1
- package/lib/knowledge-product-operations.js +46 -0
- package/lib/mate-avatar-catalog.js +12 -0
- package/lib/mate-avatar-migration.js +41 -0
- package/lib/mate-context-service.js +138 -0
- package/lib/mate-context-tools.js +21 -0
- package/lib/mate-creation-mcp-server.js +2 -0
- package/lib/mate-knowledge-canonical-access.js +10 -0
- package/lib/mate-knowledge-mate-bound.js +53 -0
- package/lib/mate-knowledge-mcp-server.js +55 -8
- package/lib/mate-knowledge-service.js +16 -34
- package/lib/mate-knowledge-text-tools.js +106 -0
- package/lib/mate-lifecycle-service.js +94 -0
- package/lib/mate-message-delivery.js +43 -0
- package/lib/mate-ready-creation.js +9 -1
- package/lib/mate-schedule-input.js +29 -0
- package/lib/mate-schedule-lifecycle.js +151 -0
- package/lib/mate-scheduling.js +103 -0
- package/lib/mates.js +18 -6
- package/lib/mcp-agent-tools.js +117 -0
- package/lib/mcp-connection-store.js +119 -15
- package/lib/mcp-import-credentials.js +31 -0
- package/lib/mcp-local-transport.js +13 -0
- package/lib/mcp-oauth.js +8 -6
- package/lib/mcp-proxy.js +2 -32
- package/lib/mcp-query-bridge.js +30 -0
- package/lib/mcp-remote-connections.js +74 -20
- package/lib/mcp-source-adapters.js +1 -0
- package/lib/mcp-source-context.js +1 -0
- package/lib/mcp-source-discovery.js +1 -0
- package/lib/mcp-source-plugins.js +1 -0
- package/lib/mcp-source-restrictions.js +1 -0
- package/lib/mcp-tool-policy.js +9 -0
- package/lib/notes-checklist.js +92 -0
- package/lib/notes.js +51 -4
- package/lib/os-user-diagnostics.js +2 -4
- package/lib/os-users.js +24 -70
- package/lib/pane-pending-interactions.js +20 -0
- package/lib/pane-session-activation.js +114 -0
- package/lib/pane-session-transport.js +26 -0
- package/lib/project-admin-overview.js +51 -0
- package/lib/project-ask-user.js +8 -4
- package/lib/project-connection.js +14 -10
- package/lib/project-control-git-view.js +12 -0
- package/lib/project-debate.js +1 -0
- package/lib/project-delegated-follow-up.js +2 -1
- package/lib/project-directory-claim.js +65 -0
- package/lib/project-file-operations.js +61 -0
- package/lib/project-filesystem.js +15 -85
- package/lib/project-full-access.js +23 -2
- package/lib/project-http.js +7 -4
- package/lib/project-knowledge.js +32 -18
- package/lib/project-lifecycle-operations.js +98 -0
- package/lib/project-lifecycle-process-witness.js +32 -0
- package/lib/project-lifecycle-runtime.js +50 -0
- package/lib/project-linux-access.js +22 -0
- package/lib/project-logs-canonical-clay.js +27 -0
- package/lib/project-logs-clay-query.js +16 -0
- package/lib/project-logs-schema.js +4 -2
- package/lib/project-logs-service.js +8 -7
- package/lib/project-logs.js +1 -0
- package/lib/project-loop.js +1 -0
- package/lib/project-mate-chat-control.js +55 -0
- package/lib/project-mate-creation-proposal.js +18 -3
- package/lib/project-mate-interaction.js +40 -62
- package/lib/project-mcp.js +54 -16
- package/lib/project-models.js +14 -31
- package/lib/project-notifications.js +76 -17
- package/lib/project-ownership.js +77 -0
- package/lib/project-pair-result-delivery.js +14 -3
- package/lib/project-pair-usage.js +12 -13
- package/lib/project-pending-message-queue.js +4 -1
- package/lib/project-product-control.js +89 -0
- package/lib/project-product-session-queue.js +46 -0
- package/lib/project-push-access.js +28 -0
- package/lib/project-scheduled-message-queue.js +30 -0
- package/lib/project-scheduled-messages.js +67 -68
- package/lib/project-scheduled-task-control.js +83 -0
- package/lib/project-scheduled-tasks.js +13 -2
- package/lib/project-scheduling-access.js +10 -0
- package/lib/project-session-actions.js +65 -0
- package/lib/project-session-delete.js +8 -1
- package/lib/project-session-document.js +27 -7
- package/lib/project-session-github.js +63 -19
- package/lib/project-session-history-actions.js +167 -0
- package/lib/project-session-linear.js +14 -6
- package/lib/project-session-notes.js +40 -11
- package/lib/project-session-pair.js +1 -1
- package/lib/project-session-runtime-actions.js +64 -0
- package/lib/project-session-spawn.js +2 -3
- package/lib/project-session-vendor.js +55 -0
- package/lib/project-sessions.js +160 -290
- package/lib/project-shared-browser.js +78 -17
- package/lib/project-start-protocol.js +29 -0
- package/lib/project-studio-presentation.js +58 -0
- package/lib/project-user-message.js +67 -1
- package/lib/project-vendor-login.js +8 -36
- package/lib/project-workspace-operations.js +126 -0
- package/lib/project-workspace-query.js +19 -2
- package/lib/project.js +181 -45
- package/lib/public/app.js +71 -17
- package/lib/public/appearance-bootstrap.js +16 -0
- package/lib/public/css/clay-tool-activity.css +51 -0
- package/lib/public/css/clay-workspace.css +29 -0
- package/lib/public/css/command-palette.css +12 -33
- package/lib/public/css/contextual-clay.css +240 -0
- package/lib/public/css/filebrowser.css +1 -1
- package/lib/public/css/home-debate-planning.css +2 -0
- package/lib/public/css/home-mate-creation.css +5 -0
- package/lib/public/css/input.css +6 -0
- package/lib/public/css/mate-avatar-gallery.css +12 -0
- package/lib/public/css/mate-conversation.css +10 -5
- package/lib/public/css/mate-loading-scene.css +21 -0
- package/lib/public/css/messages.css +6 -2
- package/lib/public/css/overlays.css +68 -258
- package/lib/public/css/project-admin-overview.css +13 -0
- package/lib/public/css/project-mate-creation.css +5 -6
- package/lib/public/css/project-start.css +108 -0
- package/lib/public/css/projects-hub.css +53 -14
- package/lib/public/css/session-folders.css +11 -0
- package/lib/public/css/session-github.css +46 -1
- package/lib/public/css/settings-shell.css +103 -0
- package/lib/public/css/shared-browser.css +35 -1
- package/lib/public/css/sidebar.css +7 -0
- package/lib/public/css/sticky-notes.css +87 -1
- package/lib/public/css/title-bar.css +79 -0
- package/lib/public/index.html +61 -68
- package/lib/public/mate-avatars/B01.png +0 -0
- package/lib/public/mate-avatars/B02.png +0 -0
- package/lib/public/mate-avatars/B03.png +0 -0
- package/lib/public/mate-avatars/B04.png +0 -0
- package/lib/public/mate-avatars/B05.png +0 -0
- package/lib/public/mate-avatars/B06.png +0 -0
- package/lib/public/mate-avatars/B07.png +0 -0
- package/lib/public/mate-avatars/B08.png +0 -0
- package/lib/public/mate-avatars/B09.png +0 -0
- package/lib/public/mate-avatars/B10.png +0 -0
- package/lib/public/mate-avatars/B11.png +0 -0
- package/lib/public/mate-avatars/B12.png +0 -0
- package/lib/public/mate-avatars/B13.png +0 -0
- package/lib/public/mate-avatars/B14.png +0 -0
- package/lib/public/mate-avatars/B15.png +0 -0
- package/lib/public/mate-avatars/B16.png +0 -0
- package/lib/public/mate-avatars/B17.png +0 -0
- package/lib/public/mate-avatars/B18.png +0 -0
- package/lib/public/mate-avatars/B19.png +0 -0
- package/lib/public/mate-avatars/B20.png +0 -0
- package/lib/public/mate-avatars/B21.png +0 -0
- package/lib/public/mate-avatars/B22.png +0 -0
- package/lib/public/mate-avatars/B23.png +0 -0
- package/lib/public/mate-avatars/B24.png +0 -0
- package/lib/public/mate-avatars/B25.png +0 -0
- package/lib/public/mate-avatars/B26.png +0 -0
- package/lib/public/mate-avatars/B27.png +0 -0
- package/lib/public/mate-avatars/B28.png +0 -0
- package/lib/public/mate-avatars/B29.png +0 -0
- package/lib/public/mate-avatars/B30.png +0 -0
- package/lib/public/mate-avatars/B31.png +0 -0
- package/lib/public/mate-avatars/B32.png +0 -0
- package/lib/public/mate-avatars/B33.png +0 -0
- package/lib/public/mate-avatars/B34.png +0 -0
- package/lib/public/mate-avatars/B35.png +0 -0
- package/lib/public/mate-avatars/B36.png +0 -0
- package/lib/public/mate-avatars/B37.png +0 -0
- package/lib/public/mate-avatars/B38.png +0 -0
- package/lib/public/mate-avatars/B39.png +0 -0
- package/lib/public/mate-avatars/B40.png +0 -0
- package/lib/public/mate-avatars/B41.png +0 -0
- package/lib/public/mate-avatars/B42.png +0 -0
- package/lib/public/mate-avatars/B43.png +0 -0
- package/lib/public/mate-avatars/B44.png +0 -0
- package/lib/public/mate-avatars/B45.png +0 -0
- package/lib/public/mate-avatars/B46.png +0 -0
- package/lib/public/mate-avatars/B47.png +0 -0
- package/lib/public/mate-avatars/B48.png +0 -0
- package/lib/public/mate-avatars/C01.png +0 -0
- package/lib/public/mate-avatars/C02.png +0 -0
- package/lib/public/mate-avatars/C03.png +0 -0
- package/lib/public/mate-avatars/C04.png +0 -0
- package/lib/public/mate-avatars/C05.png +0 -0
- package/lib/public/mate-avatars/C06.png +0 -0
- package/lib/public/mate-avatars/C07.png +0 -0
- package/lib/public/mate-avatars/C08.png +0 -0
- package/lib/public/mate-avatars/C09.png +0 -0
- package/lib/public/mate-avatars/C10.png +0 -0
- package/lib/public/mate-avatars/C11.png +0 -0
- package/lib/public/mate-avatars/C12.png +0 -0
- package/lib/public/mate-avatars/C13.png +0 -0
- package/lib/public/mate-avatars/C14.png +0 -0
- package/lib/public/mate-avatars/C15.png +0 -0
- package/lib/public/mate-avatars/C16.png +0 -0
- package/lib/public/mate-avatars/C17.png +0 -0
- package/lib/public/mate-avatars/C18.png +0 -0
- package/lib/public/mate-avatars/C19.png +0 -0
- package/lib/public/mate-avatars/C20.png +0 -0
- package/lib/public/mate-avatars/C21.png +0 -0
- package/lib/public/mate-avatars/C22.png +0 -0
- package/lib/public/mate-avatars/C23.png +0 -0
- package/lib/public/mate-avatars/C24.png +0 -0
- package/lib/public/mate-avatars/C25.png +0 -0
- package/lib/public/mate-avatars/C26.png +0 -0
- package/lib/public/mate-avatars/C27.png +0 -0
- package/lib/public/mate-avatars/C28.png +0 -0
- package/lib/public/mate-avatars/C29.png +0 -0
- package/lib/public/mate-avatars/C30.png +0 -0
- package/lib/public/mate-avatars/C31.png +0 -0
- package/lib/public/mate-avatars/C32.png +0 -0
- package/lib/public/mate-avatars/C33.png +0 -0
- package/lib/public/mate-avatars/C34.png +0 -0
- package/lib/public/mate-avatars/C35.png +0 -0
- package/lib/public/mate-avatars/C36.png +0 -0
- package/lib/public/mate-avatars/C37.png +0 -0
- package/lib/public/mate-avatars/C38.png +0 -0
- package/lib/public/mate-avatars/C39.png +0 -0
- package/lib/public/mate-avatars/C40.png +0 -0
- package/lib/public/mate-avatars/C41.png +0 -0
- package/lib/public/mate-avatars/C42.png +0 -0
- package/lib/public/mate-avatars/C43.png +0 -0
- package/lib/public/mate-avatars/C44.png +0 -0
- package/lib/public/mate-avatars/C45.png +0 -0
- package/lib/public/mate-avatars/C46.png +0 -0
- package/lib/public/mate-avatars/C47.png +0 -0
- package/lib/public/mate-avatars/C48.png +0 -0
- package/lib/public/mate-avatars/catalog.json +482 -0
- package/lib/public/mate-avatars/lead-clay.png +0 -0
- package/lib/public/modules/admin-settings-invitations.js +2 -2
- package/lib/public/modules/admin-settings-projects.js +8 -4
- package/lib/public/modules/admin-settings-ui.js +20 -4
- package/lib/public/modules/admin-settings-users.js +4 -4
- package/lib/public/modules/app-connection.js +11 -1
- package/lib/public/modules/app-favicon.js +18 -9
- package/lib/public/modules/app-header.js +7 -4
- package/lib/public/modules/app-home-hub.js +2 -1
- package/lib/public/modules/app-loop-ui.js +2 -0
- package/lib/public/modules/app-message-router.js +22 -1
- package/lib/public/modules/app-messages.js +125 -19
- package/lib/public/modules/app-misc.js +3 -1
- package/lib/public/modules/app-notifications.js +11 -5
- package/lib/public/modules/app-panels.js +61 -123
- package/lib/public/modules/app-projects.js +14 -407
- package/lib/public/modules/app-rate-limit.js +19 -28
- package/lib/public/modules/app-rendering.js +4 -3
- package/lib/public/modules/avatar.js +15 -41
- package/lib/public/modules/chat-render-runtime.js +20 -0
- package/lib/public/modules/clay-browser-links.js +47 -0
- package/lib/public/modules/clay-control-activity.js +214 -0
- package/lib/public/modules/clay-control-copy.js +36 -0
- package/lib/public/modules/clay-control-detail-targets.js +44 -0
- package/lib/public/modules/clay-control-object-targets.js +52 -0
- package/lib/public/modules/clay-control-target-visibility.js +12 -0
- package/lib/public/modules/clay-control-targets.js +44 -0
- package/lib/public/modules/clay-log-links.js +23 -0
- package/lib/public/modules/clay-navigation-render.js +52 -0
- package/lib/public/modules/clay-owner-navigation.js +33 -0
- package/lib/public/modules/clay-session-links.js +31 -0
- package/lib/public/modules/clay-studio-bridge.js +20 -0
- package/lib/public/modules/clay-studio-document.js +67 -0
- package/lib/public/modules/clay-studio-render.js +146 -0
- package/lib/public/modules/clay-tool-activity.js +140 -0
- package/lib/public/modules/clay-tool-presentation.js +343 -0
- package/lib/public/modules/command-palette.js +162 -40
- package/lib/public/modules/contextual-ask-session.js +26 -0
- package/lib/public/modules/contextual-clay-geometry.js +155 -0
- package/lib/public/modules/contextual-clay-session.js +130 -0
- package/lib/public/modules/contextual-clay-workspace.js +169 -0
- package/lib/public/modules/contextual-clay.js +252 -0
- package/lib/public/modules/contextual-composer.js +91 -0
- package/lib/public/modules/contextual-mate-context.js +117 -0
- package/lib/public/modules/contextual-mate-hint.js +40 -0
- package/lib/public/modules/contextual-mate-identity.js +23 -0
- package/lib/public/modules/contextual-mate-sessions.js +134 -0
- package/lib/public/modules/contextual-search.js +137 -0
- package/lib/public/modules/contextual-session-citations.js +58 -0
- package/lib/public/modules/debate.js +1 -0
- package/lib/public/modules/default-ai.js +11 -3
- package/lib/public/modules/elicitation-form.js +5 -0
- package/lib/public/modules/filebrowser.js +20 -1
- package/lib/public/modules/generation-stop.js +8 -5
- package/lib/public/modules/git-panel.js +3 -1
- package/lib/public/modules/github-star.js +66 -0
- package/lib/public/modules/history-replay-batch.js +13 -1
- package/lib/public/modules/home-debate-live.js +2 -0
- package/lib/public/modules/home-debate-planning.js +7 -7
- package/lib/public/modules/home-mate-avatar-editor.js +127 -208
- package/lib/public/modules/home-mate-chat.js +8 -6
- package/lib/public/modules/home-mate-creation.js +73 -1
- package/lib/public/modules/home-mate-settings.js +19 -12
- package/lib/public/modules/icon-strip-tooltip.js +2 -1
- package/lib/public/modules/input.js +88 -10
- package/lib/public/modules/issues-render.js +3 -2
- package/lib/public/modules/knowledge-db-workbench.js +4 -4
- package/lib/public/modules/markdown.js +6 -34
- package/lib/public/modules/mate-avatar-catalog.js +97 -0
- package/lib/public/modules/mate-knowledge-workbench.js +1 -1
- package/lib/public/modules/mate-loading-scene.js +17 -0
- package/lib/public/modules/mate-management.js +40 -7
- package/lib/public/modules/mcp-connection-view.js +31 -13
- package/lib/public/modules/mcp-discovery-view.js +31 -0
- package/lib/public/modules/mcp-ui.js +23 -4
- package/lib/public/modules/mention.js +3 -0
- package/lib/public/modules/message-delivery.js +20 -2
- package/lib/public/modules/model-picker.js +2 -0
- package/lib/public/modules/pane-activation.js +214 -0
- package/lib/public/modules/pane-binding.js +82 -0
- package/lib/public/modules/pane-bridge.js +7 -4
- package/lib/public/modules/pane-browser-bridge.js +22 -0
- package/lib/public/modules/pane-file-bridge.js +4 -0
- package/lib/public/modules/pane-issue-bridge.js +4 -1
- package/lib/public/modules/pending-message-queue.js +1 -0
- package/lib/public/modules/permission-control.js +5 -4
- package/lib/public/modules/personal-settings-dialog.js +7 -1
- package/lib/public/modules/product-review.js +26 -0
- package/lib/public/modules/profile.js +12 -241
- package/lib/public/modules/project-access-recovery.js +17 -0
- package/lib/public/modules/project-admin-overview.js +21 -0
- package/lib/public/modules/project-chat-identity.js +13 -4
- package/lib/public/modules/project-logs-render.js +3 -0
- package/lib/public/modules/project-mate-creation-workspace.js +13 -4
- package/lib/public/modules/project-mate-navigation.js +144 -22
- package/lib/public/modules/project-session-visibility-settings.js +19 -16
- package/lib/public/modules/project-settings.js +119 -129
- package/lib/public/modules/project-start-dialog.js +130 -0
- package/lib/public/modules/project-start-folder-state.js +78 -0
- package/lib/public/modules/project-start-folder-view.js +190 -0
- package/lib/public/modules/project-start-forms.js +66 -0
- package/lib/public/modules/project-start-path.js +60 -0
- package/lib/public/modules/project-start-state.js +54 -0
- package/lib/public/modules/project-start-submit.js +67 -0
- package/lib/public/modules/projects-hub-view.js +33 -14
- package/lib/public/modules/projects-hub.js +10 -6
- package/lib/public/modules/rewind.js +5 -0
- package/lib/public/modules/scheduled-tasks.js +2 -0
- package/lib/public/modules/scheduler.js +2 -0
- package/lib/public/modules/search-clay-chat.js +5 -440
- package/lib/public/modules/server-settings.js +36 -91
- package/lib/public/modules/session-actions.js +5 -2
- package/lib/public/modules/session-context-menu.js +5 -0
- package/lib/public/modules/session-create-form.js +10 -10
- package/lib/public/modules/session-folder-layout.js +1 -1
- package/lib/public/modules/session-folder-view-menu.js +9 -0
- package/lib/public/modules/session-github.js +85 -14
- package/lib/public/modules/session-rich-drafts.js +21 -0
- package/lib/public/modules/session-switch-defer.js +67 -0
- package/lib/public/modules/session-work-primary.js +51 -0
- package/lib/public/modules/settings-defaults.js +27 -28
- package/lib/public/modules/settings-project-target.js +56 -0
- package/lib/public/modules/settings-select.js +1 -1
- package/lib/public/modules/settings-shell-registry.js +88 -0
- package/lib/public/modules/settings-shell-view.js +104 -0
- package/lib/public/modules/settings-shell.js +342 -0
- package/lib/public/modules/shared-browser-settings.js +112 -0
- package/lib/public/modules/shared-browser-tabs.js +13 -3
- package/lib/public/modules/shared-browser.js +29 -6
- package/lib/public/modules/sidebar-mobile.js +12 -33
- package/lib/public/modules/sidebar-projects.js +3 -1
- package/lib/public/modules/sidebar-session-folders-ui.js +1 -1
- package/lib/public/modules/sidebar-sessions.js +1 -0
- package/lib/public/modules/split-group-restore.js +68 -0
- package/lib/public/modules/split-pair-ui.js +1 -0
- package/lib/public/modules/split-pane-reconciler.js +15 -0
- package/lib/public/modules/split-pane-renderer.js +87 -6
- package/lib/public/modules/split-session-boundary.js +1 -1
- package/lib/public/modules/split-view.js +60 -68
- package/lib/public/modules/sticky-note-markdown.js +72 -6
- package/lib/public/modules/sticky-notes-actions.js +30 -0
- package/lib/public/modules/sticky-notes-browser.js +9 -2
- package/lib/public/modules/sticky-notes-card.js +23 -7
- package/lib/public/modules/sticky-notes-checklist.js +116 -0
- package/lib/public/modules/sticky-notes-editor.js +108 -44
- package/lib/public/modules/sticky-notes-shared.js +50 -2
- package/lib/public/modules/sticky-notes-state.js +66 -0
- package/lib/public/modules/sticky-notes.js +34 -51
- package/lib/public/modules/stt-controller.js +4 -1
- package/lib/public/modules/stt-recording.js +1 -1
- package/lib/public/modules/stt.js +7 -2
- package/lib/public/modules/terminal.js +9 -0
- package/lib/public/modules/theme.js +18 -3
- package/lib/public/modules/thinking-lifecycle.js +33 -3
- package/lib/public/modules/thinking-view.js +23 -1
- package/lib/public/modules/tools.js +60 -11
- package/lib/public/modules/tui-grab.js +1 -2
- package/lib/public/modules/user-settings-appearance.js +10 -3
- package/lib/public/modules/user-settings-editors.js +1 -1
- package/lib/public/modules/user-settings-layout.js +14 -30
- package/lib/public/modules/user-settings-preferences.js +6 -2
- package/lib/public/modules/user-settings-profile.js +13 -3
- package/lib/public/modules/user-settings.js +18 -84
- package/lib/public/modules/vendor-login-browser.js +5 -3
- package/lib/public/modules/vendor-login.js +2 -2
- package/lib/public/modules/vendor-priority.js +15 -1
- package/lib/public/modules/vendor-usage-format.js +93 -0
- package/lib/public/modules/vendor-usage-list.js +45 -0
- package/lib/public/modules/vendor-usage-model.js +215 -0
- package/lib/public/modules/vendor-usage-overview.js +312 -0
- package/lib/public/modules/wireframe-workbench.js +5 -2
- package/lib/public/muse-avatar.svg +4 -0
- package/lib/public/style.css +14 -6
- package/lib/public/sw.js +3 -1
- package/lib/public/welcome-art/conversation-desk.png +0 -0
- package/lib/public/welcome-art/mate-clay.png +0 -0
- package/lib/public/welcome-art/project-clay.png +0 -0
- package/lib/safe-bash-commands.js +3 -45
- package/lib/scheduled-task-records.js +3 -1
- package/lib/scheduler.js +2 -0
- package/lib/sdk-bridge.js +348 -402
- package/lib/sdk-foreground-admission.js +16 -0
- package/lib/sdk-mcp-descriptors.js +2 -37
- package/lib/sdk-message-processor.js +61 -18
- package/lib/sdk-quota-snapshot.js +21 -3
- package/lib/sdk-response-recovery.js +1 -0
- package/lib/sdk-worker.js +2 -677
- package/lib/server-admin.js +63 -16
- package/lib/server-appearance-settings.js +13 -1
- package/lib/server-contextual-clay-settings.js +40 -0
- package/lib/server-contextual-mate-sessions.js +70 -0
- package/lib/server-dm.js +2 -1
- package/lib/server-github-stars.js +39 -0
- package/lib/server-global-ws.js +26 -32
- package/lib/server-home-chat-events.js +18 -4
- package/lib/server-home-chat.js +22 -20
- package/lib/server-home-clay-entry.js +23 -4
- package/lib/server-home-clay-session-links.js +29 -9
- package/lib/server-home-mate-creation.js +1 -0
- package/lib/server-home-mcp-consent.js +14 -0
- package/lib/server-mates.js +25 -62
- package/lib/server-owner-ui.js +118 -0
- package/lib/server-path-access.js +38 -0
- package/lib/server-project-removal.js +22 -0
- package/lib/server-settings.js +6 -1
- package/lib/server.js +167 -43
- package/lib/session-config-transition.js +45 -0
- package/lib/session-folders.js +7 -2
- package/lib/session-fork-history.js +21 -0
- package/lib/session-github.js +9 -2
- package/lib/session-hygiene.js +3 -35
- package/lib/session-notes-mcp-server.js +26 -4
- package/lib/session-notes-writes.js +88 -0
- package/lib/session-permission-mode.js +4 -3
- package/lib/session-skill-scope.js +11 -0
- package/lib/session-visibility.js +25 -10
- package/lib/session-work-primary.js +50 -0
- package/lib/sessions.js +66 -99
- package/lib/shared-browser-cookie-sync.js +32 -0
- package/lib/shared-browser-cookies.js +79 -0
- package/lib/shared-browser-runtime.js +25 -9
- package/lib/shared-browser-storage-sync.js +43 -0
- package/lib/shared-browser-storage.js +101 -0
- package/lib/shared-browser-tools.js +2 -1
- package/lib/shared-browser-worker.js +46 -10
- package/lib/terminal-manager.js +65 -6
- package/lib/tool-llm.js +1 -1
- package/lib/tui-transcript-index.js +1 -132
- package/lib/users-contextual-clay-preferences.js +31 -0
- package/lib/users-permissions.js +2 -8
- package/lib/users.js +7 -0
- package/lib/vendor-login-browser.js +1 -11
- package/lib/vendor-usage-acp-readers.js +97 -0
- package/lib/vendor-usage-capabilities.js +88 -0
- package/lib/vendor-usage-http-readers.js +214 -0
- package/lib/vendor-usage-metrics.js +47 -0
- package/lib/vendor-usage-native-readers.js +106 -0
- package/lib/vendor-usage-overview.js +406 -0
- package/lib/vendor-usage-service.js +281 -0
- package/lib/workspace-assignment-service.js +25 -0
- package/lib/workspace-query-access.js +4 -1
- package/lib/workspace-query-mcp-server.js +1 -1
- package/lib/workspace-query-service.js +13 -2
- package/lib/ws-request.js +1 -0
- package/lib/ws-schema.js +22 -4
- package/lib/yoke/acp-agent-profiles.js +7 -5
- package/lib/yoke/adapters/antigravity.js +3 -14
- package/lib/yoke/adapters/claude-query-contract.js +9 -0
- package/lib/yoke/adapters/claude.js +66 -50
- package/lib/yoke/adapters/codex-query-contract.js +25 -0
- package/lib/yoke/adapters/codex.js +98 -123
- package/lib/yoke/adapters/kiro.js +3 -1
- package/lib/yoke/adapters/muse-query-contract.js +7 -0
- package/lib/yoke/adapters/muse.js +122 -0
- package/lib/yoke/auth-events.js +17 -0
- package/lib/yoke/claude-hook-installer.js +272 -0
- package/lib/yoke/claude-jsonl-watcher.js +204 -0
- package/lib/yoke/claude-maintenance.js +55 -0
- package/lib/yoke/claude-permission-patterns.js +53 -0
- package/lib/yoke/claude-response-recovery.js +155 -0
- package/lib/yoke/claude-transcript-hygiene.js +34 -0
- package/lib/yoke/claude-worker-startup.js +28 -0
- package/lib/yoke/clay-skill-install.js +33 -0
- package/lib/yoke/cli-sessions.js +300 -0
- package/lib/yoke/codex-app-server.js +7 -12
- package/lib/yoke/codex-dynamic-tool-names.js +80 -0
- package/lib/yoke/codex-idle-recovery.js +81 -1
- package/lib/yoke/codex-model-catalog.js +37 -3
- package/lib/yoke/codex-recovery-admission.js +164 -0
- package/lib/yoke/configuration.js +13 -0
- package/lib/yoke/discovery.js +70 -0
- package/lib/yoke/errors.js +8 -0
- package/lib/yoke/host-environment.js +7 -0
- package/lib/yoke/index.js +9 -51
- package/lib/yoke/interface.js +116 -0
- package/lib/yoke/kiro-acp-server.js +5 -5
- package/lib/yoke/legacy-sessions.js +89 -0
- package/lib/yoke/login-protocol.js +25 -0
- package/lib/yoke/maintenance.js +12 -0
- package/lib/yoke/mcp-proxy.js +32 -0
- package/lib/yoke/mcp-source-adapters.js +91 -0
- package/lib/yoke/mcp-source-context.js +42 -0
- package/lib/yoke/mcp-source-discovery.js +169 -0
- package/lib/yoke/mcp-source-plugins.js +68 -0
- package/lib/yoke/mcp-source-restrictions.js +47 -0
- package/lib/yoke/mcp-tool-policy-normalize.js +28 -0
- package/lib/yoke/model-preferences.js +6 -0
- package/lib/yoke/muse-artifacts.js +36 -0
- package/lib/yoke/muse-controls.js +50 -0
- package/lib/yoke/muse-input.js +64 -0
- package/lib/yoke/muse-items.js +157 -0
- package/lib/yoke/muse-policy.js +52 -0
- package/lib/yoke/muse-query.js +428 -0
- package/lib/yoke/muse-runtime.js +211 -0
- package/lib/yoke/muse-services.js +92 -0
- package/lib/yoke/muse-skills.js +79 -0
- package/lib/yoke/muse-turns.js +71 -0
- package/lib/yoke/options/acp.js +2 -0
- package/lib/yoke/options/antigravity.js +2 -0
- package/lib/yoke/options/claude.js +21 -0
- package/lib/yoke/options/codex-defaults.js +29 -0
- package/lib/yoke/options/codex-settings.js +21 -0
- package/lib/yoke/options/codex.js +6 -0
- package/lib/yoke/options/kiro-defaults.js +22 -0
- package/lib/yoke/options/kiro.js +5 -0
- package/lib/yoke/options/muse.js +5 -0
- package/lib/yoke/provider-contract.js +5 -0
- package/lib/yoke/providers/antigravity-executable.js +8 -0
- package/lib/yoke/providers/claude-executable.js +40 -0
- package/lib/yoke/providers/claude-model-descriptions.js +34 -0
- package/lib/yoke/providers/claude-process.js +97 -0
- package/lib/yoke/providers/claude-provision.js +75 -0
- package/lib/yoke/providers/codex-errors.js +8 -0
- package/lib/yoke/providers/muse-executable.js +17 -0
- package/lib/yoke/provisioning.js +6 -0
- package/lib/yoke/query-options.js +10 -0
- package/lib/yoke/response-recovery.js +41 -0
- package/lib/yoke/sdk-mcp-descriptors.js +37 -0
- package/lib/yoke/sdk-server-factory.js +7 -0
- package/lib/yoke/session-history.js +8 -0
- package/lib/yoke/session-tool-transport.js +34 -13
- package/lib/yoke/settings.js +23 -0
- package/lib/yoke/source-locations.js +4 -0
- package/lib/yoke/title-query.js +18 -7
- package/lib/yoke/tui-transcript-index.js +132 -0
- package/lib/yoke/usage.js +48 -0
- package/lib/yoke/user-input.js +13 -0
- package/lib/yoke/vendor-registry.js +87 -3
- package/package.json +11 -4
- package/lib/public/modules/server-settings-navigation.js +0 -39
|
@@ -1,440 +1,5 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { mateAvatarUrl } from './avatar.js';
|
|
7
|
-
import { createAssistantBubble, createUserBubble, finalizeAssistantBubble, renderAssistantBubbleText } from './chat-bubble-renderer.js';
|
|
8
|
-
import { isExactSearchControlMessage, replaceSearchPermissions, applySearchPermissionMessage, createSearchPermissionCard } from './search-clay-controls.js';
|
|
9
|
-
|
|
10
|
-
var state = store.get('searchClayChatState') || null;
|
|
11
|
-
var hostEl = null;
|
|
12
|
-
var backHandler = null;
|
|
13
|
-
var closeHandler = null;
|
|
14
|
-
var sequence = 0;
|
|
15
|
-
var progressTimer = null;
|
|
16
|
-
|
|
17
|
-
function send(payload) {
|
|
18
|
-
var ws = getWs();
|
|
19
|
-
if (!ws || ws.readyState !== 1) return false;
|
|
20
|
-
ws.send(JSON.stringify(payload));
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function requestId() {
|
|
25
|
-
sequence++;
|
|
26
|
-
return "search-clay-" + Date.now() + "-" + sequence;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function stopProgressTimer() {
|
|
30
|
-
if (!progressTimer) return;
|
|
31
|
-
clearInterval(progressTimer);
|
|
32
|
-
progressTimer = null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function startProgressTimer() {
|
|
36
|
-
if (progressTimer) return;
|
|
37
|
-
progressTimer = setInterval(function () { if (state && state.processing) updateProgressDom(); else stopProgressTimer(); }, 1000);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function progressCopy() {
|
|
41
|
-
var elapsed = state && state.startedAt ? Math.max(0, Math.floor((Date.now() - state.startedAt) / 1000)) : 0;
|
|
42
|
-
var label = state && state.step ? "Considering what was found" : "Understanding what to look for";
|
|
43
|
-
if (state.activity === "searching") label = state.step > 1 ? "Checking another lead" : "Searching your conversations";
|
|
44
|
-
else if (state.activity === "reviewing") label = "Reviewing what Clay found";
|
|
45
|
-
else if (state.activity === "reconsidering") label = "Trying another search route";
|
|
46
|
-
else if (elapsed >= 12) label = "Following related context";
|
|
47
|
-
else if (elapsed >= 4) label = "Searching your conversations";
|
|
48
|
-
var detail = (state.step ? "Search pass " + state.step + " · " : "") + elapsed + "s";
|
|
49
|
-
return { label: label, detail: detail };
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function updateProgressDom() {
|
|
53
|
-
if (!hostEl) return;
|
|
54
|
-
var progress = progressCopy();
|
|
55
|
-
var label = hostEl.querySelector(".search-clay-pending-copy strong");
|
|
56
|
-
var detail = hostEl.querySelector(".search-clay-pending-copy small");
|
|
57
|
-
if (label) label.textContent = progress.label;
|
|
58
|
-
if (detail) detail.textContent = progress.detail;
|
|
59
|
-
var activeDetails = hostEl.querySelectorAll(".search-clay-activity-item.is-active small");
|
|
60
|
-
var activeIndex = 0;
|
|
61
|
-
for (var i = 0; state && i < state.activities.length; i++) {
|
|
62
|
-
if (state.activities[i].status !== "active") continue;
|
|
63
|
-
var elapsed = Math.max(0, Math.floor((Date.now() - state.activities[i].startedAt) / 1000));
|
|
64
|
-
state.activities[i].detail = elapsed + "s elapsed";
|
|
65
|
-
if (activeDetails[activeIndex]) activeDetails[activeIndex].textContent = state.activities[i].detail;
|
|
66
|
-
activeIndex++;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
function button(icon, label, title, handler) {
|
|
71
|
-
var el = document.createElement("button");
|
|
72
|
-
el.type = "button";
|
|
73
|
-
el.className = "search-clay-icon-button";
|
|
74
|
-
el.title = title;
|
|
75
|
-
el.setAttribute("aria-label", title);
|
|
76
|
-
el.innerHTML = '<i data-lucide="' + icon + '" aria-hidden="true"></i><span>' + label + '</span>';
|
|
77
|
-
el.addEventListener("click", handler);
|
|
78
|
-
return el;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function clayMate() {
|
|
82
|
-
var mates = store.get('cachedMatesList') || [];
|
|
83
|
-
for (var i = 0; i < mates.length; i++) {
|
|
84
|
-
if (mates[i] && (mates[i].id === state.mateId || mates[i].builtinKey === "clay")) return mates[i];
|
|
85
|
-
}
|
|
86
|
-
return { name: "Clay", profile: { displayName: "Clay", avatarCustom: "/clay-studio-symbol.png" } };
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function appendActivityList(content, items, expanded, onToggle) {
|
|
90
|
-
var panel = document.createElement("div");
|
|
91
|
-
panel.className = "search-clay-activity-panel " + (expanded ? "is-expanded" : "is-collapsed");
|
|
92
|
-
var toggle = document.createElement("button");
|
|
93
|
-
toggle.type = "button";
|
|
94
|
-
toggle.className = "search-clay-activity-toggle";
|
|
95
|
-
toggle.setAttribute("aria-expanded", expanded ? "true" : "false");
|
|
96
|
-
toggle.setAttribute("aria-label", (expanded ? "Collapse" : "Expand") + " Clay activity, " + items.length + (items.length === 1 ? " step" : " steps"));
|
|
97
|
-
toggle.innerHTML = '<i data-lucide="activity" aria-hidden="true"></i><span><strong>Activity</strong><small></small></span><i class="search-clay-activity-chevron" data-lucide="chevron-down" aria-hidden="true"></i>';
|
|
98
|
-
toggle.querySelector("small").textContent = items.length + (items.length === 1 ? " step" : " steps");
|
|
99
|
-
if (items.length <= 2) {
|
|
100
|
-
toggle.disabled = true;
|
|
101
|
-
toggle.setAttribute("aria-label", "Clay activity, " + items.length + (items.length === 1 ? " step" : " steps"));
|
|
102
|
-
} else {
|
|
103
|
-
toggle.addEventListener("click", function () {
|
|
104
|
-
expanded = !expanded;
|
|
105
|
-
panel.classList.toggle("is-expanded", expanded);
|
|
106
|
-
panel.classList.toggle("is-collapsed", !expanded);
|
|
107
|
-
toggle.setAttribute("aria-expanded", expanded ? "true" : "false");
|
|
108
|
-
toggle.setAttribute("aria-label", (expanded ? "Collapse" : "Expand") + " Clay activity, " + items.length + " steps");
|
|
109
|
-
onToggle(expanded);
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
panel.appendChild(toggle);
|
|
113
|
-
var list = document.createElement("div");
|
|
114
|
-
list.className = "search-clay-activity-list";
|
|
115
|
-
for (var i = 0; i < items.length; i++) {
|
|
116
|
-
var item = document.createElement("div");
|
|
117
|
-
item.className = "search-clay-activity-item is-" + items[i].status;
|
|
118
|
-
item.innerHTML = '<i data-lucide="' + activityIcon(items[i].status) + '" aria-hidden="true"></i>';
|
|
119
|
-
var copy = document.createElement("span");
|
|
120
|
-
var label = document.createElement("strong");
|
|
121
|
-
label.textContent = items[i].label;
|
|
122
|
-
copy.appendChild(label);
|
|
123
|
-
var detail = document.createElement("small");
|
|
124
|
-
detail.textContent = items[i].detail || "";
|
|
125
|
-
copy.appendChild(detail);
|
|
126
|
-
item.appendChild(copy);
|
|
127
|
-
list.appendChild(item);
|
|
128
|
-
}
|
|
129
|
-
panel.appendChild(list);
|
|
130
|
-
content.appendChild(panel);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
function renderMessage(message, streaming) {
|
|
134
|
-
var row;
|
|
135
|
-
if (message.role === "user") {
|
|
136
|
-
row = createUserBubble({ text: message.text || "" });
|
|
137
|
-
row.classList.add("search-clay-message", "search-clay-message-user");
|
|
138
|
-
} else {
|
|
139
|
-
row = createAssistantBubble({ name: "Clay", avatarUrl: mateAvatarUrl(clayMate(), 28) });
|
|
140
|
-
row.classList.add("search-clay-message", "search-clay-message-assistant");
|
|
141
|
-
if (streaming) renderAssistantBubbleText(row, message.text || "", false);
|
|
142
|
-
else finalizeAssistantBubble(row, message.text || "", false);
|
|
143
|
-
if (message.activities && message.activities.length) {
|
|
144
|
-
appendActivityList(row.querySelector(".dm-bubble-content"), message.activities, message.activitiesExpanded === true, message.toggleActivities || function (expanded) { message.activitiesExpanded = expanded; });
|
|
145
|
-
row.classList.add("search-clay-activity-message");
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
row.setAttribute("role", "article");
|
|
149
|
-
row.setAttribute("aria-label", message.role === "user" ? "Your message" : "Message from Clay");
|
|
150
|
-
return row;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function activityIcon(status) {
|
|
154
|
-
if (status === "done") return "circle-check";
|
|
155
|
-
if (status === "error") return "circle-alert";
|
|
156
|
-
return "loader-circle";
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function updateActivity(message) {
|
|
160
|
-
var id = message.activityId || message.phase + ":" + (message.step || 0);
|
|
161
|
-
var activity = null;
|
|
162
|
-
for (var i = 0; i < state.activities.length; i++) if (state.activities[i].id === id) activity = state.activities[i];
|
|
163
|
-
if (!activity) {
|
|
164
|
-
activity = { id: id, label: message.label || "Working", detail: "0s elapsed", status: message.status || "active", startedAt: Date.now() };
|
|
165
|
-
state.activities.push(activity);
|
|
166
|
-
} else if (message.status === "active") {
|
|
167
|
-
activity.label = message.label || activity.label;
|
|
168
|
-
activity.status = "active";
|
|
169
|
-
} else {
|
|
170
|
-
var elapsed = Math.max(0, Math.floor((Date.now() - activity.startedAt) / 1000));
|
|
171
|
-
activity.detail = (message.label || "Complete") + (elapsed ? " \u00b7 " + elapsed + "s" : "");
|
|
172
|
-
activity.status = message.status || "done";
|
|
173
|
-
}
|
|
174
|
-
if (state.activities.length > 12) state.activities = state.activities.slice(state.activities.length - 12);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function takeActivities(finalLabel, finalStatus) {
|
|
178
|
-
var now = Date.now();
|
|
179
|
-
for (var i = 0; i < state.activities.length; i++) {
|
|
180
|
-
if (state.activities[i].status !== "active") continue;
|
|
181
|
-
var elapsed = Math.max(0, Math.floor((now - state.activities[i].startedAt) / 1000));
|
|
182
|
-
state.activities[i].status = finalStatus || "done";
|
|
183
|
-
state.activities[i].detail = finalLabel + (elapsed ? " \u00b7 " + elapsed + "s" : "");
|
|
184
|
-
}
|
|
185
|
-
var items = state.activities.slice();
|
|
186
|
-
state.activities = [];
|
|
187
|
-
return items;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
function submit(input, sendButton) {
|
|
191
|
-
var text = input.value.trim();
|
|
192
|
-
if (!state || !text || !state.sessionId) return;
|
|
193
|
-
if (!send({ type: "home_mate_send", mateId: state.mateId, sessionId: state.sessionId, requestId: state.requestId, text: text })) return;
|
|
194
|
-
if (state.processing) {
|
|
195
|
-
state.queuedUsers.push({ role: "user", text: text });
|
|
196
|
-
} else {
|
|
197
|
-
state.messages.push({ role: "user", text: text });
|
|
198
|
-
state.processing = true;
|
|
199
|
-
state.awaitingCompletion = true;
|
|
200
|
-
state.stream = "";
|
|
201
|
-
state.activity = "thinking";
|
|
202
|
-
state.step = 0;
|
|
203
|
-
state.activities = [];
|
|
204
|
-
state.activityExpanded = false;
|
|
205
|
-
state.startedAt = Date.now();
|
|
206
|
-
}
|
|
207
|
-
state.pendingTurns++;
|
|
208
|
-
state.updatedAt = Date.now();
|
|
209
|
-
startProgressTimer();
|
|
210
|
-
state.draft = "";
|
|
211
|
-
input.value = "";
|
|
212
|
-
sendButton.disabled = true;
|
|
213
|
-
render();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
function stopSearchClayChat() {
|
|
217
|
-
if (!state || !state.processing || state.stopping || !state.mateId || !state.sessionId) return false;
|
|
218
|
-
if (!send({ type: "home_mate_stop", mateId: state.mateId, sessionId: state.sessionId, requestId: state.requestId })) return false;
|
|
219
|
-
state.stopping = true;
|
|
220
|
-
render();
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function respondToPermission(permission, decision) {
|
|
225
|
-
if (!state || permission.status !== "pending") return false;
|
|
226
|
-
if (!send({ type: "home_mate_permission_response", mateId: state.mateId, sessionId: state.sessionId, requestId: state.requestId, permissionRequestId: permission.permissionRequestId, decision: decision })) return false;
|
|
227
|
-
permission.status = "answering";
|
|
228
|
-
render();
|
|
229
|
-
return true;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function expand() {
|
|
233
|
-
if (!state || !state.mateId || !state.localId) return;
|
|
234
|
-
if (closeHandler) closeHandler();
|
|
235
|
-
openProjectSession('mate-' + state.mateId, state.localId);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function render() {
|
|
239
|
-
if (!hostEl || !state) return;
|
|
240
|
-
var shell = hostEl.querySelector(".search-clay-chat");
|
|
241
|
-
var transcript = shell ? shell.querySelector(".search-clay-transcript") : null;
|
|
242
|
-
var previousTop = transcript ? transcript.scrollTop : 0;
|
|
243
|
-
var follow = !transcript || transcript.scrollHeight - transcript.scrollTop - transcript.clientHeight < 40;
|
|
244
|
-
if (!shell) {
|
|
245
|
-
hostEl.innerHTML = "";
|
|
246
|
-
shell = document.createElement("section");
|
|
247
|
-
shell.className = "search-clay-chat";
|
|
248
|
-
shell.setAttribute("aria-label", "Chat with Clay");
|
|
249
|
-
var header = document.createElement("header");
|
|
250
|
-
header.className = "search-clay-header";
|
|
251
|
-
var identity = document.createElement("div");
|
|
252
|
-
identity.className = "search-clay-identity";
|
|
253
|
-
identity.innerHTML = '<span><strong>Clay</strong><small>Workspace search</small></span>';
|
|
254
|
-
header.appendChild(identity);
|
|
255
|
-
var actions = document.createElement("div");
|
|
256
|
-
actions.className = "search-clay-header-actions";
|
|
257
|
-
actions.appendChild(button("search", "Search", "Back to search", function () { detachSearchClayChat(); if (backHandler) backHandler(); }));
|
|
258
|
-
actions.appendChild(button("maximize-2", "Expand", "Open this conversation in project chat", expand));
|
|
259
|
-
header.appendChild(actions);
|
|
260
|
-
shell.appendChild(header);
|
|
261
|
-
transcript = document.createElement("div");
|
|
262
|
-
transcript.className = "search-clay-transcript";
|
|
263
|
-
transcript.setAttribute("aria-live", "polite");
|
|
264
|
-
shell.appendChild(transcript);
|
|
265
|
-
var composer = document.createElement("div");
|
|
266
|
-
composer.className = "search-clay-composer";
|
|
267
|
-
var freshInput = document.createElement("textarea");
|
|
268
|
-
freshInput.rows = 1;
|
|
269
|
-
freshInput.value = state.draft || "";
|
|
270
|
-
freshInput.setAttribute("aria-label", "Message Clay");
|
|
271
|
-
var freshSendButton = document.createElement("button");
|
|
272
|
-
freshSendButton.type = "button";
|
|
273
|
-
freshSendButton.className = "search-clay-send";
|
|
274
|
-
freshSendButton.setAttribute("aria-label", "Send to Clay");
|
|
275
|
-
freshSendButton.innerHTML = '<i data-lucide="arrow-up" aria-hidden="true"></i>';
|
|
276
|
-
freshInput.addEventListener("input", function () { state.draft = freshInput.value; freshSendButton.disabled = state.processing ? (!state.sessionId || state.stopping) : (!state.sessionId || !freshInput.value.trim()); });
|
|
277
|
-
freshInput.addEventListener("keydown", function (event) { if (event.key === "Enter" && !event.shiftKey && !event.isComposing) { event.preventDefault(); submit(freshInput, freshSendButton); } });
|
|
278
|
-
freshSendButton.addEventListener("click", function () { if (state.processing) stopSearchClayChat(); else submit(freshInput, freshSendButton); });
|
|
279
|
-
composer.appendChild(freshInput);
|
|
280
|
-
composer.appendChild(freshSendButton);
|
|
281
|
-
shell.appendChild(composer);
|
|
282
|
-
hostEl.appendChild(shell);
|
|
283
|
-
}
|
|
284
|
-
transcript.innerHTML = "";
|
|
285
|
-
for (var i = 0; i < state.messages.length; i++) transcript.appendChild(renderMessage(state.messages[i], false));
|
|
286
|
-
if (state.activities.length || state.stream) transcript.appendChild(renderMessage({ role: "assistant", text: state.stream, activities: state.activities, activitiesExpanded: state.activityExpanded, toggleActivities: function (expanded) { state.activityExpanded = expanded; } }, true));
|
|
287
|
-
for (var p = 0; p < state.permissions.length; p++) transcript.appendChild(createSearchPermissionCard(state.permissions[p], respondToPermission));
|
|
288
|
-
if (state.processing && !state.stream && !state.activities.length) {
|
|
289
|
-
var progress = progressCopy();
|
|
290
|
-
var pending = document.createElement("div");
|
|
291
|
-
pending.className = "search-clay-pending";
|
|
292
|
-
pending.setAttribute("role", "status");
|
|
293
|
-
var pendingCopy = document.createElement("span");
|
|
294
|
-
pendingCopy.className = "search-clay-pending-copy";
|
|
295
|
-
var pendingLabel = document.createElement("strong");
|
|
296
|
-
pendingLabel.textContent = progress.label;
|
|
297
|
-
var pendingDetail = document.createElement("small");
|
|
298
|
-
pendingDetail.textContent = progress.detail;
|
|
299
|
-
pendingCopy.appendChild(pendingLabel);
|
|
300
|
-
pendingCopy.appendChild(pendingDetail);
|
|
301
|
-
pending.appendChild(pendingCopy);
|
|
302
|
-
var dots = document.createElement("span");
|
|
303
|
-
dots.className = "search-clay-dots";
|
|
304
|
-
dots.setAttribute("aria-hidden", "true");
|
|
305
|
-
dots.innerHTML = "<i></i><i></i><i></i>";
|
|
306
|
-
pending.appendChild(dots);
|
|
307
|
-
transcript.appendChild(pending);
|
|
308
|
-
}
|
|
309
|
-
for (var q = 0; q < state.queuedUsers.length; q++) transcript.appendChild(renderMessage(state.queuedUsers[q], false));
|
|
310
|
-
var input = shell.querySelector(".search-clay-composer textarea");
|
|
311
|
-
var sendButton = shell.querySelector(".search-clay-send");
|
|
312
|
-
input.placeholder = state.sessionId ? "Message Clay…" : "Starting Clay…";
|
|
313
|
-
input.disabled = !state.sessionId;
|
|
314
|
-
sendButton.disabled = state.processing ? (!state.sessionId || state.stopping) : (!state.sessionId || !input.value.trim());
|
|
315
|
-
sendButton.setAttribute("aria-label", state.processing ? (state.stopping ? "Stopping Clay" : "Stop Clay") : "Send to Clay");
|
|
316
|
-
sendButton.innerHTML = state.processing ? '<i data-lucide="square" aria-hidden="true"></i>' : '<i data-lucide="arrow-up" aria-hidden="true"></i>';
|
|
317
|
-
var expandButton = shell.querySelector('.search-clay-icon-button[aria-label="Open this conversation in project chat"]');
|
|
318
|
-
if (expandButton) expandButton.disabled = !state.localId;
|
|
319
|
-
refreshIcons();
|
|
320
|
-
transcript.scrollTop = follow ? transcript.scrollHeight : previousTop;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export function startSearchClayChat(query, host, onBack, onClose) {
|
|
324
|
-
var clean = typeof query === "string" ? query.trim().slice(0, 12000) : "";
|
|
325
|
-
if (!clean) return false;
|
|
326
|
-
hostEl = host;
|
|
327
|
-
backHandler = onBack;
|
|
328
|
-
closeHandler = onClose;
|
|
329
|
-
var startedAt = Date.now();
|
|
330
|
-
state = { requestId: requestId(), mateId: null, sessionId: null, localId: null, messages: [{ role: "user", text: clean }], queuedUsers: [], pendingTurns: 1, activities: [], permissions: [], activityExpanded: false, stream: "", draft: "", processing: true, stopping: false, awaitingCompletion: true, activity: "thinking", step: 0, startedAt: startedAt, updatedAt: startedAt, query: clean };
|
|
331
|
-
store.set({ searchClayChatState: state });
|
|
332
|
-
startProgressTimer();
|
|
333
|
-
render();
|
|
334
|
-
if (!send({ type: "home_clay_ask", requestId: state.requestId, text: clean })) {
|
|
335
|
-
state.processing = false;
|
|
336
|
-
state.awaitingCompletion = false;
|
|
337
|
-
state.pendingTurns = 0;
|
|
338
|
-
stopProgressTimer();
|
|
339
|
-
state.messages.push({ role: "assistant", text: "Clay is offline. Reconnect and try again." });
|
|
340
|
-
render();
|
|
341
|
-
}
|
|
342
|
-
return true;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export function attachSearchClayChat(host, onBack, onClose) {
|
|
346
|
-
if (!state) return false;
|
|
347
|
-
hostEl = host;
|
|
348
|
-
backHandler = onBack;
|
|
349
|
-
closeHandler = onClose;
|
|
350
|
-
if (state.processing) send({ type: "home_clay_ask", requestId: state.requestId, text: state.query });
|
|
351
|
-
render();
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
export function getSearchClayChatSummary() {
|
|
356
|
-
if (!state) return null;
|
|
357
|
-
var preview = "";
|
|
358
|
-
var candidates = state.queuedUsers.length ? state.queuedUsers : state.messages;
|
|
359
|
-
for (var i = candidates.length - 1; i >= 0; i--) {
|
|
360
|
-
if (!candidates[i] || typeof candidates[i].text !== "string" || !candidates[i].text.trim()) continue;
|
|
361
|
-
preview = candidates[i].text.replace(/\s+/g, " ").trim().slice(0, 120);
|
|
362
|
-
break;
|
|
363
|
-
}
|
|
364
|
-
return { sessionId: state.sessionId, processing: state.processing === true, preview: preview, updatedAt: state.updatedAt || state.startedAt || null };
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
export function detachSearchClayChat() { hostEl = null; }
|
|
368
|
-
|
|
369
|
-
export function handleSearchClayMessage(msg) {
|
|
370
|
-
if (!isExactSearchControlMessage(state, msg)) return false;
|
|
371
|
-
state.updatedAt = Date.now();
|
|
372
|
-
if (msg.mateId) state.mateId = msg.mateId;
|
|
373
|
-
if (msg.type === "home_mate_session_identity" && msg.sessionId) state.sessionId = msg.sessionId;
|
|
374
|
-
if (msg.type === "home_clay_activity") {
|
|
375
|
-
if (!state.awaitingCompletion) return true;
|
|
376
|
-
state.activity = msg.phase || state.activity;
|
|
377
|
-
state.step = typeof msg.step === "number" ? msg.step : state.step;
|
|
378
|
-
updateActivity(msg);
|
|
379
|
-
} else if (msg.type === "home_mate_history") {
|
|
380
|
-
state.sessionId = msg.sessionId || state.sessionId;
|
|
381
|
-
state.localId = typeof msg.localId === "number" ? msg.localId : state.localId;
|
|
382
|
-
state.messages = Array.isArray(msg.messages) ? msg.messages.filter(function (item) { return item && (item.role === "user" || item.role === "assistant"); }).map(function (item) { return { role: item.role, text: item.text || "" }; }) : state.messages;
|
|
383
|
-
state.processing = msg.isProcessing === true;
|
|
384
|
-
state.awaitingCompletion = state.processing;
|
|
385
|
-
state.pendingTurns = state.processing ? Math.max(1, state.pendingTurns) : 0;
|
|
386
|
-
if (state.processing) startProgressTimer();
|
|
387
|
-
state.stream = "";
|
|
388
|
-
state.stopping = false;
|
|
389
|
-
replaceSearchPermissions(state, msg.pendingPermissions);
|
|
390
|
-
} else if (msg.type === "home_mate_permission_request" || msg.type === "home_mate_permission_resolved" || msg.type === "home_mate_permission_cancelled") {
|
|
391
|
-
applySearchPermissionMessage(state, msg);
|
|
392
|
-
} else if (msg.type === "home_mate_stopping") {
|
|
393
|
-
state.stopping = true;
|
|
394
|
-
} else if (msg.type === "home_mate_delta") {
|
|
395
|
-
if (!state.awaitingCompletion) return true;
|
|
396
|
-
state.sessionId = msg.sessionId || state.sessionId;
|
|
397
|
-
state.processing = true;
|
|
398
|
-
state.pendingTurns = Math.max(1, state.pendingTurns);
|
|
399
|
-
state.stream += msg.text || "";
|
|
400
|
-
} else if (msg.type === "home_mate_done") {
|
|
401
|
-
if (!state.awaitingCompletion) return true;
|
|
402
|
-
var completedActivities = takeActivities("Response complete", "done");
|
|
403
|
-
if (state.stream || msg.text || completedActivities.length) state.messages.push({ role: "assistant", text: state.stream || msg.text || "", activities: completedActivities, activitiesExpanded: state.activityExpanded });
|
|
404
|
-
if (state.queuedUsers.length) state.messages.push(state.queuedUsers.shift());
|
|
405
|
-
state.stream = "";
|
|
406
|
-
state.activityExpanded = false;
|
|
407
|
-
state.pendingTurns = Math.max(0, state.pendingTurns - 1);
|
|
408
|
-
state.processing = state.pendingTurns > 0;
|
|
409
|
-
state.stopping = false;
|
|
410
|
-
state.awaitingCompletion = state.processing;
|
|
411
|
-
state.startedAt = Date.now();
|
|
412
|
-
if (!state.processing) stopProgressTimer();
|
|
413
|
-
} else if (msg.type === "home_mate_error") {
|
|
414
|
-
if (!state.awaitingCompletion) return true;
|
|
415
|
-
var failedActivities = takeActivities("Stopped", "error");
|
|
416
|
-
state.stream = "";
|
|
417
|
-
state.messages.push({ role: "assistant", text: msg.text || "Clay could not complete that search.", activities: failedActivities, activitiesExpanded: state.activityExpanded });
|
|
418
|
-
if (state.queuedUsers.length) state.messages.push(state.queuedUsers.shift());
|
|
419
|
-
state.pendingTurns = Math.max(0, state.pendingTurns - 1);
|
|
420
|
-
state.activityExpanded = false;
|
|
421
|
-
state.processing = state.pendingTurns > 0;
|
|
422
|
-
state.stopping = false;
|
|
423
|
-
state.awaitingCompletion = state.processing;
|
|
424
|
-
state.startedAt = Date.now();
|
|
425
|
-
if (!state.processing) stopProgressTimer();
|
|
426
|
-
}
|
|
427
|
-
render();
|
|
428
|
-
return true;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
store.subscribe(function (appState, previous) {
|
|
432
|
-
if (!state || appState.connected === previous.connected) return;
|
|
433
|
-
if (!appState.connected) {
|
|
434
|
-
replaceSearchPermissions(state, []);
|
|
435
|
-
state.stopping = false;
|
|
436
|
-
render();
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
if (state.processing) send({ type: "home_clay_ask", requestId: state.requestId, text: state.query });
|
|
440
|
-
});
|
|
1
|
+
// Search is an entry point. The sole chat renderer is the contextual Mate pane.
|
|
2
|
+
import { startContextualSearch, handleContextualSearchMessage, retryContextualSearch } from './contextual-search.js';
|
|
3
|
+
export function startSearchClayChat(query) { return startContextualSearch(query); }
|
|
4
|
+
export function handleSearchClayMessage(message) { return handleContextualSearchMessage(message); }
|
|
5
|
+
export function retrySearchClayAsk() { return retryContextualSearch(); }
|
|
@@ -1,46 +1,28 @@
|
|
|
1
1
|
import { initStorageUsage, loadStorageUsage } from './server-storage-settings.js';
|
|
2
2
|
import { initAccountAuthSettings, loadAccountAuthSettings } from './account-auth-settings.js';
|
|
3
|
-
//
|
|
3
|
+
// Server pane of the unified settings shell. Page state survives navigation and closing.
|
|
4
4
|
import { store } from './store.js';
|
|
5
5
|
import { getWs } from './ws-ref.js';
|
|
6
6
|
import { refreshIcons } from './icons.js';
|
|
7
7
|
import { closeFileViewer } from './filebrowser.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { loadAdminSection } from './admin.js';
|
|
9
|
+
import { registerSettingsScope, isSettingsShellOpen, activeSettingsScope } from './settings-shell.js';
|
|
10
10
|
import { initNetworkSettings, loadNetworkSettings } from './server-network-settings.js';
|
|
11
11
|
import { initServerControls, setServerPinAvailability } from './server-settings-controls.js';
|
|
12
12
|
import { initServerEnvironment, loadSharedEnv } from './server-settings-environment.js';
|
|
13
|
-
import {
|
|
14
|
-
import { hasSettingsDrafts, confirmSettingsAction, trapSettingsFocus } from './server-settings-state.js';
|
|
13
|
+
import { hasSettingsDrafts } from './server-settings-state.js';
|
|
15
14
|
import { enhanceSettingsSelects } from './settings-select.js';
|
|
16
15
|
export { updateDaemonConfig, handleSetPinResult, handleKeepAwakeChanged, handleAutoContinueChanged, handleRestartResult, handleShutdownResult, handleServerSettingResult } from './server-settings-controls.js';
|
|
17
16
|
export { handleSharedEnv, handleSharedEnvSaved } from './server-settings-environment.js';
|
|
18
17
|
|
|
19
|
-
function isolateSettings(active) {
|
|
20
|
-
if (active) {
|
|
21
|
-
var entries = Array.from(document.body.children).filter(function (el) { return el !== root() && el.id !== 'confirm-modal' && el.tagName !== 'SCRIPT' && el.tagName !== 'STYLE'; }).map(function (el) { var entry = { el: el, inert: el.inert, hidden: el.getAttribute('aria-hidden') }; el.inert = true; el.setAttribute('aria-hidden', 'true'); return entry; });
|
|
22
|
-
store.set({ serverSettingsInert: entries });
|
|
23
|
-
} else {
|
|
24
|
-
(store.get('serverSettingsInert') || []).forEach(function (entry) { entry.el.inert = entry.inert; if (entry.hidden === null) entry.el.removeAttribute('aria-hidden'); else entry.el.setAttribute('aria-hidden', entry.hidden); });
|
|
25
|
-
store.set({ serverSettingsInert: [] });
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
18
|
function root() { return document.getElementById('server-settings'); }
|
|
29
|
-
export function isSettingsOpen() { return
|
|
19
|
+
export function isSettingsOpen() { return isSettingsShellOpen() && activeSettingsScope() === 'server'; }
|
|
30
20
|
function send(type) { var ws = getWs(); if (ws && ws.readyState === 1) ws.send(JSON.stringify({ type: type })); }
|
|
31
21
|
|
|
32
|
-
function selectPage(id
|
|
22
|
+
function selectPage(id) {
|
|
33
23
|
if (!store.get('serverSettingsAuthorized')) return;
|
|
34
|
-
if (id === 'admin-invites') id = 'admin-users';
|
|
35
|
-
var nav = document.getElementById('settings-page-nav');
|
|
36
|
-
if (!nav.querySelector('[data-section="' + id + '"]')) id = 'overview';
|
|
37
24
|
store.set({ serverSettingsPage: id });
|
|
38
25
|
root().querySelectorAll('.server-settings-section').forEach(function (page) { page.classList.toggle('active', page.dataset.section === id); });
|
|
39
|
-
nav.querySelectorAll('button').forEach(function (button) {
|
|
40
|
-
button.classList.toggle('active', button.dataset.section === id);
|
|
41
|
-
if (button.dataset.section === id) button.setAttribute('aria-current', 'page'); else button.removeAttribute('aria-current');
|
|
42
|
-
});
|
|
43
|
-
document.getElementById('settings-nav-dropdown').value = id;
|
|
44
26
|
if (id === 'network') loadNetworkSettings();
|
|
45
27
|
if (id === 'security') loadAccountAuthSettings();
|
|
46
28
|
if (id === 'storage') loadStorageUsage();
|
|
@@ -49,85 +31,48 @@ function selectPage(id, focus) {
|
|
|
49
31
|
var body = document.getElementById(id + '-body');
|
|
50
32
|
if (id !== 'admin-smtp' || !(store.get('serverSettingsDrafts') || {}).smtp) loadAdminSection(id, body);
|
|
51
33
|
}
|
|
52
|
-
|
|
53
|
-
var heading = root().querySelector('.server-settings-section.active h2');
|
|
54
|
-
heading.tabIndex = -1; heading.focus();
|
|
55
|
-
}
|
|
34
|
+
enhanceSettingsSelects(root()); refreshIcons(root());
|
|
56
35
|
}
|
|
57
36
|
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
// The shell has already verified administrator (or solo-owner) access.
|
|
38
|
+
function enterServerSettings(ctx) {
|
|
60
39
|
closeFileViewer();
|
|
61
|
-
isolateSettings(true);
|
|
62
|
-
store.set({ serverSettingsReturnFocus: document.activeElement });
|
|
63
|
-
root().classList.remove('hidden');
|
|
64
|
-
document.getElementById('server-settings-btn').classList.add('active');
|
|
65
|
-
document.getElementById('server-settings-close').focus();
|
|
66
40
|
var status = document.getElementById('settings-access-status');
|
|
67
|
-
status.textContent = '
|
|
68
|
-
store.set({ serverSettingsAuthorized:
|
|
69
|
-
|
|
70
|
-
if (serverPinSection) serverPinSection.hidden = true;
|
|
41
|
+
status.textContent = '';
|
|
42
|
+
store.set({ serverSettingsAuthorized: true });
|
|
43
|
+
setServerPinAvailability(!ctx.access.multiUser);
|
|
71
44
|
root().querySelectorAll('.server-settings-section').forEach(function (page) { page.classList.remove('active'); });
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (!
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if (!isSettingsOpen()) return;
|
|
84
|
-
store.set({ serverSettingsAuthorized: true });
|
|
85
|
-
setServerPinAvailability(!data.multiUser);
|
|
86
|
-
status.textContent = '';
|
|
87
|
-
renderSettingsNavigation(!!data.multiUser, selectPage);
|
|
88
|
-
selectPage(store.get('serverSettingsPage') || 'overview', false);
|
|
89
|
-
if (!hasSettingsDrafts()) send('get_daemon_config');
|
|
90
|
-
setTimeout(function () {
|
|
91
|
-
if (isSettingsOpen() && !store.get('serverSettingsConfigLoaded')) status.textContent = 'Server configuration has not loaded. Reconnect, then reopen Settings to retry.';
|
|
92
|
-
}, 12000);
|
|
93
|
-
send('process_stats');
|
|
94
|
-
clearInterval(store.get('serverSettingsStatsTimer'));
|
|
95
|
-
store.set({ serverSettingsStatsTimer: setInterval(function () { send('process_stats'); }, 5000) });
|
|
96
|
-
document.getElementById('settings-project-slug').textContent = store.get('currentSlug') || '(none)';
|
|
97
|
-
document.getElementById('settings-ws-path').textContent = store.get('wsPath') || '/ws';
|
|
98
|
-
var pill = document.getElementById('skip-perms-pill');
|
|
99
|
-
document.getElementById('settings-skip-perms').textContent = pill && !pill.classList.contains('hidden') ? 'Skip' : 'Permission checks';
|
|
100
|
-
enhanceSettingsSelects(root()); refreshIcons(root());
|
|
101
|
-
} catch (error) { status.textContent = error.message; }
|
|
45
|
+
if (!hasSettingsDrafts()) send('get_daemon_config');
|
|
46
|
+
setTimeout(function () {
|
|
47
|
+
if (isSettingsOpen() && !store.get('serverSettingsConfigLoaded')) status.textContent = 'Server configuration has not loaded. Reconnect, then reopen Settings to retry.';
|
|
48
|
+
}, 12000);
|
|
49
|
+
send('process_stats');
|
|
50
|
+
clearInterval(store.get('serverSettingsStatsTimer'));
|
|
51
|
+
store.set({ serverSettingsStatsTimer: setInterval(function () { send('process_stats'); }, 5000) });
|
|
52
|
+
document.getElementById('settings-project-slug').textContent = store.get('currentSlug') || '(none)';
|
|
53
|
+
document.getElementById('settings-ws-path').textContent = store.get('wsPath') || '/ws';
|
|
54
|
+
var pill = document.getElementById('skip-perms-pill');
|
|
55
|
+
document.getElementById('settings-skip-perms').textContent = pill && !pill.classList.contains('hidden') ? 'Skip' : 'Permission checks';
|
|
102
56
|
}
|
|
103
57
|
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
root().classList.add('hidden');
|
|
108
|
-
document.getElementById('server-settings-btn').classList.remove('active');
|
|
109
|
-
clearInterval(store.get('serverSettingsStatsTimer'));
|
|
110
|
-
var previous = store.get('serverSettingsReturnFocus');
|
|
111
|
-
if (previous && previous.isConnected) previous.focus();
|
|
112
|
-
}
|
|
113
|
-
if (hasSettingsDrafts()) confirmSettingsAction('You have unsaved changes. Closing keeps these drafts in this tab, but reloading the page will lose them.', 'Close with drafts', close);
|
|
114
|
-
else close();
|
|
58
|
+
function leaveServerSettings() {
|
|
59
|
+
clearInterval(store.get('serverSettingsStatsTimer'));
|
|
60
|
+
store.set({ serverSettingsAuthorized: false });
|
|
115
61
|
}
|
|
116
62
|
|
|
117
63
|
export function initServerSettings() {
|
|
118
64
|
if (!root()) return;
|
|
119
65
|
initNetworkSettings(); initServerControls(); initServerEnvironment(); initStorageUsage(); initAccountAuthSettings();
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
trapSettingsFocus(event, root());
|
|
66
|
+
registerSettingsScope('server', {
|
|
67
|
+
pane: root(),
|
|
68
|
+
enter: enterServerSettings,
|
|
69
|
+
activate: selectPage,
|
|
70
|
+
leave: leaveServerSettings,
|
|
71
|
+
leavePrompt: function (kind) {
|
|
72
|
+
if (!hasSettingsDrafts() || kind === 'page' || kind === 'project') return null;
|
|
73
|
+
if (kind === 'close') return { message: 'You have unsaved changes. Closing keeps these drafts in this tab, but reloading the page will lose them.', action: 'Close with drafts' };
|
|
74
|
+
return { message: 'Your server settings drafts will remain in this tab while you visit another settings area.', action: 'Leave Server settings' };
|
|
75
|
+
}
|
|
131
76
|
});
|
|
132
77
|
new MutationObserver(function () { enhanceSettingsSelects(root()); }).observe(root(), { childList: true, subtree: true });
|
|
133
78
|
}
|
|
@@ -4,6 +4,7 @@ import { addSystemMessage, VENDOR_AVATARS, VENDOR_NAMES } from './app-rendering.
|
|
|
4
4
|
import { openPairDialog } from './split-pair-ui.js';
|
|
5
5
|
import { buildAgentVendorSelect, fillAgentModels, buildAgentEffortSelect, fillAgentEffort } from './agent-config-selects.js';
|
|
6
6
|
import { showToast } from './utils.js';
|
|
7
|
+
import { sessionCallback, captureSessionAction, sessionActionCurrent } from './pane-binding.js';
|
|
7
8
|
|
|
8
9
|
var addWorkerButton = null;
|
|
9
10
|
var handoffButton = null;
|
|
@@ -33,6 +34,7 @@ function handoffField(labelText, control) {
|
|
|
33
34
|
function requestHandoffDialog() {
|
|
34
35
|
var ws = getWs();
|
|
35
36
|
if (!ws || ws.readyState !== 1) return;
|
|
37
|
+
store.set({ handoffAction: captureSessionAction() });
|
|
36
38
|
ws.send(JSON.stringify({ type: "handoff_session_options" }));
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -47,6 +49,7 @@ function openWorkerDialog() {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
function showHandoffDialog(options) {
|
|
52
|
+
if (!sessionActionCurrent(store.get('handoffAction'))) return;
|
|
50
53
|
closeHandoffDialog();
|
|
51
54
|
var installed = options.installedVendors || [];
|
|
52
55
|
var vendorInfo = store.get('vendorInfo') || {};
|
|
@@ -147,7 +150,7 @@ function showHandoffDialog(options) {
|
|
|
147
150
|
if (event.key === "Escape") closeHandoffDialog();
|
|
148
151
|
};
|
|
149
152
|
document.addEventListener("keydown", handoffEscapeHandler);
|
|
150
|
-
submit.addEventListener("click", function () {
|
|
153
|
+
submit.addEventListener("click", sessionCallback(function () {
|
|
151
154
|
var ws = getWs();
|
|
152
155
|
if (!ws || ws.readyState !== 1) return;
|
|
153
156
|
ws.send(JSON.stringify({
|
|
@@ -158,7 +161,7 @@ function showHandoffDialog(options) {
|
|
|
158
161
|
}));
|
|
159
162
|
submit.disabled = true;
|
|
160
163
|
submit.textContent = "Continuing…";
|
|
161
|
-
});
|
|
164
|
+
}));
|
|
162
165
|
vendorSelect.focus();
|
|
163
166
|
}
|
|
164
167
|
|