clay-server 5.2.0-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-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 +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 +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/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 +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-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-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/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/index.html +11 -5
- 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-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 +115 -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/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 +3 -0
- 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/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-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.js +3 -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/muse-avatar.svg +4 -0
- package/lib/public/style.css +5 -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-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-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 +6 -1
- package/lib/server.js +163 -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/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/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 +10 -4
|
@@ -19,6 +19,8 @@ function attachWorkspaceAssignmentService(ctx) {
|
|
|
19
19
|
var records = [];
|
|
20
20
|
var unsubscribers = {};
|
|
21
21
|
var pendingRestartReplay = {};
|
|
22
|
+
var presentations = new WeakMap();
|
|
23
|
+
var presentationTargets = new WeakMap();
|
|
22
24
|
|
|
23
25
|
function recordFile(userId) {
|
|
24
26
|
return storageDir ? path.join(storageDir, userStorageKey(userId)) : null;
|
|
@@ -130,7 +132,27 @@ function attachWorkspaceAssignmentService(ctx) {
|
|
|
130
132
|
return { project: project, manager: manager, session: session };
|
|
131
133
|
}
|
|
132
134
|
|
|
135
|
+
function present(record, principal) {
|
|
136
|
+
try {
|
|
137
|
+
var display = ctx.getPresentation && ctx.getPresentation(principal), project = exactTarget(record);
|
|
138
|
+
if (!display || !project) return;
|
|
139
|
+
var view = { project: project, session: null, origin: null }; presentationTargets.set(record, view);
|
|
140
|
+
if (record.delivery === 'follow_up') project.getSessionManager().sessions.forEach(function (session) { if (ctx.sessionRef(record.targetProjectSlug, session) === record.targetSessionRef) { view.session = session; view.origin = session.sessionOriginId; } });
|
|
141
|
+
var projection = require('./clay-control-target-projection');
|
|
142
|
+
var target = view.session ? { kind: 'session', projectSlug: record.targetProjectSlug, sessionId: view.session.localId, sessionOriginId: view.origin } : { kind: 'project', projectSlug: record.targetProjectSlug, runtimeId: projection.runtime(project.getSessionManager()) };
|
|
143
|
+
var observer = display.track('assignment', record.delivery === 'follow_up' ? 'follow_up' : 'assign', target, function () {
|
|
144
|
+
if (exactTarget(record) !== project || view.session && (project.getSessionManager().sessions.get(view.session.localId) !== view.session || view.session.sessionOriginId !== view.origin || (view.session.ownerId || null) !== (record.userId || null))) throw new Error('Assignment target changed.');
|
|
145
|
+
}, 'review');
|
|
146
|
+
if (observer) { presentations.set(record, observer); var expiry = setTimeout(function () { presentations.delete(record); }, 300000); expiry.unref(); }
|
|
147
|
+
} catch (error) { /* Presentation never changes the assignment decision. */ }
|
|
148
|
+
}
|
|
133
149
|
function emit(record, eventType) {
|
|
150
|
+
var observer = presentations.get(record);
|
|
151
|
+
if (observer) {
|
|
152
|
+
if (record.status === 'starting') observer.phase('queued');
|
|
153
|
+
else if (record.status === 'running') observer.phase('running');
|
|
154
|
+
else if (record.status !== 'proposed') { observer.finish({ status: record.status === 'interrupted' ? 'failed' : record.status, outcome: record.status === 'interrupted' ? 'uncertain' : undefined }); presentations.delete(record); }
|
|
155
|
+
}
|
|
134
156
|
var source = exactSource(record);
|
|
135
157
|
if (!source) return;
|
|
136
158
|
source.manager.sendAndRecord(source.session, {
|
|
@@ -193,6 +215,7 @@ function attachWorkspaceAssignmentService(ctx) {
|
|
|
193
215
|
if (!exactSource(record)) throw new Error("Source conversation is no longer available.");
|
|
194
216
|
records.push(record);
|
|
195
217
|
saveUser(record.userId);
|
|
218
|
+
present(record, principal);
|
|
196
219
|
emit(record, "project_assignment_proposal");
|
|
197
220
|
return publicRecord(record);
|
|
198
221
|
}
|
|
@@ -229,6 +252,7 @@ function attachWorkspaceAssignmentService(ctx) {
|
|
|
229
252
|
if (!exactSource(record)) throw new Error("Source conversation is no longer available.");
|
|
230
253
|
records.push(record);
|
|
231
254
|
saveUser(record.userId);
|
|
255
|
+
present(record, principal);
|
|
232
256
|
emit(record, "project_assignment_proposal");
|
|
233
257
|
return publicRecord(record);
|
|
234
258
|
}
|
|
@@ -267,6 +291,7 @@ function attachWorkspaceAssignmentService(ctx) {
|
|
|
267
291
|
}
|
|
268
292
|
|
|
269
293
|
function watch(record, manager, session) {
|
|
294
|
+
var view = presentationTargets.get(record); if (view) { view.session = session; view.origin = session.sessionOriginId; var observer = presentations.get(record); if (observer && observer.target) observer.target({ kind: 'session', projectSlug: record.targetProjectSlug, sessionId: session.localId, sessionOriginId: session.sessionOriginId }); }
|
|
270
295
|
var unsubscribe = manager.subscribeSession(session.localId, function (event) {
|
|
271
296
|
if (event.type === "session_id") {
|
|
272
297
|
record.targetSessionRef = ctx.sessionRef(record.targetProjectSlug, session);
|
|
@@ -96,7 +96,10 @@ function attachWorkspaceQueryAccess(deps) {
|
|
|
96
96
|
// as ownership would let a stale status skip the authoritative record.
|
|
97
97
|
var access = record(status);
|
|
98
98
|
if (!access) return denied;
|
|
99
|
-
if (access.ownerId && access.ownerId === principal.userId)
|
|
99
|
+
if (access.ownerId && access.ownerId === principal.userId) {
|
|
100
|
+
var ownerPermitted = permitted(principal.userId, access);
|
|
101
|
+
return { owned: ownerPermitted, accessible: ownerPermitted };
|
|
102
|
+
}
|
|
100
103
|
return { owned: false, accessible: permitted(principal.userId, access) };
|
|
101
104
|
}
|
|
102
105
|
|
|
@@ -32,7 +32,7 @@ function handler(bound, method) {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
var SESSION_CITATION = "
|
|
35
|
+
var SESSION_CITATION = " Cite returned sessions as Markdown links: [short human label](session:OPAQUE_REFERENCE), replacing the entire target with the exact returned sessionRef. Do not prepend a project name, change the opaque reference, or wrap citations in backticks/code. For a specific returned entry, append #entry-<entryIndex> using its exact returned entry index. Legacy [clayos/<sessionRef> — short label] remains supported. Labels are presentation only; Clay Studio resolves the exact reference with the authenticated owner's permissions.";
|
|
36
36
|
|
|
37
37
|
function commonTools(bound) {
|
|
38
38
|
return [
|
|
@@ -168,6 +168,13 @@ function attachWorkspaceQueryService(ctx) {
|
|
|
168
168
|
} else if (source.session.ownerId) {
|
|
169
169
|
return null;
|
|
170
170
|
}
|
|
171
|
+
if (source.viewerId !== undefined) {
|
|
172
|
+
var viewerPrincipal = {
|
|
173
|
+
userId: isMultiUser() ? source.viewerId : null,
|
|
174
|
+
singleUserOwnerId: isMultiUser() ? null : source.viewerId,
|
|
175
|
+
};
|
|
176
|
+
if (!ownsSession(viewerPrincipal, source.session)) return null;
|
|
177
|
+
}
|
|
171
178
|
return createBound({
|
|
172
179
|
userId: isMultiUser() ? source.session.ownerId : null,
|
|
173
180
|
sourceProjectSlug: source.projectSlug,
|
|
@@ -366,11 +373,13 @@ function attachWorkspaceQueryService(ctx) {
|
|
|
366
373
|
|
|
367
374
|
function resolveSessionNavigation(principal, ref) {
|
|
368
375
|
if (typeof ref !== "string" || !/^session:[A-Za-z0-9_-]{24}$/.test(ref)) throw new Error("Invalid session reference.");
|
|
376
|
+
var entryIndex = arguments.length > 2 ? arguments[2] : null;
|
|
377
|
+
if (entryIndex !== null && entryIndex !== undefined && (!Number.isSafeInteger(entryIndex) || entryIndex < 0)) throw new Error("Invalid session entry reference.");
|
|
369
378
|
var projects = collect(principal);
|
|
370
379
|
for (var p = 0; p < projects.length; p++) {
|
|
371
380
|
var session = findSession(projects[p], ref);
|
|
372
381
|
if (!session) continue;
|
|
373
|
-
|
|
382
|
+
var target = {
|
|
374
383
|
projectSlug: projects[p].projectSlug,
|
|
375
384
|
projectTitle: projects[p].projectTitle,
|
|
376
385
|
isMate: projects[p].isMate,
|
|
@@ -379,6 +388,8 @@ function attachWorkspaceQueryService(ctx) {
|
|
|
379
388
|
homeSessionId: session.cliSessionId || "local:" + session.localId,
|
|
380
389
|
title: cleanMetadata(session.title || "New Session", 160),
|
|
381
390
|
};
|
|
391
|
+
if (entryIndex !== null && entryIndex !== undefined) target.entryIndex = entryIndex;
|
|
392
|
+
return target;
|
|
382
393
|
}
|
|
383
394
|
throw new Error("Session not found in the owned workspace.");
|
|
384
395
|
}
|
|
@@ -450,7 +461,7 @@ function attachWorkspaceQueryService(ctx) {
|
|
|
450
461
|
if (!principal.isClay) throw new Error("Workspace-wide activity is available only to builtin Clay.");
|
|
451
462
|
return workspaceActivity(principal, args || {});
|
|
452
463
|
},
|
|
453
|
-
resolveSessionNavigation: function (args) { return resolveSessionNavigation(principal, args && args.sessionRef); },
|
|
464
|
+
resolveSessionNavigation: function (args) { return resolveSessionNavigation(principal, args && args.sessionRef, args && args.entryIndex); },
|
|
454
465
|
listRecentDecisions: function (args) {
|
|
455
466
|
if (!principal.isClay) throw new Error("Workspace decisions are available only to builtin Clay.");
|
|
456
467
|
return recentDecisions(principal, args || {});
|
package/lib/ws-request.js
CHANGED
package/lib/ws-schema.js
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
* Use it as a reference when adding new message types.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
// message.contextualSnapshot: version=1, viewId, nullable projectTitle,
|
|
15
|
+
// conversationTitle/projectSlug (160 characters), nullable positive sessionId,
|
|
16
|
+
// screen=Home|Project|Direct message. Private canonical owner delivery only.
|
|
17
|
+
// Persisted user_message metadata is echoed in message_ack only after recording;
|
|
18
|
+
// queued admission ACK has no snapshot. Never part of user text/pastes or authority.
|
|
14
19
|
var schema = {
|
|
15
20
|
|
|
16
21
|
// -----------------------------------------------------------------------
|
|
@@ -62,6 +67,7 @@ var schema = {
|
|
|
62
67
|
"project_assignment_response": { direction: "c2s", handler: "lib/workspace-assignment-service.js", description: "Approve or cancel an exact-session cross-project assignment proposal" },
|
|
63
68
|
"home_clay_session_resolve": { direction: "c2s", handler: "lib/server-home-chat.js", description: "Resolve an opaque Mate session reference through the exact bound source session" },
|
|
64
69
|
"home_clay_session_target": { direction: "s2c", handler: "lib/public/modules/command-palette.js", description: "Return an owner-validated navigation target for a rendered Mate session reference" },
|
|
70
|
+
"home_clay_contextual_session": { direction: "s2c", handler: "lib/public/modules/contextual-search.js", description: "Return the exact fresh canonical session for an idempotent contextual Ask request; does not submit or execute a message" },
|
|
65
71
|
"issues_list": { direction: "c2s", handler: "lib/project-issues.js", description: "Project Issues issues list" },
|
|
66
72
|
"issue_read": { direction: "c2s", handler: "lib/project-issues.js", description: "Project Issues issue read" },
|
|
67
73
|
"issue_create": { direction: "c2s", handler: "lib/project-issues.js", description: "Project Issues issue create" },
|
|
@@ -482,6 +488,7 @@ var schema = {
|
|
|
482
488
|
"term_resized": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Terminal was resized" },
|
|
483
489
|
"term_exited": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Terminal process exited" },
|
|
484
490
|
"term_closed": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Terminal session was closed" },
|
|
491
|
+
"term_control_projection": { direction: "s2c", handler: "lib/public/modules/terminal.js", description: "Authoritative terminal identity/revision after owner resize without echoing resize input" },
|
|
485
492
|
"term_list": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Full list of open terminals" },
|
|
486
493
|
"term_error": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Terminal error (e.g. access denied)" },
|
|
487
494
|
"shell_command": { direction: "c2s", handler: "lib/project-shell-command.js", description: "Run a one-shot shell command for agent context" },
|
|
@@ -495,10 +502,11 @@ var schema = {
|
|
|
495
502
|
"note_written": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Agent created or updated a sticky note" },
|
|
496
503
|
"note_update": { direction: "c2s", handler: "lib/project-user-message.js", description: "Update a sticky note" },
|
|
497
504
|
"note_updated": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Sticky note was updated" },
|
|
498
|
-
"
|
|
505
|
+
"note_update_result": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Correlated sticky note update result" },
|
|
506
|
+
"note_close": { direction: "c2s", handler: "lib/project-user-message.js", description: "Close a sticky note; human draft-aware requests remove empty notes, tool and legacy closes stay reversible" },
|
|
499
507
|
"note_reopen": { direction: "c2s", handler: "lib/project-user-message.js", description: "Reopen a closed sticky note" },
|
|
500
508
|
"note_delete": { direction: "c2s", handler: "lib/project-user-message.js", description: "Retired: older clients still send this; handled as a non-destructive close" },
|
|
501
|
-
"note_deleted": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "
|
|
509
|
+
"note_deleted": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "A sticky note was permanently removed after a human-authorized storage transaction" },
|
|
502
510
|
"note_list_request": { direction: "c2s", handler: "lib/project-user-message.js", description: "Request the full notes list" },
|
|
503
511
|
"note_bring_front": { direction: "c2s", handler: "lib/project-user-message.js", description: "Bring a note to front (update z-order)" },
|
|
504
512
|
"notes_list": { direction: "s2c", handler: "lib/public/modules/app-messages.js", description: "Full list of sticky notes" },
|
|
@@ -784,6 +792,7 @@ var schema = {
|
|
|
784
792
|
// -----------------------------------------------------------------------
|
|
785
793
|
"home_mate_open": { direction: "c2s", handler: "lib/server-home-chat.js", description: "Open or restore the selected mate's embedded chat session" },
|
|
786
794
|
"home_clay_ask": { direction: "c2s", handler: "lib/server-home-chat.js", description: "Start a fresh builtin Clay conversation from the global search drawer" },
|
|
795
|
+
"contextual_mate_sessions_result": { direction: "s2c", handler: "lib/public/modules/contextual-mate-sessions.js", description: "Exact owner-private saved Mate conversation list or selection receipt; no transcript tap or underlying navigation" },
|
|
787
796
|
"home_mate_sessions_list": { direction: "c2s", handler: "lib/server-home-chat.js", description: "List the current user's conversations with the selected mate" },
|
|
788
797
|
"home_mate_session_open": { direction: "c2s", handler: "lib/server-home-chat.js", description: "Open one explicit conversation with the selected mate" },
|
|
789
798
|
"home_mate_send": { direction: "c2s", handler: "lib/server-home-chat.js", description: "Send a message to the selected mate from the home hub" },
|
|
@@ -809,6 +818,13 @@ var schema = {
|
|
|
809
818
|
"default_vendor_get": { direction: "c2s", handler: "lib/server-default-vendor.js", description: "Read the authenticated user's New session vendor preference" },
|
|
810
819
|
"default_vendor_set": { direction: "c2s", handler: "lib/server-default-vendor.js", description: "Validate and persist the authenticated user's New session vendor preference" },
|
|
811
820
|
"default_vendor_state": { direction: "s2c", handler: "lib/public/modules/default-vendor.js", description: "Correlated or same-user-broadcast New session vendor preference" },
|
|
821
|
+
"clay_ui_ready": { direction: "c2s", handler: "lib/server-owner-ui.js", description: "Advertise exact owner UI navigation support on this socket" },
|
|
822
|
+
"clay_navigation_offer": { direction: "s2c", handler: "lib/public/modules/clay-owner-navigation.js", description: "Offer one exact reviewed navigation to a selected owner connection" },
|
|
823
|
+
"clay_navigation_claim": { direction: "c2s", handler: "lib/server-owner-ui.js", description: "Claim an offered navigation with live source/target revalidation" },
|
|
824
|
+
"clay_navigation_apply": { direction: "s2c", handler: "lib/public/modules/clay-owner-navigation.js", description: "Invoke the shared conversation navigator after live claim" },
|
|
825
|
+
"clay_studio_rendered": { direction: "c2s", handler: "lib/project-studio-presentation.js", description: "Exact source-viewer workbench render receipt; no product effects" },
|
|
826
|
+
"clay_navigation_rendered": { direction: "c2s", handler: "lib/server-owner-ui.js", description: "Bounded exact-viewer rendered conversation evidence; acceptance alone remains separate" },
|
|
827
|
+
"clay_navigation_ack": { direction: "c2s", handler: "lib/server-owner-ui.js", description: "Client invocation acknowledgement; never proof of visible rendering" },
|
|
812
828
|
"context_view_get": { direction: "c2s", handler: "lib/server-context-view.js", description: "Read the authenticated user's context display preference" },
|
|
813
829
|
"context_view_set": { direction: "c2s", handler: "lib/server-context-view.js", description: "Persist the authenticated user's context display preference" },
|
|
814
830
|
"context_view_state": { direction: "s2c", handler: "lib/public/modules/context-view-preference.js", description: "Correlated or same-user-broadcast context display preference" },
|
|
@@ -9,8 +9,9 @@ var execFile = require("child_process").execFile;
|
|
|
9
9
|
var execFileSync = require("child_process").execFileSync;
|
|
10
10
|
|
|
11
11
|
function findOnPath(binaryName, overrideName) {
|
|
12
|
-
var
|
|
13
|
-
|
|
12
|
+
var discovery = require("./discovery");
|
|
13
|
+
var overridePath = overrideName && discovery.explicitEntry(process.env, overrideName, false);
|
|
14
|
+
if (overridePath !== undefined && overrideName) return overridePath;
|
|
14
15
|
try {
|
|
15
16
|
var command = process.platform === "win32" ? "where" : "which";
|
|
16
17
|
var out = execFileSync(command, [binaryName], {
|
|
@@ -18,7 +19,8 @@ function findOnPath(binaryName, overrideName) {
|
|
|
18
19
|
encoding: "utf8",
|
|
19
20
|
stdio: ["pipe", "pipe", "pipe"],
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
var resolved = out.trim().split(/\r?\n/)[0] || null;
|
|
23
|
+
return discovery.validEntry(resolved, false) ? resolved : null;
|
|
22
24
|
} catch (e) {
|
|
23
25
|
return null;
|
|
24
26
|
}
|
|
@@ -50,7 +52,7 @@ function fetchOpenCodeResolvedConfig(binaryPath, cwd, env) {
|
|
|
50
52
|
return new Promise(function(resolve, reject) {
|
|
51
53
|
execFile(binaryPath, ["debug", "config"], {
|
|
52
54
|
cwd: cwd || process.cwd(),
|
|
53
|
-
env: Object.assign({}, process.env,
|
|
55
|
+
env: env ? Object.assign({}, env) : process.env,
|
|
54
56
|
timeout: 30000,
|
|
55
57
|
maxBuffer: 4 * 1024 * 1024,
|
|
56
58
|
}, function(err, stdout) {
|
|
@@ -141,7 +143,7 @@ var ACP_AGENT_PROFILES = {
|
|
|
141
143
|
});
|
|
142
144
|
},
|
|
143
145
|
buildProcessOptions: function(ctx, base) {
|
|
144
|
-
var existing =
|
|
146
|
+
var existing = base.env ? base.env.OPENCODE_CONFIG_CONTENT : process.env.OPENCODE_CONFIG_CONTENT;
|
|
145
147
|
var config = {};
|
|
146
148
|
if (existing) config = JSON.parse(existing);
|
|
147
149
|
var agent = Object.assign({}, config.agent || {});
|
|
@@ -3,19 +3,7 @@ var childProcess = require("child_process");
|
|
|
3
3
|
var readline = require("readline");
|
|
4
4
|
var skillDiscovery = require("../skill-discovery");
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
if (process.env.ANTIGRAVITY_CLI_PATH) return process.env.ANTIGRAVITY_CLI_PATH;
|
|
8
|
-
try {
|
|
9
|
-
var command = process.platform === "win32" ? "where" : "which";
|
|
10
|
-
return childProcess.execFileSync(command, ["agy"], {
|
|
11
|
-
encoding: "utf8",
|
|
12
|
-
timeout: 3000,
|
|
13
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
14
|
-
}).trim().split(/\r?\n/)[0] || null;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
6
|
+
var findBinary = require("../providers/antigravity-executable").resolve;
|
|
19
7
|
|
|
20
8
|
function modelValue(model) {
|
|
21
9
|
if (typeof model === "string") return model;
|
|
@@ -427,7 +415,8 @@ function createAntigravityAdapter(opts) {
|
|
|
427
415
|
var adapter = {
|
|
428
416
|
vendor: "antigravity",
|
|
429
417
|
init: async function(initOpts) {
|
|
430
|
-
if (
|
|
418
|
+
if (opts.linuxUser || initOpts && initOpts.linuxUser) throw new Error("Antigravity does not support mapped OS-user execution.");
|
|
419
|
+
if (!binaryPath) binaryPath = findBinary({ env: initOpts && initOpts.env || opts.env || process.env });
|
|
431
420
|
if (!binaryPath) throw new Error("Antigravity CLI binary not found: agy");
|
|
432
421
|
var fetched = opts._fetchModels ? await opts._fetchModels(binaryPath, cwd) : await fetchModels(binaryPath, cwd);
|
|
433
422
|
if (fetched && fetched.length) cachedModels = fetched;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Init-free provider transport obligations, shared by the registry and adapter.
|
|
2
|
+
module.exports = {
|
|
3
|
+
questionInput: function(name, input) { return name === "AskUserQuestion" ? input : null; },
|
|
4
|
+
toolTransport: "sdk-mcp",
|
|
5
|
+
catalogLifetime: "query",
|
|
6
|
+
permissionModes: ["auto"],
|
|
7
|
+
mcpPermissionOverrides: true,
|
|
8
|
+
interruptionMessage: "Interrupted · What should Claude do instead?",
|
|
9
|
+
};
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// This is the ONLY file (besides claude-worker.js) that imports the SDK.
|
|
5
5
|
// Also manages worker processes for OS-level user isolation.
|
|
6
6
|
|
|
7
|
+
var attachWorkerStartup = require("../claude-worker-startup").attachWorkerStartup;
|
|
7
8
|
var bindQueryAbort = require("../query-abort").bindAbort;
|
|
8
9
|
var path = require("path");
|
|
9
10
|
var fs = require("fs");
|
|
@@ -527,7 +528,7 @@ function flattenEvent(raw) {
|
|
|
527
528
|
// --- rate_limit_event ---
|
|
528
529
|
if (raw.type === "rate_limit_event" && raw.rate_limit_info) {
|
|
529
530
|
base.yokeType = "rate_limit";
|
|
530
|
-
base.rateLimitInfo = raw.rate_limit_info;
|
|
531
|
+
base.rateLimitInfo = Object.assign({}, raw.rate_limit_info, { isUsingOverage: raw.rate_limit_info.isUsingOverage === true || raw.rate_limit_info.overageInUse === true });
|
|
531
532
|
return base;
|
|
532
533
|
}
|
|
533
534
|
|
|
@@ -600,6 +601,8 @@ function createQueryHandle(rawQuery, messageQueue, abortController) {
|
|
|
600
601
|
var correlation = claudeCorrelation.createCorrelation();
|
|
601
602
|
var closed = false;
|
|
602
603
|
var removeAbort = function () {};
|
|
604
|
+
var resolveStopped;
|
|
605
|
+
var stopped = new Promise(function(resolve) { resolveStopped = resolve; });
|
|
603
606
|
var handle = {
|
|
604
607
|
// Opaque adapter state (null for in-process queries)
|
|
605
608
|
_adapterState: null,
|
|
@@ -610,12 +613,13 @@ function createQueryHandle(rawQuery, messageQueue, abortController) {
|
|
|
610
613
|
return {
|
|
611
614
|
next: function() {
|
|
612
615
|
return rawIter.next().then(function(result) {
|
|
613
|
-
if (result.done) { closed = true; removeAbort(); }
|
|
616
|
+
if (result.done) { closed = true; removeAbort(); resolveStopped(); }
|
|
614
617
|
if (result.done) return result;
|
|
615
618
|
return { value: correlation.result(result.value, flattenEvent(result.value)), done: false };
|
|
616
619
|
}, function(err) {
|
|
617
620
|
closed = true;
|
|
618
621
|
removeAbort();
|
|
622
|
+
resolveStopped();
|
|
619
623
|
throw err;
|
|
620
624
|
});
|
|
621
625
|
},
|
|
@@ -715,6 +719,11 @@ function createQueryHandle(rawQuery, messageQueue, abortController) {
|
|
|
715
719
|
}
|
|
716
720
|
},
|
|
717
721
|
|
|
722
|
+
stopAndWait: function() {
|
|
723
|
+
handle.abort();
|
|
724
|
+
return stopped;
|
|
725
|
+
},
|
|
726
|
+
|
|
718
727
|
close: function() {
|
|
719
728
|
closed = true;
|
|
720
729
|
removeAbort();
|
|
@@ -818,9 +827,7 @@ function spawnWorker(linuxUser, workerScriptPath, cwd) {
|
|
|
818
827
|
buffer: "",
|
|
819
828
|
};
|
|
820
829
|
|
|
821
|
-
worker
|
|
822
|
-
worker._readyResolve = resolve;
|
|
823
|
-
});
|
|
830
|
+
attachWorkerStartup(worker);
|
|
824
831
|
|
|
825
832
|
// Resolves when the worker process actually exits.
|
|
826
833
|
// Used to prevent spawning a new worker before the old one finishes
|
|
@@ -860,7 +867,15 @@ function spawnWorker(linuxUser, workerScriptPath, cwd) {
|
|
|
860
867
|
});
|
|
861
868
|
connection.on("error", function(err) {
|
|
862
869
|
console.error("[yoke/claude] Worker connection error:", err.message);
|
|
870
|
+
if (worker._readyReject) worker._readyReject(err);
|
|
863
871
|
});
|
|
872
|
+
connection.on("close", function() {
|
|
873
|
+
if (worker._readyReject) worker._readyReject(new Error("Claude worker connection closed before ready."));
|
|
874
|
+
});
|
|
875
|
+
});
|
|
876
|
+
worker.server.on("error", function(error) {
|
|
877
|
+
if (worker._readyReject) worker._readyReject(error);
|
|
878
|
+
cleanupWorker(worker);
|
|
864
879
|
});
|
|
865
880
|
|
|
866
881
|
worker.server.listen(socketPath, function() {
|
|
@@ -892,6 +907,14 @@ function spawnWorker(linuxUser, workerScriptPath, cwd) {
|
|
|
892
907
|
});
|
|
893
908
|
worker.process = spawn(workerSpawn.command, workerSpawn.args, workerSpawn.options);
|
|
894
909
|
|
|
910
|
+
worker.process.on("error", function(error) {
|
|
911
|
+
if (worker._readyReject) worker._readyReject(error);
|
|
912
|
+
worker.messageHandlers.forEach(function(handler) { handler({ type: "query_error", error: error.message, _fallback: true }); });
|
|
913
|
+
cleanupWorker(worker);
|
|
914
|
+
// Only a spawn failure proves that no child execution exists. Other
|
|
915
|
+
// ChildProcess errors (for example a failed signal) are not exit evidence.
|
|
916
|
+
if (!worker.process.pid && worker._exitResolve) { worker._exitResolve(); worker._exitResolve = null; }
|
|
917
|
+
});
|
|
895
918
|
worker.process.stdout.on("data", function(data) {
|
|
896
919
|
console.log("[sdk-worker:" + linuxUser + "] " + data.toString().trim());
|
|
897
920
|
});
|
|
@@ -905,9 +928,8 @@ function spawnWorker(linuxUser, workerScriptPath, cwd) {
|
|
|
905
928
|
worker.process.on("exit", function(code, signal) {
|
|
906
929
|
console.log("[yoke/claude] Worker for " + linuxUser + " exited (code=" + code + ", signal=" + signal + ")" + (worker._stderrBuf ? " stderr: " + worker._stderrBuf.trim() : ""));
|
|
907
930
|
// Reject readyPromise if worker dies before becoming ready
|
|
908
|
-
if (!worker.ready && worker.
|
|
909
|
-
worker.
|
|
910
|
-
// Let the readyPromise hang; the query_error handler will clean up
|
|
931
|
+
if (!worker.ready && worker._readyReject) {
|
|
932
|
+
worker._readyReject(new Error("Claude worker exited before ready (code=" + code + ")."));
|
|
911
933
|
}
|
|
912
934
|
// Notify message handlers about unexpected exit so sessions don't hang.
|
|
913
935
|
// Always dispatch a fallback query_error. The handler is idempotent:
|
|
@@ -1082,6 +1104,9 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool,
|
|
|
1082
1104
|
var iterWaiting = null;
|
|
1083
1105
|
var iterEnded = false;
|
|
1084
1106
|
var iterError = null;
|
|
1107
|
+
var resolveStopped;
|
|
1108
|
+
var stopped = new Promise(function(resolve) { resolveStopped = resolve; });
|
|
1109
|
+
if (worker.exitPromise) worker.exitPromise.then(resolveStopped);
|
|
1085
1110
|
|
|
1086
1111
|
// Pending request/response correlation for handle methods that need a
|
|
1087
1112
|
// result from the worker (e.g. rewindFiles). Each entry is keyed by a
|
|
@@ -1299,6 +1324,8 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool,
|
|
|
1299
1324
|
}
|
|
1300
1325
|
|
|
1301
1326
|
case "query_done":
|
|
1327
|
+
if (worker._abortTimeout) { clearTimeout(worker._abortTimeout); worker._abortTimeout = null; }
|
|
1328
|
+
resolveStopped();
|
|
1302
1329
|
rejectPendingPermissionModes(new Error("Worker query ended while changing permission mode"));
|
|
1303
1330
|
console.log("[yoke/claude] IPC query_done received, pid=" + (worker.process ? worker.process.pid : "?"));
|
|
1304
1331
|
worker._queryEnded = true;
|
|
@@ -1306,6 +1333,10 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool,
|
|
|
1306
1333
|
break;
|
|
1307
1334
|
|
|
1308
1335
|
case "query_error": {
|
|
1336
|
+
if (!msg._fallback) {
|
|
1337
|
+
if (worker._abortTimeout) { clearTimeout(worker._abortTimeout); worker._abortTimeout = null; }
|
|
1338
|
+
resolveStopped();
|
|
1339
|
+
}
|
|
1309
1340
|
rejectPendingPermissionModes(new Error(msg.error || "Worker exited while changing permission mode"));
|
|
1310
1341
|
console.log("[yoke/claude] IPC query_error received, pid=" + (worker.process ? worker.process.pid : "?") + " _fallback=" + !!msg._fallback + " _queryEnded=" + worker._queryEnded + " error=" + (msg.error || "").substring(0, 100));
|
|
1311
1342
|
// Skip fallback errors from exit handler if we already handled the real one
|
|
@@ -1472,6 +1503,11 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool,
|
|
|
1472
1503
|
}, 5000);
|
|
1473
1504
|
},
|
|
1474
1505
|
|
|
1506
|
+
stopAndWait: function() {
|
|
1507
|
+
handle.abort();
|
|
1508
|
+
return stopped;
|
|
1509
|
+
},
|
|
1510
|
+
|
|
1475
1511
|
close: function() {
|
|
1476
1512
|
rejectPendingPermissionModes(new Error("Worker query closed while changing permission mode"));
|
|
1477
1513
|
// End the iterator
|
|
@@ -1507,43 +1543,7 @@ function createWorkerQueryHandle(worker, canUseTool, onElicitation, callMcpTool,
|
|
|
1507
1543
|
|
|
1508
1544
|
// --- Adapter factory ---
|
|
1509
1545
|
|
|
1510
|
-
|
|
1511
|
-
// 1. Explicit env var override
|
|
1512
|
-
if (process.env.CLAUDE_CODE_PATH && fs.existsSync(process.env.CLAUDE_CODE_PATH)) {
|
|
1513
|
-
return process.env.CLAUDE_CODE_PATH;
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
// 2. `which claude` in the daemon's PATH
|
|
1517
|
-
try {
|
|
1518
|
-
var result = require("child_process").execSync("which claude", { encoding: "utf8", timeout: 5000 }).trim();
|
|
1519
|
-
if (result && fs.existsSync(result)) return result;
|
|
1520
|
-
} catch (e) {}
|
|
1521
|
-
|
|
1522
|
-
// 3. Common per-user and system locations (best-effort fallback for the daemon user)
|
|
1523
|
-
var home = process.env.HOME || "";
|
|
1524
|
-
var candidates = [];
|
|
1525
|
-
if (home) {
|
|
1526
|
-
candidates.push(home + "/.npm-global/bin/claude");
|
|
1527
|
-
candidates.push(home + "/.local/bin/claude");
|
|
1528
|
-
candidates.push(home + "/.volta/bin/claude");
|
|
1529
|
-
candidates.push(home + "/.bun/bin/claude");
|
|
1530
|
-
candidates.push(home + "/bin/claude");
|
|
1531
|
-
}
|
|
1532
|
-
candidates.push("/usr/local/bin/claude");
|
|
1533
|
-
candidates.push("/usr/bin/claude");
|
|
1534
|
-
candidates.push("/opt/homebrew/bin/claude");
|
|
1535
|
-
for (var i = 0; i < candidates.length; i++) {
|
|
1536
|
-
try { if (fs.existsSync(candidates[i])) return candidates[i]; } catch (e) {}
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
// 4. Bundled CLI entry from the SDK's peer
|
|
1540
|
-
try {
|
|
1541
|
-
var resolved = require.resolve("@anthropic-ai/claude-code/cli.js");
|
|
1542
|
-
if (resolved && fs.existsSync(resolved)) return resolved;
|
|
1543
|
-
} catch (e) {}
|
|
1544
|
-
|
|
1545
|
-
return null;
|
|
1546
|
-
}
|
|
1546
|
+
var resolveClaudeBinaryPath = require("../providers/claude-executable").resolve;
|
|
1547
1547
|
|
|
1548
1548
|
function createClaudeAdapter(opts) {
|
|
1549
1549
|
var _cwd = (opts && opts.cwd) || process.cwd();
|
|
@@ -1556,6 +1556,7 @@ function createClaudeAdapter(opts) {
|
|
|
1556
1556
|
|
|
1557
1557
|
var adapter = {
|
|
1558
1558
|
vendor: "claude",
|
|
1559
|
+
queryContract: require("./claude-query-contract"),
|
|
1559
1560
|
userInputCapability: { mode: "native", native: true, transport: "AskUserQuestion/onElicitation" },
|
|
1560
1561
|
|
|
1561
1562
|
// Path to worker script (sdk-bridge uses this to spawn worker processes)
|
|
@@ -1642,7 +1643,7 @@ function createClaudeAdapter(opts) {
|
|
|
1642
1643
|
|
|
1643
1644
|
try {
|
|
1644
1645
|
var models = await stream.supportedModels();
|
|
1645
|
-
result.models = models
|
|
1646
|
+
result.models = require("../providers/claude-model-descriptions").list(models);
|
|
1646
1647
|
_cachedModels = result.models;
|
|
1647
1648
|
} catch (e) {
|
|
1648
1649
|
// supportedModels may fail, models list will be empty
|
|
@@ -1909,7 +1910,10 @@ function createClaudeAdapter(opts) {
|
|
|
1909
1910
|
|
|
1910
1911
|
// Wait for worker to be ready before sending query_start
|
|
1911
1912
|
if (!reusingWorker) {
|
|
1912
|
-
await worker.readyPromise;
|
|
1913
|
+
try { await worker.readyPromise; } catch (error) {
|
|
1914
|
+
worker.kill();
|
|
1915
|
+
throw error;
|
|
1916
|
+
}
|
|
1913
1917
|
}
|
|
1914
1918
|
|
|
1915
1919
|
// Build serializable query options (no callbacks, no AbortController).
|
|
@@ -1954,7 +1958,7 @@ function createClaudeAdapter(opts) {
|
|
|
1954
1958
|
warmupDone = true;
|
|
1955
1959
|
var r = msg.result || {};
|
|
1956
1960
|
resolve({
|
|
1957
|
-
models: r.models
|
|
1961
|
+
models: require("../providers/claude-model-descriptions").list(r.models),
|
|
1958
1962
|
defaultModel: r.model || "",
|
|
1959
1963
|
skills: r.skills || [],
|
|
1960
1964
|
slashCommands: r.slashCommands || [],
|
|
@@ -2071,7 +2075,7 @@ function createClaudeAdapter(opts) {
|
|
|
2071
2075
|
|
|
2072
2076
|
try {
|
|
2073
2077
|
var models = await stream.supportedModels();
|
|
2074
|
-
result.models = models
|
|
2078
|
+
result.models = require("../providers/claude-model-descriptions").list(models);
|
|
2075
2079
|
_cachedModels = result.models;
|
|
2076
2080
|
} catch (e) {
|
|
2077
2081
|
// supportedModels may fail, models list will be empty
|
|
@@ -2122,7 +2126,7 @@ function createClaudeAdapter(opts) {
|
|
|
2122
2126
|
warmupDone = true;
|
|
2123
2127
|
var r = msg.result || {};
|
|
2124
2128
|
resolve({
|
|
2125
|
-
models: r.models
|
|
2129
|
+
models: require("../providers/claude-model-descriptions").list(r.models),
|
|
2126
2130
|
defaultModel: r.model || "",
|
|
2127
2131
|
skills: r.skills || [],
|
|
2128
2132
|
slashCommands: r.slashCommands || [],
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Codex restores dynamic definitions from the original thread catalog.
|
|
2
|
+
// Keep persisted legacy field names here so old conversations remain readable.
|
|
3
|
+
var fields = {
|
|
4
|
+
schedules: "codexDynamicToolCatalogVersion",
|
|
5
|
+
questions: "codexUserInputToolCatalogVersion",
|
|
6
|
+
browser: "codexSharedBrowserToolCatalogVersion",
|
|
7
|
+
issues: "codexIssuesToolCatalogVersion",
|
|
8
|
+
knowledge: "codexYouToolCatalogVersion",
|
|
9
|
+
linear: "codexLinearToolCatalogVersion",
|
|
10
|
+
};
|
|
11
|
+
module.exports = {
|
|
12
|
+
toolTransport: "dynamic",
|
|
13
|
+
catalogLifetime: "conversation",
|
|
14
|
+
externalToolTransport: "dynamic",
|
|
15
|
+
defaultUserInputMode: "fallback",
|
|
16
|
+
questionGuidance: require("../user-input-guidance").codexQuestionGuidance,
|
|
17
|
+
catalogVersion: function (session, family) { return Number(session[fields[family]] || 0); },
|
|
18
|
+
recordCatalog: function (session, versions) {
|
|
19
|
+
Object.keys(versions).forEach(function (family) {
|
|
20
|
+
if (fields[family]) session[fields[family]] = versions[family];
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
staleCatalogReason: "This Codex conversation predates Clay's scheduled-task tool catalog. Start a new conversation to use the assisted interview; manual task creation remains available here.",
|
|
24
|
+
};
|