clay-server 5.1.1-beta.1 → 5.2.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/lib/account-auth-policy.js +21 -0
- package/lib/account-auth-socket.js +30 -0
- package/lib/account-auth-throttle.js +44 -0
- package/lib/account-auth-transport.js +48 -0
- package/lib/account-login-page.js +28 -0
- package/lib/account-passkey-challenges.js +31 -0
- package/lib/account-passkey-page.js +89 -0
- package/lib/account-passkey-policy.js +39 -0
- package/lib/account-password-page.js +69 -0
- package/lib/account-passwords.js +36 -0
- package/lib/account-remembered.js +77 -0
- package/lib/account-session-page.js +51 -0
- package/lib/account-session-store.js +82 -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 +51 -0
- package/lib/clay-product-control.js +247 -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-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 +80 -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/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/migrate-single-user.js +3 -23
- package/lib/notes-checklist.js +50 -0
- package/lib/notes.js +49 -3
- 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-server-settings.js +1 -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 +7 -3
- 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 +103 -272
- package/lib/project-shared-browser.js +78 -17
- package/lib/project-studio-presentation.js +58 -0
- package/lib/project-user-knowledge.js +2 -1
- package/lib/project-user-message.js +67 -1
- package/lib/project-vendor-login.js +6 -36
- package/lib/project-workspace-operations.js +126 -0
- package/lib/project-workspace-query.js +19 -2
- package/lib/project.js +178 -45
- package/lib/public/app.js +46 -0
- package/lib/public/appearance-bootstrap.js +16 -0
- package/lib/public/auth/account-login.css +98 -0
- package/lib/public/auth/account-login.js +104 -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/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/messages.css +6 -2
- package/lib/public/css/overlays.css +4 -2
- package/lib/public/css/project-admin-overview.css +13 -0
- package/lib/public/css/session-folders.css +11 -0
- package/lib/public/css/session-github.css +46 -1
- package/lib/public/css/shared-browser.css +35 -1
- package/lib/public/css/sticky-notes.css +87 -1
- package/lib/public/css/user-settings-sessions.css +42 -0
- package/lib/public/index.html +28 -10
- 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/account-auth-settings.js +71 -0
- package/lib/public/modules/account-transport-settings.js +51 -0
- package/lib/public/modules/admin-settings-projects.js +6 -2
- 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-loop-ui.js +2 -0
- package/lib/public/modules/app-message-router.js +22 -1
- package/lib/public/modules/app-messages.js +119 -17
- 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 +13 -0
- package/lib/public/modules/app-rate-limit.js +7 -27
- 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 +342 -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 +250 -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/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-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/passkey-browser.js +69 -0
- package/lib/public/modules/passkey-server-settings.js +57 -0
- 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 +1 -238
- 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 +6 -2
- package/lib/public/modules/project-mate-navigation.js +144 -22
- 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-controls.js +10 -0
- package/lib/public/modules/server-settings.js +7 -2
- 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/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 +4 -3
- package/lib/public/modules/sidebar-projects.js +1 -0
- 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 +8 -1
- 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-account.js +14 -1
- 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 +11 -2
- package/lib/public/modules/user-settings-preferences.js +6 -2
- package/lib/public/modules/user-settings-profile.js +12 -2
- package/lib/public/modules/user-settings-sessions.js +120 -0
- package/lib/public/modules/user-settings.js +6 -2
- 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/wireframe-workbench.js +5 -2
- package/lib/public/modules/you-activity.js +3 -1
- package/lib/public/modules/you.js +91 -6
- package/lib/public/muse-avatar.svg +4 -0
- package/lib/public/style.css +6 -0
- package/lib/public/sw.js +3 -1
- 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 +342 -401
- package/lib/sdk-foreground-admission.js +16 -0
- package/lib/sdk-mcp-descriptors.js +2 -37
- package/lib/sdk-message-processor.js +52 -17
- package/lib/sdk-quota-snapshot.js +1 -1
- package/lib/sdk-response-recovery.js +1 -0
- package/lib/sdk-worker.js +2 -677
- package/lib/server-account-passkeys.js +186 -0
- package/lib/server-account-passwords.js +127 -0
- package/lib/server-account-security.js +53 -0
- package/lib/server-admin.js +63 -16
- package/lib/server-appearance-settings.js +13 -1
- package/lib/server-auth.js +107 -79
- 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-global-ws.js +10 -20
- 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 +8 -2
- package/lib/server.js +165 -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-permission-mode.js +4 -3
- package/lib/session-skill-scope.js +11 -0
- package/lib/session-visibility.js +5 -2
- package/lib/session-work-primary.js +50 -0
- package/lib/sessions.js +64 -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/user-knowledge-service.js +23 -1
- package/lib/users-auth.js +38 -3
- package/lib/users-contextual-clay-preferences.js +31 -0
- package/lib/users-create.js +97 -0
- package/lib/users-permissions.js +2 -8
- package/lib/users-server-pin.js +37 -0
- package/lib/users.js +18 -84
- package/lib/vendor-login-browser.js +1 -11
- 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 +18 -2
- 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 +54 -50
- package/lib/yoke/adapters/codex-query-contract.js +24 -0
- package/lib/yoke/adapters/codex.js +53 -111
- 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 +271 -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-idle-recovery.js +81 -1
- 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 +79 -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 +14 -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 +81 -1
- package/package.json +11 -4
|
@@ -8,7 +8,7 @@ import { store } from './store.js';
|
|
|
8
8
|
import { getWs } from './ws-ref.js';
|
|
9
9
|
import { iconHtml, refreshIcons } from './icons.js';
|
|
10
10
|
import { confirmMateRemoval } from './mate-management.js';
|
|
11
|
-
import { renderHomeMateAvatarEditor, confirmHomeMateAvatar, failHomeMateAvatar, clearHomeMateAvatarEditor } from './home-mate-avatar-editor.js';
|
|
11
|
+
import { hasHomeMateAvatarDraft, homeMateAvatarSaving, renderHomeMateAvatarEditor, confirmHomeMateAvatar, failHomeMateAvatar, clearHomeMateAvatarEditor } from './home-mate-avatar-editor.js';
|
|
12
12
|
import { resetHomeMateModelPicker, clearHomeMateModelPicker, hasHomeMateModelDraft, requestHomeMateModels, renderHomeMateModelPicker, applyHomeMateModelsState, applyHomeMateModelResult } from './home-mate-model-picker.js';
|
|
13
13
|
|
|
14
14
|
var dialog = null;
|
|
@@ -73,16 +73,19 @@ function renderGeneral(body, mate) {
|
|
|
73
73
|
description.textContent = "Manage " + getMateName(mate) + "’s identity and appearance.";
|
|
74
74
|
body.appendChild(description);
|
|
75
75
|
renderMateProfile(body, mate, renderDialogContent, function () {
|
|
76
|
+
if (homeMateAvatarSaving()) return;
|
|
77
|
+
if (store.get('mateSettingsAvatarOpen') && hasHomeMateAvatarDraft()) {
|
|
78
|
+
showConfirm('Discard this avatar choice?', function () { clearHomeMateAvatarEditor(); store.set({mateSettingsAvatarOpen:false}); renderDialogContent(); document.getElementById('mate-profile-avatar').focus(); }, 'Discard choice');
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
clearHomeMateAvatarEditor();
|
|
76
82
|
store.set({mateSettingsAvatarOpen: !store.get('mateSettingsAvatarOpen')});
|
|
77
83
|
renderDialogContent();
|
|
78
84
|
});
|
|
79
85
|
if (store.get('mateSettingsAvatarOpen')) {
|
|
80
86
|
var appearance = document.createElement("section");
|
|
81
87
|
appearance.className = "mate-settings-appearance";
|
|
82
|
-
renderHomeMateAvatarEditor(appearance, mate, renderDialogContent);
|
|
83
|
-
var done = document.createElement('button'); done.type = 'button'; done.className = 'mate-settings-button'; done.textContent = 'Done';
|
|
84
|
-
done.addEventListener('click',function () { store.set({mateSettingsAvatarOpen:false}); renderDialogContent(); document.getElementById('mate-profile-avatar').focus(); });
|
|
85
|
-
appearance.appendChild(done);
|
|
88
|
+
renderHomeMateAvatarEditor(appearance, mate, renderDialogContent, store.get('mateSettingsAvatarDirect') ? function () { clearHomeMateAvatarEditor(); renderDialogContent(); closeHomeMateSettings(); } : null);
|
|
86
89
|
body.appendChild(appearance);
|
|
87
90
|
}
|
|
88
91
|
renderMateColorPicker(body, mate, renderDialogContent);
|
|
@@ -118,7 +121,7 @@ function requestSection(section) {
|
|
|
118
121
|
function savePending() {
|
|
119
122
|
var prompt = store.get('mateInstructionsDraft');
|
|
120
123
|
var model = store.get('mateModelDraft');
|
|
121
|
-
return mateColorSaving() || mateProfileSaving() || !!((prompt && prompt.status === 'saving') || (model && model.saveId));
|
|
124
|
+
return homeMateAvatarSaving() || mateColorSaving() || mateProfileSaving() || !!((prompt && prompt.status === 'saving') || (model && model.saveId));
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
function renderDialogContent() {
|
|
@@ -199,7 +202,7 @@ function handleDialogKeydown(event) {
|
|
|
199
202
|
|
|
200
203
|
export function closeHomeMateSettings(force) {
|
|
201
204
|
if (force !== true && savePending()) return false;
|
|
202
|
-
if (force !== true && (hasMateProfileDraft() || hasMateInstructionDraft() || hasHomeMateModelDraft())) {
|
|
205
|
+
if (force !== true && (hasHomeMateAvatarDraft() || hasMateProfileDraft() || hasMateInstructionDraft() || hasHomeMateModelDraft())) {
|
|
203
206
|
var previous = document.activeElement;
|
|
204
207
|
showConfirm("Discard unsaved Mate settings?", function () { closeHomeMateSettings(true); }, "Discard changes", false, function () { if (previous && previous.isConnected) previous.focus(); });
|
|
205
208
|
document.getElementById("confirm-cancel").focus();
|
|
@@ -215,7 +218,7 @@ export function closeHomeMateSettings(force) {
|
|
|
215
218
|
memoryState = null;
|
|
216
219
|
knowledgeState = null;
|
|
217
220
|
modelRequested = false;
|
|
218
|
-
store.set({mateSettingsAvatarOpen:false});
|
|
221
|
+
store.set({mateSettingsAvatarOpen:false, mateSettingsAvatarDirect:false});
|
|
219
222
|
resetMateProfile();
|
|
220
223
|
resetMateColor();
|
|
221
224
|
clearHomeMateModelPicker();
|
|
@@ -230,12 +233,13 @@ export function closeHomeMateSettings(force) {
|
|
|
230
233
|
export function openHomeMateSettings(mateId, opener, options) {
|
|
231
234
|
var mate = getMate(mateId);
|
|
232
235
|
if (!mate || (dialog && savePending())) return false;
|
|
233
|
-
if (dialog && (hasMateProfileDraft() || hasMateInstructionDraft() || hasHomeMateModelDraft())) {
|
|
236
|
+
if (dialog && (hasHomeMateAvatarDraft() || hasMateProfileDraft() || hasMateInstructionDraft() || hasHomeMateModelDraft())) {
|
|
234
237
|
showConfirm("Discard unsaved Mate settings?", function () { closeHomeMateSettings(true); openHomeMateSettings(mateId, opener, options); }, "Discard changes", false);
|
|
235
238
|
return false;
|
|
236
239
|
}
|
|
237
240
|
closeHomeMateSettings(true);
|
|
238
241
|
resetMateInstructions(mateId);
|
|
242
|
+
store.set({ mateSettingsAvatarOpen: !!(options && options.avatar && !(mate.profile || {}).avatarLocked), mateSettingsAvatarDirect: !!(options && options.avatar) });
|
|
239
243
|
dialogMateId = mateId;
|
|
240
244
|
dialogOpener = opener || document.activeElement;
|
|
241
245
|
dialogSection = options && ["model", "prompt"].indexOf(options.section) !== -1 ? options.section : "general";
|
|
@@ -308,7 +312,10 @@ export function openHomeMateSettings(mateId, opener, options) {
|
|
|
308
312
|
requestSection(dialogSection);
|
|
309
313
|
loadMateInstructions(renderDialogContent);
|
|
310
314
|
refreshIcons();
|
|
311
|
-
requestAnimationFrame(function () {
|
|
315
|
+
requestAnimationFrame(function () {
|
|
316
|
+
var first = options && options.avatar && dialog ? (dialog.querySelector('.home-mate-avatar-choice[aria-pressed="true"]:not(:disabled)') || dialog.querySelector('.home-mate-avatar-choice:not(:disabled)')) : null;
|
|
317
|
+
(first || close).focus();
|
|
318
|
+
});
|
|
312
319
|
return true;
|
|
313
320
|
}
|
|
314
321
|
|
|
@@ -354,7 +361,7 @@ export function syncHomeMateSettingsTarget(msg) {
|
|
|
354
361
|
var mate = getMate(dialogMateId);
|
|
355
362
|
if (!mate) closeHomeMateSettings();
|
|
356
363
|
else {
|
|
357
|
-
confirmHomeMateAvatar(mate);
|
|
364
|
+
confirmHomeMateAvatar(mate, msg && msg.requestId);
|
|
358
365
|
dialog.querySelector(".home-mate-settings-header span").textContent = getMateName(mate);
|
|
359
366
|
renderDialogContent();
|
|
360
367
|
}
|
|
@@ -364,7 +371,7 @@ export function handleHomeMateAvatarError(msg) {
|
|
|
364
371
|
if (!dialog || !msg) return false;
|
|
365
372
|
var colorHandled = applyMateColorResult(msg);
|
|
366
373
|
var profileHandled = applyMateProfile(msg);
|
|
367
|
-
if (!colorHandled && !profileHandled && !failHomeMateAvatar(msg.mateId, msg.error)) return false;
|
|
374
|
+
if (!colorHandled && !profileHandled && !failHomeMateAvatar(msg.mateId, msg.error, msg.requestId)) return false;
|
|
368
375
|
renderDialogContent();
|
|
369
376
|
return true;
|
|
370
377
|
}
|
|
@@ -81,7 +81,8 @@ export function showIconTooltipHtml(el, html, options) {
|
|
|
81
81
|
export function bindIconTooltip(el, resolveMetadata) {
|
|
82
82
|
function show() {
|
|
83
83
|
var metadata = tooltipMetadata(typeof resolveMetadata === "function" ? resolveMetadata() : resolveMetadata);
|
|
84
|
-
|
|
84
|
+
if (!metadata.text) { hideIconTooltip(); return; }
|
|
85
|
+
showIconTooltip(el, metadata.text, metadata);
|
|
85
86
|
}
|
|
86
87
|
el.addEventListener("mouseenter", show);
|
|
87
88
|
el.addEventListener("focus", show);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { contextualAccessReference } from './contextual-mate-context.js';
|
|
2
|
+
import { contextualScreenReference } from './contextual-clay-session.js';
|
|
1
3
|
import { stopSTT } from './stt-controller.js';
|
|
2
4
|
import { expectCreatedSession } from './session-create.js';
|
|
3
5
|
import { hasRecordedSpeechFor, requestRecordedSend } from './stt-recording.js';
|
|
@@ -6,6 +8,7 @@ import { setRewindMode, isRewindMode } from './rewind.js';
|
|
|
6
8
|
import { renderPicker as renderContextPicker } from './context-sources.js';
|
|
7
9
|
import { checkForMention, showMentionMenu, hideMentionMenu, isMentionMenuVisible, mentionMenuKeydown, setMentionAtIdx, parseMentionFromInput, clearMentionState, stickyReapplyMention, sendMention, sendUserMention, renderMentionUser, renderUserMention, removeMentionChip } from './mention.js';
|
|
8
10
|
import { store } from './store.js';
|
|
11
|
+
import { sessionCallback, paneMessageBinding, samePaneBinding } from './pane-binding.js';
|
|
9
12
|
import { sendAcknowledgedMessage } from './message-delivery.js';
|
|
10
13
|
import { mateAvatarUrl } from './avatar.js';
|
|
11
14
|
import { tuiIsActive, tuiSubmitText } from './session-tui-view.js';
|
|
@@ -120,6 +123,10 @@ function showPreThinkingForTurn() {
|
|
|
120
123
|
|
|
121
124
|
// --- Send ---
|
|
122
125
|
export function sendMessage() {
|
|
126
|
+
if (store.get('deferredSessionSwitch') || store.get('panePendingBinding') || store.get('paneSuspended')) return;
|
|
127
|
+
if (store.get('paneCommittedBinding') && !store.get('paneReady')) return;
|
|
128
|
+
var actionBinding = paneMessageBinding();
|
|
129
|
+
if (store.get('contextualWriterSuspended')) return;
|
|
123
130
|
if (ctx && requestRecordedSend(ctx.inputEl, sendMessage)) return;
|
|
124
131
|
stopSTT();
|
|
125
132
|
// Debate ended mode intercept: route to resume handler
|
|
@@ -343,13 +350,17 @@ export function sendMessage() {
|
|
|
343
350
|
store.set({ pendingScheduleAdmissions: admissions, pendingScheduleAdmission: admissions[scheduleRequestId] });
|
|
344
351
|
ctx.ws.send(JSON.stringify({
|
|
345
352
|
type: "schedule_message", requestId: scheduleRequestId,
|
|
353
|
+
paneBinding: actionBinding || undefined,
|
|
346
354
|
projectSlug: scheduleContext.projectSlug, sessionId: scheduleContext.sessionId, accountId: scheduleContext.accountId,
|
|
347
355
|
text: text || "", images: images, pastes: pastes, resetsAt: resetsAt,
|
|
348
356
|
}));
|
|
349
357
|
return;
|
|
350
358
|
}
|
|
351
359
|
|
|
360
|
+
var screenReference = contextualScreenReference();
|
|
352
361
|
var payload = { type: "message", text: text || "" };
|
|
362
|
+
if (actionBinding) payload.paneBinding = actionBinding;
|
|
363
|
+
if (screenReference) payload.contextualSnapshot = screenReference;
|
|
353
364
|
if (images.length > 0) {
|
|
354
365
|
payload.images = images;
|
|
355
366
|
}
|
|
@@ -359,6 +370,8 @@ export function sendMessage() {
|
|
|
359
370
|
// Include selected vendor for session binding (server uses on first message)
|
|
360
371
|
var _selVendor = store.get("currentVendor") || null;
|
|
361
372
|
if (_selVendor) payload.vendor = _selVendor;
|
|
373
|
+
var contextRef = contextualAccessReference();
|
|
374
|
+
if (contextRef) payload.mateContextRef = contextRef;
|
|
362
375
|
if (!prepareAutonomousPayload(payload)) return;
|
|
363
376
|
ctx.currentMsgTs = Date.now();
|
|
364
377
|
sendAcknowledgedMessage(payload);
|
|
@@ -433,6 +446,7 @@ export function sendTextMessage(text) {
|
|
|
433
446
|
export function sendShellResultToAgent(msg) {
|
|
434
447
|
if (!ctx || !ctx.connected || !msg || msg.error || !msg.command) return false;
|
|
435
448
|
if (String(msg.sessionId) !== String(store.get("activeSessionId"))) return false;
|
|
449
|
+
if (store.get('paneCommittedBinding') && !samePaneBinding(msg.paneActivation, store.get('paneCommittedBinding'))) return false;
|
|
436
450
|
var payload = {
|
|
437
451
|
type: "message",
|
|
438
452
|
text: "$ " + msg.command,
|
|
@@ -440,7 +454,8 @@ export function sendShellResultToAgent(msg) {
|
|
|
440
454
|
};
|
|
441
455
|
var selectedVendor = store.get("currentVendor") || null;
|
|
442
456
|
if (selectedVendor) payload.vendor = selectedVendor;
|
|
443
|
-
|
|
457
|
+
if (msg.paneActivation) payload.paneBinding = msg.paneActivation;
|
|
458
|
+
if (ctx.ws.send(JSON.stringify(payload)) === false) return false;
|
|
444
459
|
commitVendorForTurn();
|
|
445
460
|
showPreThinkingForTurn();
|
|
446
461
|
return true;
|
|
@@ -448,7 +463,9 @@ export function sendShellResultToAgent(msg) {
|
|
|
448
463
|
|
|
449
464
|
export function autoResize() {
|
|
450
465
|
ctx.inputEl.style.height = "auto";
|
|
451
|
-
ctx.inputEl.
|
|
466
|
+
var border = ctx.inputEl.offsetHeight - ctx.inputEl.clientHeight;
|
|
467
|
+
ctx.inputEl.style.height = Math.min(ctx.inputEl.scrollHeight + border, 120) + "px";
|
|
468
|
+
ctx.inputEl.style.overflowY = ctx.inputEl.scrollHeight > ctx.inputEl.clientHeight ? "auto" : "hidden";
|
|
452
469
|
// Defensive: sync send/stop button whenever input size changes
|
|
453
470
|
if (ctx.processing && ctx.setSendBtnMode) {
|
|
454
471
|
ctx.setSendBtnMode(hasSendableContent() ? "send" : "stop");
|
|
@@ -533,6 +550,38 @@ function removePendingImage(idx) {
|
|
|
533
550
|
renderInputPreviews();
|
|
534
551
|
}
|
|
535
552
|
|
|
553
|
+
// Move composer ownership between two authenticated views of the same session.
|
|
554
|
+
export function composerDepartureReason() {
|
|
555
|
+
if (uploadingCount) return 'Wait for attachments to finish uploading before changing views.';
|
|
556
|
+
if (store.get('speechActive') || ctx && hasRecordedSpeechFor(ctx.inputEl)) return 'Finish or discard the voice recording before changing views.';
|
|
557
|
+
var retry = store.get('speechRetry');
|
|
558
|
+
if (retry && ctx && retry.input === ctx.inputEl) return 'Retry or discard the voice recording before changing views.';
|
|
559
|
+
return '';
|
|
560
|
+
}
|
|
561
|
+
export function takeComposerDraft() {
|
|
562
|
+
var reason = composerDepartureReason();
|
|
563
|
+
if (reason) throw new Error(reason);
|
|
564
|
+
if (document.dispatchEvent) document.dispatchEvent(new CustomEvent('clay-composer-handoff'));
|
|
565
|
+
var input = ctx.inputEl;
|
|
566
|
+
var draft = { text: input.value, start: input.selectionStart, end: input.selectionEnd, direction: input.selectionDirection, images: pendingImages, pastes: pendingPastes, files: pendingFiles, delay: scheduleDelayMs };
|
|
567
|
+
input.value = '';
|
|
568
|
+
clearPendingImages();
|
|
569
|
+
clearScheduleDelay();
|
|
570
|
+
autoResize();
|
|
571
|
+
return draft;
|
|
572
|
+
}
|
|
573
|
+
export function restoreComposerDraft(draft) {
|
|
574
|
+
if (!draft) return;
|
|
575
|
+
pendingImages = draft.images || [];
|
|
576
|
+
pendingPastes = draft.pastes || [];
|
|
577
|
+
pendingFiles = draft.files || [];
|
|
578
|
+
ctx.inputEl.value = draft.text || '';
|
|
579
|
+
ctx.inputEl.setSelectionRange(draft.start || 0, draft.end || 0, draft.direction || 'none');
|
|
580
|
+
setScheduleDelayMs(draft.delay || 0);
|
|
581
|
+
renderInputPreviews();
|
|
582
|
+
autoResize();
|
|
583
|
+
}
|
|
584
|
+
|
|
536
585
|
export function clearPendingImages() {
|
|
537
586
|
pendingImages = [];
|
|
538
587
|
pendingPastes = [];
|
|
@@ -552,14 +601,14 @@ function pastePreview(text) {
|
|
|
552
601
|
}
|
|
553
602
|
|
|
554
603
|
function editPendingPaste(idx) {
|
|
555
|
-
showPasteModal(pendingPastes[idx].text, function (text) {
|
|
604
|
+
showPasteModal(pendingPastes[idx].text, sessionCallback(function (text) {
|
|
556
605
|
if (!text) {
|
|
557
606
|
removePendingPaste(idx);
|
|
558
607
|
return;
|
|
559
608
|
}
|
|
560
609
|
pendingPastes[idx] = { text: text, preview: pastePreview(text) };
|
|
561
610
|
renderInputPreviews();
|
|
562
|
-
});
|
|
611
|
+
}));
|
|
563
612
|
}
|
|
564
613
|
|
|
565
614
|
function removePendingFile(idx) {
|
|
@@ -693,6 +742,7 @@ function uploadFile(file) {
|
|
|
693
742
|
return;
|
|
694
743
|
}
|
|
695
744
|
uploadingCount++;
|
|
745
|
+
store.set({ composerUploadingCount: uploadingCount });
|
|
696
746
|
renderInputPreviews();
|
|
697
747
|
var reader = new FileReader();
|
|
698
748
|
reader.onload = function (ev) {
|
|
@@ -705,12 +755,14 @@ function uploadFile(file) {
|
|
|
705
755
|
xhr.setRequestHeader("Content-Type", "application/json");
|
|
706
756
|
xhr.onload = function () {
|
|
707
757
|
uploadingCount--;
|
|
758
|
+
store.set({ composerUploadingCount: uploadingCount });
|
|
708
759
|
if (xhr.status === 200) {
|
|
709
760
|
try {
|
|
710
761
|
var resp = JSON.parse(xhr.responseText);
|
|
711
762
|
pendingFiles.push({ name: resp.name || uploadName, path: resp.path });
|
|
712
|
-
} catch (e) {}
|
|
763
|
+
} catch (e) { showToast('Upload response could not be read: ' + uploadName + '. Your draft is preserved.', 'error'); }
|
|
713
764
|
} else {
|
|
765
|
+
showToast('Upload failed: ' + uploadName + '. Your draft is preserved.', 'error');
|
|
714
766
|
if (ctx.addSystemMessage) ctx.addSystemMessage("Upload failed: " + uploadName, true);
|
|
715
767
|
}
|
|
716
768
|
renderInputPreviews();
|
|
@@ -720,6 +772,8 @@ function uploadFile(file) {
|
|
|
720
772
|
};
|
|
721
773
|
xhr.onerror = function () {
|
|
722
774
|
uploadingCount--;
|
|
775
|
+
store.set({ composerUploadingCount: uploadingCount });
|
|
776
|
+
showToast('Upload failed: ' + uploadName + '. Your draft is preserved.', 'error');
|
|
723
777
|
if (ctx.addSystemMessage) ctx.addSystemMessage("Upload failed: " + uploadName, true);
|
|
724
778
|
renderInputPreviews();
|
|
725
779
|
if (ctx.processing && ctx.setSendBtnMode) {
|
|
@@ -728,6 +782,7 @@ function uploadFile(file) {
|
|
|
728
782
|
};
|
|
729
783
|
xhr.send(JSON.stringify({ name: uploadName, data: b64 }));
|
|
730
784
|
};
|
|
785
|
+
reader.onerror = function () { uploadingCount--; store.set({ composerUploadingCount: uploadingCount }); renderInputPreviews(); showToast('Attachment could not be read. Your draft is preserved.', 'error'); };
|
|
731
786
|
reader.readAsDataURL(file);
|
|
732
787
|
}
|
|
733
788
|
|
|
@@ -739,7 +794,14 @@ function readImageBlob(blob) {
|
|
|
739
794
|
uploadFile(blob);
|
|
740
795
|
return;
|
|
741
796
|
}
|
|
797
|
+
uploadingCount++; store.set({ composerUploadingCount: uploadingCount });
|
|
798
|
+
var completed = false;
|
|
799
|
+
function finish() {
|
|
800
|
+
if (completed) return; completed = true; uploadingCount--;
|
|
801
|
+
store.set({ composerUploadingCount: uploadingCount }); renderInputPreviews();
|
|
802
|
+
}
|
|
742
803
|
var reader = new FileReader();
|
|
804
|
+
reader.onerror = function () { finish(); showToast('Image could not be read. Your draft is preserved.', 'error'); };
|
|
743
805
|
reader.onload = function (ev) {
|
|
744
806
|
var dataUrl = ev.target.result;
|
|
745
807
|
// Check base64 payload size (~3/4 of base64 length)
|
|
@@ -748,7 +810,7 @@ function readImageBlob(blob) {
|
|
|
748
810
|
var estimatedBytes = b64.length * 0.75;
|
|
749
811
|
|
|
750
812
|
if (estimatedBytes <= MAX_IMAGE_BYTES) {
|
|
751
|
-
addPendingImage(dataUrl);
|
|
813
|
+
addPendingImage(dataUrl); finish();
|
|
752
814
|
return;
|
|
753
815
|
}
|
|
754
816
|
|
|
@@ -766,8 +828,9 @@ function readImageBlob(blob) {
|
|
|
766
828
|
var cx = canvas.getContext("2d");
|
|
767
829
|
cx.drawImage(img, 0, 0, nw, nh);
|
|
768
830
|
var resized = canvas.toDataURL("image/jpeg", RESIZE_QUALITY);
|
|
769
|
-
addPendingImage(resized);
|
|
831
|
+
addPendingImage(resized); finish();
|
|
770
832
|
};
|
|
833
|
+
img.onerror = function () { finish(); showToast('Image could not be loaded. Your draft is preserved.', 'error'); };
|
|
771
834
|
img.src = dataUrl;
|
|
772
835
|
};
|
|
773
836
|
reader.readAsDataURL(blob);
|
|
@@ -836,10 +899,13 @@ function sendInputSync() {
|
|
|
836
899
|
if (dk) ctx.ws.send(JSON.stringify({ type: "dm_typing", dmKey: dk, typing: hasText }));
|
|
837
900
|
return;
|
|
838
901
|
}
|
|
839
|
-
|
|
902
|
+
var speech = store.get('speechActive');
|
|
903
|
+
ctx.ws.send(JSON.stringify({ type: "input_sync", text: ctx.inputEl.value,
|
|
904
|
+
paneBinding: speech && speech.writing ? speech.paneBinding || undefined : undefined }));
|
|
840
905
|
}
|
|
841
906
|
|
|
842
907
|
export function handleInputSync(text) {
|
|
908
|
+
if (store.get('contextualWriterSuspended')) return;
|
|
843
909
|
isRemoteInput = true;
|
|
844
910
|
ctx.inputEl.value = text;
|
|
845
911
|
autoResize();
|
|
@@ -859,7 +925,7 @@ function createFileInput(accept, capture, multiple) {
|
|
|
859
925
|
input.style.display = "none";
|
|
860
926
|
document.body.appendChild(input);
|
|
861
927
|
|
|
862
|
-
|
|
928
|
+
var selectFiles = sessionCallback(function () {
|
|
863
929
|
if (input.files) {
|
|
864
930
|
for (var i = 0; i < input.files.length; i++) {
|
|
865
931
|
if (input.files[i].type.indexOf("image/") === 0) {
|
|
@@ -869,6 +935,9 @@ function createFileInput(accept, capture, multiple) {
|
|
|
869
935
|
}
|
|
870
936
|
}
|
|
871
937
|
}
|
|
938
|
+
});
|
|
939
|
+
input.addEventListener("change", function () {
|
|
940
|
+
selectFiles();
|
|
872
941
|
document.body.removeChild(input);
|
|
873
942
|
});
|
|
874
943
|
|
|
@@ -957,6 +1026,14 @@ export function initInput(_ctx) {
|
|
|
957
1026
|
}
|
|
958
1027
|
}
|
|
959
1028
|
|
|
1029
|
+
document.addEventListener('clay-composer-handoff', function () {
|
|
1030
|
+
if (scheduleInlineInput) {
|
|
1031
|
+
var minutes = parseInt(scheduleInlineInput.value, 10);
|
|
1032
|
+
if (minutes >= 1 && minutes <= 1440) setScheduleDelayMs(minutes * 60000);
|
|
1033
|
+
}
|
|
1034
|
+
collapseScheduleBtn();
|
|
1035
|
+
});
|
|
1036
|
+
|
|
960
1037
|
function setScheduleDelay(ms) {
|
|
961
1038
|
scheduleDelayMs = ms;
|
|
962
1039
|
if (!scheduleBtn) return;
|
|
@@ -986,7 +1063,7 @@ export function initInput(_ctx) {
|
|
|
986
1063
|
scheduleInlineInput.className = "schedule-inline-input";
|
|
987
1064
|
scheduleBtn.appendChild(scheduleInlineInput);
|
|
988
1065
|
|
|
989
|
-
setTimeout(function () { scheduleInlineInput.focus(); }, 0);
|
|
1066
|
+
setTimeout(sessionCallback(function () { if (scheduleInlineInput) scheduleInlineInput.focus(); }), 0);
|
|
990
1067
|
|
|
991
1068
|
scheduleInlineInput.addEventListener("click", function (e) { e.stopPropagation(); });
|
|
992
1069
|
scheduleInlineInput.addEventListener("keydown", function (e) {
|
|
@@ -1005,6 +1082,7 @@ export function initInput(_ctx) {
|
|
|
1005
1082
|
|
|
1006
1083
|
// Close on outside click
|
|
1007
1084
|
setTimeout(function () {
|
|
1085
|
+
if (!scheduleInlineInput) return;
|
|
1008
1086
|
scheduleOutsideHandler = function (ev) {
|
|
1009
1087
|
if (!scheduleBtn.contains(ev.target)) {
|
|
1010
1088
|
if (scheduleInlineInput) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { store } from './store.js';
|
|
1
2
|
import { githubWorkMarkup } from './session-github.js';
|
|
2
3
|
import { issueGithubAction } from './issues-github.js';
|
|
3
4
|
import { escapeHtml } from './utils.js';
|
|
@@ -18,7 +19,7 @@ export function renderIssueList(result) {
|
|
|
18
19
|
var meta = [authorLine(entry), relativeTime(entry.updatedAt || entry.createdAt)];
|
|
19
20
|
if (entry.revision > 1) meta.push('v' + entry.revision);
|
|
20
21
|
if (entry.commentCount) meta.push(entry.commentCount + (entry.commentCount === 1 ? ' comment' : ' comments'));
|
|
21
|
-
return '<button type="button" class="issue-row" data-open-issue="' + esc(entry.ref) + '">' +
|
|
22
|
+
return '<button type="button" class="issue-row" data-control-runtime="' + esc(store.get("controlRuntimeId")) + '" data-control-revision="' + esc(entry.revision) + '" data-open-issue="' + esc(entry.ref) + '">' +
|
|
22
23
|
'<div class="issue-row-head"><span class="issue-type">' + esc(entry.type) + '</span>' + priorityChip(entry.priority) + '<strong>' + esc(entry.title) + '</strong></div>' +
|
|
23
24
|
(entry.summary ? '<p>' + esc(entry.summary) + '</p>' : '') +
|
|
24
25
|
'<div class="issue-row-meta">' + statusChip(entry.status) + '<span>' + esc(meta.filter(Boolean).join(' · ')) + '</span></div></button>';
|
|
@@ -35,7 +36,7 @@ export function renderIssueDetail(entry) {
|
|
|
35
36
|
var closed = entry.status === 'resolved' || entry.status === 'closed';
|
|
36
37
|
var time = entry.updatedAt || entry.createdAt;
|
|
37
38
|
var byline = [authorLine(entry), time ? new Date(time).toLocaleString() : '', 'v' + entry.revision].filter(Boolean).join(' · ');
|
|
38
|
-
return '<article class="issue-detail"><div class="issue-doc-chips"><span class="issue-type">' + esc(entry.type) + '</span>' + priorityChip(entry.priority) + statusChip(entry.status) + '</div>' +
|
|
39
|
+
return '<article class="issue-detail" data-control-ref="' + esc(entry.ref) + '" data-control-runtime="' + esc(store.get("controlRuntimeId")) + '" data-control-revision="' + esc(entry.revision) + '"><div class="issue-doc-chips"><span class="issue-type">' + esc(entry.type) + '</span>' + priorityChip(entry.priority) + statusChip(entry.status) + '</div>' +
|
|
39
40
|
githubWorkMarkup(entry, true) +
|
|
40
41
|
'<h2 class="issue-doc-title">' + esc(entry.title) + '</h2>' + prose(entry.summary, 'issue-doc-summary') + '<div class="issue-byline">' + esc(byline) + '</div>' +
|
|
41
42
|
'<div class="issue-actions">' + action('data-issue-work', 'play', 'Start work', ' class="issue-primary"' + (closed ? ' disabled title="Reopen this issue to start work"' : '')) +
|
|
@@ -125,7 +125,7 @@ export function handleKnowledgeDbClick(event, panel) {
|
|
|
125
125
|
if (event.target.closest('[data-db-create-submit]')) { submitCreate(panel); return true; }
|
|
126
126
|
if (event.target.closest('[data-db-create-cancel]')) { patchState(workspaceKey(), { createDraft: null }); patchMain(workspaceKey(), { fullscreen: false }); if (renderOwner) renderOwner({ forceDocument: true }); return true; }
|
|
127
127
|
var reference = event.target.closest('[data-db-reference]'); if (reference) { var referenceKey = workspaceKey(); if (reference.dataset.dbReferenceType === 'text') { if (openOwnerDocument) openOwnerDocument('local:' + reference.dataset.dbReference); } else { var databaseIdentity = identityOwner ? identityOwner({ id: reference.dataset.dbReferenceDatabase, itemType: 'db', common: false }) : 'local:' + reference.dataset.dbReferenceDatabase; if (openOwnerDocument) openOwnerDocument(databaseIdentity); openRecord(reference.dataset.dbReferenceDatabase, reference.dataset.dbReference, referenceKey); } return true; }
|
|
128
|
-
var row = event.target.closest('[data-db-record]'); if (row) { openRecord(row.dataset.dbDatabase, row.dataset.dbRecord); return true; }
|
|
128
|
+
var row = event.target.closest('tr[data-db-record]'); if (row) { openRecord(row.dataset.dbDatabase, row.dataset.dbRecord); return true; }
|
|
129
129
|
var edit = event.target.closest('[data-db-edit-record]'); if (edit) { beginRecordEdit(edit.dataset.dbEditRecord, false); return true; }
|
|
130
130
|
var add = event.target.closest('[data-db-add-record]'); if (add) { beginRecordEdit(add.dataset.dbAddRecord, true); return true; }
|
|
131
131
|
var save = event.target.closest('[data-db-save-record]'); if (save) { submitRecord(panel, save.dataset.dbSaveRecord); return true; }
|
|
@@ -155,7 +155,7 @@ export function handleKnowledgeDbClick(event, panel) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
export function handleKnowledgeDbKeydown(event, panel) {
|
|
158
|
-
var keyboardRow = event.target.closest && event.target.closest('[data-db-record]'); if (keyboardRow && (event.key === 'Enter' || event.key === ' ')) { event.preventDefault(); openRecord(keyboardRow.dataset.dbDatabase, keyboardRow.dataset.dbRecord); return true; }
|
|
158
|
+
var keyboardRow = event.target.closest && event.target.closest('tr[data-db-record]'); if (keyboardRow && (event.key === 'Enter' || event.key === ' ')) { event.preventDefault(); openRecord(keyboardRow.dataset.dbDatabase, keyboardRow.dataset.dbRecord); return true; }
|
|
159
159
|
var dialog = panel && panel.querySelector('.knowledge-db-dialog'); if (!dialog) return false;
|
|
160
160
|
if (event.key === 'Escape') { event.preventDefault(); closeArchiveDialog(panel); return true; }
|
|
161
161
|
if (event.key !== 'Tab') return false; var controls = dialog.querySelectorAll('button:not(:disabled)'); if (!controls.length) return false; var first = controls[0]; var last = controls[controls.length - 1];
|
|
@@ -175,10 +175,10 @@ function renderDatabaseRecovery(body, toolbar, draft) { toolbar.innerHTML = '<sp
|
|
|
175
175
|
function renderTable(body, dbState) {
|
|
176
176
|
var database = dbState.database; var view = database.views.filter(function (item) { return item.id === dbState.selectedViewId; })[0] || database.views[0] || { columns: database.schema.filter(function (field) { return !field.archived; }).map(function (field) { return field.id; }) }; var fields = view.columns.map(function (id) { return fieldById(database, id); }).filter(Boolean);
|
|
177
177
|
var html = '<div class="knowledge-db-table-wrap"><table class="knowledge-db-table"><thead><tr>' + fields.map(function (field) { return '<th scope="col">' + escapeText(field.name) + '</th>'; }).join('') + '</tr></thead><tbody>';
|
|
178
|
-
html += dbState.records.map(function (record) { return '<tr tabindex="0" data-db-record="' + escapeText(record.id) + '" data-db-database="' + escapeText(database.id) + '">' + fields.map(function (field) { return '<td>' + displayValue(field, record.values[field.id], record.references) + '</td>'; }).join('') + '</tr>'; }).join('');
|
|
178
|
+
html += dbState.records.map(function (record) { return '<tr data-control-runtime="' + escapeText(store.get('controlRuntimeId')) + '" data-control-revision="' + escapeText(record.revision) + '" tabindex="0" data-db-record="' + escapeText(record.id) + '" data-db-database="' + escapeText(database.id) + '">' + fields.map(function (field) { return '<td>' + displayValue(field, record.values[field.id], record.references) + '</td>'; }).join('') + '</tr>'; }).join('');
|
|
179
179
|
html += '</tbody></table>' + (!dbState.records.length && !dbState.loading ? '<p class="knowledge-empty">No records in this view.</p>' : '') + (dbState.nextCursor ? '<button type="button" class="knowledge-search-more" data-db-more="' + escapeText(database.id) + '">Load more</button>' : '') + '</div>'; body.innerHTML = html;
|
|
180
180
|
}
|
|
181
|
-
function renderRecord(body, dbState) { var detail = selectedRecordState(workspaceKey(), dbState.database.id); if (!detail) { body.innerHTML = '<p class="knowledge-empty">Loading record…</p>'; return; } var history = (detail.history || []).map(function (entry) { return '<li><b>' + escapeText(entry.action || 'update') + '</b><span>Revision ' + escapeText(entry.revision) + ' · ' + new Date(entry.at).toLocaleString() + '</span></li>'; }).join(''); body.innerHTML = '<article class="knowledge-db-record"><button type="button" data-db-record-back="' + escapeText(dbState.database.id) + '">' + iconHtml('arrow-left') + 'Table</button><h2>' + escapeText(detail.title) + '</h2><dl>' + dbState.database.schema.filter(function (field) { return !field.archived; }).map(function (field) { return '<dt>' + escapeText(field.name) + '</dt><dd>' + displayValue(field, detail.record.values[field.id], detail.record.references) + '</dd>'; }).join('') + '</dl><p class="knowledge-db-attribution">Revision ' + detail.record.revision + ' · updated ' + new Date(detail.record.updatedAt).toLocaleString() + '</p>' + (history ? '<h3>Recent history</h3><ol class="knowledge-db-history">' + history + '</ol>' : '') + '</article>'; }
|
|
181
|
+
function renderRecord(body, dbState) { var detail = selectedRecordState(workspaceKey(), dbState.database.id); if (!detail) { body.innerHTML = '<p class="knowledge-empty">Loading record…</p>'; return; } var history = (detail.history || []).map(function (entry) { return '<li><b>' + escapeText(entry.action || 'update') + '</b><span>Revision ' + escapeText(entry.revision) + ' · ' + new Date(entry.at).toLocaleString() + '</span></li>'; }).join(''); body.innerHTML = '<article class="knowledge-db-record" data-control-runtime="' + escapeText(store.get('controlRuntimeId')) + '" data-control-revision="' + escapeText(detail.record.revision) + '" data-db-record="' + escapeText(detail.record.id) + '" data-db-database="' + escapeText(dbState.database.id) + '"><button type="button" data-db-record-back="' + escapeText(dbState.database.id) + '">' + iconHtml('arrow-left') + 'Table</button><h2>' + escapeText(detail.title) + '</h2><dl>' + dbState.database.schema.filter(function (field) { return !field.archived; }).map(function (field) { return '<dt>' + escapeText(field.name) + '</dt><dd>' + displayValue(field, detail.record.values[field.id], detail.record.references) + '</dd>'; }).join('') + '</dl><p class="knowledge-db-attribution">Revision ' + detail.record.revision + ' · updated ' + new Date(detail.record.updatedAt).toLocaleString() + '</p>' + (history ? '<h3>Recent history</h3><ol class="knowledge-db-history">' + history + '</ol>' : '') + '</article>'; }
|
|
182
182
|
function renderRecordForm(body, toolbar, dbState) { var edit = dbState.edit; var values = edit.values || {}; toolbar.innerHTML = '<span class="knowledge-preview-name">' + (edit.creating ? 'New record' : 'Edit record') + '</span>' + (!edit.creating ? '<button type="button" class="danger" data-db-archive-record="' + escapeText(dbState.database.id) + '">Archive</button>' : '') + '<button type="button" data-db-cancel-edit>Cancel</button><button type="button" class="primary" data-db-save-record="' + escapeText(dbState.database.id) + '">' + (edit.saving ? 'Retry save' : 'Save') + '</button>'; body.innerHTML = '<form class="knowledge-db-form" onsubmit="return false"><h2>' + (edit.creating ? 'New record' : 'Edit record') + '</h2>' + dbState.database.schema.filter(function (field) { return !field.archived; }).map(function (field) { return '<label>' + escapeText(field.name) + fieldInput(field, values[field.id]) + '</label>'; }).join('') + (edit.error ? '<p class="knowledge-inline-error">' + escapeText(edit.error) + '</p>' : '') + '</form>'; }
|
|
183
183
|
function renderSettings(body, toolbar, dbState) { var edit = dbState.edit; toolbar.innerHTML = '<span class="knowledge-preview-name">Database settings</span><button type="button" data-db-cancel-edit>Cancel</button><button type="button" class="primary" data-db-save-settings="' + escapeText(dbState.database.id) + '">' + (edit.saving ? 'Retry rename' : 'Save name') + '</button>'; body.innerHTML = '<form class="knowledge-db-form" onsubmit="return false"><h2>Database settings</h2><label>Name<input data-db-settings-name value="' + escapeText(edit.name) + '" maxlength="120"></label>' + (edit.error ? '<p class="knowledge-inline-error">' + escapeText(edit.error) + '</p>' : '') + '<section class="knowledge-danger-zone"><h3>Archive database</h3><p>Records, schema, views, and history remain recoverable.</p><button type="button" class="danger" data-db-archive-database="' + escapeText(dbState.database.id) + '">Archive database</button></section></form>'; }
|
|
184
184
|
function renderRecover(body, toolbar, dbState) { var edit = dbState.edit; toolbar.innerHTML = '<span class="knowledge-preview-name">Recover record</span><button type="button" data-db-cancel-edit>Cancel</button><button type="button" class="primary" data-db-confirm-recover-record="' + escapeText(dbState.database.id) + '">' + (edit.saving ? 'Retry recovery' : 'Recover') + '</button>'; body.innerHTML = '<div class="knowledge-db-form"><h2>Recover archived record?</h2><p>This restores the exact record at revision ' + escapeText(edit.baseVersion) + '.</p>' + (edit.error ? '<p class="knowledge-inline-error">' + escapeText(edit.error) + '</p>' : '') + '</div>'; }
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { enhanceSessionCitations } from './clay-session-links.js';
|
|
2
|
+
import { renderBrowserLink, enhanceBrowserLinks } from './clay-browser-links.js';
|
|
1
3
|
import { renderWireframeBlocks } from './wireframe-chat.js';
|
|
2
4
|
import { copyToClipboard, escapeHtml } from './utils.js';
|
|
3
5
|
import { refreshIcons } from './icons.js';
|
|
@@ -14,6 +16,8 @@ marked.use({ gfm: true, breaks: false });
|
|
|
14
16
|
marked.use({
|
|
15
17
|
renderer: {
|
|
16
18
|
link({ href, title, tokens, text }) {
|
|
19
|
+
var browserLink = renderBrowserLink(href, title, text);
|
|
20
|
+
if (browserLink) return browserLink;
|
|
17
21
|
var recordLink = renderClayRecordLink(href, text);
|
|
18
22
|
if (recordLink) return recordLink;
|
|
19
23
|
var localLink = renderLocalFileLink(href, title, text);
|
|
@@ -67,42 +71,10 @@ export function renderMarkdown(text) {
|
|
|
67
71
|
|
|
68
72
|
export function enhanceClaySessionLinks(root) {
|
|
69
73
|
if (!root || typeof document === "undefined") return;
|
|
70
|
-
|
|
71
|
-
var nodes = [];
|
|
72
|
-
var node;
|
|
73
|
-
while ((node = walker.nextNode())) {
|
|
74
|
-
if (!node.parentElement || node.parentElement.closest("code, pre, a, button")) continue;
|
|
75
|
-
if (/\[clayos\/session:[A-Za-z0-9_-]{24}(?:\s+[\u2014-]\s+[^\]\n]{1,80})?\]/.test(node.nodeValue || "")) nodes.push(node);
|
|
76
|
-
}
|
|
77
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
78
|
-
var text = nodes[i].nodeValue || "";
|
|
79
|
-
var pattern = /\[clayos\/(session:[A-Za-z0-9_-]{24})(?:\s+[\u2014-]\s+([^\]\n]{1,80}))?\]/g;
|
|
80
|
-
var fragment = document.createDocumentFragment();
|
|
81
|
-
var offset = 0;
|
|
82
|
-
var match;
|
|
83
|
-
while ((match = pattern.exec(text))) {
|
|
84
|
-
fragment.appendChild(document.createTextNode(text.slice(offset, match.index)));
|
|
85
|
-
var button = document.createElement("button");
|
|
86
|
-
button.type = "button";
|
|
87
|
-
button.className = "clayos-session-link";
|
|
88
|
-
button.dataset.sessionRef = match[1];
|
|
89
|
-
button.setAttribute("aria-label", "Open session" + (match[2] ? " from " + match[2].trim() : ""));
|
|
90
|
-
var label = document.createElement("span");
|
|
91
|
-
label.textContent = "Session";
|
|
92
|
-
button.appendChild(label);
|
|
93
|
-
if (match[2]) {
|
|
94
|
-
var meta = document.createElement("small");
|
|
95
|
-
meta.textContent = match[2].trim();
|
|
96
|
-
button.appendChild(meta);
|
|
97
|
-
}
|
|
98
|
-
fragment.appendChild(button);
|
|
99
|
-
offset = pattern.lastIndex;
|
|
100
|
-
}
|
|
101
|
-
fragment.appendChild(document.createTextNode(text.slice(offset)));
|
|
102
|
-
nodes[i].parentNode.replaceChild(fragment, nodes[i]);
|
|
103
|
-
}
|
|
74
|
+
enhanceSessionCitations(root);
|
|
104
75
|
enhanceClayLogLinks(root);
|
|
105
76
|
enhanceClayFileLinks(root);
|
|
77
|
+
enhanceBrowserLinks(root);
|
|
106
78
|
}
|
|
107
79
|
|
|
108
80
|
/**
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// Shared appearance names; stable IDs remain internal catalog identities.
|
|
2
|
+
export var MATE_AVATAR_COLLECTIONS = [{"id":"B","name":"Oddballs","avatars":[{"id":"B01","name":"Indigo Cyclops"},
|
|
3
|
+
{"id":"B02","name":"Coral Sentinel"},
|
|
4
|
+
{"id":"B03","name":"Golden Visor"},
|
|
5
|
+
{"id":"B04","name":"Mint Wide Eyes"},
|
|
6
|
+
{"id":"B05","name":"Ivory Grin"},
|
|
7
|
+
{"id":"B06","name":"Blue Teardrop"},
|
|
8
|
+
{"id":"B07","name":"Peach Orbit"},
|
|
9
|
+
{"id":"B08","name":"Lilac Sleeper"},
|
|
10
|
+
{"id":"B09","name":"Coral Prism"},
|
|
11
|
+
{"id":"B10","name":"Mint Spring"},
|
|
12
|
+
{"id":"B11","name":"Golden Pebbles"},
|
|
13
|
+
{"id":"B12","name":"Periwinkle Orbit"},
|
|
14
|
+
{"id":"B13","name":"Coral Horizon"},
|
|
15
|
+
{"id":"B14","name":"Indigo Stack"},
|
|
16
|
+
{"id":"B15","name":"Mint Button Box"},
|
|
17
|
+
{"id":"B16","name":"Golden Curve"},
|
|
18
|
+
{"id":"B17","name":"Loop Listener"},
|
|
19
|
+
{"id":"B18","name":"Blue Twin Antenna"},
|
|
20
|
+
{"id":"B19","name":"Lilac Daydream"},
|
|
21
|
+
{"id":"B20","name":"Coral Toothsome"},
|
|
22
|
+
{"id":"B21","name":"Ivory Satellite"},
|
|
23
|
+
{"id":"B22","name":"Mint Coil"},
|
|
24
|
+
{"id":"B23","name":"Golden Wonder"},
|
|
25
|
+
{"id":"B24","name":"Slate Smile"},
|
|
26
|
+
{"id":"B25","name":"Lilac Shield"},
|
|
27
|
+
{"id":"B26","name":"Mint Diamond"},
|
|
28
|
+
{"id":"B27","name":"Coral Pebble"},
|
|
29
|
+
{"id":"B28","name":"Golden Horns"},
|
|
30
|
+
{"id":"B29","name":"Blue Trio"},
|
|
31
|
+
{"id":"B30","name":"Ivory Tower"},
|
|
32
|
+
{"id":"B31","name":"Charcoal Grin"},
|
|
33
|
+
{"id":"B32","name":"Teal Cheer"},
|
|
34
|
+
{"id":"B33","name":"Rose Satellite"},
|
|
35
|
+
{"id":"B34","name":"Blue Spool"},
|
|
36
|
+
{"id":"B35","name":"Golden Band"},
|
|
37
|
+
{"id":"B36","name":"Mint Beacon"},
|
|
38
|
+
{"id":"B37","name":"Charcoal Crescent"},
|
|
39
|
+
{"id":"B38","name":"Coral Cyclops"},
|
|
40
|
+
{"id":"B39","name":"Blue Scout"},
|
|
41
|
+
{"id":"B40","name":"Ivory Navigator"},
|
|
42
|
+
{"id":"B41","name":"Golden Porthole"},
|
|
43
|
+
{"id":"B42","name":"Lilac Windup"},
|
|
44
|
+
{"id":"B43","name":"Mint Receiver"},
|
|
45
|
+
{"id":"B44","name":"Coral Stack"},
|
|
46
|
+
{"id":"B45","name":"Indigo Porthole"},
|
|
47
|
+
{"id":"B46","name":"Stone Sprout"},
|
|
48
|
+
{"id":"B47","name":"Mint Sunbeam"},
|
|
49
|
+
{"id":"B48","name":"Golden Cubby"}]},
|
|
50
|
+
{"id":"C","name":"Kindred Bots","avatars":[{"id":"C01","name":"Violet Smile"},
|
|
51
|
+
{"id":"C02","name":"Apricot Joy"},
|
|
52
|
+
{"id":"C03","name":"Sage Curious"},
|
|
53
|
+
{"id":"C04","name":"Golden Wink"},
|
|
54
|
+
{"id":"C05","name":"Blue Sideglance"},
|
|
55
|
+
{"id":"C06","name":"Charcoal Wonder"},
|
|
56
|
+
{"id":"C07","name":"Lilac Specs"},
|
|
57
|
+
{"id":"C08","name":"Coral Giggle"},
|
|
58
|
+
{"id":"C09","name":"Mint Blush"},
|
|
59
|
+
{"id":"C10","name":"Golden Button"},
|
|
60
|
+
{"id":"C11","name":"Sky Smile"},
|
|
61
|
+
{"id":"C12","name":"Plum Joy"},
|
|
62
|
+
{"id":"C13","name":"Teal Diamond"},
|
|
63
|
+
{"id":"C14","name":"Peach Dimple"},
|
|
64
|
+
{"id":"C15","name":"Indigo Delight"},
|
|
65
|
+
{"id":"C16","name":"Sage Sprout"},
|
|
66
|
+
{"id":"C17","name":"Golden Specs"},
|
|
67
|
+
{"id":"C18","name":"Lilac Stargaze"},
|
|
68
|
+
{"id":"C19","name":"Blue Curiosity"},
|
|
69
|
+
{"id":"C20","name":"Coral Heart"},
|
|
70
|
+
{"id":"C21","name":"Mint Bud"},
|
|
71
|
+
{"id":"C22","name":"Ivory Surprise"},
|
|
72
|
+
{"id":"C23","name":"Rose Wink"},
|
|
73
|
+
{"id":"C24","name":"Sky Giggle"},
|
|
74
|
+
{"id":"C25","name":"Ivory Dreamer"},
|
|
75
|
+
{"id":"C26","name":"Mint Loop"},
|
|
76
|
+
{"id":"C27","name":"Violet Glasses"},
|
|
77
|
+
{"id":"C28","name":"Coral Sunshine"},
|
|
78
|
+
{"id":"C29","name":"Slate Sideglance"},
|
|
79
|
+
{"id":"C30","name":"Golden Dimple"},
|
|
80
|
+
{"id":"C31","name":"Teal Listener"},
|
|
81
|
+
{"id":"C32","name":"Peach Cheer"},
|
|
82
|
+
{"id":"C33","name":"Indigo Blush"},
|
|
83
|
+
{"id":"C34","name":"Sage Daydream"},
|
|
84
|
+
{"id":"C35","name":"Rose Wonder"},
|
|
85
|
+
{"id":"C36","name":"Sky Blush"},
|
|
86
|
+
{"id":"C37","name":"Peach Heart"},
|
|
87
|
+
{"id":"C38","name":"Blue Button"},
|
|
88
|
+
{"id":"C39","name":"Lilac Wink"},
|
|
89
|
+
{"id":"C40","name":"Mint Dish"},
|
|
90
|
+
{"id":"C41","name":"Ivory Wonder"},
|
|
91
|
+
{"id":"C42","name":"Violet Cheer"},
|
|
92
|
+
{"id":"C43","name":"Rose Specs"},
|
|
93
|
+
{"id":"C44","name":"Teal Delight"},
|
|
94
|
+
{"id":"C45","name":"Golden Diamond"},
|
|
95
|
+
{"id":"C46","name":"Lilac Surprise"},
|
|
96
|
+
{"id":"C47","name":"Sage Listener"},
|
|
97
|
+
{"id":"C48","name":"Coral Crown"}]}];
|
|
@@ -350,7 +350,7 @@ function renderExplorer() {
|
|
|
350
350
|
files.forEach(function (file) {
|
|
351
351
|
var parts = file.name.split('/'); var folder = parts.length > 1 ? parts.slice(0, -1).join('/') : '';
|
|
352
352
|
if (!state.query.trim() && folder !== lastFolder) { var folderRow = document.createElement('div'); folderRow.className = 'knowledge-folder-row'; folderRow.innerHTML = iconHtml('folder') + '<span>' + escapeText(folder || 'Top level') + '</span>'; list.appendChild(folderRow); lastFolder = folder; }
|
|
353
|
-
var id = documentIdentity(file); var button = document.createElement('button'); button.type = 'button'; button.className = 'knowledge-file-row'; button.dataset.openDocument = id; button.style.setProperty('--knowledge-depth', String(Math.min(parts.length - 1, 6))); if (id === state.selected) button.setAttribute('aria-current', 'true');
|
|
353
|
+
var id = documentIdentity(file); var button = document.createElement('button'); button.type = 'button'; button.className = 'knowledge-file-row'; button.dataset.openDocument = id; button.dataset.controlRevision = String(file.revision || ''); button.dataset.controlRuntime = store.get('controlRuntimeId') || ''; button.style.setProperty('--knowledge-depth', String(Math.min(parts.length - 1, 6))); if (id === state.selected) button.setAttribute('aria-current', 'true');
|
|
354
354
|
button.innerHTML = iconHtml(file.itemType === 'db' || file.name.endsWith('.jsonl') ? 'database' : 'file-text') + '<span>' + escapeText(parts[parts.length - 1].replace(/\.(md|jsonl)$/i, '')) + (file.snippet ? '<em>' + escapeText(file.snippet) + '</em>' : '') + '</span>' + (file.common ? '<small>shared</small>' : ''); list.appendChild(button);
|
|
355
355
|
});
|
|
356
356
|
if (state.query.trim() && state.searchFiles.length < state.searchTotal) { var more = document.createElement('button'); more.type = 'button'; more.className = 'knowledge-search-more'; more.dataset.searchMore = ''; more.disabled = state.searching; more.textContent = state.searching ? 'Loading more…' : 'Load more results'; list.appendChild(more); }
|