@dyyz1993/create-agent 1.9.0
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/package.json +25 -0
- package/src/__tests__/cli.test.ts +85 -0
- package/src/__tests__/copy.test.ts +168 -0
- package/src/__tests__/templates.test.ts +87 -0
- package/src/cli.ts +65 -0
- package/src/commands/create.ts +49 -0
- package/src/commands/list.ts +12 -0
- package/src/commands/status.ts +85 -0
- package/src/commands/workspace.ts +129 -0
- package/src/lib/copy.ts +285 -0
- package/src/lib/templates.ts +57 -0
- package/src/lib/types.ts +6 -0
- package/templates/agent/.env.example +7 -0
- package/templates/agent/LICENSE +21 -0
- package/templates/agent/README.md +87 -0
- package/templates/agent/bun.lock +1279 -0
- package/templates/agent/electrobun.config.ts +27 -0
- package/templates/agent/eslint.config.mjs +63 -0
- package/templates/agent/llms.txt +24 -0
- package/templates/agent/package-lock.json +3670 -0
- package/templates/agent/package.json +59 -0
- package/templates/agent/postcss.config.js +6 -0
- package/templates/agent/scripts/dev.ts +138 -0
- package/templates/agent/src/__tests__/server-config.test.ts +59 -0
- package/templates/agent/src/bun/index.ts +73 -0
- package/templates/agent/src/gateway/__tests__/ws-handler.test.ts +48 -0
- package/templates/agent/src/gateway/http-routes.ts +1 -0
- package/templates/agent/src/gateway/ipc-transport.ts +68 -0
- package/templates/agent/src/gateway/ws-handler.ts +86 -0
- package/templates/agent/src/mainview/App.tsx +41 -0
- package/templates/agent/src/mainview/__tests__/components/ChatPanel.test.tsx +114 -0
- package/templates/agent/src/mainview/__tests__/components/ExplorerSidebar.test.tsx +141 -0
- package/templates/agent/src/mainview/__tests__/components/MessageBubble.test.tsx +72 -0
- package/templates/agent/src/mainview/__tests__/hooks/use-input-history.test.ts +125 -0
- package/templates/agent/src/mainview/__tests__/hooks/use-rpc-init.test.ts +217 -0
- package/templates/agent/src/mainview/__tests__/hooks/use-sidebar-resize.test.ts +127 -0
- package/templates/agent/src/mainview/__tests__/i18n/i18n.test.ts +48 -0
- package/templates/agent/src/mainview/__tests__/setup.ts +37 -0
- package/templates/agent/src/mainview/__tests__/stores/use-chat-store.test.ts +83 -0
- package/templates/agent/src/mainview/__tests__/stores/use-sidebar-store.test.ts +85 -0
- package/templates/agent/src/mainview/components/activity-bar/ActivityBar.tsx +36 -0
- package/templates/agent/src/mainview/components/activity-bar/MobileTabBar.tsx +36 -0
- package/templates/agent/src/mainview/components/activity-bar/__tests__/ActivityBar.test.tsx +44 -0
- package/templates/agent/src/mainview/components/activity-bar/__tests__/MobileTabBar.test.tsx +44 -0
- package/templates/agent/src/mainview/components/bash/BashPanel.tsx +206 -0
- package/templates/agent/src/mainview/components/bash/__tests__/BashPanel.test.tsx +103 -0
- package/templates/agent/src/mainview/components/chat/ChatPanel.tsx +102 -0
- package/templates/agent/src/mainview/components/chat/MessageBubble.tsx +86 -0
- package/templates/agent/src/mainview/components/common/ErrorBoundary.tsx +58 -0
- package/templates/agent/src/mainview/components/common/LanguageSwitcher.tsx +14 -0
- package/templates/agent/src/mainview/components/common/ThemeToggle.tsx +24 -0
- package/templates/agent/src/mainview/components/common/__tests__/ErrorBoundary.test.tsx +74 -0
- package/templates/agent/src/mainview/components/common/__tests__/LanguageSwitcher.test.tsx +44 -0
- package/templates/agent/src/mainview/components/common/__tests__/ThemeToggle.test.tsx +41 -0
- package/templates/agent/src/mainview/components/debug/DebugPanel.tsx +120 -0
- package/templates/agent/src/mainview/components/debug/__tests__/DebugPanel.test.tsx +102 -0
- package/templates/agent/src/mainview/components/diff/DiffViewerPanel.tsx +106 -0
- package/templates/agent/src/mainview/components/diff/__tests__/DiffViewerPanel.test.tsx +73 -0
- package/templates/agent/src/mainview/components/explorer/ConfirmDialog.tsx +53 -0
- package/templates/agent/src/mainview/components/explorer/ContextMenu.tsx +82 -0
- package/templates/agent/src/mainview/components/explorer/ExplorerSidebar.tsx +221 -0
- package/templates/agent/src/mainview/components/explorer/InlineInput.tsx +55 -0
- package/templates/agent/src/mainview/components/explorer/TreeNodeItem.tsx +121 -0
- package/templates/agent/src/mainview/components/explorer/__tests__/ConfirmDialog.test.tsx +37 -0
- package/templates/agent/src/mainview/components/explorer/__tests__/ContextMenu.test.tsx +49 -0
- package/templates/agent/src/mainview/components/explorer/__tests__/InlineInput.test.tsx +48 -0
- package/templates/agent/src/mainview/components/explorer/__tests__/TreeNodeItem.test.tsx +146 -0
- package/templates/agent/src/mainview/components/feed/FeedPanel.tsx +239 -0
- package/templates/agent/src/mainview/components/feed/__tests__/FeedPanel.test.tsx +108 -0
- package/templates/agent/src/mainview/components/file-preview/FilePreviewOverlay.tsx +56 -0
- package/templates/agent/src/mainview/components/file-preview/VirtualizedCodeView.tsx +99 -0
- package/templates/agent/src/mainview/components/file-preview/__tests__/FilePreviewOverlay.test.tsx +96 -0
- package/templates/agent/src/mainview/components/file-preview/__tests__/VirtualizedCodeView.test.tsx +58 -0
- package/templates/agent/src/mainview/components/git/GitBranchSelector.tsx +98 -0
- package/templates/agent/src/mainview/components/git/GitCommitInput.tsx +60 -0
- package/templates/agent/src/mainview/components/git/GitPanel.tsx +528 -0
- package/templates/agent/src/mainview/components/git/__tests__/GitBranchSelector.test.tsx +76 -0
- package/templates/agent/src/mainview/components/git/__tests__/GitCommitInput.test.tsx +91 -0
- package/templates/agent/src/mainview/components/git/__tests__/GitPanel.test.tsx +174 -0
- package/templates/agent/src/mainview/components/layout/AppLayout.tsx +170 -0
- package/templates/agent/src/mainview/components/layout/__tests__/AppLayout.test.tsx +163 -0
- package/templates/agent/src/mainview/components/rules/RulesPanel.tsx +117 -0
- package/templates/agent/src/mainview/components/rules/__tests__/RulesPanel.test.tsx +91 -0
- package/templates/agent/src/mainview/components/search/SearchPanel.tsx +404 -0
- package/templates/agent/src/mainview/components/search/__tests__/SearchPanel.test.tsx +50 -0
- package/templates/agent/src/mainview/components/sidebar/PinButton.tsx +20 -0
- package/templates/agent/src/mainview/components/sidebar/__tests__/PinButton.test.tsx +48 -0
- package/templates/agent/src/mainview/components/todo/TodoPanel.tsx +141 -0
- package/templates/agent/src/mainview/components/todo/__tests__/TodoPanel.test.tsx +91 -0
- package/templates/agent/src/mainview/global.d.ts +13 -0
- package/templates/agent/src/mainview/hooks/__tests__/use-breakpoint.test.ts +147 -0
- package/templates/agent/src/mainview/hooks/use-breakpoint.ts +34 -0
- package/templates/agent/src/mainview/hooks/use-input-history.ts +84 -0
- package/templates/agent/src/mainview/hooks/use-rpc-init.ts +61 -0
- package/templates/agent/src/mainview/hooks/use-sidebar-resize.ts +40 -0
- package/templates/agent/src/mainview/index.css +61 -0
- package/templates/agent/src/mainview/index.html +12 -0
- package/templates/agent/src/mainview/lib/api-client.ts +192 -0
- package/templates/agent/src/mainview/lib/i18n/index.ts +30 -0
- package/templates/agent/src/mainview/lib/i18n/locales/en.json +157 -0
- package/templates/agent/src/mainview/lib/i18n/locales/zh.json +157 -0
- package/templates/agent/src/mainview/lib/rpc-cache.ts +94 -0
- package/templates/agent/src/mainview/main.tsx +24 -0
- package/templates/agent/src/mainview/stores/__tests__/use-app-store.test.ts +86 -0
- package/templates/agent/src/mainview/stores/__tests__/use-bash-store.test.ts +99 -0
- package/templates/agent/src/mainview/stores/__tests__/use-connection-store.test.ts +26 -0
- package/templates/agent/src/mainview/stores/__tests__/use-explorer-store.test.ts +130 -0
- package/templates/agent/src/mainview/stores/__tests__/use-feed-store.test.ts +132 -0
- package/templates/agent/src/mainview/stores/__tests__/use-git-store.test.ts +161 -0
- package/templates/agent/src/mainview/stores/__tests__/use-locale-store.test.ts +32 -0
- package/templates/agent/src/mainview/stores/__tests__/use-log-store.test.ts +28 -0
- package/templates/agent/src/mainview/stores/__tests__/use-notification-store.test.ts +102 -0
- package/templates/agent/src/mainview/stores/__tests__/use-rules-store.test.ts +75 -0
- package/templates/agent/src/mainview/stores/__tests__/use-theme-store.test.ts +59 -0
- package/templates/agent/src/mainview/stores/__tests__/use-todo-store.test.ts +75 -0
- package/templates/agent/src/mainview/stores/message-batcher.ts +25 -0
- package/templates/agent/src/mainview/stores/use-app-store.ts +99 -0
- package/templates/agent/src/mainview/stores/use-bash-store.ts +93 -0
- package/templates/agent/src/mainview/stores/use-chat-store.ts +37 -0
- package/templates/agent/src/mainview/stores/use-connection-store.ts +42 -0
- package/templates/agent/src/mainview/stores/use-explorer-store.ts +320 -0
- package/templates/agent/src/mainview/stores/use-feed-store.ts +129 -0
- package/templates/agent/src/mainview/stores/use-git-store.ts +291 -0
- package/templates/agent/src/mainview/stores/use-locale-store.ts +27 -0
- package/templates/agent/src/mainview/stores/use-log-store.ts +16 -0
- package/templates/agent/src/mainview/stores/use-notification-store.ts +82 -0
- package/templates/agent/src/mainview/stores/use-rules-store.ts +54 -0
- package/templates/agent/src/mainview/stores/use-sidebar-store.ts +99 -0
- package/templates/agent/src/mainview/stores/use-theme-store.ts +46 -0
- package/templates/agent/src/mainview/stores/use-todo-store.ts +54 -0
- package/templates/agent/src/mainview/types/index.ts +33 -0
- package/templates/agent/src/mainview/utils/constants.ts +1 -0
- package/templates/agent/src/mainview/utils/drop-handler.ts +150 -0
- package/templates/agent/src/mainview/utils/file-icon.tsx +24 -0
- package/templates/agent/src/mainview/utils/file-utils.ts +35 -0
- package/templates/agent/src/server-config.ts +43 -0
- package/templates/agent/src/server.ts +89 -0
- package/templates/agent/src/shared/handlers/__tests__/bash-handler.test.ts +135 -0
- package/templates/agent/src/shared/handlers/__tests__/chat-handler.test.ts +77 -0
- package/templates/agent/src/shared/handlers/__tests__/feed-handler.test.ts +108 -0
- package/templates/agent/src/shared/handlers/__tests__/file-handler.test.ts +100 -0
- package/templates/agent/src/shared/handlers/__tests__/system-handler.test.ts +55 -0
- package/templates/agent/src/shared/handlers/__tests__/timer-handler.test.ts +77 -0
- package/templates/agent/src/shared/handlers/bash.ts +89 -0
- package/templates/agent/src/shared/handlers/chat.ts +179 -0
- package/templates/agent/src/shared/handlers/feed.ts +53 -0
- package/templates/agent/src/shared/handlers/file.ts +99 -0
- package/templates/agent/src/shared/handlers/git.ts +263 -0
- package/templates/agent/src/shared/handlers/index.ts +10 -0
- package/templates/agent/src/shared/handlers/rules.ts +45 -0
- package/templates/agent/src/shared/handlers/system.ts +27 -0
- package/templates/agent/src/shared/handlers/timer.ts +34 -0
- package/templates/agent/src/shared/handlers/todo.ts +45 -0
- package/templates/agent/src/shared/lib/__tests__/bash-security.test.ts +125 -0
- package/templates/agent/src/shared/lib/__tests__/logger.test.ts +92 -0
- package/templates/agent/src/shared/lib/__tests__/path-security.test.ts +77 -0
- package/templates/agent/src/shared/lib/bash-security.ts +64 -0
- package/templates/agent/src/shared/lib/logger.ts +130 -0
- package/templates/agent/src/shared/lib/path-security.ts +38 -0
- package/templates/agent/src/shared/lib/port-registry.ts +103 -0
- package/templates/agent/src/shared/modules/bash.ts +19 -0
- package/templates/agent/src/shared/modules/chat.ts +20 -0
- package/templates/agent/src/shared/modules/feed.ts +30 -0
- package/templates/agent/src/shared/modules/file.ts +40 -0
- package/templates/agent/src/shared/modules/git.ts +81 -0
- package/templates/agent/src/shared/modules/rules.ts +25 -0
- package/templates/agent/src/shared/modules/system.ts +8 -0
- package/templates/agent/src/shared/modules/timer.ts +11 -0
- package/templates/agent/src/shared/modules/todo.ts +27 -0
- package/templates/agent/src/shared/register-all-handlers.ts +36 -0
- package/templates/agent/src/shared/rpc-schema.ts +35 -0
- package/templates/agent/tailwind.config.js +15 -0
- package/templates/agent/tsconfig.json +26 -0
- package/templates/agent/vite.config.ts +3 -0
- package/templates/agent/vitest.config.ts +3 -0
- package/templates/chat/.env.example +6 -0
- package/templates/chat/LICENSE +21 -0
- package/templates/chat/README.md +56 -0
- package/templates/chat/bun.lock +1203 -0
- package/templates/chat/electrobun.config.ts +27 -0
- package/templates/chat/eslint.config.mjs +56 -0
- package/templates/chat/llms.txt +24 -0
- package/templates/chat/package-lock.json +3670 -0
- package/templates/chat/package.json +58 -0
- package/templates/chat/postcss.config.js +6 -0
- package/templates/chat/scripts/dev.ts +138 -0
- package/templates/chat/src/__tests__/server-config.test.ts +59 -0
- package/templates/chat/src/bun/index.ts +72 -0
- package/templates/chat/src/gateway/__tests__/ws-handler.test.ts +48 -0
- package/templates/chat/src/gateway/http-routes.ts +1 -0
- package/templates/chat/src/gateway/ipc-transport.ts +68 -0
- package/templates/chat/src/gateway/ws-handler.ts +86 -0
- package/templates/chat/src/mainview/App.tsx +108 -0
- package/templates/chat/src/mainview/__tests__/components/ChatPanel.test.tsx +76 -0
- package/templates/chat/src/mainview/__tests__/components/MessageBubble.test.tsx +48 -0
- package/templates/chat/src/mainview/__tests__/i18n/i18n.test.ts +48 -0
- package/templates/chat/src/mainview/__tests__/setup-verify.test.ts +8 -0
- package/templates/chat/src/mainview/__tests__/setup.ts +37 -0
- package/templates/chat/src/mainview/__tests__/stores/use-app-store.test.ts +46 -0
- package/templates/chat/src/mainview/__tests__/stores/use-chat-store.test.ts +104 -0
- package/templates/chat/src/mainview/__tests__/stores/use-connection-store.test.ts +35 -0
- package/templates/chat/src/mainview/__tests__/stores/use-log-store.test.ts +45 -0
- package/templates/chat/src/mainview/__tests__/stores/use-notification-store.test.ts +102 -0
- package/templates/chat/src/mainview/__tests__/stores/use-sidebar-store.test.ts +89 -0
- package/templates/chat/src/mainview/components/activity-bar/ActivityBar.tsx +26 -0
- package/templates/chat/src/mainview/components/activity-bar/MobileTabBar.tsx +20 -0
- package/templates/chat/src/mainview/components/chat/ChatPanel.tsx +66 -0
- package/templates/chat/src/mainview/components/chat/MessageBubble.tsx +85 -0
- package/templates/chat/src/mainview/components/common/LanguageSwitcher.tsx +15 -0
- package/templates/chat/src/mainview/components/common/ThemeToggle.tsx +24 -0
- package/templates/chat/src/mainview/components/sidebar/PinButton.tsx +20 -0
- package/templates/chat/src/mainview/global.d.ts +13 -0
- package/templates/chat/src/mainview/hooks/use-breakpoint.ts +34 -0
- package/templates/chat/src/mainview/hooks/use-input-history.ts +84 -0
- package/templates/chat/src/mainview/index.css +61 -0
- package/templates/chat/src/mainview/index.html +12 -0
- package/templates/chat/src/mainview/lib/api-client.ts +175 -0
- package/templates/chat/src/mainview/lib/i18n/index.ts +30 -0
- package/templates/chat/src/mainview/lib/i18n/locales/en.json +157 -0
- package/templates/chat/src/mainview/lib/i18n/locales/zh.json +157 -0
- package/templates/chat/src/mainview/main.tsx +20 -0
- package/templates/chat/src/mainview/stores/__tests__/use-locale-store.test.ts +32 -0
- package/templates/chat/src/mainview/stores/__tests__/use-theme-store.test.ts +59 -0
- package/templates/chat/src/mainview/stores/message-batcher.ts +25 -0
- package/templates/chat/src/mainview/stores/use-app-store.ts +50 -0
- package/templates/chat/src/mainview/stores/use-chat-store.ts +37 -0
- package/templates/chat/src/mainview/stores/use-connection-store.ts +42 -0
- package/templates/chat/src/mainview/stores/use-locale-store.ts +27 -0
- package/templates/chat/src/mainview/stores/use-log-store.ts +16 -0
- package/templates/chat/src/mainview/stores/use-notification-store.ts +82 -0
- package/templates/chat/src/mainview/stores/use-sidebar-store.ts +98 -0
- package/templates/chat/src/mainview/stores/use-theme-store.ts +46 -0
- package/templates/chat/src/mainview/types/index.ts +8 -0
- package/templates/chat/src/mainview/utils/constants.ts +1 -0
- package/templates/chat/src/server-config.ts +42 -0
- package/templates/chat/src/server.ts +89 -0
- package/templates/chat/src/shared/__tests__/chat-handler.test.ts +71 -0
- package/templates/chat/src/shared/__tests__/system-handler.test.ts +70 -0
- package/templates/chat/src/shared/handlers/chat.ts +186 -0
- package/templates/chat/src/shared/handlers/index.ts +2 -0
- package/templates/chat/src/shared/handlers/system.ts +27 -0
- package/templates/chat/src/shared/lib/logger.ts +130 -0
- package/templates/chat/src/shared/lib/path-security.ts +38 -0
- package/templates/chat/src/shared/lib/port-registry.ts +103 -0
- package/templates/chat/src/shared/modules/chat.ts +20 -0
- package/templates/chat/src/shared/modules/system.ts +8 -0
- package/templates/chat/src/shared/register-all-handlers.ts +36 -0
- package/templates/chat/src/shared/rpc-schema.ts +11 -0
- package/templates/chat/tailwind.config.js +15 -0
- package/templates/chat/tsconfig.json +26 -0
- package/templates/chat/vite.config.ts +3 -0
- package/templates/chat/vitest.config.ts +3 -0
- package/templates/general/.env.example +7 -0
- package/templates/general/LICENSE +21 -0
- package/templates/general/README.md +113 -0
- package/templates/general/bun.lock +1266 -0
- package/templates/general/electrobun.config.ts +27 -0
- package/templates/general/eslint.config.mjs +56 -0
- package/templates/general/llms.txt +24 -0
- package/templates/general/package-lock.json +3670 -0
- package/templates/general/package.json +59 -0
- package/templates/general/postcss.config.js +6 -0
- package/templates/general/scripts/dev.ts +138 -0
- package/templates/general/src/__tests__/server-config.test.ts +59 -0
- package/templates/general/src/bun/index.ts +72 -0
- package/templates/general/src/gateway/http-routes.ts +1 -0
- package/templates/general/src/gateway/ipc-transport.ts +68 -0
- package/templates/general/src/gateway/ws-handler.ts +86 -0
- package/templates/general/src/mainview/App.tsx +40 -0
- package/templates/general/src/mainview/__tests__/components/ChatPanel.test.tsx +82 -0
- package/templates/general/src/mainview/__tests__/components/FeedPanel.test.tsx +109 -0
- package/templates/general/src/mainview/__tests__/components/GitPanel.test.tsx +151 -0
- package/templates/general/src/mainview/__tests__/i18n/i18n.test.ts +48 -0
- package/templates/general/src/mainview/__tests__/setup-verify.test.ts +8 -0
- package/templates/general/src/mainview/__tests__/setup.ts +37 -0
- package/templates/general/src/mainview/components/activity-bar/ActivityBar.tsx +40 -0
- package/templates/general/src/mainview/components/activity-bar/MobileTabBar.tsx +29 -0
- package/templates/general/src/mainview/components/chat/ChatPanel.tsx +66 -0
- package/templates/general/src/mainview/components/chat/MessageBubble.tsx +85 -0
- package/templates/general/src/mainview/components/common/LanguageSwitcher.tsx +15 -0
- package/templates/general/src/mainview/components/common/ThemeToggle.tsx +24 -0
- package/templates/general/src/mainview/components/debug/DebugPanel.tsx +176 -0
- package/templates/general/src/mainview/components/diff/DiffViewerPanel.tsx +108 -0
- package/templates/general/src/mainview/components/explorer/ConfirmDialog.tsx +52 -0
- package/templates/general/src/mainview/components/explorer/ContextMenu.tsx +82 -0
- package/templates/general/src/mainview/components/explorer/ExplorerSidebar.tsx +225 -0
- package/templates/general/src/mainview/components/explorer/InlineInput.tsx +55 -0
- package/templates/general/src/mainview/components/explorer/TreeNodeItem.tsx +121 -0
- package/templates/general/src/mainview/components/feed/FeedPanel.tsx +248 -0
- package/templates/general/src/mainview/components/file-preview/FilePreviewOverlay.tsx +55 -0
- package/templates/general/src/mainview/components/file-preview/VirtualizedCodeView.tsx +99 -0
- package/templates/general/src/mainview/components/git/GitBranchSelector.tsx +93 -0
- package/templates/general/src/mainview/components/git/GitCommitInput.tsx +60 -0
- package/templates/general/src/mainview/components/git/GitPanel.tsx +533 -0
- package/templates/general/src/mainview/components/layout/AppLayout.tsx +146 -0
- package/templates/general/src/mainview/components/search/SearchPanel.tsx +405 -0
- package/templates/general/src/mainview/components/sidebar/PinButton.tsx +20 -0
- package/templates/general/src/mainview/global.d.ts +13 -0
- package/templates/general/src/mainview/hooks/use-breakpoint.ts +34 -0
- package/templates/general/src/mainview/hooks/use-input-history.ts +84 -0
- package/templates/general/src/mainview/hooks/use-rpc-init.ts +61 -0
- package/templates/general/src/mainview/hooks/use-sidebar-resize.ts +40 -0
- package/templates/general/src/mainview/index.css +61 -0
- package/templates/general/src/mainview/index.html +12 -0
- package/templates/general/src/mainview/lib/api-client.ts +175 -0
- package/templates/general/src/mainview/lib/i18n/index.ts +30 -0
- package/templates/general/src/mainview/lib/i18n/locales/en.json +157 -0
- package/templates/general/src/mainview/lib/i18n/locales/zh.json +157 -0
- package/templates/general/src/mainview/main.tsx +20 -0
- package/templates/general/src/mainview/stores/__tests__/use-chat-store.test.ts +104 -0
- package/templates/general/src/mainview/stores/__tests__/use-connection-store.test.ts +35 -0
- package/templates/general/src/mainview/stores/__tests__/use-locale-store.test.ts +32 -0
- package/templates/general/src/mainview/stores/__tests__/use-log-store.test.ts +45 -0
- package/templates/general/src/mainview/stores/__tests__/use-theme-store.test.ts +59 -0
- package/templates/general/src/mainview/stores/message-batcher.ts +25 -0
- package/templates/general/src/mainview/stores/use-app-store.ts +104 -0
- package/templates/general/src/mainview/stores/use-chat-store.ts +37 -0
- package/templates/general/src/mainview/stores/use-connection-store.ts +42 -0
- package/templates/general/src/mainview/stores/use-explorer-store.ts +315 -0
- package/templates/general/src/mainview/stores/use-feed-store.ts +129 -0
- package/templates/general/src/mainview/stores/use-git-store.ts +284 -0
- package/templates/general/src/mainview/stores/use-locale-store.ts +27 -0
- package/templates/general/src/mainview/stores/use-log-store.ts +16 -0
- package/templates/general/src/mainview/stores/use-notification-store.ts +82 -0
- package/templates/general/src/mainview/stores/use-sidebar-store.ts +99 -0
- package/templates/general/src/mainview/stores/use-theme-store.ts +46 -0
- package/templates/general/src/mainview/types/index.ts +33 -0
- package/templates/general/src/mainview/utils/constants.ts +1 -0
- package/templates/general/src/mainview/utils/drop-handler.ts +150 -0
- package/templates/general/src/mainview/utils/file-icon.tsx +24 -0
- package/templates/general/src/mainview/utils/file-utils.ts +35 -0
- package/templates/general/src/server-config.ts +42 -0
- package/templates/general/src/server.ts +89 -0
- package/templates/general/src/shared/handlers/__tests__/chat.test.ts +183 -0
- package/templates/general/src/shared/handlers/__tests__/system.test.ts +94 -0
- package/templates/general/src/shared/handlers/__tests__/timer.test.ts +113 -0
- package/templates/general/src/shared/handlers/chat.ts +179 -0
- package/templates/general/src/shared/handlers/feed.ts +53 -0
- package/templates/general/src/shared/handlers/file.ts +99 -0
- package/templates/general/src/shared/handlers/git.ts +263 -0
- package/templates/general/src/shared/handlers/index.ts +7 -0
- package/templates/general/src/shared/handlers/system.ts +27 -0
- package/templates/general/src/shared/handlers/timer.ts +34 -0
- package/templates/general/src/shared/lib/logger.ts +130 -0
- package/templates/general/src/shared/lib/path-security.ts +38 -0
- package/templates/general/src/shared/lib/port-registry.ts +103 -0
- package/templates/general/src/shared/modules/chat.ts +20 -0
- package/templates/general/src/shared/modules/feed.ts +30 -0
- package/templates/general/src/shared/modules/file.ts +40 -0
- package/templates/general/src/shared/modules/git.ts +81 -0
- package/templates/general/src/shared/modules/system.ts +8 -0
- package/templates/general/src/shared/modules/timer.ts +11 -0
- package/templates/general/src/shared/register-all-handlers.ts +36 -0
- package/templates/general/src/shared/rpc-schema.ts +31 -0
- package/templates/general/tailwind.config.js +15 -0
- package/templates/general/tsconfig.json +26 -0
- package/templates/general/vite.config.ts +3 -0
- package/templates/general/vitest.config.ts +3 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--color-bg-primary: #ffffff;
|
|
7
|
+
--color-bg-secondary: #f3f4f6;
|
|
8
|
+
--color-bg-tertiary: #e5e7eb;
|
|
9
|
+
--color-bg-input: #f9fafb;
|
|
10
|
+
--color-bg-hover: #e5e7eb;
|
|
11
|
+
--color-bg-active: #d1d5db;
|
|
12
|
+
--color-bg-sidebar: #f3f4f6;
|
|
13
|
+
--color-bg-overlay: rgba(0, 0, 0, 0.5);
|
|
14
|
+
|
|
15
|
+
--color-text-primary: #111827;
|
|
16
|
+
--color-text-secondary: #4b5563;
|
|
17
|
+
--color-text-tertiary: #9ca3af;
|
|
18
|
+
--color-text-placeholder: #6b7280;
|
|
19
|
+
--color-text-accent: #4f46e5;
|
|
20
|
+
--color-text-success: #16a34a;
|
|
21
|
+
--color-text-error: #dc2626;
|
|
22
|
+
--color-text-info: #0891b2;
|
|
23
|
+
|
|
24
|
+
--color-border-primary: #d1d5db;
|
|
25
|
+
--color-border-secondary: #e5e7eb;
|
|
26
|
+
|
|
27
|
+
--color-accent: #4f46e5;
|
|
28
|
+
--color-accent-hover: #4338ca;
|
|
29
|
+
|
|
30
|
+
--color-badge-bg: #e0e7ff;
|
|
31
|
+
--color-badge-text: #3730a3;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dark {
|
|
35
|
+
--color-bg-primary: #111827;
|
|
36
|
+
--color-bg-secondary: #1f2937;
|
|
37
|
+
--color-bg-tertiary: #374151;
|
|
38
|
+
--color-bg-input: #374151;
|
|
39
|
+
--color-bg-hover: #4b5563;
|
|
40
|
+
--color-bg-active: #6b7280;
|
|
41
|
+
--color-bg-sidebar: #1f2937;
|
|
42
|
+
--color-bg-overlay: rgba(0, 0, 0, 0.7);
|
|
43
|
+
|
|
44
|
+
--color-text-primary: #ffffff;
|
|
45
|
+
--color-text-secondary: #d1d5db;
|
|
46
|
+
--color-text-tertiary: #6b7280;
|
|
47
|
+
--color-text-placeholder: #9ca3af;
|
|
48
|
+
--color-text-accent: #818cf8;
|
|
49
|
+
--color-text-success: #4ade80;
|
|
50
|
+
--color-text-error: #f87171;
|
|
51
|
+
--color-text-info: #22d3ee;
|
|
52
|
+
|
|
53
|
+
--color-border-primary: #374151;
|
|
54
|
+
--color-border-secondary: #4b5563;
|
|
55
|
+
|
|
56
|
+
--color-accent: #6366f1;
|
|
57
|
+
--color-accent-hover: #4f46e5;
|
|
58
|
+
|
|
59
|
+
--color-badge-bg: #312e81;
|
|
60
|
+
--color-badge-text: #a5b4fc;
|
|
61
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>React + Tailwind + Vite</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="./main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createTypedClient, WebSocketTransport, IPCTransport } from "@dyyz1993/rpc-core";
|
|
2
|
+
import type { TypedClient, MethodParams, MethodResult, EventPayload, EventMetadata } from "@dyyz1993/rpc-core";
|
|
3
|
+
import type { RPCMethods, RPCEvents } from "../../shared/rpc-schema";
|
|
4
|
+
import { rpcCache, CACHEABLE_METHODS } from "./rpc-cache";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Token 来源优先级:
|
|
8
|
+
* 1. URL query ?token=xxx(部署时注入)
|
|
9
|
+
* 2. localStorage "rpc-auth-token"
|
|
10
|
+
* 3. 默认值(开发用)
|
|
11
|
+
*/
|
|
12
|
+
function resolveAuthToken(): string {
|
|
13
|
+
if (typeof window !== "undefined") {
|
|
14
|
+
const fromQuery = new URLSearchParams(window.location.search).get("token");
|
|
15
|
+
if (fromQuery) return fromQuery;
|
|
16
|
+
const fromStorage = localStorage.getItem("rpc-auth-token");
|
|
17
|
+
if (fromStorage) return fromStorage;
|
|
18
|
+
}
|
|
19
|
+
return "pi-agent-template-token";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const AUTH_TOKEN = resolveAuthToken();
|
|
23
|
+
|
|
24
|
+
class APIClientImpl {
|
|
25
|
+
private client: TypedClient<RPCMethods, RPCEvents> | null = null;
|
|
26
|
+
private initPromise: Promise<void> | null = null;
|
|
27
|
+
private _transport: "ipc" | "websocket" = "websocket";
|
|
28
|
+
private _baseUrl: string | null = null;
|
|
29
|
+
private wsTransport: WebSocketTransport | null = null;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 桌面端同步初始化:通过 executeJavascript 接收 + __electrobunBunBridge 发送
|
|
33
|
+
*/
|
|
34
|
+
initSyncForDesktop(): void {
|
|
35
|
+
if (this.client) return;
|
|
36
|
+
|
|
37
|
+
const ipcTransport = new IPCTransport();
|
|
38
|
+
this._transport = "ipc";
|
|
39
|
+
this._baseUrl = null; // 桌面端不走 HTTP
|
|
40
|
+
this.client = createTypedClient<RPCMethods, RPCEvents>(ipcTransport);
|
|
41
|
+
this.setupElectrobunBridge(ipcTransport);
|
|
42
|
+
if (import.meta.env.DEV) {
|
|
43
|
+
console.warn("[APIClient] Desktop (IPC) initialized synchronously");
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 异步初始化:Web 端使用(连接 WebSocket)
|
|
49
|
+
*/
|
|
50
|
+
async initialize(): Promise<void> {
|
|
51
|
+
// 已连接且 transport 正常 → 直接返回
|
|
52
|
+
if (this.client && (this._transport === "ipc" || this.wsTransport?.isConnected())) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// client 存在但 WS 断开了 → 清理后重连
|
|
57
|
+
if (this.client && this.wsTransport && !this.wsTransport.isConnected()) {
|
|
58
|
+
this.wsTransport.close();
|
|
59
|
+
this.wsTransport = null;
|
|
60
|
+
this.client = null;
|
|
61
|
+
this.initPromise = null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (this.initPromise) return this.initPromise;
|
|
65
|
+
|
|
66
|
+
this.initPromise = (async () => {
|
|
67
|
+
const env = this.detectEnvironment();
|
|
68
|
+
|
|
69
|
+
if (env === "electrobun") {
|
|
70
|
+
// 不应走到这里,桌面端应通过 initSyncForDesktop() 初始化
|
|
71
|
+
this.initSyncForDesktop();
|
|
72
|
+
} else {
|
|
73
|
+
this._transport = "websocket";
|
|
74
|
+
const wsUrl = this.getWebSocketUrl();
|
|
75
|
+
this.wsTransport = new WebSocketTransport(wsUrl);
|
|
76
|
+
await this.wsTransport.connect();
|
|
77
|
+
this.client = createTypedClient<RPCMethods, RPCEvents>(this.wsTransport);
|
|
78
|
+
|
|
79
|
+
const wsUrlObj = new URL(wsUrl);
|
|
80
|
+
this._baseUrl = `http://${wsUrlObj.host}`;
|
|
81
|
+
}
|
|
82
|
+
})();
|
|
83
|
+
|
|
84
|
+
return this.initPromise;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
private detectEnvironment(): "electrobun" | "browser" {
|
|
88
|
+
if (typeof window === "undefined") return "browser";
|
|
89
|
+
if (window.__electrobunBunBridge) return "electrobun";
|
|
90
|
+
return "browser";
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private getWebSocketUrl(): string {
|
|
94
|
+
if (typeof window === "undefined") return `ws://localhost:3100?token=${AUTH_TOKEN}`;
|
|
95
|
+
const customUrl = (
|
|
96
|
+
new URLSearchParams(window.location.search).get("ws") ||
|
|
97
|
+
localStorage.getItem("rpc-websocket-url")
|
|
98
|
+
);
|
|
99
|
+
if (customUrl) return customUrl.includes("token=") ? customUrl : `${customUrl}?token=${AUTH_TOKEN}`;
|
|
100
|
+
return `ws://${window.location.host}/ws?token=${AUTH_TOKEN}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 桌面端 IPC 桥接:
|
|
105
|
+
* - Bun → Browser: 通过 executeJavascript 调用 window.__piAgentIPC()
|
|
106
|
+
* - Browser → Bun: 通过 __electrobunBunBridge.postMessage 发送 Electrobun 消息格式
|
|
107
|
+
*/
|
|
108
|
+
private setupElectrobunBridge(ipcTransport: IPCTransport): void {
|
|
109
|
+
if (typeof window === "undefined") return;
|
|
110
|
+
|
|
111
|
+
const win = window;
|
|
112
|
+
|
|
113
|
+
// 1. 注册接收函数:Bun 通过 executeJavascript 调用此函数发送消息到 Browser
|
|
114
|
+
win.__piAgentIPC = (msg: unknown) => {
|
|
115
|
+
ipcTransport.simulateMessage(msg);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// 2. 覆写 send:将 RPC-core 消息包装成 Electrobun 消息格式,通过原生桥接发送
|
|
119
|
+
const bridge = win.__electrobunBunBridge;
|
|
120
|
+
|
|
121
|
+
if (bridge) {
|
|
122
|
+
ipcTransport.send = async (message: unknown) => {
|
|
123
|
+
// 包装成 Electrobun message packet,bun 端 defineRPC 注册了 "rpc-message" handler
|
|
124
|
+
const electrobunPacket = {
|
|
125
|
+
type: "message",
|
|
126
|
+
id: "rpc-message",
|
|
127
|
+
payload: JSON.stringify(message),
|
|
128
|
+
};
|
|
129
|
+
bridge.postMessage(JSON.stringify(electrobunPacket));
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
getTransport(): "ipc" | "websocket" {
|
|
135
|
+
return this._transport;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Web 端 HTTP 基础 URL(如 http://localhost:3100),桌面端返回 null */
|
|
139
|
+
getBaseUrl(): string | null {
|
|
140
|
+
return this._baseUrl;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** 获取当前 auth token(用于需要直接调 HTTP 的场景) */
|
|
144
|
+
getAuthToken(): string {
|
|
145
|
+
return AUTH_TOKEN;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async call<K extends keyof RPCMethods>(
|
|
149
|
+
method: K,
|
|
150
|
+
params: MethodParams<RPCMethods, K>
|
|
151
|
+
): Promise<MethodResult<RPCMethods, K>> {
|
|
152
|
+
const methodStr = method as string;
|
|
153
|
+
const ttl = CACHEABLE_METHODS[methodStr];
|
|
154
|
+
if (ttl !== undefined) {
|
|
155
|
+
const cached = rpcCache.get<MethodResult<RPCMethods, K>>(methodStr, params, ttl);
|
|
156
|
+
if (cached !== null) return cached;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
await this.initialize();
|
|
160
|
+
const result = await this.client!.call(method, params);
|
|
161
|
+
|
|
162
|
+
if (ttl !== undefined) {
|
|
163
|
+
rpcCache.set(methodStr, params, result);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return result;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async subscribe<K extends keyof RPCEvents>(
|
|
170
|
+
eventType: K,
|
|
171
|
+
handler: (payload: EventPayload<RPCEvents[K]>, metadata: EventMetadata<RPCEvents[K]>) => void,
|
|
172
|
+
filter?: Record<string, unknown>
|
|
173
|
+
): Promise<string> {
|
|
174
|
+
await this.initialize();
|
|
175
|
+
return this.client!.subscribe(eventType, handler, filter);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
unsubscribe(subscriptionId: string): void {
|
|
179
|
+
this.client?.unsubscribe(subscriptionId);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
isConnected(): boolean {
|
|
183
|
+
return this.client !== null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
close(): void {
|
|
187
|
+
this.client?.close();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export const apiClient = new APIClientImpl();
|
|
192
|
+
export type { APIClientImpl, RPCMethods, RPCEvents };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import i18n from "i18next";
|
|
2
|
+
import { initReactI18next } from "react-i18next";
|
|
3
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
4
|
+
import en from "./locales/en.json";
|
|
5
|
+
import zh from "./locales/zh.json";
|
|
6
|
+
|
|
7
|
+
export const supportedLocales = ["en", "zh"] as const;
|
|
8
|
+
export type Locale = (typeof supportedLocales)[number];
|
|
9
|
+
|
|
10
|
+
i18n
|
|
11
|
+
.use(LanguageDetector)
|
|
12
|
+
.use(initReactI18next)
|
|
13
|
+
.init({
|
|
14
|
+
resources: {
|
|
15
|
+
en: { translation: en },
|
|
16
|
+
zh: { translation: zh },
|
|
17
|
+
},
|
|
18
|
+
fallbackLng: "en",
|
|
19
|
+
supportedLngs: [...supportedLocales],
|
|
20
|
+
interpolation: {
|
|
21
|
+
escapeValue: false,
|
|
22
|
+
},
|
|
23
|
+
detection: {
|
|
24
|
+
order: ["localStorage", "navigator"],
|
|
25
|
+
lookupLocalStorage: "locale",
|
|
26
|
+
caches: ["localStorage"],
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default i18n;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"title": "Pi Agent",
|
|
4
|
+
"connecting": "Connecting to RPC server...",
|
|
5
|
+
"mode": {
|
|
6
|
+
"desktop": "Desktop (IPC)",
|
|
7
|
+
"web": "Web (WebSocket)"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"sidebar": {
|
|
11
|
+
"explorer": "Explorer",
|
|
12
|
+
"git": "Source Control",
|
|
13
|
+
"search": "Search",
|
|
14
|
+
"rules": "Rules"
|
|
15
|
+
},
|
|
16
|
+
"tabs": {
|
|
17
|
+
"chat": "Chat",
|
|
18
|
+
"feed": "Feed + Subs",
|
|
19
|
+
"bash": "Terminal",
|
|
20
|
+
"todo": "Todo",
|
|
21
|
+
"debug": "Debug"
|
|
22
|
+
},
|
|
23
|
+
"chat": {
|
|
24
|
+
"title": "Messages",
|
|
25
|
+
"placeholder": "Type a message...",
|
|
26
|
+
"send": "Send",
|
|
27
|
+
"empty": "Start a conversation..."
|
|
28
|
+
},
|
|
29
|
+
"explorer": {
|
|
30
|
+
"title": "Explorer",
|
|
31
|
+
"pathPlaceholder": "Path",
|
|
32
|
+
"refresh": "Refresh",
|
|
33
|
+
"listDirectory": "List directory",
|
|
34
|
+
"newFile": "New File",
|
|
35
|
+
"newFolder": "New Folder",
|
|
36
|
+
"rename": "Rename",
|
|
37
|
+
"delete": "Delete",
|
|
38
|
+
"copyPath": "Copy Path",
|
|
39
|
+
"confirmDelete": "Confirm Delete",
|
|
40
|
+
"confirmDeleteMessage": "Are you sure you want to delete \"{{name}}\"? This action cannot be undone.",
|
|
41
|
+
"emptyHint": "Enter path and click refresh"
|
|
42
|
+
},
|
|
43
|
+
"git": {
|
|
44
|
+
"title": "Source Control",
|
|
45
|
+
"staged": "Staged Changes",
|
|
46
|
+
"changes": "Changes",
|
|
47
|
+
"untracked": "Untracked",
|
|
48
|
+
"noChanges": "No changes detected",
|
|
49
|
+
"commits": "Commits",
|
|
50
|
+
"noCommits": "No commits",
|
|
51
|
+
"noFiles": "No files",
|
|
52
|
+
"loadingFiles": "Loading files...",
|
|
53
|
+
"commitPlaceholder": "Commit message (Ctrl+Enter to commit)",
|
|
54
|
+
"committing": "Committing...",
|
|
55
|
+
"commit": "Commit",
|
|
56
|
+
"openDiff": "Open Diff",
|
|
57
|
+
"openFile": "Open File",
|
|
58
|
+
"copyHash": "Copy Hash",
|
|
59
|
+
"copyMessage": "Copy Message",
|
|
60
|
+
"copyPath": "Copy Path",
|
|
61
|
+
"pull": "Pull",
|
|
62
|
+
"push": "Push",
|
|
63
|
+
"refresh": "Refresh",
|
|
64
|
+
"stage": "Stage",
|
|
65
|
+
"unstage": "Unstage",
|
|
66
|
+
"stageAll": "Stage all",
|
|
67
|
+
"unstageAll": "Unstage all",
|
|
68
|
+
"worktrees": "Worktrees",
|
|
69
|
+
"close": "Close",
|
|
70
|
+
"justNow": "just now",
|
|
71
|
+
"minutesAgo": "{{count}}m ago",
|
|
72
|
+
"hoursAgo": "{{count}}h ago",
|
|
73
|
+
"daysAgo": "{{count}}d ago"
|
|
74
|
+
},
|
|
75
|
+
"feed": {
|
|
76
|
+
"title": "Feed + Subscriptions",
|
|
77
|
+
"newPost": "New Post",
|
|
78
|
+
"authorPlaceholder": "Author",
|
|
79
|
+
"post": "Post",
|
|
80
|
+
"postPlaceholder": "Write a post...",
|
|
81
|
+
"subscribeWithFilter": "Subscribe with Filter",
|
|
82
|
+
"filterPlaceholder": "filter JSON, e.g. {\"category\":\"tech\"}",
|
|
83
|
+
"subscribe": "Subscribe",
|
|
84
|
+
"unsubscribe": "Unsubscribe",
|
|
85
|
+
"noFilter": "no filter",
|
|
86
|
+
"eventStream": "Event Stream",
|
|
87
|
+
"live": "LIVE",
|
|
88
|
+
"noPostsYet": "No posts yet. Create one above!"
|
|
89
|
+
},
|
|
90
|
+
"todo": {
|
|
91
|
+
"title": "Todo",
|
|
92
|
+
"add": "Add Todo",
|
|
93
|
+
"placeholder": "What needs to be done?",
|
|
94
|
+
"save": "Add",
|
|
95
|
+
"empty": "No tasks yet",
|
|
96
|
+
"emptyHint": "Click \"Add Todo\" to create one",
|
|
97
|
+
"status": "Status:",
|
|
98
|
+
"statusPending": "pending",
|
|
99
|
+
"statusInProgress": "in progress",
|
|
100
|
+
"statusCompleted": "completed"
|
|
101
|
+
},
|
|
102
|
+
"rules": {
|
|
103
|
+
"title": "Rules",
|
|
104
|
+
"add": "Add Rule",
|
|
105
|
+
"namePlaceholder": "Rule name",
|
|
106
|
+
"patternPlaceholder": "Glob pattern (e.g. **/*.ts)",
|
|
107
|
+
"save": "Save",
|
|
108
|
+
"empty": "No rules defined yet",
|
|
109
|
+
"emptyHint": "Click \"Add Rule\" to create one",
|
|
110
|
+
"pattern": "Pattern:"
|
|
111
|
+
},
|
|
112
|
+
"bash": {
|
|
113
|
+
"title": "Terminal",
|
|
114
|
+
"enterCommand": "Enter command...",
|
|
115
|
+
"run": "Run",
|
|
116
|
+
"processRunning": "Process running... (PID: {{pid}})",
|
|
117
|
+
"waitingOutput": "Waiting for output...",
|
|
118
|
+
"exit": "Exit: {{code}}",
|
|
119
|
+
"noActiveProcess": "No active process",
|
|
120
|
+
"getStarted": "Run a command to get started",
|
|
121
|
+
"kill": "Kill",
|
|
122
|
+
"exited": "exited({{code}})"
|
|
123
|
+
},
|
|
124
|
+
"diff": {
|
|
125
|
+
"lineByLine": "Line by line",
|
|
126
|
+
"sideBySide": "Side by side",
|
|
127
|
+
"loading": "Loading diff...",
|
|
128
|
+
"before": "Before",
|
|
129
|
+
"after": "After"
|
|
130
|
+
},
|
|
131
|
+
"debug": {
|
|
132
|
+
"rpcCalls": "RPC Calls",
|
|
133
|
+
"call": "Call",
|
|
134
|
+
"subscriptions": "Subscriptions",
|
|
135
|
+
"subscribe": "Subscribe",
|
|
136
|
+
"unsubscribe": "Unsubscribe",
|
|
137
|
+
"events": "{{count}} events",
|
|
138
|
+
"noEvents": "No events yet",
|
|
139
|
+
"logs": "Logs"
|
|
140
|
+
},
|
|
141
|
+
"theme": {
|
|
142
|
+
"light": "Light",
|
|
143
|
+
"dark": "Dark",
|
|
144
|
+
"toggle": "Toggle theme"
|
|
145
|
+
},
|
|
146
|
+
"locale": {
|
|
147
|
+
"en": "English",
|
|
148
|
+
"zh": "中文"
|
|
149
|
+
},
|
|
150
|
+
"common": {
|
|
151
|
+
"loading": "Loading...",
|
|
152
|
+
"cancel": "Cancel",
|
|
153
|
+
"confirm": "Confirm",
|
|
154
|
+
"save": "Save",
|
|
155
|
+
"delete": "Delete"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"title": "Pi Agent",
|
|
4
|
+
"connecting": "正在连接 RPC 服务器...",
|
|
5
|
+
"mode": {
|
|
6
|
+
"desktop": "桌面 (IPC)",
|
|
7
|
+
"web": "Web (WebSocket)"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"sidebar": {
|
|
11
|
+
"explorer": "资源管理器",
|
|
12
|
+
"git": "源代码管理",
|
|
13
|
+
"search": "搜索",
|
|
14
|
+
"rules": "规则"
|
|
15
|
+
},
|
|
16
|
+
"tabs": {
|
|
17
|
+
"chat": "聊天",
|
|
18
|
+
"feed": "动态 + 订阅",
|
|
19
|
+
"bash": "终端",
|
|
20
|
+
"todo": "待办",
|
|
21
|
+
"debug": "调试"
|
|
22
|
+
},
|
|
23
|
+
"chat": {
|
|
24
|
+
"title": "消息",
|
|
25
|
+
"placeholder": "输入消息...",
|
|
26
|
+
"send": "发送",
|
|
27
|
+
"empty": "开始对话..."
|
|
28
|
+
},
|
|
29
|
+
"explorer": {
|
|
30
|
+
"title": "资源管理器",
|
|
31
|
+
"pathPlaceholder": "路径",
|
|
32
|
+
"refresh": "刷新",
|
|
33
|
+
"listDirectory": "列出目录",
|
|
34
|
+
"newFile": "新建文件",
|
|
35
|
+
"newFolder": "新建文件夹",
|
|
36
|
+
"rename": "重命名",
|
|
37
|
+
"delete": "删除",
|
|
38
|
+
"copyPath": "复制路径",
|
|
39
|
+
"confirmDelete": "确认删除",
|
|
40
|
+
"confirmDeleteMessage": "确定要删除 \"{{name}}\" 吗?此操作无法撤销。",
|
|
41
|
+
"emptyHint": "输入路径并点击刷新"
|
|
42
|
+
},
|
|
43
|
+
"git": {
|
|
44
|
+
"title": "源代码管理",
|
|
45
|
+
"staged": "已暂存更改",
|
|
46
|
+
"changes": "更改",
|
|
47
|
+
"untracked": "未跟踪",
|
|
48
|
+
"noChanges": "未检测到更改",
|
|
49
|
+
"commits": "提交记录",
|
|
50
|
+
"noCommits": "暂无提交",
|
|
51
|
+
"noFiles": "暂无文件",
|
|
52
|
+
"loadingFiles": "加载文件中...",
|
|
53
|
+
"commitPlaceholder": "提交信息 (Ctrl+Enter 提交)",
|
|
54
|
+
"committing": "提交中...",
|
|
55
|
+
"commit": "提交",
|
|
56
|
+
"openDiff": "打开差异",
|
|
57
|
+
"openFile": "打开文件",
|
|
58
|
+
"copyHash": "复制哈希",
|
|
59
|
+
"copyMessage": "复制信息",
|
|
60
|
+
"copyPath": "复制路径",
|
|
61
|
+
"pull": "拉取",
|
|
62
|
+
"push": "推送",
|
|
63
|
+
"refresh": "刷新",
|
|
64
|
+
"stage": "暂存",
|
|
65
|
+
"unstage": "取消暂存",
|
|
66
|
+
"stageAll": "全部暂存",
|
|
67
|
+
"unstageAll": "全部取消暂存",
|
|
68
|
+
"worktrees": "工作树",
|
|
69
|
+
"close": "关闭",
|
|
70
|
+
"justNow": "刚刚",
|
|
71
|
+
"minutesAgo": "{{count}}分钟前",
|
|
72
|
+
"hoursAgo": "{{count}}小时前",
|
|
73
|
+
"daysAgo": "{{count}}天前"
|
|
74
|
+
},
|
|
75
|
+
"feed": {
|
|
76
|
+
"title": "动态 + 订阅",
|
|
77
|
+
"newPost": "新动态",
|
|
78
|
+
"authorPlaceholder": "作者",
|
|
79
|
+
"post": "发布",
|
|
80
|
+
"postPlaceholder": "写点什么...",
|
|
81
|
+
"subscribeWithFilter": "带过滤器订阅",
|
|
82
|
+
"filterPlaceholder": "过滤器 JSON,如 {\"category\":\"tech\"}",
|
|
83
|
+
"subscribe": "订阅",
|
|
84
|
+
"unsubscribe": "取消订阅",
|
|
85
|
+
"noFilter": "无过滤",
|
|
86
|
+
"eventStream": "事件流",
|
|
87
|
+
"live": "直播",
|
|
88
|
+
"noPostsYet": "暂无动态,在上方创建一条!"
|
|
89
|
+
},
|
|
90
|
+
"todo": {
|
|
91
|
+
"title": "待办",
|
|
92
|
+
"add": "添加待办",
|
|
93
|
+
"placeholder": "需要做什么?",
|
|
94
|
+
"save": "添加",
|
|
95
|
+
"empty": "暂无任务",
|
|
96
|
+
"emptyHint": "点击\"添加待办\"来创建",
|
|
97
|
+
"status": "状态:",
|
|
98
|
+
"statusPending": "待处理",
|
|
99
|
+
"statusInProgress": "进行中",
|
|
100
|
+
"statusCompleted": "已完成"
|
|
101
|
+
},
|
|
102
|
+
"rules": {
|
|
103
|
+
"title": "规则",
|
|
104
|
+
"add": "添加规则",
|
|
105
|
+
"namePlaceholder": "规则名称",
|
|
106
|
+
"patternPlaceholder": "Glob 匹配模式 (如 **/*.ts)",
|
|
107
|
+
"save": "保存",
|
|
108
|
+
"empty": "暂无规则",
|
|
109
|
+
"emptyHint": "点击\"添加规则\"来创建",
|
|
110
|
+
"pattern": "模式:"
|
|
111
|
+
},
|
|
112
|
+
"bash": {
|
|
113
|
+
"title": "终端",
|
|
114
|
+
"enterCommand": "输入命令...",
|
|
115
|
+
"run": "运行",
|
|
116
|
+
"processRunning": "进程运行中... (PID: {{pid}})",
|
|
117
|
+
"waitingOutput": "等待输出...",
|
|
118
|
+
"exit": "退出码: {{code}}",
|
|
119
|
+
"noActiveProcess": "无活动进程",
|
|
120
|
+
"getStarted": "运行命令开始",
|
|
121
|
+
"kill": "终止",
|
|
122
|
+
"exited": "已退出({{code}})"
|
|
123
|
+
},
|
|
124
|
+
"diff": {
|
|
125
|
+
"lineByLine": "逐行对比",
|
|
126
|
+
"sideBySide": "并排对比",
|
|
127
|
+
"loading": "加载差异...",
|
|
128
|
+
"before": "修改前",
|
|
129
|
+
"after": "修改后"
|
|
130
|
+
},
|
|
131
|
+
"debug": {
|
|
132
|
+
"rpcCalls": "RPC 调用",
|
|
133
|
+
"call": "调用",
|
|
134
|
+
"subscriptions": "订阅",
|
|
135
|
+
"subscribe": "订阅",
|
|
136
|
+
"unsubscribe": "取消订阅",
|
|
137
|
+
"events": "{{count}} 个事件",
|
|
138
|
+
"noEvents": "暂无事件",
|
|
139
|
+
"logs": "日志"
|
|
140
|
+
},
|
|
141
|
+
"theme": {
|
|
142
|
+
"light": "浅色",
|
|
143
|
+
"dark": "深色",
|
|
144
|
+
"toggle": "切换主题"
|
|
145
|
+
},
|
|
146
|
+
"locale": {
|
|
147
|
+
"en": "English",
|
|
148
|
+
"zh": "中文"
|
|
149
|
+
},
|
|
150
|
+
"common": {
|
|
151
|
+
"loading": "加载中...",
|
|
152
|
+
"cancel": "取消",
|
|
153
|
+
"confirm": "确认",
|
|
154
|
+
"save": "保存",
|
|
155
|
+
"delete": "删除"
|
|
156
|
+
}
|
|
157
|
+
}
|