@clawpump/claw-agent 0.1.5 → 0.1.7
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/agent/.dockerignore +67 -0
- package/agent/.envrc +1 -1
- package/agent/.gitattributes +8 -0
- package/agent/AGENTS.md +216 -4
- package/agent/CONTRIBUTING.md +46 -8
- package/agent/Dockerfile +78 -35
- package/agent/MANIFEST.in +2 -0
- package/agent/README.md +12 -5
- package/agent/README.ur-pk.md +261 -0
- package/agent/README.zh-CN.md +11 -8
- package/agent/SECURITY.md +5 -4
- package/agent/acp_adapter/provenance.py +127 -0
- package/agent/acp_adapter/server.py +112 -5
- package/agent/acp_adapter/session.py +1 -6
- package/agent/acp_registry/agent.json +2 -2
- package/agent/agent/account_usage.py +313 -1
- package/agent/agent/agent_init.py +140 -37
- package/agent/agent/agent_runtime_helpers.py +342 -83
- package/agent/agent/anthropic_adapter.py +320 -33
- package/agent/agent/auxiliary_client.py +525 -105
- package/agent/agent/background_review.py +157 -19
- package/agent/agent/bedrock_adapter.py +71 -6
- package/agent/agent/billing_view.py +295 -0
- package/agent/agent/chat_completion_helpers.py +229 -4
- package/agent/agent/codex_responses_adapter.py +86 -10
- package/agent/agent/codex_runtime.py +153 -1
- package/agent/agent/coding_context.py +738 -0
- package/agent/agent/context_compressor.py +392 -44
- package/agent/agent/context_references.py +34 -1
- package/agent/agent/conversation_compression.py +159 -22
- package/agent/agent/conversation_loop.py +643 -908
- package/agent/agent/copilot_acp_client.py +4 -11
- package/agent/agent/credential_pool.py +5 -3
- package/agent/agent/credits_tracker.py +794 -0
- package/agent/agent/curator.py +91 -18
- package/agent/agent/curator_backup.py +26 -10
- package/agent/agent/display.py +42 -1
- package/agent/agent/error_classifier.py +52 -3
- package/agent/agent/errors.py +3 -0
- package/agent/agent/file_safety.py +0 -17
- package/agent/agent/gemini_native_adapter.py +31 -1
- package/agent/agent/i18n.py +48 -4
- package/agent/agent/image_gen_provider.py +74 -5
- package/agent/agent/image_routing.py +29 -0
- package/agent/agent/insights.py +8 -17
- package/agent/agent/lsp/install.py +3 -0
- package/agent/agent/memory_manager.py +326 -31
- package/agent/agent/message_content.py +50 -0
- package/agent/agent/model_metadata.py +214 -3
- package/agent/agent/moonshot_schema.py +8 -1
- package/agent/agent/onboarding.py +60 -0
- package/agent/agent/prompt_builder.py +327 -37
- package/agent/agent/redact.py +1 -0
- package/agent/agent/runtime_cwd.py +34 -5
- package/agent/agent/secret_scope.py +205 -0
- package/agent/agent/secret_sources/bitwarden.py +34 -2
- package/agent/agent/skill_commands.py +90 -1
- package/agent/agent/skill_preprocessing.py +1 -0
- package/agent/agent/skill_utils.py +209 -36
- package/agent/agent/ssl_guard.py +94 -0
- package/agent/agent/system_prompt.py +133 -5
- package/agent/agent/tool_executor.py +496 -70
- package/agent/agent/transports/anthropic.py +83 -21
- package/agent/agent/transports/chat_completions.py +94 -5
- package/agent/agent/transports/codex.py +67 -2
- package/agent/agent/transports/codex_app_server.py +1 -0
- package/agent/agent/transports/codex_app_server_session.py +30 -0
- package/agent/agent/transports/types.py +12 -0
- package/agent/agent/turn_context.py +408 -0
- package/agent/agent/turn_finalizer.py +428 -0
- package/agent/agent/turn_retry_state.py +68 -0
- package/agent/agent/usage_pricing.py +3 -0
- package/agent/apps/bootstrap-installer/package.json +6 -5
- package/agent/apps/bootstrap-installer/src/routes/failure.tsx +12 -5
- package/agent/apps/bootstrap-installer/src/routes/progress.tsx +1 -3
- package/agent/apps/bootstrap-installer/src/store.ts +3 -2
- package/agent/apps/bootstrap-installer/src-tauri/src/bootstrap.rs +172 -7
- package/agent/apps/bootstrap-installer/src-tauri/src/events.rs +14 -1
- package/agent/apps/bootstrap-installer/src-tauri/src/paths.rs +29 -0
- package/agent/apps/bootstrap-installer/src-tauri/src/powershell.rs +93 -3
- package/agent/apps/bootstrap-installer/src-tauri/src/update.rs +695 -39
- package/agent/apps/bootstrap-installer/tsconfig.json +3 -4
- package/agent/apps/desktop/DESIGN.md +167 -0
- package/agent/apps/desktop/README.md +20 -16
- package/agent/apps/desktop/assets/icon.icns +0 -0
- package/agent/apps/desktop/assets/icon.ico +0 -0
- package/agent/apps/desktop/assets/icon.png +0 -0
- package/agent/apps/desktop/electron/backend-env.cjs +112 -0
- package/agent/apps/desktop/electron/backend-env.test.cjs +111 -0
- package/agent/apps/desktop/electron/backend-probes.test.cjs +3 -1
- package/agent/apps/desktop/electron/backend-ready.cjs +66 -0
- package/agent/apps/desktop/electron/bootstrap-platform.cjs +52 -0
- package/agent/apps/desktop/electron/bootstrap-platform.test.cjs +59 -1
- package/agent/apps/desktop/electron/bootstrap-runner.cjs +176 -38
- package/agent/apps/desktop/electron/bootstrap-runner.test.cjs +112 -1
- package/agent/apps/desktop/electron/connection-config.cjs +288 -0
- package/agent/apps/desktop/electron/connection-config.test.cjs +396 -0
- package/agent/apps/desktop/electron/dashboard-token.cjs +99 -0
- package/agent/apps/desktop/electron/dashboard-token.test.cjs +142 -0
- package/agent/apps/desktop/electron/desktop-uninstall.cjs +232 -0
- package/agent/apps/desktop/electron/desktop-uninstall.test.cjs +246 -0
- package/agent/apps/desktop/electron/entitlements.mac.inherit.plist +2 -0
- package/agent/apps/desktop/electron/fs-read-dir.cjs +109 -0
- package/agent/apps/desktop/electron/fs-read-dir.test.cjs +364 -0
- package/agent/apps/desktop/electron/gateway-ws-probe.cjs +188 -0
- package/agent/apps/desktop/electron/gateway-ws-probe.test.cjs +122 -0
- package/agent/apps/desktop/electron/git-root.cjs +54 -0
- package/agent/apps/desktop/electron/git-root.test.cjs +40 -0
- package/agent/apps/desktop/electron/git-worktrees.cjs +174 -0
- package/agent/apps/desktop/electron/hardening.cjs +123 -28
- package/agent/apps/desktop/electron/hardening.test.cjs +163 -0
- package/agent/apps/desktop/electron/main.cjs +3121 -331
- package/agent/apps/desktop/electron/oauth-net-request.cjs +20 -0
- package/agent/apps/desktop/electron/oauth-net-request.test.cjs +34 -0
- package/agent/apps/desktop/electron/preload.cjs +52 -2
- package/agent/apps/desktop/electron/session-windows.cjs +124 -0
- package/agent/apps/desktop/electron/session-windows.test.cjs +199 -0
- package/agent/apps/desktop/electron/update-rebuild.cjs +29 -0
- package/agent/apps/desktop/electron/update-rebuild.test.cjs +55 -0
- package/agent/apps/desktop/electron/update-remote.cjs +56 -0
- package/agent/apps/desktop/electron/update-remote.test.cjs +78 -0
- package/agent/apps/desktop/electron/vscode-marketplace.cjs +331 -0
- package/agent/apps/desktop/electron/vscode-marketplace.test.cjs +113 -0
- package/agent/apps/desktop/electron/windows-child-process.test.cjs +57 -0
- package/agent/apps/desktop/electron/windows-user-env.cjs +76 -0
- package/agent/apps/desktop/electron/windows-user-env.test.cjs +90 -0
- package/agent/apps/desktop/electron/workspace-cwd.cjs +38 -0
- package/agent/apps/desktop/electron/workspace-cwd.test.cjs +45 -0
- package/agent/apps/desktop/eslint.config.mjs +0 -3
- package/agent/apps/desktop/index.html +27 -2
- package/agent/apps/desktop/package.json +31 -11
- package/agent/apps/desktop/pr-assets/session-source-folders.png +0 -0
- package/agent/apps/desktop/public/apple-touch-icon.png +0 -0
- package/agent/apps/desktop/public/nous-girl.jpg +0 -0
- package/agent/apps/desktop/scripts/assert-dist-built.cjs +70 -0
- package/agent/apps/desktop/scripts/assert-dist-built.test.cjs +84 -0
- package/agent/apps/desktop/scripts/before-pack.cjs +78 -0
- package/agent/apps/desktop/scripts/before-pack.test.cjs +53 -0
- package/agent/apps/desktop/scripts/diag-scroll-reset.mjs +229 -0
- package/agent/apps/desktop/scripts/patch-electron-builder-mac-binary.cjs +64 -0
- package/agent/apps/desktop/scripts/run-electron-builder.cjs +57 -0
- package/agent/apps/desktop/src/app/agents/index.tsx +53 -45
- package/agent/apps/desktop/src/app/artifacts/index.tsx +102 -83
- package/agent/apps/desktop/src/app/chat/chat-drop-overlay.tsx +29 -8
- package/agent/apps/desktop/src/app/chat/chat-swap-overlay.tsx +47 -0
- package/agent/apps/desktop/src/app/chat/composer/attachments.tsx +81 -45
- package/agent/apps/desktop/src/app/chat/composer/completion-drawer.tsx +13 -24
- package/agent/apps/desktop/src/app/chat/composer/context-menu.tsx +138 -88
- package/agent/apps/desktop/src/app/chat/composer/controls.tsx +138 -90
- package/agent/apps/desktop/src/app/chat/composer/enter-submit-dom-race.test.tsx +218 -0
- package/agent/apps/desktop/src/app/chat/composer/focus.ts +32 -0
- package/agent/apps/desktop/src/app/chat/composer/help-hint.tsx +38 -25
- package/agent/apps/desktop/src/app/chat/composer/hooks/use-live-completion-adapter.ts +7 -0
- package/agent/apps/desktop/src/app/chat/composer/hooks/use-mic-recorder.ts +22 -12
- package/agent/apps/desktop/src/app/chat/composer/hooks/use-slash-completions.ts +142 -14
- package/agent/apps/desktop/src/app/chat/composer/hooks/use-voice-conversation.ts +14 -11
- package/agent/apps/desktop/src/app/chat/composer/hooks/use-voice-recorder.ts +9 -6
- package/agent/apps/desktop/src/app/chat/composer/ime-composition-dom-repro.test.tsx +108 -0
- package/agent/apps/desktop/src/app/chat/composer/index.tsx +930 -180
- package/agent/apps/desktop/src/app/chat/composer/inline-refs.ts +136 -32
- package/agent/apps/desktop/src/app/chat/composer/model-pill.tsx +86 -0
- package/agent/apps/desktop/src/app/chat/composer/queue-panel.tsx +54 -75
- package/agent/apps/desktop/src/app/chat/composer/rich-editor.test.ts +117 -1
- package/agent/apps/desktop/src/app/chat/composer/rich-editor.ts +117 -6
- package/agent/apps/desktop/src/app/chat/composer/slash-nav-dom-repro.test.tsx +186 -0
- package/agent/apps/desktop/src/app/chat/composer/status-stack/index.tsx +202 -0
- package/agent/apps/desktop/src/app/chat/composer/status-stack/status-row.tsx +155 -0
- package/agent/apps/desktop/src/app/chat/composer/text-utils.test.ts +104 -0
- package/agent/apps/desktop/src/app/chat/composer/text-utils.ts +37 -9
- package/agent/apps/desktop/src/app/chat/composer/trigger-popover.test.tsx +50 -0
- package/agent/apps/desktop/src/app/chat/composer/trigger-popover.tsx +105 -40
- package/agent/apps/desktop/src/app/chat/composer/types.ts +5 -0
- package/agent/apps/desktop/src/app/chat/composer/url-dialog.tsx +11 -15
- package/agent/apps/desktop/src/app/chat/composer/voice-activity.tsx +8 -4
- package/agent/apps/desktop/src/app/chat/hooks/use-composer-actions.test.ts +57 -0
- package/agent/apps/desktop/src/app/chat/hooks/use-composer-actions.ts +70 -16
- package/agent/apps/desktop/src/app/chat/hooks/use-file-drop-zone.ts +52 -16
- package/agent/apps/desktop/src/app/chat/index.tsx +234 -81
- package/agent/apps/desktop/src/app/chat/perf-probe.tsx +69 -21
- package/agent/apps/desktop/src/app/chat/right-rail/preview-console.tsx +44 -40
- package/agent/apps/desktop/src/app/chat/right-rail/preview-file.tsx +71 -25
- package/agent/apps/desktop/src/app/chat/right-rail/preview-pane.test.tsx +40 -1
- package/agent/apps/desktop/src/app/chat/right-rail/preview-pane.tsx +55 -53
- package/agent/apps/desktop/src/app/chat/right-rail/preview.tsx +35 -17
- package/agent/apps/desktop/src/app/chat/scroll-to-bottom-button.test.tsx +67 -0
- package/agent/apps/desktop/src/app/chat/scroll-to-bottom-button.tsx +74 -0
- package/agent/apps/desktop/src/app/chat/sidebar/cron-jobs-section.tsx +356 -0
- package/agent/apps/desktop/src/app/chat/sidebar/index.tsx +1189 -364
- package/agent/apps/desktop/src/app/chat/sidebar/load-more-row.tsx +30 -0
- package/agent/apps/desktop/src/app/chat/sidebar/order.test.ts +21 -0
- package/agent/apps/desktop/src/app/chat/sidebar/order.ts +17 -0
- package/agent/apps/desktop/src/app/chat/sidebar/profile-switcher.tsx +524 -0
- package/agent/apps/desktop/src/app/chat/sidebar/session-actions-menu.tsx +80 -45
- package/agent/apps/desktop/src/app/chat/sidebar/session-row.tsx +120 -25
- package/agent/apps/desktop/src/app/chat/sidebar/virtual-session-list.tsx +7 -13
- package/agent/apps/desktop/src/app/chat/sidebar/workspace-groups.test.ts +149 -0
- package/agent/apps/desktop/src/app/chat/sidebar/workspace-groups.ts +326 -0
- package/agent/apps/desktop/src/app/chat/thread-loading.ts +7 -2
- package/agent/apps/desktop/src/app/command-center/index.tsx +320 -581
- package/agent/apps/desktop/src/app/command-palette/index.tsx +681 -0
- package/agent/apps/desktop/src/app/command-palette/marketplace-theme-page.tsx +157 -0
- package/agent/apps/desktop/src/app/cron/index.tsx +392 -324
- package/agent/apps/desktop/src/app/cron/job-state.ts +29 -0
- package/agent/apps/desktop/src/app/desktop-controller.tsx +618 -123
- package/agent/apps/desktop/src/app/floating-hud.ts +22 -0
- package/agent/apps/desktop/src/app/gateway/hooks/use-gateway-boot.test.tsx +265 -0
- package/agent/apps/desktop/src/app/gateway/hooks/use-gateway-boot.ts +260 -14
- package/agent/apps/desktop/src/app/gateway/hooks/use-gateway-request.ts +48 -4
- package/agent/apps/desktop/src/app/hooks/use-keybinds.ts +270 -0
- package/agent/apps/desktop/src/app/hooks/use-refresh-hotkey.ts +45 -0
- package/agent/apps/desktop/src/app/layout-constants.ts +19 -0
- package/agent/apps/desktop/src/app/messaging/index.tsx +136 -241
- package/agent/apps/desktop/src/app/messaging/platform-icon.tsx +95 -0
- package/agent/apps/desktop/src/app/model-visibility-overlay.tsx +31 -0
- package/agent/apps/desktop/src/app/overlays/overlay-search-input.tsx +18 -62
- package/agent/apps/desktop/src/app/overlays/overlay-split-layout.tsx +59 -7
- package/agent/apps/desktop/src/app/overlays/overlay-view.tsx +9 -5
- package/agent/apps/desktop/src/app/page-search-shell.tsx +42 -20
- package/agent/apps/desktop/src/app/profiles/create-profile-dialog.tsx +165 -0
- package/agent/apps/desktop/src/app/profiles/delete-profile-dialog.tsx +65 -0
- package/agent/apps/desktop/src/app/profiles/index.tsx +174 -199
- package/agent/apps/desktop/src/app/profiles/rename-profile-dialog.tsx +125 -0
- package/agent/apps/desktop/src/app/right-sidebar/files/dnd-manager.ts +27 -0
- package/agent/apps/desktop/src/app/right-sidebar/files/ipc.test.ts +100 -0
- package/agent/apps/desktop/src/app/right-sidebar/files/ipc.ts +12 -18
- package/agent/apps/desktop/src/app/right-sidebar/files/remote-picker.tsx +177 -0
- package/agent/apps/desktop/src/app/right-sidebar/files/tree.tsx +35 -21
- package/agent/apps/desktop/src/app/right-sidebar/files/use-project-tree.test.ts +75 -3
- package/agent/apps/desktop/src/app/right-sidebar/files/use-project-tree.ts +152 -5
- package/agent/apps/desktop/src/app/right-sidebar/index.test.tsx +75 -0
- package/agent/apps/desktop/src/app/right-sidebar/index.tsx +166 -129
- package/agent/apps/desktop/src/app/right-sidebar/store.ts +19 -4
- package/agent/apps/desktop/src/app/right-sidebar/terminal/buffer.ts +65 -0
- package/agent/apps/desktop/src/app/right-sidebar/terminal/index.tsx +29 -34
- package/agent/apps/desktop/src/app/right-sidebar/terminal/persistent.tsx +18 -6
- package/agent/apps/desktop/src/app/right-sidebar/terminal/selection.ts +93 -32
- package/agent/apps/desktop/src/app/right-sidebar/terminal/use-terminal-session.ts +381 -119
- package/agent/apps/desktop/src/app/routes.ts +9 -0
- package/agent/apps/desktop/src/app/session/hooks/use-cwd-actions.ts +17 -7
- package/agent/apps/desktop/src/app/session/hooks/use-message-stream.ts +365 -47
- package/agent/apps/desktop/src/app/session/hooks/use-model-controls.test.tsx +198 -0
- package/agent/apps/desktop/src/app/session/hooks/use-model-controls.ts +70 -34
- package/agent/apps/desktop/src/app/session/hooks/use-prompt-actions.test.tsx +1061 -0
- package/agent/apps/desktop/src/app/session/hooks/use-prompt-actions.ts +1143 -165
- package/agent/apps/desktop/src/app/session/hooks/use-route-resume.test.tsx +341 -2
- package/agent/apps/desktop/src/app/session/hooks/use-route-resume.ts +176 -5
- package/agent/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx +259 -0
- package/agent/apps/desktop/src/app/session/hooks/use-session-actions.ts +452 -149
- package/agent/apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsx +327 -0
- package/agent/apps/desktop/src/app/session/hooks/use-session-state-cache.ts +133 -4
- package/agent/apps/desktop/src/app/session-picker-overlay.tsx +32 -0
- package/agent/apps/desktop/src/app/session-switcher.tsx +107 -0
- package/agent/apps/desktop/src/app/settings/about-settings.tsx +45 -36
- package/agent/apps/desktop/src/app/settings/appearance-settings.tsx +243 -162
- package/agent/apps/desktop/src/app/settings/config-settings.tsx +86 -66
- package/agent/apps/desktop/src/app/settings/constants.ts +459 -122
- package/agent/apps/desktop/src/app/settings/credential-key-ui.tsx +373 -0
- package/agent/apps/desktop/src/app/settings/env-credentials.tsx +198 -0
- package/agent/apps/desktop/src/app/settings/env-var-actions-menu.tsx +136 -0
- package/agent/apps/desktop/src/app/settings/field-copy.ts +56 -0
- package/agent/apps/desktop/src/app/settings/gateway-settings.tsx +385 -72
- package/agent/apps/desktop/src/app/settings/helpers.test.ts +156 -1
- package/agent/apps/desktop/src/app/settings/helpers.ts +30 -2
- package/agent/apps/desktop/src/app/settings/index.tsx +118 -84
- package/agent/apps/desktop/src/app/settings/keys-settings.tsx +62 -419
- package/agent/apps/desktop/src/app/settings/mcp-settings.tsx +65 -60
- package/agent/apps/desktop/src/app/settings/model-settings.test.tsx +129 -5
- package/agent/apps/desktop/src/app/settings/model-settings.tsx +370 -65
- package/agent/apps/desktop/src/app/settings/notifications-settings.tsx +150 -0
- package/agent/apps/desktop/src/app/settings/primitives.tsx +5 -11
- package/agent/apps/desktop/src/app/settings/provider-config-panel.test.tsx +142 -0
- package/agent/apps/desktop/src/app/settings/provider-config-panel.tsx +182 -0
- package/agent/apps/desktop/src/app/settings/providers-settings.test.tsx +171 -0
- package/agent/apps/desktop/src/app/settings/providers-settings.tsx +471 -0
- package/agent/apps/desktop/src/app/settings/sessions-settings.tsx +183 -71
- package/agent/apps/desktop/src/app/settings/toolset-config-panel.test.tsx +135 -1
- package/agent/apps/desktop/src/app/settings/toolset-config-panel.tsx +180 -57
- package/agent/apps/desktop/src/app/settings/types.ts +9 -6
- package/agent/apps/desktop/src/app/settings/uninstall-section.tsx +185 -0
- package/agent/apps/desktop/src/app/settings/use-deep-link-highlight.ts +60 -0
- package/agent/apps/desktop/src/app/shell/app-shell.tsx +59 -13
- package/agent/apps/desktop/src/app/shell/gateway-menu-panel.tsx +37 -32
- package/agent/apps/desktop/src/app/shell/hooks/use-overlay-routing.ts +6 -3
- package/agent/apps/desktop/src/app/shell/hooks/use-statusbar-items.tsx +212 -53
- package/agent/apps/desktop/src/app/shell/keybind-panel.tsx +215 -0
- package/agent/apps/desktop/src/app/shell/model-edit-submenu.test.tsx +84 -0
- package/agent/apps/desktop/src/app/shell/model-edit-submenu.tsx +244 -0
- package/agent/apps/desktop/src/app/shell/model-menu-panel.tsx +392 -0
- package/agent/apps/desktop/src/app/shell/statusbar-controls.tsx +23 -33
- package/agent/apps/desktop/src/app/shell/titlebar-controls.tsx +79 -95
- package/agent/apps/desktop/src/app/shell/titlebar.ts +8 -2
- package/agent/apps/desktop/src/app/skills/index.test.tsx +11 -0
- package/agent/apps/desktop/src/app/skills/index.tsx +79 -64
- package/agent/apps/desktop/src/app/types.ts +85 -0
- package/agent/apps/desktop/src/app/updates-overlay.tsx +110 -105
- package/agent/apps/desktop/src/components/assistant-ui/ansi-text.tsx +34 -0
- package/agent/apps/desktop/src/components/assistant-ui/block-direction.test.tsx +129 -0
- package/agent/apps/desktop/src/components/assistant-ui/clarify-tool.tsx +102 -81
- package/agent/apps/desktop/src/components/assistant-ui/directive-text.tsx +92 -15
- package/agent/apps/desktop/src/components/assistant-ui/markdown-text.test.ts +38 -0
- package/agent/apps/desktop/src/components/assistant-ui/markdown-text.tsx +304 -45
- package/agent/apps/desktop/src/components/assistant-ui/message-render-boundary.test.tsx +80 -0
- package/agent/apps/desktop/src/components/assistant-ui/message-render-boundary.tsx +48 -0
- package/agent/apps/desktop/src/components/assistant-ui/streaming.test.tsx +142 -90
- package/agent/apps/desktop/src/components/assistant-ui/thread-list.tsx +337 -0
- package/agent/apps/desktop/src/components/assistant-ui/thread.tsx +667 -190
- package/agent/apps/desktop/src/components/assistant-ui/tool-approval-group.test.tsx +299 -0
- package/agent/apps/desktop/src/components/assistant-ui/tool-approval.test.tsx +133 -0
- package/agent/apps/desktop/src/components/assistant-ui/tool-approval.tsx +239 -0
- package/agent/apps/desktop/src/components/assistant-ui/tool-fallback-model.test.ts +31 -0
- package/agent/apps/desktop/src/components/assistant-ui/tool-fallback-model.ts +152 -134
- package/agent/apps/desktop/src/components/assistant-ui/tool-fallback.tsx +142 -150
- package/agent/apps/desktop/src/components/assistant-ui/tooltip-icon-button.tsx +14 -12
- package/agent/apps/desktop/src/components/assistant-ui/user-message-edit.test.tsx +141 -0
- package/agent/apps/desktop/src/components/assistant-ui/user-message-text.tsx +152 -0
- package/agent/apps/desktop/src/components/boot-failure-overlay.tsx +150 -33
- package/agent/apps/desktop/src/components/boot-failure-reauth.test.ts +100 -0
- package/agent/apps/desktop/src/components/boot-failure-reauth.ts +81 -0
- package/agent/apps/desktop/src/components/brand-mark.tsx +19 -0
- package/agent/apps/desktop/src/components/chat/code-card.tsx +1 -1
- package/agent/apps/desktop/src/components/chat/composer-dock.ts +31 -0
- package/agent/apps/desktop/src/components/chat/diff-lines.tsx +1 -1
- package/agent/apps/desktop/src/components/chat/disclosure-row.tsx +13 -3
- package/agent/apps/desktop/src/components/chat/expandable-block.tsx +52 -0
- package/agent/apps/desktop/src/components/chat/generated-image-result.tsx +174 -0
- package/agent/apps/desktop/src/components/chat/image-generation-placeholder.tsx +70 -37
- package/agent/apps/desktop/src/components/chat/intro.tsx +8 -7
- package/agent/apps/desktop/src/components/chat/preview-attachment.tsx +4 -2
- package/agent/apps/desktop/src/components/chat/shiki-highlighter.test.ts +37 -0
- package/agent/apps/desktop/src/components/chat/shiki-highlighter.tsx +96 -22
- package/agent/apps/desktop/src/components/chat/status-row.tsx +70 -0
- package/agent/apps/desktop/src/components/chat/status-section.tsx +42 -0
- package/agent/apps/desktop/src/components/chat/terminal-output.tsx +54 -0
- package/agent/apps/desktop/src/components/chat/zoomable-image.tsx +70 -109
- package/agent/apps/desktop/src/components/desktop-install-overlay.tsx +154 -84
- package/agent/apps/desktop/src/components/desktop-onboarding-overlay.test.tsx +38 -8
- package/agent/apps/desktop/src/components/desktop-onboarding-overlay.tsx +789 -233
- package/agent/apps/desktop/src/components/error-boundary.tsx +77 -0
- package/agent/apps/desktop/src/components/gateway-connecting-overlay.test.tsx +144 -0
- package/agent/apps/desktop/src/components/gateway-connecting-overlay.tsx +7 -1
- package/agent/apps/desktop/src/components/haptics-provider.tsx +24 -0
- package/agent/apps/desktop/src/components/language-switcher.test.tsx +53 -0
- package/agent/apps/desktop/src/components/language-switcher.tsx +175 -0
- package/agent/apps/desktop/src/components/model-picker.tsx +42 -40
- package/agent/apps/desktop/src/components/model-visibility-dialog.tsx +166 -0
- package/agent/apps/desktop/src/components/notifications.tsx +48 -27
- package/agent/apps/desktop/src/components/pane-shell/index.ts +1 -1
- package/agent/apps/desktop/src/components/pane-shell/pane-shell.tsx +146 -9
- package/agent/apps/desktop/src/components/prompt-overlays.tsx +234 -0
- package/agent/apps/desktop/src/components/session-picker.tsx +108 -0
- package/agent/apps/desktop/src/components/ui/action-status.tsx +25 -0
- package/agent/apps/desktop/src/components/ui/badge.tsx +35 -0
- package/agent/apps/desktop/src/components/ui/button.tsx +37 -13
- package/agent/apps/desktop/src/components/ui/confirm-dialog.tsx +109 -0
- package/agent/apps/desktop/src/components/ui/control.ts +25 -0
- package/agent/apps/desktop/src/components/ui/copy-button.test.tsx +36 -0
- package/agent/apps/desktop/src/components/ui/copy-button.tsx +38 -27
- package/agent/apps/desktop/src/components/ui/dialog.tsx +39 -11
- package/agent/apps/desktop/src/components/ui/dropdown-menu.tsx +98 -24
- package/agent/apps/desktop/src/components/ui/error-state.tsx +50 -0
- package/agent/apps/desktop/src/components/ui/fade-text.tsx +9 -2
- package/agent/apps/desktop/src/components/ui/{braille-spinner.tsx → glyph-spinner.tsx} +15 -13
- package/agent/apps/desktop/src/components/ui/input.tsx +5 -2
- package/agent/apps/desktop/src/components/ui/kbd.tsx +83 -12
- package/agent/apps/desktop/src/components/ui/log-view.tsx +19 -0
- package/agent/apps/desktop/src/components/ui/pagination.tsx +12 -5
- package/agent/apps/desktop/src/components/ui/popover.tsx +44 -0
- package/agent/apps/desktop/src/components/ui/search-field.tsx +80 -0
- package/agent/apps/desktop/src/components/ui/segmented-control.tsx +51 -0
- package/agent/apps/desktop/src/components/ui/select.tsx +10 -3
- package/agent/apps/desktop/src/components/ui/sheet.tsx +8 -2
- package/agent/apps/desktop/src/components/ui/sidebar.tsx +18 -25
- package/agent/apps/desktop/src/components/ui/switch.tsx +38 -15
- package/agent/apps/desktop/src/components/ui/textarea.tsx +4 -11
- package/agent/apps/desktop/src/components/ui/tool-icon.tsx +65 -0
- package/agent/apps/desktop/src/components/ui/tooltip.tsx +31 -4
- package/agent/apps/desktop/src/fonts/JetBrainsMono-Bold.woff2 +0 -0
- package/agent/apps/desktop/src/fonts/JetBrainsMono-Italic.woff2 +0 -0
- package/agent/apps/desktop/src/fonts/JetBrainsMono-Regular.woff2 +0 -0
- package/agent/apps/desktop/src/global.d.ts +181 -4
- package/agent/apps/desktop/src/hermes.test.ts +60 -0
- package/agent/apps/desktop/src/hermes.ts +190 -13
- package/agent/apps/desktop/src/hooks/use-image-download.ts +85 -0
- package/agent/apps/desktop/src/hooks/use-resize-observer.ts +13 -4
- package/agent/apps/desktop/src/hooks/use-worktree-info.ts +68 -0
- package/agent/apps/desktop/src/i18n/catalog.ts +12 -0
- package/agent/apps/desktop/src/i18n/context.test.tsx +232 -0
- package/agent/apps/desktop/src/i18n/context.tsx +183 -0
- package/agent/apps/desktop/src/i18n/define-locale.ts +41 -0
- package/agent/apps/desktop/src/i18n/en.ts +1921 -0
- package/agent/apps/desktop/src/i18n/index.ts +20 -0
- package/agent/apps/desktop/src/i18n/ja.ts +2053 -0
- package/agent/apps/desktop/src/i18n/languages.test.ts +43 -0
- package/agent/apps/desktop/src/i18n/languages.ts +86 -0
- package/agent/apps/desktop/src/i18n/runtime.test.ts +75 -0
- package/agent/apps/desktop/src/i18n/runtime.ts +53 -0
- package/agent/apps/desktop/src/i18n/types.ts +1559 -0
- package/agent/apps/desktop/src/i18n/zh-hant.ts +1992 -0
- package/agent/apps/desktop/src/i18n/zh.ts +2099 -0
- package/agent/apps/desktop/src/lib/ansi.test.ts +123 -0
- package/agent/apps/desktop/src/lib/ansi.ts +186 -0
- package/agent/apps/desktop/src/lib/chat-messages.test.ts +79 -0
- package/agent/apps/desktop/src/lib/chat-messages.ts +68 -29
- package/agent/apps/desktop/src/lib/chat-runtime.test.ts +65 -1
- package/agent/apps/desktop/src/lib/chat-runtime.ts +39 -3
- package/agent/apps/desktop/src/lib/completion-sound.ts +519 -0
- package/agent/apps/desktop/src/lib/desktop-fs.test.ts +116 -0
- package/agent/apps/desktop/src/lib/desktop-fs.ts +113 -0
- package/agent/apps/desktop/src/lib/desktop-slash-commands.test.ts +89 -6
- package/agent/apps/desktop/src/lib/desktop-slash-commands.ts +270 -131
- package/agent/apps/desktop/src/lib/external-link.test.tsx +27 -0
- package/agent/apps/desktop/src/lib/external-link.tsx +9 -2
- package/agent/apps/desktop/src/lib/gateway-events.test.ts +27 -0
- package/agent/apps/desktop/src/lib/gateway-events.ts +16 -0
- package/agent/apps/desktop/src/lib/gateway-ws-url.test.ts +78 -0
- package/agent/apps/desktop/src/lib/gateway-ws-url.ts +91 -0
- package/agent/apps/desktop/src/lib/generated-images.test.ts +97 -0
- package/agent/apps/desktop/src/lib/generated-images.ts +116 -0
- package/agent/apps/desktop/src/lib/haptics.ts +17 -0
- package/agent/apps/desktop/src/lib/icons.ts +10 -2
- package/agent/apps/desktop/src/lib/keybinds/actions.ts +137 -0
- package/agent/apps/desktop/src/lib/keybinds/combo.test.ts +86 -0
- package/agent/apps/desktop/src/lib/keybinds/combo.ts +195 -0
- package/agent/apps/desktop/src/lib/local-preview.ts +23 -2
- package/agent/apps/desktop/src/lib/markdown-preprocess.ts +20 -7
- package/agent/apps/desktop/src/lib/media.remote.test.ts +90 -0
- package/agent/apps/desktop/src/lib/media.ts +40 -1
- package/agent/apps/desktop/src/lib/model-status-label.test.ts +59 -0
- package/agent/apps/desktop/src/lib/model-status-label.ts +122 -0
- package/agent/apps/desktop/src/lib/mutable-ref.ts +6 -0
- package/agent/apps/desktop/src/lib/profile-color.ts +58 -0
- package/agent/apps/desktop/src/lib/query-client.ts +13 -0
- package/agent/apps/desktop/src/lib/remend-tail.test.ts +105 -0
- package/agent/apps/desktop/src/lib/remend-tail.ts +108 -0
- package/agent/apps/desktop/src/lib/session-export.ts +6 -3
- package/agent/apps/desktop/src/lib/session-ids.test.ts +44 -0
- package/agent/apps/desktop/src/lib/session-ids.ts +26 -0
- package/agent/apps/desktop/src/lib/session-search.test.ts +66 -0
- package/agent/apps/desktop/src/lib/session-search.ts +21 -0
- package/agent/apps/desktop/src/lib/session-source.ts +126 -0
- package/agent/apps/desktop/src/lib/storage.test.ts +25 -0
- package/agent/apps/desktop/src/lib/storage.ts +35 -1
- package/agent/apps/desktop/src/lib/todos.test.ts +46 -1
- package/agent/apps/desktop/src/lib/todos.ts +37 -0
- package/agent/apps/desktop/src/lib/tool-result-summary.ts +5 -1
- package/agent/apps/desktop/src/lib/update-copy.test.ts +38 -0
- package/agent/apps/desktop/src/lib/update-copy.ts +44 -0
- package/agent/apps/desktop/src/lib/use-enter-animation.ts +2 -2
- package/agent/apps/desktop/src/lib/yolo-session.ts +50 -0
- package/agent/apps/desktop/src/main.tsx +19 -19
- package/agent/apps/desktop/src/store/boot.ts +4 -3
- package/agent/apps/desktop/src/store/clarify.test.ts +81 -0
- package/agent/apps/desktop/src/store/clarify.ts +50 -13
- package/agent/apps/desktop/src/store/command-palette.ts +20 -0
- package/agent/apps/desktop/src/store/compaction.test.ts +53 -0
- package/agent/apps/desktop/src/store/compaction.ts +38 -0
- package/agent/apps/desktop/src/store/completion-sound.ts +32 -0
- package/agent/apps/desktop/src/store/composer-input-history.test.ts +147 -0
- package/agent/apps/desktop/src/store/composer-input-history.ts +158 -0
- package/agent/apps/desktop/src/store/composer-queue.test.ts +68 -0
- package/agent/apps/desktop/src/store/composer-queue.ts +76 -0
- package/agent/apps/desktop/src/store/composer-status.test.ts +99 -0
- package/agent/apps/desktop/src/store/composer-status.ts +277 -0
- package/agent/apps/desktop/src/store/composer.test.ts +106 -0
- package/agent/apps/desktop/src/store/composer.ts +116 -0
- package/agent/apps/desktop/src/store/cron.ts +19 -0
- package/agent/apps/desktop/src/store/gateway.ts +280 -6
- package/agent/apps/desktop/src/store/keybinds.ts +143 -0
- package/agent/apps/desktop/src/store/layout.ts +107 -9
- package/agent/apps/desktop/src/store/model-presets.test.ts +51 -0
- package/agent/apps/desktop/src/store/model-presets.ts +86 -0
- package/agent/apps/desktop/src/store/model-visibility.test.ts +99 -0
- package/agent/apps/desktop/src/store/model-visibility.ts +161 -0
- package/agent/apps/desktop/src/store/native-notifications.test.ts +192 -0
- package/agent/apps/desktop/src/store/native-notifications.ts +203 -0
- package/agent/apps/desktop/src/store/notifications.ts +10 -7
- package/agent/apps/desktop/src/store/onboarding.test.ts +271 -1
- package/agent/apps/desktop/src/store/onboarding.ts +268 -38
- package/agent/apps/desktop/src/store/preview.ts +10 -1
- package/agent/apps/desktop/src/store/profile.test.ts +89 -0
- package/agent/apps/desktop/src/store/profile.ts +395 -0
- package/agent/apps/desktop/src/store/prompts.test.ts +127 -0
- package/agent/apps/desktop/src/store/prompts.ts +117 -0
- package/agent/apps/desktop/src/store/session-switcher.test.ts +115 -0
- package/agent/apps/desktop/src/store/session-switcher.ts +128 -0
- package/agent/apps/desktop/src/store/session-sync.ts +25 -0
- package/agent/apps/desktop/src/store/session.test.ts +268 -2
- package/agent/apps/desktop/src/store/session.ts +392 -18
- package/agent/apps/desktop/src/store/subagents.ts +3 -0
- package/agent/apps/desktop/src/store/system-actions.ts +48 -0
- package/agent/apps/desktop/src/store/thread-scroll.ts +58 -5
- package/agent/apps/desktop/src/store/todos.test.ts +47 -0
- package/agent/apps/desktop/src/store/todos.ts +64 -0
- package/agent/apps/desktop/src/store/tool-dismiss.ts +45 -0
- package/agent/apps/desktop/src/store/translucency.ts +38 -0
- package/agent/apps/desktop/src/store/updates.test.ts +187 -2
- package/agent/apps/desktop/src/store/updates.ts +268 -18
- package/agent/apps/desktop/src/store/windows.test.ts +143 -0
- package/agent/apps/desktop/src/store/windows.ts +115 -0
- package/agent/apps/desktop/src/styles.css +510 -119
- package/agent/apps/desktop/src/themes/color.ts +142 -0
- package/agent/apps/desktop/src/themes/context.tsx +128 -75
- package/agent/apps/desktop/src/themes/install.test.ts +119 -0
- package/agent/apps/desktop/src/themes/install.ts +95 -0
- package/agent/apps/desktop/src/themes/presets.test.ts +33 -0
- package/agent/apps/desktop/src/themes/presets.ts +13 -4
- package/agent/apps/desktop/src/themes/profile-theme.test.ts +41 -0
- package/agent/apps/desktop/src/themes/types.ts +35 -0
- package/agent/apps/desktop/src/themes/user-themes.test.ts +63 -0
- package/agent/apps/desktop/src/themes/user-themes.ts +122 -0
- package/agent/apps/desktop/src/themes/vscode.test.ts +171 -0
- package/agent/apps/desktop/src/themes/vscode.ts +343 -0
- package/agent/apps/desktop/src/types/hermes.ts +138 -1
- package/agent/apps/desktop/tsconfig.json +2 -2
- package/agent/apps/desktop/vite.config.ts +18 -0
- package/agent/apps/shared/package.json +1 -1
- package/agent/apps/shared/src/json-rpc-gateway.ts +63 -2
- package/agent/apps/shared/tsconfig.json +2 -2
- package/agent/cli-config.yaml.example +78 -1
- package/agent/cli.py +2177 -3162
- package/agent/cron/blueprint_catalog.py +713 -0
- package/agent/cron/jobs.py +226 -110
- package/agent/cron/scheduler.py +468 -193
- package/agent/cron/scheduler_provider.py +177 -0
- package/agent/cron/scripts/__init__.py +1 -0
- package/agent/cron/scripts/classify_items.py +226 -0
- package/agent/cron/suggestion_catalog.py +154 -0
- package/agent/cron/suggestions.py +257 -0
- package/agent/docs/chronos-managed-cron-contract.md +196 -0
- package/agent/docs/design/profile-builder.md +146 -0
- package/agent/docs/middleware/README.md +260 -0
- package/agent/docs/observability/README.md +316 -0
- package/agent/docs/plans/2026-06-09-003-fix-telegram-stream-overflow-continuations-plan.md +240 -0
- package/agent/docs/rca-ssl-cacert-post-git-pull.md +54 -0
- package/agent/docs/relay-connector-contract.md +285 -0
- package/agent/gateway/authz_mixin.py +536 -0
- package/agent/gateway/channel_directory.py +65 -3
- package/agent/gateway/config.py +222 -12
- package/agent/gateway/display_config.py +10 -0
- package/agent/gateway/hooks.py +17 -0
- package/agent/gateway/kanban_watchers.py +1146 -0
- package/agent/gateway/message_timestamps.py +166 -0
- package/agent/gateway/platforms/ADDING_A_PLATFORM.md +29 -0
- package/agent/gateway/platforms/api_server.py +216 -38
- package/agent/gateway/platforms/base.py +210 -58
- package/agent/gateway/platforms/email.py +122 -12
- package/agent/gateway/platforms/feishu.py +80 -11
- package/agent/gateway/platforms/feishu_meeting_invite.py +212 -0
- package/agent/gateway/platforms/matrix.py +1498 -297
- package/agent/gateway/platforms/qqbot/adapter.py +6 -0
- package/agent/gateway/platforms/signal.py +8 -0
- package/agent/gateway/platforms/slack.py +308 -12
- package/agent/gateway/platforms/telegram.py +831 -24
- package/agent/gateway/platforms/webhook.py +109 -21
- package/agent/gateway/platforms/weixin.py +113 -2
- package/agent/gateway/platforms/whatsapp.py +94 -288
- package/agent/gateway/platforms/whatsapp_cloud.py +1956 -0
- package/agent/gateway/platforms/whatsapp_common.py +367 -0
- package/agent/gateway/platforms/yuanbao.py +608 -191
- package/agent/gateway/platforms/yuanbao_proto.py +232 -23
- package/agent/gateway/relay/__init__.py +375 -0
- package/agent/gateway/relay/adapter.py +222 -0
- package/agent/gateway/relay/auth.py +168 -0
- package/agent/gateway/relay/descriptor.py +118 -0
- package/agent/gateway/relay/transport.py +101 -0
- package/agent/gateway/relay/ws_transport.py +327 -0
- package/agent/gateway/response_filters.py +53 -0
- package/agent/gateway/rich_sent_store.py +80 -0
- package/agent/gateway/run.py +2940 -5001
- package/agent/gateway/session.py +109 -8
- package/agent/gateway/session_context.py +22 -4
- package/agent/gateway/slash_commands.py +3854 -0
- package/agent/gateway/status.py +141 -21
- package/agent/gateway/stream_consumer.py +288 -31
- package/agent/hermes-already-has-routines.md +1 -1
- package/agent/hermes_cli/__init__.py +62 -17
- package/agent/hermes_cli/_parser.py +30 -0
- package/agent/hermes_cli/_subprocess_compat.py +61 -0
- package/agent/hermes_cli/active_sessions.py +320 -0
- package/agent/hermes_cli/auth.py +707 -59
- package/agent/hermes_cli/auth_commands.py +39 -22
- package/agent/hermes_cli/backup.py +109 -7
- package/agent/hermes_cli/banner.py +88 -0
- package/agent/hermes_cli/blueprint_cmd.py +318 -0
- package/agent/hermes_cli/cli_agent_setup_mixin.py +684 -0
- package/agent/hermes_cli/cli_commands_mixin.py +2293 -0
- package/agent/hermes_cli/commands.py +215 -91
- package/agent/hermes_cli/config.py +967 -130
- package/agent/hermes_cli/container_boot.py +76 -11
- package/agent/hermes_cli/cron.py +5 -11
- package/agent/hermes_cli/curator.py +21 -0
- package/agent/hermes_cli/dashboard_auth/__init__.py +2 -0
- package/agent/hermes_cli/dashboard_auth/base.py +62 -0
- package/agent/hermes_cli/dashboard_auth/cookies.py +32 -19
- package/agent/hermes_cli/dashboard_auth/login_page.py +156 -6
- package/agent/hermes_cli/dashboard_auth/middleware.py +28 -4
- package/agent/hermes_cli/dashboard_auth/prefix.py +46 -2
- package/agent/hermes_cli/dashboard_auth/public_paths.py +6 -0
- package/agent/hermes_cli/dashboard_auth/routes.py +158 -2
- package/agent/hermes_cli/dashboard_auth/ws_tickets.py +85 -11
- package/agent/hermes_cli/dashboard_register.py +427 -0
- package/agent/hermes_cli/debug.py +155 -50
- package/agent/hermes_cli/doctor.py +255 -14
- package/agent/hermes_cli/dump.py +60 -6
- package/agent/hermes_cli/env_loader.py +33 -0
- package/agent/hermes_cli/gateway.py +755 -103
- package/agent/hermes_cli/gateway_enroll.py +250 -0
- package/agent/hermes_cli/gateway_windows.py +254 -11
- package/agent/hermes_cli/gui_uninstall.py +285 -0
- package/agent/hermes_cli/inventory.py +105 -4
- package/agent/hermes_cli/kanban.py +58 -71
- package/agent/hermes_cli/kanban_db.py +391 -14
- package/agent/hermes_cli/kanban_decompose.py +2 -2
- package/agent/hermes_cli/kanban_specify.py +3 -1
- package/agent/hermes_cli/logs.py +2 -0
- package/agent/hermes_cli/main.py +2889 -5287
- package/agent/hermes_cli/managed_scope.py +214 -0
- package/agent/hermes_cli/managed_uv.py +254 -0
- package/agent/hermes_cli/mcp_catalog.py +6 -3
- package/agent/hermes_cli/mcp_config.py +145 -21
- package/agent/hermes_cli/mcp_security.py +96 -0
- package/agent/hermes_cli/mcp_startup.py +32 -3
- package/agent/hermes_cli/memory_providers.py +149 -0
- package/agent/hermes_cli/memory_setup.py +97 -42
- package/agent/hermes_cli/middleware.py +313 -0
- package/agent/hermes_cli/model_catalog.py +31 -0
- package/agent/hermes_cli/model_cost_guard.py +134 -0
- package/agent/hermes_cli/model_normalize.py +2 -1
- package/agent/hermes_cli/model_setup_flows.py +2759 -0
- package/agent/hermes_cli/model_switch.py +242 -27
- package/agent/hermes_cli/models.py +284 -44
- package/agent/hermes_cli/nous_account.py +33 -6
- package/agent/hermes_cli/nous_billing.py +406 -0
- package/agent/hermes_cli/nous_subscription.py +202 -5
- package/agent/hermes_cli/platforms.py +1 -0
- package/agent/hermes_cli/plugins.py +218 -18
- package/agent/hermes_cli/plugins_cmd.py +249 -105
- package/agent/hermes_cli/portal_cli.py +56 -16
- package/agent/hermes_cli/profile_distribution.py +6 -1
- package/agent/hermes_cli/profiles.py +283 -32
- package/agent/hermes_cli/provider_catalog.py +170 -0
- package/agent/hermes_cli/providers.py +4 -1
- package/agent/hermes_cli/pty_bridge.py +53 -4
- package/agent/hermes_cli/runtime_provider.py +216 -34
- package/agent/hermes_cli/secret_prompt.py +4 -4
- package/agent/hermes_cli/secrets_cli.py +24 -0
- package/agent/hermes_cli/send_cmd.py +28 -2
- package/agent/hermes_cli/service_manager.py +166 -19
- package/agent/hermes_cli/session_listing.py +97 -0
- package/agent/hermes_cli/setup.py +158 -94
- package/agent/hermes_cli/setup_whatsapp_cloud.py +541 -0
- package/agent/hermes_cli/skills_config.py +8 -2
- package/agent/hermes_cli/skills_hub.py +149 -7
- package/agent/hermes_cli/status.py +2 -2
- package/agent/hermes_cli/subcommands/__init__.py +18 -0
- package/agent/hermes_cli/subcommands/_shared.py +29 -0
- package/agent/hermes_cli/subcommands/acp.py +52 -0
- package/agent/hermes_cli/subcommands/auth.py +109 -0
- package/agent/hermes_cli/subcommands/backup.py +38 -0
- package/agent/hermes_cli/subcommands/claw.py +92 -0
- package/agent/hermes_cli/subcommands/config.py +49 -0
- package/agent/hermes_cli/subcommands/cron.py +163 -0
- package/agent/hermes_cli/subcommands/dashboard.py +143 -0
- package/agent/hermes_cli/subcommands/debug.py +77 -0
- package/agent/hermes_cli/subcommands/doctor.py +35 -0
- package/agent/hermes_cli/subcommands/dump.py +28 -0
- package/agent/hermes_cli/subcommands/gateway.py +332 -0
- package/agent/hermes_cli/subcommands/gui.py +63 -0
- package/agent/hermes_cli/subcommands/hooks.py +77 -0
- package/agent/hermes_cli/subcommands/import_cmd.py +31 -0
- package/agent/hermes_cli/subcommands/insights.py +25 -0
- package/agent/hermes_cli/subcommands/login.py +78 -0
- package/agent/hermes_cli/subcommands/logout.py +28 -0
- package/agent/hermes_cli/subcommands/logs.py +78 -0
- package/agent/hermes_cli/subcommands/mcp.py +108 -0
- package/agent/hermes_cli/subcommands/memory.py +53 -0
- package/agent/hermes_cli/subcommands/model.py +72 -0
- package/agent/hermes_cli/subcommands/pairing.py +36 -0
- package/agent/hermes_cli/subcommands/plugins.py +94 -0
- package/agent/hermes_cli/subcommands/postinstall.py +23 -0
- package/agent/hermes_cli/subcommands/profile.py +203 -0
- package/agent/hermes_cli/subcommands/prompt_size.py +36 -0
- package/agent/hermes_cli/subcommands/security.py +62 -0
- package/agent/hermes_cli/subcommands/setup.py +58 -0
- package/agent/hermes_cli/subcommands/skills.py +298 -0
- package/agent/hermes_cli/subcommands/slack.py +60 -0
- package/agent/hermes_cli/subcommands/status.py +28 -0
- package/agent/hermes_cli/subcommands/tools.py +95 -0
- package/agent/hermes_cli/subcommands/uninstall.py +41 -0
- package/agent/hermes_cli/subcommands/update.py +70 -0
- package/agent/hermes_cli/subcommands/version.py +18 -0
- package/agent/hermes_cli/subcommands/webhook.py +76 -0
- package/agent/hermes_cli/subcommands/whatsapp.py +22 -0
- package/agent/hermes_cli/suggestions_cmd.py +153 -0
- package/agent/hermes_cli/telegram_managed_bot.py +358 -0
- package/agent/hermes_cli/tips.py +3 -4
- package/agent/hermes_cli/tools_config.py +155 -28
- package/agent/hermes_cli/uninstall.py +231 -35
- package/agent/hermes_cli/web_server.py +6190 -973
- package/agent/hermes_cli/win_pty_bridge.py +179 -0
- package/agent/hermes_cli/write_approval_commands.py +209 -0
- package/agent/hermes_constants.py +164 -33
- package/agent/hermes_logging.py +74 -2
- package/agent/hermes_state.py +919 -106
- package/agent/hermes_time.py +20 -0
- package/agent/locales/af.yaml +23 -0
- package/agent/locales/de.yaml +23 -0
- package/agent/locales/en.yaml +20 -0
- package/agent/locales/es.yaml +23 -0
- package/agent/locales/fr.yaml +23 -0
- package/agent/locales/ga.yaml +23 -0
- package/agent/locales/hu.yaml +23 -0
- package/agent/locales/it.yaml +23 -0
- package/agent/locales/ja.yaml +23 -0
- package/agent/locales/ko.yaml +23 -0
- package/agent/locales/pt.yaml +23 -0
- package/agent/locales/ru.yaml +23 -0
- package/agent/locales/tr.yaml +23 -0
- package/agent/locales/uk.yaml +23 -0
- package/agent/locales/zh-hant.yaml +23 -0
- package/agent/locales/zh.yaml +23 -0
- package/agent/model_tools.py +204 -40
- package/agent/optional-mcps/clawpump/manifest.yaml +4 -2
- package/agent/optional-mcps/clawpump-stdio/manifest.yaml +2 -0
- package/agent/optional-mcps/unreal-engine/manifest.yaml +54 -0
- package/agent/optional-skills/blockchain/hyperliquid/SKILL.md +2 -2
- package/agent/optional-skills/blockchain/hyperliquid/scripts/hyperliquid_client.py +1 -1
- package/agent/optional-skills/creative/kanban-video-orchestrator/SKILL.md +1 -1
- package/agent/optional-skills/creative/kanban-video-orchestrator/assets/setup.sh.tmpl +4 -3
- package/agent/optional-skills/creative/kanban-video-orchestrator/references/kanban-setup.md +6 -4
- package/agent/optional-skills/creative/kanban-video-orchestrator/references/tool-matrix.md +2 -2
- package/agent/{skills/software-development → optional-skills/devops}/hermes-s6-container-supervision/SKILL.md +2 -0
- package/agent/optional-skills/devops/watchers/SKILL.md +1 -1
- package/agent/optional-skills/devops/watchers/scripts/watch_github.py +2 -1
- package/agent/optional-skills/payments/mpp-agent/SKILL.md +124 -0
- package/agent/optional-skills/payments/stripe-link-cli/SKILL.md +184 -0
- package/agent/optional-skills/payments/stripe-projects/SKILL.md +120 -0
- package/agent/optional-skills/productivity/canvas/SKILL.md +1 -1
- package/agent/optional-skills/productivity/canvas/scripts/canvas_api.py +4 -1
- package/agent/optional-skills/productivity/shop/SKILL.md +224 -0
- package/agent/optional-skills/productivity/shop/references/catalog-mcp.md +236 -0
- package/agent/optional-skills/productivity/shop/references/direct-api.md +278 -0
- package/agent/optional-skills/productivity/shop/references/legal.md +3 -0
- package/agent/optional-skills/productivity/shop/references/safety.md +36 -0
- package/agent/optional-skills/productivity/shopify/SKILL.md +1 -1
- package/agent/optional-skills/productivity/siyuan/SKILL.md +1 -1
- package/agent/optional-skills/productivity/telephony/SKILL.md +4 -4
- package/agent/optional-skills/productivity/telephony/scripts/telephony.py +15 -15
- package/agent/optional-skills/security/1password/SKILL.md +1 -1
- package/agent/{skills/red-teaming → optional-skills/security}/godmode/SKILL.md +3 -4
- package/agent/{skills/red-teaming → optional-skills/security}/godmode/scripts/auto_jailbreak.py +3 -1
- package/agent/optional-skills/software-development/rest-graphql-debug/SKILL.md +1 -1
- package/agent/{skills → optional-skills}/software-development/subagent-driven-development/SKILL.md +5 -5
- package/agent/package-lock.json +4082 -7907
- package/agent/package.json +18 -3
- package/agent/plugins/browser/firecrawl/provider.py +4 -1
- package/agent/plugins/cron/__init__.py +344 -0
- package/agent/plugins/cron/chronos/__init__.py +241 -0
- package/agent/plugins/cron/chronos/_nas_client.py +123 -0
- package/agent/plugins/cron/chronos/plugin.yaml +9 -0
- package/agent/plugins/cron/chronos/verify.py +103 -0
- package/agent/plugins/dashboard_auth/basic/__init__.py +491 -0
- package/agent/plugins/dashboard_auth/basic/plugin.yaml +7 -0
- package/agent/plugins/dashboard_auth/nous/__init__.py +12 -14
- package/agent/plugins/dashboard_auth/self_hosted/__init__.py +736 -0
- package/agent/plugins/dashboard_auth/self_hosted/plugin.yaml +8 -0
- package/agent/plugins/disk-cleanup/disk_cleanup.py +100 -20
- package/agent/plugins/google_meet/audio_bridge.py +4 -0
- package/agent/plugins/google_meet/meet_bot.py +7 -1
- package/agent/plugins/hermes-achievements/dashboard/dist/index.js +9 -15
- package/agent/plugins/image_gen/fal/__init__.py +35 -6
- package/agent/plugins/image_gen/krea/__init__.py +56 -13
- package/agent/plugins/image_gen/openai/__init__.py +122 -24
- package/agent/plugins/image_gen/openai-codex/__init__.py +28 -2
- package/agent/plugins/image_gen/xai/__init__.py +92 -12
- package/agent/plugins/kanban/dashboard/dist/index.js +63 -48
- package/agent/plugins/kanban/dashboard/plugin_api.py +39 -35
- package/agent/plugins/memory/__init__.py +48 -5
- package/agent/plugins/memory/byterover/__init__.py +1 -0
- package/agent/plugins/memory/hindsight/README.md +1 -1
- package/agent/plugins/memory/hindsight/__init__.py +138 -24
- package/agent/plugins/memory/hindsight/plugin.yaml +1 -1
- package/agent/plugins/memory/honcho/README.md +13 -10
- package/agent/plugins/memory/honcho/cli.py +247 -122
- package/agent/plugins/memory/honcho/client.py +112 -102
- package/agent/plugins/memory/openviking/README.md +12 -1
- package/agent/plugins/memory/openviking/__init__.py +2281 -107
- package/agent/plugins/memory/openviking/plugin.yaml +1 -2
- package/agent/plugins/memory/supermemory/README.md +22 -10
- package/agent/plugins/memory/supermemory/__init__.py +142 -37
- package/agent/plugins/memory/supermemory/plugin.yaml +1 -1
- package/agent/plugins/model-providers/anthropic/__init__.py +1 -0
- package/agent/plugins/model-providers/bedrock/__init__.py +1 -0
- package/agent/plugins/model-providers/copilot-acp/__init__.py +1 -0
- package/agent/plugins/model-providers/custom/__init__.py +8 -2
- package/agent/plugins/model-providers/kimi-coding/__init__.py +16 -7
- package/agent/plugins/model-providers/minimax/__init__.py +60 -8
- package/agent/plugins/model-providers/opencode-zen/__init__.py +12 -3
- package/agent/plugins/model-providers/openrouter/__init__.py +75 -4
- package/agent/plugins/model-providers/xiaomi/__init__.py +2 -0
- package/agent/plugins/model-providers/zai/__init__.py +1 -0
- package/agent/plugins/observability/langfuse/__init__.py +147 -14
- package/agent/plugins/observability/nemo_relay/README.md +559 -0
- package/agent/plugins/observability/nemo_relay/__init__.py +962 -0
- package/agent/plugins/observability/nemo_relay/plugin.yaml +20 -0
- package/agent/plugins/platforms/discord/adapter.py +932 -61
- package/agent/plugins/platforms/discord/voice_mixer.py +379 -0
- package/agent/plugins/platforms/google_chat/adapter.py +9 -3
- package/agent/plugins/platforms/google_chat/oauth.py +1 -1
- package/agent/plugins/platforms/homeassistant/__init__.py +3 -0
- package/agent/{gateway/platforms/homeassistant.py → plugins/platforms/homeassistant/adapter.py} +128 -0
- package/agent/plugins/platforms/homeassistant/plugin.yaml +22 -0
- package/agent/plugins/platforms/irc/adapter.py +4 -1
- package/agent/plugins/platforms/line/adapter.py +16 -1
- package/agent/plugins/platforms/mattermost/adapter.py +100 -24
- package/agent/plugins/platforms/photon/README.md +179 -0
- package/agent/plugins/platforms/photon/__init__.py +4 -0
- package/agent/plugins/platforms/photon/adapter.py +1586 -0
- package/agent/plugins/platforms/photon/auth.py +1046 -0
- package/agent/plugins/platforms/photon/cli.py +439 -0
- package/agent/plugins/platforms/photon/plugin.yaml +88 -0
- package/agent/plugins/platforms/photon/sidecar/README.md +52 -0
- package/agent/plugins/platforms/photon/sidecar/index.mjs +720 -0
- package/agent/plugins/platforms/photon/sidecar/package-lock.json +1730 -0
- package/agent/plugins/platforms/photon/sidecar/package.json +25 -0
- package/agent/plugins/platforms/photon/sidecar/patch-spectrum-mixed-attachments.mjs +155 -0
- package/agent/plugins/platforms/raft/__init__.py +3 -0
- package/agent/plugins/platforms/raft/adapter.py +774 -0
- package/agent/plugins/platforms/raft/plugin.yaml +19 -0
- package/agent/plugins/platforms/simplex/adapter.py +777 -220
- package/agent/plugins/platforms/simplex/plugin.yaml +21 -2
- package/agent/plugins/platforms/teams/adapter.py +175 -5
- package/agent/plugins/plugin_utils.py +135 -0
- package/agent/plugins/video_gen/fal/__init__.py +10 -3
- package/agent/plugins/web/searxng/provider.py +15 -2
- package/agent/plugins/web/xai/provider.py +2 -2
- package/agent/providers/base.py +22 -3
- package/agent/pyproject.toml +115 -21
- package/agent/run_agent.py +733 -39
- package/agent/scripts/build_skills_index.py +51 -19
- package/agent/scripts/check_subprocess_stdin.py +177 -0
- package/agent/scripts/contributor_audit.py +2 -0
- package/agent/scripts/docker_config_migrate.py +67 -0
- package/agent/scripts/install.cmd +3 -3
- package/agent/scripts/install.ps1 +580 -154
- package/agent/scripts/install.sh +402 -185
- package/agent/scripts/lib/node-bootstrap.sh +39 -4
- package/agent/scripts/release.py +183 -0
- package/agent/scripts/run_tests.sh +1 -0
- package/agent/scripts/run_tests_parallel.py +18 -23
- package/agent/scripts/whatsapp-bridge/bridge.js +25 -4
- package/agent/setup.py +59 -0
- package/agent/skills/autonomous-ai-agents/codex/SKILL.md +19 -0
- package/agent/skills/autonomous-ai-agents/hermes-agent/SKILL.md +10 -3
- package/agent/skills/{mcp/native-mcp/SKILL.md → autonomous-ai-agents/hermes-agent/references/native-mcp.md} +0 -13
- package/agent/skills/{devops/webhook-subscriptions/SKILL.md → autonomous-ai-agents/hermes-agent/references/webhooks.md} +1 -11
- package/agent/skills/clawpump/SKILL.md +4 -1
- package/agent/skills/devops/kanban-orchestrator/SKILL.md +1 -0
- package/agent/skills/devops/kanban-worker/SKILL.md +1 -0
- package/agent/skills/github/github-auth/SKILL.md +2 -2
- package/agent/skills/github/github-auth/scripts/gh-env.sh +2 -2
- package/agent/skills/github/github-code-review/SKILL.md +2 -2
- package/agent/skills/github/github-issues/SKILL.md +2 -2
- package/agent/skills/github/github-pr-workflow/SKILL.md +2 -2
- package/agent/skills/github/github-repo-management/SKILL.md +2 -2
- package/agent/skills/media/gif-search/SKILL.md +1 -1
- package/agent/skills/media/youtube-content/SKILL.md +10 -7
- package/agent/skills/media/youtube-content/scripts/fetch_transcript.py +3 -3
- package/agent/skills/note-taking/obsidian/SKILL.md +1 -1
- package/agent/skills/productivity/airtable/SKILL.md +2 -2
- package/agent/skills/productivity/google-workspace/scripts/setup.py +33 -7
- package/agent/skills/productivity/notion/SKILL.md +2 -2
- package/agent/skills/productivity/teams-meeting-pipeline/SKILL.md +1 -1
- package/agent/skills/research/llm-wiki/SKILL.md +1 -1
- package/agent/skills/social-media/xurl/SKILL.md +9 -0
- package/agent/skills/software-development/hermes-agent-skill-authoring/SKILL.md +1 -1
- package/agent/skills/software-development/plan/SKILL.md +285 -5
- package/agent/skills/software-development/requesting-code-review/SKILL.md +2 -2
- package/agent/skills/software-development/simplify-code/SKILL.md +212 -0
- package/agent/skills/software-development/spike/SKILL.md +2 -2
- package/agent/skills/software-development/systematic-debugging/SKILL.md +1 -1
- package/agent/skills/software-development/test-driven-development/SKILL.md +1 -1
- package/agent/tools/approval.py +302 -4
- package/agent/tools/async_delegation.py +386 -0
- package/agent/tools/blueprints.py +325 -0
- package/agent/tools/browser_cdp_tool.py +3 -3
- package/agent/tools/browser_tool.py +34 -6
- package/agent/tools/checkpoint_manager.py +31 -1
- package/agent/tools/clarify_tool.py +55 -5
- package/agent/tools/code_execution_tool.py +31 -14
- package/agent/tools/computer_use/cua_backend.py +81 -3
- package/agent/tools/computer_use/tool.py +79 -5
- package/agent/tools/computer_use/vision_routing.py +55 -3
- package/agent/tools/credential_files.py +31 -12
- package/agent/tools/cronjob_tools.py +30 -20
- package/agent/tools/delegate_tool.py +356 -31
- package/agent/tools/env_probe.py +1 -0
- package/agent/tools/environments/docker.py +163 -8
- package/agent/tools/environments/file_sync.py +2 -1
- package/agent/tools/environments/local.py +74 -23
- package/agent/tools/environments/singularity.py +4 -1
- package/agent/tools/environments/ssh.py +78 -11
- package/agent/tools/file_operations.py +277 -41
- package/agent/tools/file_tools.py +166 -28
- package/agent/tools/image_generation_tool.py +515 -29
- package/agent/tools/kanban_tools.py +99 -0
- package/agent/tools/lazy_deps.py +33 -2
- package/agent/tools/mcp_oauth.py +5 -5
- package/agent/tools/mcp_oauth_manager.py +7 -5
- package/agent/tools/mcp_tool.py +840 -33
- package/agent/tools/memory_tool.py +335 -38
- package/agent/tools/osv_check.py +15 -1
- package/agent/tools/process_registry.py +155 -11
- package/agent/tools/read_extract.py +248 -0
- package/agent/tools/read_terminal_tool.py +93 -0
- package/agent/tools/schema_sanitizer.py +38 -0
- package/agent/tools/send_message_tool.py +163 -49
- package/agent/tools/session_search_tool.py +189 -7
- package/agent/tools/skill_manager_tool.py +202 -3
- package/agent/tools/skill_usage.py +52 -4
- package/agent/tools/skills_hub.py +184 -44
- package/agent/tools/skills_sync.py +232 -5
- package/agent/tools/skills_tool.py +125 -11
- package/agent/tools/terminal_tool.py +148 -26
- package/agent/tools/tirith_security.py +2 -0
- package/agent/tools/todo_tool.py +32 -1
- package/agent/tools/transcription_tools.py +13 -5
- package/agent/tools/tts_tool.py +332 -38
- package/agent/tools/url_safety.py +52 -1
- package/agent/tools/vision_tools.py +124 -39
- package/agent/tools/voice_mode.py +4 -3
- package/agent/tools/web_tools.py +45 -15
- package/agent/tools/write_approval.py +493 -0
- package/agent/toolsets.py +34 -10
- package/agent/trajectory_compressor.py +81 -10
- package/agent/tui_gateway/entry.py +43 -6
- package/agent/tui_gateway/server.py +3335 -330
- package/agent/tui_gateway/slash_worker.py +61 -0
- package/agent/tui_gateway/ws.py +67 -9
- package/agent/ui-tui/eslint.config.mjs +0 -4
- package/agent/ui-tui/package.json +6 -6
- package/agent/ui-tui/packages/hermes-ink/package.json +1 -1
- package/agent/ui-tui/packages/hermes-ink/src/ink/app-mouse.test.ts +34 -1
- package/agent/ui-tui/packages/hermes-ink/src/ink/app-rawmode-mouse.test.ts +91 -0
- package/agent/ui-tui/packages/hermes-ink/src/ink/components/App.tsx +35 -2
- package/agent/ui-tui/packages/hermes-ink/src/ink/events/input-event.ts +4 -11
- package/agent/ui-tui/packages/hermes-ink/src/ink/parse-keypress.test.ts +23 -57
- package/agent/ui-tui/packages/hermes-ink/src/ink/parse-keypress.ts +11 -135
- package/agent/ui-tui/packages/hermes-ink/src/ink/termio/tokenize.test.ts +185 -0
- package/agent/ui-tui/packages/hermes-ink/src/ink/termio/tokenize.ts +37 -3
- package/agent/ui-tui/packages/hermes-ink/src/utils/execFileNoThrow.ts +5 -5
- package/agent/ui-tui/src/__tests__/appChromeStatusRule.test.tsx +217 -0
- package/agent/ui-tui/src/__tests__/appChromeStatusRuleDevCredits.test.tsx +73 -0
- package/agent/ui-tui/src/__tests__/approvalAction.test.ts +11 -0
- package/agent/ui-tui/src/__tests__/billingCommand.test.ts +301 -0
- package/agent/ui-tui/src/__tests__/blockLayout.test.ts +122 -0
- package/agent/ui-tui/src/__tests__/brandingMcpCount.test.ts +111 -0
- package/agent/ui-tui/src/__tests__/completionApply.test.ts +51 -0
- package/agent/ui-tui/src/__tests__/createGatewayEventHandler.test.ts +487 -2
- package/agent/ui-tui/src/__tests__/createSlashHandler.test.ts +54 -0
- package/agent/ui-tui/src/__tests__/creditsCommand.test.ts +144 -0
- package/agent/ui-tui/src/__tests__/gatewayClient.test.ts +120 -99
- package/agent/ui-tui/src/__tests__/gracefulExit.test.ts +11 -0
- package/agent/ui-tui/src/__tests__/memoryMonitor.test.ts +102 -0
- package/agent/ui-tui/src/__tests__/paths.test.ts +41 -1
- package/agent/ui-tui/src/__tests__/terminalModes.test.ts +22 -0
- package/agent/ui-tui/src/__tests__/text.test.ts +23 -0
- package/agent/ui-tui/src/__tests__/textInputFastEcho.test.ts +37 -0
- package/agent/ui-tui/src/__tests__/turnControllerNotice.test.ts +43 -0
- package/agent/ui-tui/src/__tests__/useInputHandlers.test.ts +38 -1
- package/agent/ui-tui/src/__tests__/virtualHeights.test.ts +8 -0
- package/agent/ui-tui/src/app/createGatewayEventHandler.ts +102 -7
- package/agent/ui-tui/src/app/interfaces.ts +64 -1
- package/agent/ui-tui/src/app/overlayStore.ts +18 -2
- package/agent/ui-tui/src/app/slash/commands/billing.ts +332 -0
- package/agent/ui-tui/src/app/slash/commands/core.ts +31 -2
- package/agent/ui-tui/src/app/slash/commands/credits.ts +57 -0
- package/agent/ui-tui/src/app/slash/commands/ops.ts +28 -0
- package/agent/ui-tui/src/app/slash/commands/session.ts +32 -4
- package/agent/ui-tui/src/app/slash/registry.ts +4 -0
- package/agent/ui-tui/src/app/turnController.ts +145 -2
- package/agent/ui-tui/src/app/uiStore.ts +2 -0
- package/agent/ui-tui/src/app/useInputHandlers.ts +42 -4
- package/agent/ui-tui/src/app/useMainApp.ts +54 -8
- package/agent/ui-tui/src/app/useSessionLifecycle.ts +40 -31
- package/agent/ui-tui/src/app/useSubmission.ts +23 -31
- package/agent/ui-tui/src/components/appChrome.tsx +112 -5
- package/agent/ui-tui/src/components/appLayout.tsx +9 -0
- package/agent/ui-tui/src/components/appOverlays.tsx +25 -1
- package/agent/ui-tui/src/components/billingOverlay.tsx +684 -0
- package/agent/ui-tui/src/components/branding.tsx +15 -3
- package/agent/ui-tui/src/components/messageLine.tsx +25 -3
- package/agent/ui-tui/src/components/pluginsHub.tsx +238 -0
- package/agent/ui-tui/src/components/prompts.tsx +31 -17
- package/agent/ui-tui/src/components/streamingAssistant.tsx +63 -55
- package/agent/ui-tui/src/components/textInput.tsx +16 -0
- package/agent/ui-tui/src/config/env.ts +12 -0
- package/agent/ui-tui/src/config/limits.ts +13 -0
- package/agent/ui-tui/src/domain/blockLayout.ts +146 -0
- package/agent/ui-tui/src/domain/paths.ts +24 -0
- package/agent/ui-tui/src/domain/slash.ts +40 -0
- package/agent/ui-tui/src/entry.tsx +35 -4
- package/agent/ui-tui/src/gatewayClient.ts +22 -10
- package/agent/ui-tui/src/gatewayTypes.ts +130 -1
- package/agent/ui-tui/src/lib/gracefulExit.ts +24 -4
- package/agent/ui-tui/src/lib/memory.test.ts +162 -0
- package/agent/ui-tui/src/lib/memory.ts +60 -1
- package/agent/ui-tui/src/lib/memoryMonitor.ts +79 -4
- package/agent/ui-tui/src/lib/osc52.ts +1 -1
- package/agent/ui-tui/src/lib/text.test.ts +32 -1
- package/agent/ui-tui/src/lib/text.ts +29 -2
- package/agent/ui-tui/src/lib/virtualHeights.ts +13 -0
- package/agent/ui-tui/src/types.ts +5 -0
- package/agent/ui-tui/tsconfig.build.json +0 -1
- package/agent/ui-tui/tsconfig.json +2 -1
- package/agent/utils.py +66 -2
- package/agent/uv.lock +300 -684
- package/agent/web/index.html +2 -2
- package/agent/web/package.json +11 -6
- package/agent/web/public/claw-bg.webp +0 -0
- package/agent/web/public/claw-logo.webp +0 -0
- package/agent/web/src/App.tsx +138 -48
- package/agent/web/src/components/AutomationBlueprints.tsx +225 -0
- package/agent/web/src/components/Backdrop.tsx +15 -0
- package/agent/web/src/components/ChatSessionList.tsx +260 -0
- package/agent/web/src/components/ChatSidebar.tsx +262 -78
- package/agent/web/src/components/ConfirmDialog.tsx +122 -0
- package/agent/web/src/components/ModelPickerDialog.tsx +111 -16
- package/agent/web/src/components/ModelReloadConfirm.tsx +40 -0
- package/agent/web/src/components/ProfileScopeBanner.tsx +30 -0
- package/agent/web/src/components/ProfileSwitcher.tsx +67 -0
- package/agent/web/src/components/ReasoningPicker.tsx +167 -0
- package/agent/web/src/components/SkillEditorDialog.tsx +215 -0
- package/agent/web/src/components/ThemeSwitcher.tsx +119 -4
- package/agent/web/src/components/ToolsetConfigDrawer.tsx +457 -0
- package/agent/web/src/contexts/PageHeaderProvider.tsx +7 -4
- package/agent/web/src/contexts/ProfileProvider.tsx +137 -0
- package/agent/web/src/contexts/SystemActions.tsx +6 -8
- package/agent/web/src/contexts/profile-context.ts +19 -0
- package/agent/web/src/contexts/useProfileScope.ts +6 -0
- package/agent/web/src/i18n/af.ts +5 -4
- package/agent/web/src/i18n/de.ts +5 -4
- package/agent/web/src/i18n/en.ts +58 -4
- package/agent/web/src/i18n/es.ts +5 -3
- package/agent/web/src/i18n/fr.ts +5 -3
- package/agent/web/src/i18n/ga.ts +5 -4
- package/agent/web/src/i18n/hu.ts +5 -4
- package/agent/web/src/i18n/it.ts +5 -4
- package/agent/web/src/i18n/ja.ts +5 -4
- package/agent/web/src/i18n/ko.ts +5 -4
- package/agent/web/src/i18n/pt.ts +5 -3
- package/agent/web/src/i18n/ru.ts +5 -4
- package/agent/web/src/i18n/tr.ts +5 -4
- package/agent/web/src/i18n/types.ts +59 -1
- package/agent/web/src/i18n/uk.ts +5 -3
- package/agent/web/src/i18n/zh-hant.ts +5 -4
- package/agent/web/src/i18n/zh.ts +5 -4
- package/agent/web/src/index.css +2 -2
- package/agent/web/src/lib/api.ts +819 -52
- package/agent/web/src/lib/dashboard-flags.ts +16 -7
- package/agent/web/src/lib/reasoning-effort.test.ts +48 -0
- package/agent/web/src/lib/reasoning-effort.ts +36 -0
- package/agent/web/src/lib/session-refresh.test.ts +21 -0
- package/agent/web/src/lib/session-refresh.ts +26 -0
- package/agent/web/src/pages/ChannelsPage.tsx +529 -68
- package/agent/web/src/pages/ChatPage.tsx +249 -56
- package/agent/web/src/pages/ConfigPage.tsx +11 -1
- package/agent/web/src/pages/CronPage.tsx +219 -31
- package/agent/web/src/pages/EnvPage.tsx +25 -6
- package/agent/web/src/pages/FilesPage.tsx +525 -0
- package/agent/web/src/pages/McpPage.tsx +80 -3
- package/agent/web/src/pages/ModelsPage.tsx +97 -12
- package/agent/web/src/pages/PluginsPage.tsx +1 -1
- package/agent/web/src/pages/ProfileBuilderPage.tsx +611 -0
- package/agent/web/src/pages/ProfilesPage.tsx +1038 -172
- package/agent/web/src/pages/SessionsPage.tsx +144 -13
- package/agent/web/src/pages/SkillsPage.tsx +851 -70
- package/agent/web/src/pages/SystemPage.tsx +340 -4
- package/agent/web/src/pages/WalletPage.tsx +401 -0
- package/agent/web/src/pages/WebhooksPage.tsx +145 -15
- package/agent/web/src/pages/X402Page.tsx +207 -0
- package/agent/web/src/plugins/registry.ts +28 -11
- package/agent/web/src/plugins/sdk.d.ts +160 -0
- package/agent/web/src/themes/context.tsx +112 -5
- package/agent/web/src/themes/fonts.ts +167 -0
- package/agent/web/src/themes/index.ts +7 -0
- package/agent/web/tsconfig.app.json +0 -1
- package/agent/web/vite.config.ts +1 -8
- package/agent/web/vitest.config.ts +16 -0
- package/package.json +1 -1
- package/agent/apps/desktop/package-lock.json +0 -18363
- package/agent/apps/desktop/src/app/chat/composer/skin-slash-popover.tsx +0 -56
- package/agent/apps/desktop/src/components/assistant-ui/thread-virtualizer.tsx +0 -382
- package/agent/apps/desktop/src/components/assistant-ui/todo-tool.tsx +0 -109
- package/agent/apps/desktop/src/components/chat/generated-image-context.tsx +0 -19
- package/agent/optional-skills/productivity/shop-app/SKILL.md +0 -340
- package/agent/skills/autonomous-ai-agents/kanban-codex-lane/SKILL.md +0 -277
- package/agent/skills/autonomous-ai-agents/kanban-codex-lane/templates/pmb-codex-lane-prompt.md +0 -57
- package/agent/skills/diagramming/DESCRIPTION.md +0 -3
- package/agent/skills/domain/DESCRIPTION.md +0 -24
- package/agent/skills/gifs/DESCRIPTION.md +0 -3
- package/agent/skills/inference-sh/DESCRIPTION.md +0 -19
- package/agent/skills/mcp/DESCRIPTION.md +0 -3
- package/agent/skills/media/spotify/SKILL.md +0 -135
- package/agent/skills/mlops/training/DESCRIPTION.md +0 -3
- package/agent/skills/mlops/vector-databases/DESCRIPTION.md +0 -3
- package/agent/skills/productivity/linear/SKILL.md +0 -380
- package/agent/skills/productivity/linear/scripts/linear_api.py +0 -445
- package/agent/skills/software-development/debugging-hermes-tui-commands/SKILL.md +0 -152
- package/agent/skills/software-development/writing-plans/SKILL.md +0 -297
- package/agent/ui-tui/package-lock.json +0 -7449
- package/agent/ui-tui/packages/hermes-ink/package-lock.json +0 -1289
- package/agent/web/package-lock.json +0 -8887
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/PORT_NOTES.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/SKILL.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/prompts/system.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/palettes/macaron.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/palettes/mono-ink.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/palettes/neon.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/palettes/warm.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/prompt-construction.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/style-presets.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/blueprint.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/chalkboard.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/editorial.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/elegant.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/fantasy-animation.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/flat-doodle.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/flat.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/ink-notes.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/intuition-machine.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/minimal.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/nature.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/notion.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/pixel-art.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/playful.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/retro.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/scientific.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/screen-print.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/sketch-notes.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/sketch.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/vector-illustration.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/vintage.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/warm.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles/watercolor.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/styles.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/usage.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-article-illustrator/references/workflow.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/PORT_NOTES.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/SKILL.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/analysis-framework.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/chalk.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/ink-brush.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/ligne-claire.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/manga.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/minimalist.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/art-styles/realistic.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/auto-selection.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/base-prompt.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/character-template.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/cinematic.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/dense.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/four-panel.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/mixed.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/splash.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/standard.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/layouts/webtoon.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/ohmsha-guide.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/partial-workflows.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/presets/concept-story.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/presets/four-panel.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/presets/ohmsha.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/presets/shoujo.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/presets/wuxia.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/storyboard-template.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/action.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/dramatic.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/energetic.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/neutral.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/romantic.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/vintage.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/tones/warm.md +0 -0
- /package/agent/{skills → optional-skills}/creative/baoyu-comic/references/workflow.md +0 -0
- /package/agent/{skills → optional-skills}/creative/creative-ideation/SKILL.md +0 -0
- /package/agent/{skills → optional-skills}/creative/creative-ideation/references/full-prompt-library.md +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/ATTRIBUTION.md +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/SKILL.md +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/references/palettes.md +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/scripts/__init__.py +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/scripts/palettes.py +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/scripts/pixel_art.py +0 -0
- /package/agent/{skills → optional-skills}/creative/pixel-art/scripts/pixel_art_video.py +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/SKILL.md +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/references/analysis-modules.md +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/references/methods-guide.md +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/templates/abliteration-config.yaml +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/templates/analysis-study.yaml +0 -0
- /package/agent/{skills/mlops/inference → optional-skills/mlops}/obliteratus/templates/batch-abliteration.yaml +0 -0
- /package/agent/{skills → optional-skills}/mlops/research/DESCRIPTION.md +0 -0
- /package/agent/{skills → optional-skills}/mlops/research/dspy/SKILL.md +0 -0
- /package/agent/{skills → optional-skills}/mlops/research/dspy/references/examples.md +0 -0
- /package/agent/{skills → optional-skills}/mlops/research/dspy/references/modules.md +0 -0
- /package/agent/{skills → optional-skills}/mlops/research/dspy/references/optimizers.md +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/references/jailbreak-templates.md +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/references/refusal-detection.md +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/scripts/godmode_race.py +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/scripts/load_godmode.py +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/scripts/parseltongue.py +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/templates/prefill-subtle.json +0 -0
- /package/agent/{skills/red-teaming → optional-skills/security}/godmode/templates/prefill.json +0 -0
- /package/agent/{skills → optional-skills}/software-development/subagent-driven-development/references/context-budget-discipline.md +0 -0
- /package/agent/{skills → optional-skills}/software-development/subagent-driven-development/references/gates-taxonomy.md +0 -0
|
@@ -2,12 +2,21 @@ import {
|
|
|
2
2
|
useCallback,
|
|
3
3
|
useEffect,
|
|
4
4
|
useLayoutEffect,
|
|
5
|
+
useMemo,
|
|
5
6
|
useRef,
|
|
6
7
|
useState,
|
|
7
8
|
} from "react";
|
|
9
|
+
import { useNavigate } from "react-router-dom";
|
|
10
|
+
import { useProfileScope } from "@/contexts/useProfileScope";
|
|
8
11
|
import {
|
|
12
|
+
AlignLeft,
|
|
13
|
+
Check,
|
|
9
14
|
ChevronDown,
|
|
15
|
+
Cpu,
|
|
16
|
+
MoreVertical,
|
|
10
17
|
Pencil,
|
|
18
|
+
Package,
|
|
19
|
+
Sparkles,
|
|
11
20
|
Terminal,
|
|
12
21
|
Trash2,
|
|
13
22
|
Users,
|
|
@@ -16,7 +25,7 @@ import {
|
|
|
16
25
|
import spinners from "unicode-animations";
|
|
17
26
|
import { H2 } from "@nous-research/ui/ui/components/typography/h2";
|
|
18
27
|
import { api } from "@/lib/api";
|
|
19
|
-
import type { ProfileInfo } from "@/lib/api";
|
|
28
|
+
import type { ActiveProfileInfo, ProfileInfo } from "@/lib/api";
|
|
20
29
|
import { DeleteConfirmDialog } from "@/components/DeleteConfirmDialog";
|
|
21
30
|
import { useToast } from "@nous-research/ui/hooks/use-toast";
|
|
22
31
|
import { useConfirmDelete } from "@nous-research/ui/hooks/use-confirm-delete";
|
|
@@ -27,6 +36,10 @@ import { Badge } from "@nous-research/ui/ui/components/badge";
|
|
|
27
36
|
import { Button } from "@nous-research/ui/ui/components/button";
|
|
28
37
|
import { Input } from "@nous-research/ui/ui/components/input";
|
|
29
38
|
import { Label } from "@nous-research/ui/ui/components/label";
|
|
39
|
+
import {
|
|
40
|
+
Select,
|
|
41
|
+
SelectOption,
|
|
42
|
+
} from "@nous-research/ui/ui/components/select";
|
|
30
43
|
import { Checkbox } from "@nous-research/ui/ui/components/checkbox";
|
|
31
44
|
import { useI18n } from "@/i18n";
|
|
32
45
|
import { usePageHeader } from "@/contexts/usePageHeader";
|
|
@@ -65,18 +78,254 @@ function ProfilesLoadingSpinner() {
|
|
|
65
78
|
);
|
|
66
79
|
}
|
|
67
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Per-card "⋯" actions menu. Holds every action for the profile (set active,
|
|
83
|
+
* model, description, SOUL, copy command, rename, delete) so the card row stays
|
|
84
|
+
* a single button. Mirrors the hand-rolled dropdown pattern used by ModelsPage's
|
|
85
|
+
* "Use as" menu (button + absolute panel + outside-click close).
|
|
86
|
+
*/
|
|
87
|
+
function ProfileActionsMenu({
|
|
88
|
+
isActive,
|
|
89
|
+
isDefault,
|
|
90
|
+
isEditingDesc,
|
|
91
|
+
isEditingModel,
|
|
92
|
+
isEditingSoul,
|
|
93
|
+
labels,
|
|
94
|
+
settingActive,
|
|
95
|
+
onCopyCommand,
|
|
96
|
+
onDelete,
|
|
97
|
+
onEditDescription,
|
|
98
|
+
onEditModel,
|
|
99
|
+
onEditSoul,
|
|
100
|
+
onManageSkills,
|
|
101
|
+
onRename,
|
|
102
|
+
onSetActive,
|
|
103
|
+
}: ProfileActionsMenuProps) {
|
|
104
|
+
const [open, setOpen] = useState(false);
|
|
105
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
106
|
+
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (!open) return;
|
|
109
|
+
const onDown = (e: MouseEvent) => {
|
|
110
|
+
const target = e.target as Node | null;
|
|
111
|
+
// Close only when the click lands outside *this* menu. Matching any
|
|
112
|
+
// `[data-profile-actions]` would treat another card's menu as "inside"
|
|
113
|
+
// and leave several menus open at once.
|
|
114
|
+
if (target && !containerRef.current?.contains(target)) setOpen(false);
|
|
115
|
+
};
|
|
116
|
+
window.addEventListener("mousedown", onDown);
|
|
117
|
+
return () => window.removeEventListener("mousedown", onDown);
|
|
118
|
+
}, [open]);
|
|
119
|
+
|
|
120
|
+
// Run the action, then collapse the menu. Toggle editors (model/description/
|
|
121
|
+
// SOUL) expand the inline section below the card once the menu closes.
|
|
122
|
+
const run = (fn: () => void) => () => {
|
|
123
|
+
fn();
|
|
124
|
+
setOpen(false);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const itemClass =
|
|
128
|
+
"flex w-full items-center gap-2.5 px-3 py-2 text-xs uppercase tracking-wider hover:bg-muted/50 disabled:opacity-40";
|
|
129
|
+
|
|
130
|
+
return (
|
|
131
|
+
<div className="relative" data-profile-actions ref={containerRef}>
|
|
132
|
+
<Button
|
|
133
|
+
ghost
|
|
134
|
+
size="icon"
|
|
135
|
+
title={labels.actions}
|
|
136
|
+
aria-label={labels.actions}
|
|
137
|
+
aria-haspopup="menu"
|
|
138
|
+
aria-expanded={open}
|
|
139
|
+
onClick={() => setOpen((v) => !v)}
|
|
140
|
+
>
|
|
141
|
+
<MoreVertical className="h-4 w-4" />
|
|
142
|
+
</Button>
|
|
143
|
+
|
|
144
|
+
{open && (
|
|
145
|
+
<div
|
|
146
|
+
role="menu"
|
|
147
|
+
className="absolute right-0 top-full z-50 mt-1 min-w-[200px] border border-border bg-card shadow-lg"
|
|
148
|
+
>
|
|
149
|
+
{!isActive && (
|
|
150
|
+
<button
|
|
151
|
+
type="button"
|
|
152
|
+
role="menuitem"
|
|
153
|
+
className={itemClass}
|
|
154
|
+
disabled={settingActive}
|
|
155
|
+
onClick={run(onSetActive)}
|
|
156
|
+
>
|
|
157
|
+
<Check className="h-4 w-4" />
|
|
158
|
+
{labels.setActive}
|
|
159
|
+
</button>
|
|
160
|
+
)}
|
|
161
|
+
|
|
162
|
+
<button
|
|
163
|
+
type="button"
|
|
164
|
+
role="menuitem"
|
|
165
|
+
className={itemClass}
|
|
166
|
+
onClick={run(onEditModel)}
|
|
167
|
+
>
|
|
168
|
+
{isEditingModel ? (
|
|
169
|
+
<ChevronDown className="h-4 w-4" />
|
|
170
|
+
) : (
|
|
171
|
+
<Cpu className="h-4 w-4" />
|
|
172
|
+
)}
|
|
173
|
+
{labels.editModel}
|
|
174
|
+
</button>
|
|
175
|
+
|
|
176
|
+
<button
|
|
177
|
+
type="button"
|
|
178
|
+
role="menuitem"
|
|
179
|
+
className={itemClass}
|
|
180
|
+
onClick={run(onEditDescription)}
|
|
181
|
+
>
|
|
182
|
+
{isEditingDesc ? (
|
|
183
|
+
<ChevronDown className="h-4 w-4" />
|
|
184
|
+
) : (
|
|
185
|
+
<AlignLeft className="h-4 w-4" />
|
|
186
|
+
)}
|
|
187
|
+
{labels.editDescription}
|
|
188
|
+
</button>
|
|
189
|
+
|
|
190
|
+
<button
|
|
191
|
+
type="button"
|
|
192
|
+
role="menuitem"
|
|
193
|
+
className={itemClass}
|
|
194
|
+
onClick={run(onEditSoul)}
|
|
195
|
+
>
|
|
196
|
+
{isEditingSoul ? (
|
|
197
|
+
<ChevronDown className="h-4 w-4" />
|
|
198
|
+
) : (
|
|
199
|
+
<span aria-hidden className="w-4 text-center text-xs font-bold">
|
|
200
|
+
S
|
|
201
|
+
</span>
|
|
202
|
+
)}
|
|
203
|
+
{labels.editSoul}
|
|
204
|
+
</button>
|
|
205
|
+
|
|
206
|
+
<button
|
|
207
|
+
type="button"
|
|
208
|
+
role="menuitem"
|
|
209
|
+
className={itemClass}
|
|
210
|
+
onClick={run(onManageSkills)}
|
|
211
|
+
>
|
|
212
|
+
<Package className="h-4 w-4" />
|
|
213
|
+
{labels.manageSkills}
|
|
214
|
+
</button>
|
|
215
|
+
|
|
216
|
+
<button
|
|
217
|
+
type="button"
|
|
218
|
+
role="menuitem"
|
|
219
|
+
className={itemClass}
|
|
220
|
+
onClick={run(onCopyCommand)}
|
|
221
|
+
>
|
|
222
|
+
<Terminal className="h-4 w-4" />
|
|
223
|
+
{labels.openInTerminal}
|
|
224
|
+
</button>
|
|
225
|
+
|
|
226
|
+
{!isDefault && (
|
|
227
|
+
<button
|
|
228
|
+
type="button"
|
|
229
|
+
role="menuitem"
|
|
230
|
+
className={cn(itemClass, "border-t border-border/50")}
|
|
231
|
+
onClick={run(onRename)}
|
|
232
|
+
>
|
|
233
|
+
<Pencil className="h-4 w-4" />
|
|
234
|
+
{labels.rename}
|
|
235
|
+
</button>
|
|
236
|
+
)}
|
|
237
|
+
|
|
238
|
+
{!isDefault && (
|
|
239
|
+
<button
|
|
240
|
+
type="button"
|
|
241
|
+
role="menuitem"
|
|
242
|
+
className={cn(itemClass, "text-destructive hover:bg-destructive/10")}
|
|
243
|
+
onClick={run(onDelete)}
|
|
244
|
+
>
|
|
245
|
+
<Trash2 className="h-4 w-4" />
|
|
246
|
+
{labels.delete}
|
|
247
|
+
</button>
|
|
248
|
+
)}
|
|
249
|
+
</div>
|
|
250
|
+
)}
|
|
251
|
+
</div>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
68
255
|
export default function ProfilesPage() {
|
|
256
|
+
const navigate = useNavigate();
|
|
69
257
|
const [profiles, setProfiles] = useState<ProfileInfo[]>([]);
|
|
258
|
+
const [activeInfo, setActiveInfo] = useState<ActiveProfileInfo | null>(null);
|
|
70
259
|
const [loading, setLoading] = useState(true);
|
|
71
260
|
const { toast, showToast } = useToast();
|
|
72
261
|
const { t } = useI18n();
|
|
73
262
|
const { setEnd } = usePageHeader();
|
|
263
|
+
const { setProfile } = useProfileScope();
|
|
264
|
+
|
|
265
|
+
// Locale strings with English fallbacks. The enriched keys are optional in
|
|
266
|
+
// the i18n type so untranslated locales don't break the build — they render
|
|
267
|
+
// the English literal until translated.
|
|
268
|
+
const L = useMemo(() => {
|
|
269
|
+
const p = t.profiles;
|
|
270
|
+
return {
|
|
271
|
+
activeProfile: p.activeProfile ?? "Active profile",
|
|
272
|
+
activeBadge: p.activeBadge ?? "active",
|
|
273
|
+
setActive: p.setActive ?? "Set as active",
|
|
274
|
+
activeSet: p.activeSet ?? "Active profile set",
|
|
275
|
+
gatewayRunning: p.gatewayRunning ?? "Gateway running",
|
|
276
|
+
gatewayStopped: p.gatewayStopped ?? "Gateway stopped",
|
|
277
|
+
gatewayRunningWarning:
|
|
278
|
+
p.gatewayRunningWarning ??
|
|
279
|
+
"This profile's gateway is running — it will be stopped.",
|
|
280
|
+
aliasBadge: p.aliasBadge ?? "alias",
|
|
281
|
+
description: p.description ?? "Description",
|
|
282
|
+
descriptionPlaceholder:
|
|
283
|
+
p.descriptionPlaceholder ??
|
|
284
|
+
"What is this profile good at? Used to route kanban tasks by role.",
|
|
285
|
+
noDescription: p.noDescription ?? "No description",
|
|
286
|
+
editDescription: p.editDescription ?? "Edit description",
|
|
287
|
+
descriptionSaved: p.descriptionSaved ?? "Description saved",
|
|
288
|
+
reviewBadge: p.reviewBadge ?? "review",
|
|
289
|
+
autoGenerate: p.autoGenerate ?? "Auto-generate",
|
|
290
|
+
generating: p.generating ?? "Generating…",
|
|
291
|
+
describeFailed: p.describeFailed ?? "Could not generate description",
|
|
292
|
+
distribution: p.distribution ?? "Distribution",
|
|
293
|
+
advancedOptions: p.advancedOptions ?? "Advanced options",
|
|
294
|
+
cloneAll:
|
|
295
|
+
p.cloneAll ?? "Clone everything (memories, sessions, skills, state)",
|
|
296
|
+
noSkillsOption: p.noSkillsOption ?? "Don't seed bundled skills",
|
|
297
|
+
descriptionOptional: p.descriptionOptional ?? "Description (optional)",
|
|
298
|
+
modelOptional: p.modelOptional ?? "Model (optional)",
|
|
299
|
+
modelInherit: p.modelInherit ?? "Inherit from clone / default",
|
|
300
|
+
modelLoading: p.modelLoading ?? "Loading models…",
|
|
301
|
+
modelNone:
|
|
302
|
+
p.modelNone ?? "No authenticated providers — set a key first",
|
|
303
|
+
editModel: p.editModel ?? "Change model",
|
|
304
|
+
modelSaved: p.modelSaved ?? "Model updated",
|
|
305
|
+
modelSelect: p.modelSelect ?? "Select a model",
|
|
306
|
+
actions: p.actions ?? "Actions",
|
|
307
|
+
manageSkills: p.manageSkills ?? "Manage skills & tools",
|
|
308
|
+
activeSetHint:
|
|
309
|
+
p.activeSetHint ??
|
|
310
|
+
"Dashboard switched to manage {name}. New CLI/gateway runs will use this profile too.",
|
|
311
|
+
};
|
|
312
|
+
}, [t.profiles]);
|
|
74
313
|
|
|
75
314
|
// Create modal
|
|
76
315
|
const [createModalOpen, setCreateModalOpen] = useState(false);
|
|
77
316
|
const [newName, setNewName] = useState("");
|
|
78
|
-
const [
|
|
317
|
+
const [cloneFrom, setCloneFrom] = useState<string | null>("default");
|
|
318
|
+
const [cloneAll, setCloneAll] = useState(false);
|
|
319
|
+
const [noSkills, setNoSkills] = useState(false);
|
|
320
|
+
const [newDescription, setNewDescription] = useState("");
|
|
79
321
|
const [creating, setCreating] = useState(false);
|
|
322
|
+
// Model picker (lazy-loaded the first time a picker is opened). modelChoice
|
|
323
|
+
// is a "slug\u0000model" key, or "" to inherit from clone/default.
|
|
324
|
+
const [modelChoices, setModelChoices] = useState<
|
|
325
|
+
{ provider: string; model: string; label: string }[] | null
|
|
326
|
+
>(null);
|
|
327
|
+
const modelChoicesLoading = useRef(false);
|
|
328
|
+
const [modelChoice, setModelChoice] = useState("");
|
|
80
329
|
const closeCreateModal = useCallback(() => setCreateModalOpen(false), []);
|
|
81
330
|
const createModalRef = useModalBehavior({
|
|
82
331
|
open: createModalOpen,
|
|
@@ -95,10 +344,60 @@ export default function ProfilesPage() {
|
|
|
95
344
|
// newer state when the user switches profiles or closes the editor.
|
|
96
345
|
const activeSoulRequest = useRef<string | null>(null);
|
|
97
346
|
|
|
98
|
-
|
|
347
|
+
// Inline description editor state
|
|
348
|
+
const [editingDescFor, setEditingDescFor] = useState<string | null>(null);
|
|
349
|
+
const [descText, setDescText] = useState("");
|
|
350
|
+
const [descSaving, setDescSaving] = useState(false);
|
|
351
|
+
const [describing, setDescribing] = useState(false);
|
|
352
|
+
// Tracks the latest description request (save / auto-describe) so a late
|
|
353
|
+
// response can't overwrite state for a different, newly-opened editor.
|
|
354
|
+
const activeDescRequest = useRef<string | null>(null);
|
|
355
|
+
// Counts in-flight save / auto-describe requests so the saving indicator
|
|
356
|
+
// is only cleared when the last concurrent request settles.
|
|
357
|
+
const descSavingCount = useRef(0);
|
|
358
|
+
const describingCount = useRef(0);
|
|
359
|
+
|
|
360
|
+
// Inline model editor state
|
|
361
|
+
const [editingModelFor, setEditingModelFor] = useState<string | null>(null);
|
|
362
|
+
const [modelEditChoice, setModelEditChoice] = useState("");
|
|
363
|
+
const [modelSaving, setModelSaving] = useState(false);
|
|
364
|
+
|
|
365
|
+
// Per-profile "set active" in-flight name
|
|
366
|
+
const [settingActive, setSettingActive] = useState<string | null>(null);
|
|
367
|
+
|
|
368
|
+
const modelKey = (provider: string | null, model: string | null) =>
|
|
369
|
+
provider && model ? `${provider}\u0000${model}` : "";
|
|
370
|
+
|
|
371
|
+
const loadModelChoices = useCallback(() => {
|
|
372
|
+
if (modelChoices !== null || modelChoicesLoading.current) return;
|
|
373
|
+
modelChoicesLoading.current = true;
|
|
99
374
|
api
|
|
100
|
-
.
|
|
101
|
-
.then((res) =>
|
|
375
|
+
.getModelOptions()
|
|
376
|
+
.then((res) => {
|
|
377
|
+
const flat: { provider: string; model: string; label: string }[] = [];
|
|
378
|
+
for (const prov of res.providers ?? []) {
|
|
379
|
+
for (const m of prov.models ?? []) {
|
|
380
|
+
flat.push({
|
|
381
|
+
provider: prov.slug,
|
|
382
|
+
model: m,
|
|
383
|
+
label: `${prov.name} · ${m}`,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
setModelChoices(flat);
|
|
388
|
+
})
|
|
389
|
+
.catch(() => setModelChoices([]))
|
|
390
|
+
.finally(() => {
|
|
391
|
+
modelChoicesLoading.current = false;
|
|
392
|
+
});
|
|
393
|
+
}, [modelChoices]);
|
|
394
|
+
|
|
395
|
+
const load = useCallback(() => {
|
|
396
|
+
Promise.all([api.getProfiles(), api.getActiveProfile().catch(() => null)])
|
|
397
|
+
.then(([res, active]) => {
|
|
398
|
+
setProfiles(res.profiles);
|
|
399
|
+
setActiveInfo(active);
|
|
400
|
+
})
|
|
102
401
|
.catch((e) => showToast(`${t.status.error}: ${e}`, "error"))
|
|
103
402
|
.finally(() => setLoading(false));
|
|
104
403
|
}, [showToast, t.status.error]);
|
|
@@ -107,6 +406,19 @@ export default function ProfilesPage() {
|
|
|
107
406
|
load();
|
|
108
407
|
}, [load]);
|
|
109
408
|
|
|
409
|
+
// Lazily load the model picker the first time the create modal opens.
|
|
410
|
+
useEffect(() => {
|
|
411
|
+
if (createModalOpen) loadModelChoices();
|
|
412
|
+
}, [createModalOpen, loadModelChoices]);
|
|
413
|
+
|
|
414
|
+
const isActive = useCallback(
|
|
415
|
+
(p: ProfileInfo) =>
|
|
416
|
+
activeInfo != null &&
|
|
417
|
+
(activeInfo.active === p.name ||
|
|
418
|
+
(activeInfo.active === "default" && p.is_default)),
|
|
419
|
+
[activeInfo],
|
|
420
|
+
);
|
|
421
|
+
|
|
110
422
|
const handleCreate = async () => {
|
|
111
423
|
const name = newName.trim();
|
|
112
424
|
if (!name) {
|
|
@@ -119,9 +431,34 @@ export default function ProfilesPage() {
|
|
|
119
431
|
}
|
|
120
432
|
setCreating(true);
|
|
121
433
|
try {
|
|
122
|
-
|
|
434
|
+
const cloning = cloneFrom !== null;
|
|
435
|
+
const picked = modelChoice
|
|
436
|
+
? modelChoices?.find(
|
|
437
|
+
(c) => `${c.provider}\u0000${c.model}` === modelChoice,
|
|
438
|
+
)
|
|
439
|
+
: undefined;
|
|
440
|
+
const res = await api.createProfile({
|
|
441
|
+
name,
|
|
442
|
+
clone_from: cloneFrom,
|
|
443
|
+
clone_all: cloning && cloneAll,
|
|
444
|
+
no_skills: cloning ? false : noSkills,
|
|
445
|
+
description: newDescription.trim() || undefined,
|
|
446
|
+
provider: picked?.provider,
|
|
447
|
+
model: picked?.model,
|
|
448
|
+
});
|
|
123
449
|
showToast(`${t.profiles.created}: ${name}`, "success");
|
|
450
|
+
if (picked && res.model_set === false) {
|
|
451
|
+
showToast(
|
|
452
|
+
`Profile created, but the model could not be saved — set it from the profile editor.`,
|
|
453
|
+
"error",
|
|
454
|
+
);
|
|
455
|
+
}
|
|
124
456
|
setNewName("");
|
|
457
|
+
setNewDescription("");
|
|
458
|
+
setNoSkills(false);
|
|
459
|
+
setCloneAll(false);
|
|
460
|
+
setCloneFrom("default");
|
|
461
|
+
setModelChoice("");
|
|
125
462
|
setCreateModalOpen(false);
|
|
126
463
|
load();
|
|
127
464
|
} catch (e) {
|
|
@@ -145,10 +482,7 @@ export default function ProfilesPage() {
|
|
|
145
482
|
}
|
|
146
483
|
try {
|
|
147
484
|
await api.renameProfile(renamingFrom, target);
|
|
148
|
-
showToast(
|
|
149
|
-
`${t.profiles.renamed}: ${renamingFrom} → ${target}`,
|
|
150
|
-
"success",
|
|
151
|
-
);
|
|
485
|
+
showToast(`${t.profiles.renamed}: ${renamingFrom} → ${target}`, "success");
|
|
152
486
|
setRenamingFrom(null);
|
|
153
487
|
setRenameTo("");
|
|
154
488
|
load();
|
|
@@ -157,13 +491,46 @@ export default function ProfilesPage() {
|
|
|
157
491
|
}
|
|
158
492
|
};
|
|
159
493
|
|
|
494
|
+
const handleSetActive = async (name: string) => {
|
|
495
|
+
setSettingActive(name);
|
|
496
|
+
try {
|
|
497
|
+
// The backend normalizes/validates the name; trust the canonical
|
|
498
|
+
// value it returns rather than the raw input.
|
|
499
|
+
const { active } = await api.setActiveProfile(name);
|
|
500
|
+
setProfile(active);
|
|
501
|
+
showToast(
|
|
502
|
+
`${L.activeSet}: ${active} — ${L.activeSetHint.replace("{name}", active)}`,
|
|
503
|
+
"success",
|
|
504
|
+
);
|
|
505
|
+
setActiveInfo((prev) =>
|
|
506
|
+
prev ? { ...prev, active } : { active, current: active },
|
|
507
|
+
);
|
|
508
|
+
} catch (e) {
|
|
509
|
+
showToast(`${t.status.error}: ${e}`, "error");
|
|
510
|
+
} finally {
|
|
511
|
+
setSettingActive(null);
|
|
512
|
+
}
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
// Closes whichever editor dialog is open (model / description / SOUL).
|
|
516
|
+
const closeEditor = useCallback(() => {
|
|
517
|
+
activeSoulRequest.current = null;
|
|
518
|
+
activeDescRequest.current = null;
|
|
519
|
+
setEditingModelFor(null);
|
|
520
|
+
setEditingDescFor(null);
|
|
521
|
+
setEditingSoulFor(null);
|
|
522
|
+
}, []);
|
|
523
|
+
|
|
160
524
|
const openSoulEditor = useCallback(
|
|
161
525
|
async (name: string) => {
|
|
526
|
+
// Re-selecting the action for the already-open editor collapses it,
|
|
527
|
+
// matching the chevron-down affordance in the actions menu.
|
|
162
528
|
if (editingSoulFor === name) {
|
|
163
|
-
|
|
164
|
-
setEditingSoulFor(null);
|
|
529
|
+
closeEditor();
|
|
165
530
|
return;
|
|
166
531
|
}
|
|
532
|
+
setEditingDescFor(null);
|
|
533
|
+
setEditingModelFor(null);
|
|
167
534
|
setEditingSoulFor(name);
|
|
168
535
|
setSoulText("");
|
|
169
536
|
activeSoulRequest.current = name;
|
|
@@ -178,7 +545,7 @@ export default function ProfilesPage() {
|
|
|
178
545
|
}
|
|
179
546
|
}
|
|
180
547
|
},
|
|
181
|
-
[editingSoulFor, showToast, t.status.error],
|
|
548
|
+
[closeEditor, editingSoulFor, showToast, t.status.error],
|
|
182
549
|
);
|
|
183
550
|
|
|
184
551
|
const handleSaveSoul = async (name: string) => {
|
|
@@ -186,6 +553,8 @@ export default function ProfilesPage() {
|
|
|
186
553
|
try {
|
|
187
554
|
await api.updateProfileSoul(name, soulText);
|
|
188
555
|
showToast(`${t.profiles.soulSaved}: ${name}`, "success");
|
|
556
|
+
activeSoulRequest.current = null;
|
|
557
|
+
setEditingSoulFor(null);
|
|
189
558
|
} catch (e) {
|
|
190
559
|
showToast(`${t.status.error}: ${e}`, "error");
|
|
191
560
|
} finally {
|
|
@@ -193,6 +562,144 @@ export default function ProfilesPage() {
|
|
|
193
562
|
}
|
|
194
563
|
};
|
|
195
564
|
|
|
565
|
+
const openDescEditor = useCallback(
|
|
566
|
+
(p: ProfileInfo) => {
|
|
567
|
+
if (editingDescFor === p.name) {
|
|
568
|
+
closeEditor();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
activeDescRequest.current = p.name;
|
|
572
|
+
setEditingSoulFor(null);
|
|
573
|
+
setEditingModelFor(null);
|
|
574
|
+
setEditingDescFor(p.name);
|
|
575
|
+
setDescText(p.description ?? "");
|
|
576
|
+
},
|
|
577
|
+
[closeEditor, editingDescFor],
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
const handleSaveDesc = async (name: string) => {
|
|
581
|
+
descSavingCount.current += 1;
|
|
582
|
+
setDescSaving(true);
|
|
583
|
+
activeDescRequest.current = name;
|
|
584
|
+
try {
|
|
585
|
+
const res = await api.updateProfileDescription(name, descText);
|
|
586
|
+
// Profile-list state always reflects the persisted result, but only
|
|
587
|
+
// touch the open editor if it's still showing this profile.
|
|
588
|
+
setProfiles((prev) =>
|
|
589
|
+
prev.map((p) =>
|
|
590
|
+
p.name === name
|
|
591
|
+
? {
|
|
592
|
+
...p,
|
|
593
|
+
description: res.description,
|
|
594
|
+
description_auto: res.description_auto,
|
|
595
|
+
}
|
|
596
|
+
: p,
|
|
597
|
+
),
|
|
598
|
+
);
|
|
599
|
+
if (activeDescRequest.current === name) {
|
|
600
|
+
showToast(`${L.descriptionSaved}: ${name}`, "success");
|
|
601
|
+
setEditingDescFor(null);
|
|
602
|
+
}
|
|
603
|
+
} catch (e) {
|
|
604
|
+
if (activeDescRequest.current === name) {
|
|
605
|
+
showToast(`${t.status.error}: ${e}`, "error");
|
|
606
|
+
}
|
|
607
|
+
} finally {
|
|
608
|
+
descSavingCount.current -= 1;
|
|
609
|
+
if (descSavingCount.current === 0) setDescSaving(false);
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
|
|
613
|
+
const handleAutoDescribe = async (name: string) => {
|
|
614
|
+
describingCount.current += 1;
|
|
615
|
+
setDescribing(true);
|
|
616
|
+
activeDescRequest.current = name;
|
|
617
|
+
try {
|
|
618
|
+
const res = await api.describeProfileAuto(name);
|
|
619
|
+
const current = activeDescRequest.current === name;
|
|
620
|
+
if (res.ok && res.description != null) {
|
|
621
|
+
if (current) setDescText(res.description);
|
|
622
|
+
setProfiles((prev) =>
|
|
623
|
+
prev.map((p) =>
|
|
624
|
+
p.name === name
|
|
625
|
+
? {
|
|
626
|
+
...p,
|
|
627
|
+
description: res.description ?? "",
|
|
628
|
+
description_auto: res.description_auto,
|
|
629
|
+
}
|
|
630
|
+
: p,
|
|
631
|
+
),
|
|
632
|
+
);
|
|
633
|
+
if (current) showToast(`${L.descriptionSaved}: ${name}`, "success");
|
|
634
|
+
} else if (current) {
|
|
635
|
+
showToast(`${L.describeFailed}: ${res.reason}`, "error");
|
|
636
|
+
}
|
|
637
|
+
} catch (e) {
|
|
638
|
+
if (activeDescRequest.current === name) {
|
|
639
|
+
showToast(`${t.status.error}: ${e}`, "error");
|
|
640
|
+
}
|
|
641
|
+
} finally {
|
|
642
|
+
describingCount.current -= 1;
|
|
643
|
+
if (describingCount.current === 0) setDescribing(false);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
|
|
647
|
+
const openModelEditor = useCallback(
|
|
648
|
+
(p: ProfileInfo) => {
|
|
649
|
+
if (editingModelFor === p.name) {
|
|
650
|
+
closeEditor();
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
setEditingSoulFor(null);
|
|
654
|
+
setEditingDescFor(null);
|
|
655
|
+
setEditingModelFor(p.name);
|
|
656
|
+
setModelEditChoice(modelKey(p.provider, p.model));
|
|
657
|
+
loadModelChoices();
|
|
658
|
+
},
|
|
659
|
+
[closeEditor, editingModelFor, loadModelChoices],
|
|
660
|
+
);
|
|
661
|
+
|
|
662
|
+
const handleSaveModel = async (name: string) => {
|
|
663
|
+
const picked = modelEditChoice
|
|
664
|
+
? modelChoices?.find(
|
|
665
|
+
(c) => `${c.provider}\u0000${c.model}` === modelEditChoice,
|
|
666
|
+
)
|
|
667
|
+
: undefined;
|
|
668
|
+
if (!picked) return;
|
|
669
|
+
setModelSaving(true);
|
|
670
|
+
try {
|
|
671
|
+
await api.setProfileModel(name, picked.provider, picked.model);
|
|
672
|
+
showToast(`${L.modelSaved}: ${picked.model}`, "success");
|
|
673
|
+
setProfiles((prev) =>
|
|
674
|
+
prev.map((p) =>
|
|
675
|
+
p.name === name
|
|
676
|
+
? { ...p, model: picked.model, provider: picked.provider }
|
|
677
|
+
: p,
|
|
678
|
+
),
|
|
679
|
+
);
|
|
680
|
+
setEditingModelFor(null);
|
|
681
|
+
} catch (e) {
|
|
682
|
+
showToast(`${t.status.error}: ${e}`, "error");
|
|
683
|
+
} finally {
|
|
684
|
+
setModelSaving(false);
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
688
|
+
// Exactly one editor is open at a time; derive which profile + kind so a
|
|
689
|
+
// single dialog can render the right body.
|
|
690
|
+
const editorName = editingModelFor ?? editingDescFor ?? editingSoulFor;
|
|
691
|
+
const editorKind: "model" | "desc" | "soul" | null = editingModelFor
|
|
692
|
+
? "model"
|
|
693
|
+
: editingDescFor
|
|
694
|
+
? "desc"
|
|
695
|
+
: editingSoulFor
|
|
696
|
+
? "soul"
|
|
697
|
+
: null;
|
|
698
|
+
const editorModalRef = useModalBehavior({
|
|
699
|
+
open: editorName != null,
|
|
700
|
+
onClose: closeEditor,
|
|
701
|
+
});
|
|
702
|
+
|
|
196
703
|
const handleCopyTerminalCommand = async (name: string) => {
|
|
197
704
|
let cmd: string;
|
|
198
705
|
try {
|
|
@@ -227,22 +734,44 @@ export default function ProfilesPage() {
|
|
|
227
734
|
});
|
|
228
735
|
|
|
229
736
|
const pendingName = profileDelete.pendingId;
|
|
737
|
+
const pendingProfile = pendingName
|
|
738
|
+
? profiles.find((p) => p.name === pendingName)
|
|
739
|
+
: undefined;
|
|
740
|
+
const deleteMessage = (() => {
|
|
741
|
+
if (!pendingName) return t.profiles.confirmDeleteMessage;
|
|
742
|
+
const base = t.profiles.confirmDeleteMessage.replace("{name}", pendingName);
|
|
743
|
+
return pendingProfile?.gateway_running
|
|
744
|
+
? `${base}\n\n${L.gatewayRunningWarning}`
|
|
745
|
+
: base;
|
|
746
|
+
})();
|
|
230
747
|
|
|
231
|
-
// Put "Create"
|
|
748
|
+
// Put "Build" (full builder) + "Create" (quick modal) buttons in header
|
|
232
749
|
useLayoutEffect(() => {
|
|
233
750
|
setEnd(
|
|
234
|
-
<
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
751
|
+
<div className="flex items-center gap-2">
|
|
752
|
+
<Button
|
|
753
|
+
className="uppercase"
|
|
754
|
+
size="sm"
|
|
755
|
+
outlined
|
|
756
|
+
onClick={() => navigate("/profiles/new")}
|
|
757
|
+
>
|
|
758
|
+
Build
|
|
759
|
+
</Button>
|
|
760
|
+
<Button
|
|
761
|
+
className="uppercase"
|
|
762
|
+
size="sm"
|
|
763
|
+
onClick={() => setCreateModalOpen(true)}
|
|
764
|
+
>
|
|
765
|
+
{t.common.create}
|
|
766
|
+
</Button>
|
|
767
|
+
</div>,
|
|
241
768
|
);
|
|
242
769
|
return () => {
|
|
243
770
|
setEnd(null);
|
|
244
771
|
};
|
|
245
|
-
}, [setEnd, t.common.create, loading]);
|
|
772
|
+
}, [setEnd, t.common.create, loading, navigate]);
|
|
773
|
+
|
|
774
|
+
const cloning = cloneFrom !== null;
|
|
246
775
|
|
|
247
776
|
if (loading) {
|
|
248
777
|
return (
|
|
@@ -267,11 +796,7 @@ export default function ProfilesPage() {
|
|
|
267
796
|
onCancel={profileDelete.cancel}
|
|
268
797
|
onConfirm={profileDelete.confirm}
|
|
269
798
|
title={t.profiles.confirmDeleteTitle}
|
|
270
|
-
description={
|
|
271
|
-
pendingName
|
|
272
|
-
? t.profiles.confirmDeleteMessage.replace("{name}", pendingName)
|
|
273
|
-
: t.profiles.confirmDeleteMessage
|
|
274
|
-
}
|
|
799
|
+
description={deleteMessage}
|
|
275
800
|
loading={profileDelete.isDeleting}
|
|
276
801
|
/>
|
|
277
802
|
|
|
@@ -287,7 +812,12 @@ export default function ProfilesPage() {
|
|
|
287
812
|
aria-modal="true"
|
|
288
813
|
aria-labelledby="create-profile-title"
|
|
289
814
|
>
|
|
290
|
-
<div
|
|
815
|
+
<div
|
|
816
|
+
className={cn(
|
|
817
|
+
themedBody,
|
|
818
|
+
"relative w-full max-w-md border border-border bg-card shadow-2xl flex flex-col max-h-[90vh]",
|
|
819
|
+
)}
|
|
820
|
+
>
|
|
291
821
|
<Button
|
|
292
822
|
ghost
|
|
293
823
|
size="icon"
|
|
@@ -307,9 +837,10 @@ export default function ProfilesPage() {
|
|
|
307
837
|
</h2>
|
|
308
838
|
</header>
|
|
309
839
|
|
|
310
|
-
<div className="p-5 grid gap-4">
|
|
840
|
+
<div className="min-h-0 overflow-y-auto p-5 grid gap-4">
|
|
311
841
|
<div className="grid gap-2">
|
|
312
842
|
<Label htmlFor="profile-name">{t.profiles.name}</Label>
|
|
843
|
+
|
|
313
844
|
<Input
|
|
314
845
|
id="profile-name"
|
|
315
846
|
autoFocus
|
|
@@ -324,28 +855,118 @@ export default function ProfilesPage() {
|
|
|
324
855
|
!PROFILE_NAME_RE.test(newName.trim())
|
|
325
856
|
}
|
|
326
857
|
/>
|
|
858
|
+
|
|
327
859
|
<p className="text-xs text-muted-foreground">
|
|
328
860
|
{t.profiles.nameRule}
|
|
329
861
|
</p>
|
|
330
862
|
</div>
|
|
331
863
|
|
|
332
|
-
<div className="
|
|
333
|
-
<
|
|
334
|
-
|
|
335
|
-
id="clone-from
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
864
|
+
<div className="grid gap-2">
|
|
865
|
+
<Label htmlFor="clone-from">{t.profiles.cloneFrom}</Label>
|
|
866
|
+
<Select
|
|
867
|
+
id="clone-from"
|
|
868
|
+
value={cloneFrom ?? ""}
|
|
869
|
+
onValueChange={(v) => {
|
|
870
|
+
const next = v || null;
|
|
871
|
+
setCloneFrom(next);
|
|
872
|
+
if (next === null) setCloneAll(false);
|
|
873
|
+
}}
|
|
874
|
+
>
|
|
875
|
+
<SelectOption value="">{t.profiles.cloneFromNone}</SelectOption>
|
|
876
|
+
{profiles.map((profile) => (
|
|
877
|
+
<SelectOption key={profile.name} value={profile.name}>
|
|
878
|
+
{profile.name}
|
|
879
|
+
</SelectOption>
|
|
880
|
+
))}
|
|
881
|
+
</Select>
|
|
882
|
+
</div>
|
|
883
|
+
|
|
884
|
+
<div className="grid gap-2">
|
|
885
|
+
<Label htmlFor="profile-description">
|
|
886
|
+
{L.descriptionOptional}
|
|
887
|
+
</Label>
|
|
888
|
+
|
|
889
|
+
<textarea
|
|
890
|
+
id="profile-description"
|
|
891
|
+
className="flex min-h-[64px] w-full border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
892
|
+
placeholder={L.descriptionPlaceholder}
|
|
893
|
+
value={newDescription}
|
|
894
|
+
onChange={(e) => setNewDescription(e.target.value)}
|
|
339
895
|
/>
|
|
896
|
+
</div>
|
|
340
897
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
898
|
+
<div className="grid gap-2">
|
|
899
|
+
<Label htmlFor="profile-model">{L.modelOptional}</Label>
|
|
900
|
+
|
|
901
|
+
<Select
|
|
902
|
+
id="profile-model"
|
|
903
|
+
value={modelChoice}
|
|
904
|
+
disabled={modelChoices === null}
|
|
905
|
+
onValueChange={setModelChoice}
|
|
344
906
|
>
|
|
345
|
-
|
|
346
|
-
|
|
907
|
+
<SelectOption value="">
|
|
908
|
+
{modelChoices === null ? L.modelLoading : L.modelInherit}
|
|
909
|
+
</SelectOption>
|
|
910
|
+
|
|
911
|
+
{(modelChoices ?? []).map((c) => (
|
|
912
|
+
<SelectOption
|
|
913
|
+
key={`${c.provider}\u0000${c.model}`}
|
|
914
|
+
value={`${c.provider}\u0000${c.model}`}
|
|
915
|
+
>
|
|
916
|
+
{c.label}
|
|
917
|
+
</SelectOption>
|
|
918
|
+
))}
|
|
919
|
+
</Select>
|
|
920
|
+
|
|
921
|
+
{modelChoices !== null && modelChoices.length === 0 && (
|
|
922
|
+
<p className="text-xs text-muted-foreground">{L.modelNone}</p>
|
|
923
|
+
)}
|
|
347
924
|
</div>
|
|
348
925
|
|
|
926
|
+
<fieldset className="grid gap-3 border-t border-border pt-4">
|
|
927
|
+
<legend className="font-mondwest text-display text-xs tracking-wider text-muted-foreground">
|
|
928
|
+
{L.advancedOptions}
|
|
929
|
+
</legend>
|
|
930
|
+
|
|
931
|
+
<div className="flex items-center gap-2.5">
|
|
932
|
+
<Checkbox
|
|
933
|
+
checked={cloneAll}
|
|
934
|
+
disabled={!cloning}
|
|
935
|
+
id="clone-all"
|
|
936
|
+
onCheckedChange={(checked) => setCloneAll(checked === true)}
|
|
937
|
+
/>
|
|
938
|
+
|
|
939
|
+
<Label
|
|
940
|
+
className={cn(
|
|
941
|
+
"font-mondwest normal-case tracking-normal text-sm cursor-pointer",
|
|
942
|
+
!cloning && "opacity-50",
|
|
943
|
+
)}
|
|
944
|
+
htmlFor="clone-all"
|
|
945
|
+
>
|
|
946
|
+
{L.cloneAll}
|
|
947
|
+
</Label>
|
|
948
|
+
</div>
|
|
949
|
+
|
|
950
|
+
<div className="flex items-center gap-2.5">
|
|
951
|
+
<Checkbox
|
|
952
|
+
checked={noSkills}
|
|
953
|
+
id="no-skills"
|
|
954
|
+
disabled={cloning}
|
|
955
|
+
onCheckedChange={(checked) => setNoSkills(checked === true)}
|
|
956
|
+
/>
|
|
957
|
+
|
|
958
|
+
<Label
|
|
959
|
+
className={cn(
|
|
960
|
+
"font-mondwest normal-case tracking-normal text-sm cursor-pointer",
|
|
961
|
+
cloning && "opacity-50",
|
|
962
|
+
)}
|
|
963
|
+
htmlFor="no-skills"
|
|
964
|
+
>
|
|
965
|
+
{L.noSkillsOption}
|
|
966
|
+
</Label>
|
|
967
|
+
</div>
|
|
968
|
+
</fieldset>
|
|
969
|
+
|
|
349
970
|
<div className="flex justify-end">
|
|
350
971
|
<Button
|
|
351
972
|
className="uppercase"
|
|
@@ -361,6 +982,30 @@ export default function ProfilesPage() {
|
|
|
361
982
|
</div>
|
|
362
983
|
)}
|
|
363
984
|
|
|
985
|
+
{/* Active profile banner */}
|
|
986
|
+
{activeInfo && (
|
|
987
|
+
<Card>
|
|
988
|
+
<CardContent className="flex flex-wrap items-center gap-x-4 gap-y-1 py-3 text-xs">
|
|
989
|
+
<span className="flex items-center gap-2 text-muted-foreground">
|
|
990
|
+
<Check className="h-3.5 w-3.5 text-success" />
|
|
991
|
+
|
|
992
|
+
<span>
|
|
993
|
+
{L.activeProfile}:{" "}
|
|
994
|
+
<span className="font-medium text-foreground">
|
|
995
|
+
{activeInfo.active}
|
|
996
|
+
</span>
|
|
997
|
+
</span>
|
|
998
|
+
</span>
|
|
999
|
+
|
|
1000
|
+
{activeInfo.current !== activeInfo.active && (
|
|
1001
|
+
<span className="font-mono text-muted-foreground/80">
|
|
1002
|
+
({activeInfo.current})
|
|
1003
|
+
</span>
|
|
1004
|
+
)}
|
|
1005
|
+
</CardContent>
|
|
1006
|
+
</Card>
|
|
1007
|
+
)}
|
|
1008
|
+
|
|
364
1009
|
{/* List */}
|
|
365
1010
|
<div className="flex flex-col gap-3">
|
|
366
1011
|
<H2
|
|
@@ -379,15 +1024,18 @@ export default function ProfilesPage() {
|
|
|
379
1024
|
</Card>
|
|
380
1025
|
)}
|
|
381
1026
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
1027
|
+
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 xl:grid-cols-3">
|
|
1028
|
+
{profiles.map((p) => {
|
|
1029
|
+
const isRenaming = renamingFrom === p.name;
|
|
1030
|
+
const isEditingSoul = editingSoulFor === p.name;
|
|
1031
|
+
const isEditingDesc = editingDescFor === p.name;
|
|
1032
|
+
const isEditingModel = editingModelFor === p.name;
|
|
1033
|
+
const active = isActive(p);
|
|
1034
|
+
return (
|
|
1035
|
+
<Card key={p.name} className="h-full">
|
|
1036
|
+
<CardContent className="flex h-full flex-col gap-2 py-4">
|
|
1037
|
+
{isRenaming ? (
|
|
1038
|
+
<div className="flex flex-col gap-2">
|
|
391
1039
|
<Input
|
|
392
1040
|
autoFocus
|
|
393
1041
|
value={renameTo}
|
|
@@ -401,159 +1049,377 @@ export default function ProfilesPage() {
|
|
|
401
1049
|
renameTo.trim() !== p.name &&
|
|
402
1050
|
!PROFILE_NAME_RE.test(renameTo.trim())
|
|
403
1051
|
}
|
|
404
|
-
className="max-w-xs"
|
|
405
1052
|
/>
|
|
406
|
-
) : (
|
|
407
|
-
<span className="font-medium text-sm truncate">
|
|
408
|
-
{p.name}
|
|
409
|
-
</span>
|
|
410
|
-
)}
|
|
411
|
-
{p.is_default && (
|
|
412
|
-
<Badge tone="secondary">{t.profiles.defaultBadge}</Badge>
|
|
413
|
-
)}
|
|
414
|
-
{p.has_env && (
|
|
415
|
-
<Badge tone="outline">{t.profiles.hasEnv}</Badge>
|
|
416
|
-
)}
|
|
417
|
-
</div>
|
|
418
|
-
{isRenaming &&
|
|
419
|
-
(() => {
|
|
420
|
-
const trimmed = renameTo.trim();
|
|
421
|
-
const invalid =
|
|
422
|
-
trimmed !== "" &&
|
|
423
|
-
trimmed !== p.name &&
|
|
424
|
-
!PROFILE_NAME_RE.test(trimmed);
|
|
425
|
-
return (
|
|
426
|
-
<p
|
|
427
|
-
className={
|
|
428
|
-
"text-xs mb-1 " +
|
|
429
|
-
(invalid
|
|
430
|
-
? "text-destructive"
|
|
431
|
-
: "text-muted-foreground")
|
|
432
|
-
}
|
|
433
|
-
>
|
|
434
|
-
{invalid
|
|
435
|
-
? `${t.profiles.invalidName}: ${t.profiles.nameRule}`
|
|
436
|
-
: t.profiles.nameRule}
|
|
437
|
-
</p>
|
|
438
|
-
);
|
|
439
|
-
})()}
|
|
440
|
-
<div className="flex items-center gap-4 text-xs text-muted-foreground flex-wrap">
|
|
441
|
-
{p.model && (
|
|
442
|
-
<span>
|
|
443
|
-
{t.profiles.model}: {p.model}
|
|
444
|
-
{p.provider ? ` (${p.provider})` : ""}
|
|
445
|
-
</span>
|
|
446
|
-
)}
|
|
447
|
-
<span>
|
|
448
|
-
{t.profiles.skills}: {p.skill_count}
|
|
449
|
-
</span>
|
|
450
|
-
<span className="font-mono truncate max-w-[28rem]">
|
|
451
|
-
{p.path}
|
|
452
|
-
</span>
|
|
453
|
-
</div>
|
|
454
|
-
</div>
|
|
455
1053
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
1054
|
+
{(() => {
|
|
1055
|
+
const trimmed = renameTo.trim();
|
|
1056
|
+
const invalid =
|
|
1057
|
+
trimmed !== "" &&
|
|
1058
|
+
trimmed !== p.name &&
|
|
1059
|
+
!PROFILE_NAME_RE.test(trimmed);
|
|
1060
|
+
return (
|
|
1061
|
+
<p
|
|
1062
|
+
className={cn(
|
|
1063
|
+
"text-xs",
|
|
1064
|
+
invalid
|
|
1065
|
+
? "text-destructive"
|
|
1066
|
+
: "text-muted-foreground",
|
|
1067
|
+
)}
|
|
1068
|
+
>
|
|
1069
|
+
{invalid
|
|
1070
|
+
? `${t.profiles.invalidName}: ${t.profiles.nameRule}`
|
|
1071
|
+
: t.profiles.nameRule}
|
|
1072
|
+
</p>
|
|
1073
|
+
);
|
|
1074
|
+
})()}
|
|
1075
|
+
|
|
1076
|
+
<div className="flex gap-1.5">
|
|
1077
|
+
<Button size="sm" onClick={handleRenameSubmit}>
|
|
1078
|
+
{t.common.save}
|
|
1079
|
+
</Button>
|
|
1080
|
+
|
|
1081
|
+
<Button
|
|
1082
|
+
size="sm"
|
|
1083
|
+
ghost
|
|
1084
|
+
onClick={() => setRenamingFrom(null)}
|
|
1085
|
+
>
|
|
1086
|
+
{t.common.cancel}
|
|
1087
|
+
</Button>
|
|
1088
|
+
</div>
|
|
1089
|
+
</div>
|
|
470
1090
|
) : (
|
|
471
1091
|
<>
|
|
472
|
-
<
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
aria-label={t.profiles.editSoul}
|
|
477
|
-
onClick={() => openSoulEditor(p.name)}
|
|
478
|
-
>
|
|
479
|
-
{isEditingSoul ? (
|
|
480
|
-
<ChevronDown className="h-4 w-4" />
|
|
481
|
-
) : (
|
|
482
|
-
<span aria-hidden className="text-xs font-bold">
|
|
483
|
-
S
|
|
1092
|
+
<div className="flex items-start gap-2">
|
|
1093
|
+
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-1.5">
|
|
1094
|
+
<span className="font-medium text-sm truncate">
|
|
1095
|
+
{p.name}
|
|
484
1096
|
</span>
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
1097
|
+
|
|
1098
|
+
{active && (
|
|
1099
|
+
<Badge tone="success">{L.activeBadge}</Badge>
|
|
1100
|
+
)}
|
|
1101
|
+
|
|
1102
|
+
{p.is_default && (
|
|
1103
|
+
<Badge tone="secondary">
|
|
1104
|
+
{t.profiles.defaultBadge}
|
|
1105
|
+
</Badge>
|
|
1106
|
+
)}
|
|
1107
|
+
|
|
1108
|
+
{p.has_alias && (
|
|
1109
|
+
<Badge tone="outline">{L.aliasBadge}</Badge>
|
|
1110
|
+
)}
|
|
1111
|
+
|
|
1112
|
+
{p.has_env && (
|
|
1113
|
+
<Badge tone="outline">{t.profiles.hasEnv}</Badge>
|
|
1114
|
+
)}
|
|
1115
|
+
|
|
1116
|
+
{p.distribution_name && (
|
|
1117
|
+
<Badge tone="outline" className="gap-1">
|
|
1118
|
+
<Package className="h-3 w-3" />
|
|
1119
|
+
{p.distribution_name}
|
|
1120
|
+
{p.distribution_version
|
|
1121
|
+
? `@${p.distribution_version}`
|
|
1122
|
+
: ""}
|
|
1123
|
+
</Badge>
|
|
1124
|
+
)}
|
|
1125
|
+
</div>
|
|
1126
|
+
|
|
1127
|
+
<ProfileActionsMenu
|
|
1128
|
+
isActive={active}
|
|
1129
|
+
isDefault={p.is_default}
|
|
1130
|
+
isEditingDesc={isEditingDesc}
|
|
1131
|
+
isEditingModel={isEditingModel}
|
|
1132
|
+
isEditingSoul={isEditingSoul}
|
|
1133
|
+
settingActive={settingActive === p.name}
|
|
1134
|
+
labels={{
|
|
1135
|
+
actions: L.actions,
|
|
1136
|
+
setActive: L.setActive,
|
|
1137
|
+
editModel: L.editModel,
|
|
1138
|
+
editDescription: L.editDescription,
|
|
1139
|
+
editSoul: t.profiles.editSoul,
|
|
1140
|
+
manageSkills: L.manageSkills,
|
|
1141
|
+
openInTerminal: t.profiles.openInTerminal,
|
|
1142
|
+
rename: t.profiles.rename,
|
|
1143
|
+
delete: t.common.delete,
|
|
1144
|
+
}}
|
|
1145
|
+
onCopyCommand={() =>
|
|
1146
|
+
handleCopyTerminalCommand(p.name)
|
|
1147
|
+
}
|
|
1148
|
+
onDelete={() => profileDelete.requestDelete(p.name)}
|
|
1149
|
+
onEditDescription={() => openDescEditor(p)}
|
|
1150
|
+
onEditModel={() => openModelEditor(p)}
|
|
1151
|
+
onEditSoul={() => openSoulEditor(p.name)}
|
|
1152
|
+
onManageSkills={() =>
|
|
1153
|
+
navigate(
|
|
1154
|
+
`/skills?profile=${encodeURIComponent(p.name)}`,
|
|
1155
|
+
)
|
|
1156
|
+
}
|
|
1157
|
+
onRename={() => {
|
|
503
1158
|
setRenamingFrom(p.name);
|
|
504
1159
|
setRenameTo(p.name);
|
|
505
1160
|
}}
|
|
1161
|
+
onSetActive={() => handleSetActive(p.name)}
|
|
1162
|
+
/>
|
|
1163
|
+
</div>
|
|
1164
|
+
|
|
1165
|
+
<div className="flex items-center gap-1.5 text-xs">
|
|
1166
|
+
<span
|
|
1167
|
+
className={cn(
|
|
1168
|
+
"h-1.5 w-1.5 rounded-full",
|
|
1169
|
+
p.gateway_running
|
|
1170
|
+
? "bg-success"
|
|
1171
|
+
: "bg-muted-foreground/40",
|
|
1172
|
+
)}
|
|
1173
|
+
/>
|
|
1174
|
+
|
|
1175
|
+
<span
|
|
1176
|
+
className={cn(
|
|
1177
|
+
p.gateway_running
|
|
1178
|
+
? "text-success"
|
|
1179
|
+
: "text-muted-foreground",
|
|
1180
|
+
)}
|
|
506
1181
|
>
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
1182
|
+
{p.gateway_running
|
|
1183
|
+
? L.gatewayRunning
|
|
1184
|
+
: L.gatewayStopped}
|
|
1185
|
+
</span>
|
|
1186
|
+
</div>
|
|
1187
|
+
|
|
1188
|
+
<div className="flex items-start gap-2 text-xs">
|
|
1189
|
+
<span
|
|
1190
|
+
className={cn(
|
|
1191
|
+
"line-clamp-2",
|
|
1192
|
+
p.description
|
|
1193
|
+
? "text-muted-foreground"
|
|
1194
|
+
: "text-muted-foreground/60 italic",
|
|
1195
|
+
)}
|
|
517
1196
|
>
|
|
518
|
-
|
|
519
|
-
</
|
|
520
|
-
|
|
1197
|
+
{p.description || L.noDescription}
|
|
1198
|
+
</span>
|
|
1199
|
+
|
|
1200
|
+
{p.description && p.description_auto && (
|
|
1201
|
+
<Badge tone="warning" className="shrink-0">
|
|
1202
|
+
{L.reviewBadge}
|
|
1203
|
+
</Badge>
|
|
1204
|
+
)}
|
|
1205
|
+
</div>
|
|
1206
|
+
|
|
1207
|
+
<div className="mt-auto flex flex-col gap-0.5 pt-1 text-xs text-muted-foreground">
|
|
1208
|
+
{p.model && (
|
|
1209
|
+
<span className="truncate">
|
|
1210
|
+
{t.profiles.model}: {p.model}
|
|
1211
|
+
{p.provider ? ` (${p.provider})` : ""}
|
|
1212
|
+
</span>
|
|
1213
|
+
)}
|
|
1214
|
+
|
|
1215
|
+
<span>
|
|
1216
|
+
{t.profiles.skills}: {p.skill_count}
|
|
1217
|
+
</span>
|
|
1218
|
+
|
|
1219
|
+
<span className="font-mono truncate">{p.path}</span>
|
|
1220
|
+
</div>
|
|
521
1221
|
</>
|
|
522
1222
|
)}
|
|
523
|
-
</
|
|
524
|
-
</
|
|
1223
|
+
</CardContent>
|
|
1224
|
+
</Card>
|
|
1225
|
+
);
|
|
1226
|
+
})}
|
|
1227
|
+
</div>
|
|
1228
|
+
</div>
|
|
1229
|
+
|
|
1230
|
+
{/* Editor dialog — model / description / SOUL for the selected profile */}
|
|
1231
|
+
{editorName && (
|
|
1232
|
+
<div
|
|
1233
|
+
ref={editorModalRef}
|
|
1234
|
+
className="fixed inset-0 z-[100] flex items-center justify-center bg-background/85 backdrop-blur-sm p-4"
|
|
1235
|
+
onClick={(e) => e.target === e.currentTarget && closeEditor()}
|
|
1236
|
+
role="dialog"
|
|
1237
|
+
aria-modal="true"
|
|
1238
|
+
aria-labelledby="profile-editor-title"
|
|
1239
|
+
>
|
|
1240
|
+
<div
|
|
1241
|
+
className={cn(
|
|
1242
|
+
themedBody,
|
|
1243
|
+
"relative w-full max-w-lg border border-border bg-card shadow-2xl flex flex-col max-h-[90vh]",
|
|
1244
|
+
)}
|
|
1245
|
+
>
|
|
1246
|
+
<Button
|
|
1247
|
+
ghost
|
|
1248
|
+
size="icon"
|
|
1249
|
+
onClick={closeEditor}
|
|
1250
|
+
className="absolute right-2 top-2 text-muted-foreground hover:text-foreground"
|
|
1251
|
+
aria-label="Close"
|
|
1252
|
+
>
|
|
1253
|
+
<X />
|
|
1254
|
+
</Button>
|
|
1255
|
+
|
|
1256
|
+
<header className="p-5 pb-3 border-b border-border">
|
|
1257
|
+
<h2
|
|
1258
|
+
id="profile-editor-title"
|
|
1259
|
+
className="font-mondwest text-display text-base tracking-wider"
|
|
1260
|
+
>
|
|
1261
|
+
{editorKind === "model"
|
|
1262
|
+
? L.editModel
|
|
1263
|
+
: editorKind === "desc"
|
|
1264
|
+
? L.description
|
|
1265
|
+
: t.profiles.soulSection}
|
|
1266
|
+
<span className="text-muted-foreground"> · {editorName}</span>
|
|
1267
|
+
</h2>
|
|
1268
|
+
</header>
|
|
1269
|
+
|
|
1270
|
+
<div
|
|
1271
|
+
className={cn(
|
|
1272
|
+
"p-5 grid gap-4",
|
|
1273
|
+
editorKind === "soul" && "min-h-0 overflow-y-auto",
|
|
1274
|
+
)}
|
|
1275
|
+
>
|
|
1276
|
+
{editorKind === "model" &&
|
|
1277
|
+
(modelChoices !== null && modelChoices.length === 0 ? (
|
|
1278
|
+
<p className="text-xs text-muted-foreground">{L.modelNone}</p>
|
|
1279
|
+
) : (
|
|
1280
|
+
<>
|
|
1281
|
+
<Select
|
|
1282
|
+
value={modelEditChoice}
|
|
1283
|
+
disabled={modelChoices === null}
|
|
1284
|
+
placeholder={
|
|
1285
|
+
modelChoices === null ? L.modelLoading : L.modelSelect
|
|
1286
|
+
}
|
|
1287
|
+
onValueChange={setModelEditChoice}
|
|
1288
|
+
>
|
|
1289
|
+
{(modelChoices ?? []).map((c) => (
|
|
1290
|
+
<SelectOption
|
|
1291
|
+
key={`${c.provider}\u0000${c.model}`}
|
|
1292
|
+
value={`${c.provider}\u0000${c.model}`}
|
|
1293
|
+
>
|
|
1294
|
+
{c.label}
|
|
1295
|
+
</SelectOption>
|
|
1296
|
+
))}
|
|
1297
|
+
</Select>
|
|
1298
|
+
|
|
1299
|
+
<div className="flex justify-end">
|
|
1300
|
+
<Button
|
|
1301
|
+
size="sm"
|
|
1302
|
+
className="uppercase"
|
|
1303
|
+
onClick={() => handleSaveModel(editorName)}
|
|
1304
|
+
disabled={
|
|
1305
|
+
modelSaving ||
|
|
1306
|
+
!modelChoices?.some(
|
|
1307
|
+
(c) =>
|
|
1308
|
+
`${c.provider}\u0000${c.model}` ===
|
|
1309
|
+
modelEditChoice,
|
|
1310
|
+
)
|
|
1311
|
+
}
|
|
1312
|
+
>
|
|
1313
|
+
{modelSaving ? t.common.saving : t.common.save}
|
|
1314
|
+
</Button>
|
|
1315
|
+
</div>
|
|
1316
|
+
</>
|
|
1317
|
+
))}
|
|
1318
|
+
|
|
1319
|
+
{editorKind === "desc" && (
|
|
1320
|
+
<>
|
|
1321
|
+
<div className="flex items-center justify-between gap-2">
|
|
1322
|
+
<Label
|
|
1323
|
+
htmlFor="profile-desc-editor"
|
|
1324
|
+
className="font-mondwest text-display text-xs tracking-wider text-muted-foreground"
|
|
1325
|
+
>
|
|
1326
|
+
{L.description}
|
|
1327
|
+
</Label>
|
|
525
1328
|
|
|
526
|
-
|
|
527
|
-
|
|
1329
|
+
<Button
|
|
1330
|
+
size="sm"
|
|
1331
|
+
ghost
|
|
1332
|
+
className="gap-1.5"
|
|
1333
|
+
disabled={describing}
|
|
1334
|
+
onClick={() => handleAutoDescribe(editorName)}
|
|
1335
|
+
>
|
|
1336
|
+
<Sparkles className="h-3.5 w-3.5" />
|
|
1337
|
+
{describing ? L.generating : L.autoGenerate}
|
|
1338
|
+
</Button>
|
|
1339
|
+
</div>
|
|
1340
|
+
|
|
1341
|
+
<textarea
|
|
1342
|
+
id="profile-desc-editor"
|
|
1343
|
+
className="flex min-h-[96px] w-full border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
1344
|
+
placeholder={L.descriptionPlaceholder}
|
|
1345
|
+
value={descText}
|
|
1346
|
+
onChange={(e) => setDescText(e.target.value)}
|
|
1347
|
+
/>
|
|
1348
|
+
|
|
1349
|
+
<div className="flex justify-end">
|
|
1350
|
+
<Button
|
|
1351
|
+
size="sm"
|
|
1352
|
+
className="uppercase"
|
|
1353
|
+
onClick={() => handleSaveDesc(editorName)}
|
|
1354
|
+
disabled={descSaving}
|
|
1355
|
+
>
|
|
1356
|
+
{descSaving ? t.common.saving : t.common.save}
|
|
1357
|
+
</Button>
|
|
1358
|
+
</div>
|
|
1359
|
+
</>
|
|
1360
|
+
)}
|
|
1361
|
+
|
|
1362
|
+
{editorKind === "soul" && (
|
|
1363
|
+
<>
|
|
528
1364
|
<Label
|
|
529
|
-
htmlFor=
|
|
530
|
-
className="
|
|
1365
|
+
htmlFor="profile-soul-editor"
|
|
1366
|
+
className="font-mondwest text-display text-xs tracking-wider text-muted-foreground"
|
|
531
1367
|
>
|
|
532
1368
|
{t.profiles.soulSection}
|
|
533
1369
|
</Label>
|
|
1370
|
+
|
|
534
1371
|
<textarea
|
|
535
|
-
id=
|
|
536
|
-
className="flex min-h-[
|
|
1372
|
+
id="profile-soul-editor"
|
|
1373
|
+
className="flex min-h-[280px] w-full border border-input bg-transparent px-3 py-2 text-sm font-mono shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
537
1374
|
placeholder={t.profiles.soulPlaceholder}
|
|
538
1375
|
value={soulText}
|
|
539
1376
|
onChange={(e) => setSoulText(e.target.value)}
|
|
540
1377
|
/>
|
|
541
|
-
|
|
1378
|
+
|
|
1379
|
+
<div className="flex justify-end">
|
|
542
1380
|
<Button
|
|
543
1381
|
size="sm"
|
|
544
1382
|
className="uppercase"
|
|
545
|
-
onClick={() => handleSaveSoul(
|
|
1383
|
+
onClick={() => handleSaveSoul(editorName)}
|
|
546
1384
|
disabled={soulSaving}
|
|
547
1385
|
>
|
|
548
1386
|
{soulSaving ? t.common.saving : t.common.save}
|
|
549
1387
|
</Button>
|
|
550
1388
|
</div>
|
|
551
|
-
|
|
1389
|
+
</>
|
|
552
1390
|
)}
|
|
553
|
-
</
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
1391
|
+
</div>
|
|
1392
|
+
</div>
|
|
1393
|
+
</div>
|
|
1394
|
+
)}
|
|
557
1395
|
</div>
|
|
558
1396
|
);
|
|
559
1397
|
}
|
|
1398
|
+
|
|
1399
|
+
interface ProfileActionsMenuProps {
|
|
1400
|
+
isActive: boolean;
|
|
1401
|
+
isDefault: boolean;
|
|
1402
|
+
isEditingDesc: boolean;
|
|
1403
|
+
isEditingModel: boolean;
|
|
1404
|
+
isEditingSoul: boolean;
|
|
1405
|
+
labels: {
|
|
1406
|
+
actions: string;
|
|
1407
|
+
delete: string;
|
|
1408
|
+
editDescription: string;
|
|
1409
|
+
editModel: string;
|
|
1410
|
+
editSoul: string;
|
|
1411
|
+
manageSkills: string;
|
|
1412
|
+
openInTerminal: string;
|
|
1413
|
+
rename: string;
|
|
1414
|
+
setActive: string;
|
|
1415
|
+
};
|
|
1416
|
+
settingActive: boolean;
|
|
1417
|
+
onCopyCommand: () => void;
|
|
1418
|
+
onDelete: () => void;
|
|
1419
|
+
onEditDescription: () => void;
|
|
1420
|
+
onEditModel: () => void;
|
|
1421
|
+
onEditSoul: () => void;
|
|
1422
|
+
onManageSkills: () => void;
|
|
1423
|
+
onRename: () => void;
|
|
1424
|
+
onSetActive: () => void;
|
|
1425
|
+
}
|