profclaw 0.0.1-beta.3 → 2.3.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/.env.example +14 -2
- package/CHANGELOG.md +54 -34
- package/CONTRIBUTING.md +23 -5
- package/Dockerfile +39 -23
- package/README.md +271 -72
- package/dist/agents/agent-summary.d.ts +44 -0
- package/dist/agents/agent-summary.js +176 -0
- package/dist/agents/auto-memory.d.ts +59 -0
- package/dist/agents/auto-memory.js +310 -0
- package/dist/agents/checkpoint-manager.d.ts +76 -0
- package/dist/agents/checkpoint-manager.js +156 -0
- package/dist/agents/circuit-breaker.d.ts +54 -0
- package/dist/agents/circuit-breaker.js +153 -0
- package/dist/agents/context-compactor.d.ts +70 -0
- package/dist/agents/context-compactor.js +361 -0
- package/dist/agents/conversation-branch.d.ts +55 -0
- package/dist/agents/conversation-branch.js +115 -0
- package/dist/agents/error-recovery.d.ts +44 -0
- package/dist/agents/error-recovery.js +197 -0
- package/dist/agents/events.d.ts +76 -0
- package/dist/agents/events.js +8 -0
- package/dist/agents/executor.d.ts +35 -1
- package/dist/agents/executor.js +573 -124
- package/dist/agents/file-snapshots.d.ts +72 -0
- package/dist/agents/file-snapshots.js +182 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +183 -0
- package/dist/agents/orchestrator.js +495 -0
- package/dist/agents/permissions.d.ts +63 -0
- package/dist/agents/permissions.js +138 -0
- package/dist/agents/plan-mode.d.ts +71 -0
- package/dist/agents/plan-mode.js +186 -0
- package/dist/agents/prompt-suggestions.d.ts +33 -0
- package/dist/agents/prompt-suggestions.js +208 -0
- package/dist/agents/rate-limit-monitor.d.ts +56 -0
- package/dist/agents/rate-limit-monitor.js +224 -0
- package/dist/agents/result-store.d.ts +37 -0
- package/dist/agents/result-store.js +104 -0
- package/dist/agents/session-diff.d.ts +43 -0
- package/dist/agents/session-diff.js +258 -0
- package/dist/agents/tool-loader.d.ts +65 -0
- package/dist/agents/tool-loader.js +273 -0
- package/dist/agents/transcript.d.ts +96 -0
- package/dist/agents/transcript.js +267 -0
- package/dist/agents/worktree-manager.d.ts +80 -0
- package/dist/agents/worktree-manager.js +203 -0
- package/dist/auth/middleware.js +14 -0
- package/dist/chat/agentic-executor.d.ts +7 -0
- package/dist/chat/agentic-executor.js +253 -30
- package/dist/chat/conversations.d.ts +2 -0
- package/dist/chat/conversations.js +8 -0
- package/dist/chat/execution/executor.d.ts +8 -0
- package/dist/chat/execution/executor.js +157 -103
- package/dist/chat/execution/index.js +5 -1
- package/dist/chat/execution/tool-router.js +40 -14
- package/dist/chat/execution/tools/canvas.d.ts +2 -2
- package/dist/chat/execution/tools/code-tools.d.ts +66 -0
- package/dist/chat/execution/tools/code-tools.js +353 -0
- package/dist/chat/execution/tools/complete-task.d.ts +2 -2
- package/dist/chat/execution/tools/cron-tool.d.ts +26 -10
- package/dist/chat/execution/tools/cron-tool.js +48 -3
- package/dist/chat/execution/tools/decompose-task.d.ts +58 -0
- package/dist/chat/execution/tools/decompose-task.js +166 -0
- package/dist/chat/execution/tools/exec.d.ts +5 -2
- package/dist/chat/execution/tools/exec.js +294 -155
- package/dist/chat/execution/tools/feed-tools.d.ts +77 -0
- package/dist/chat/execution/tools/feed-tools.js +142 -0
- package/dist/chat/execution/tools/file-ops.d.ts +1 -1
- package/dist/chat/execution/tools/github.d.ts +2 -2
- package/dist/chat/execution/tools/index.d.ts +15 -3
- package/dist/chat/execution/tools/index.js +125 -12
- package/dist/chat/execution/tools/integrations.d.ts +8 -8
- package/dist/chat/execution/tools/multi-patch.d.ts +53 -0
- package/dist/chat/execution/tools/multi-patch.js +373 -0
- package/dist/chat/execution/tools/openai-image-gen.d.ts +2 -2
- package/dist/chat/execution/tools/plan-tools.d.ts +80 -0
- package/dist/chat/execution/tools/plan-tools.js +134 -0
- package/dist/chat/execution/tools/profclaw-ops.d.ts +6 -6
- package/dist/chat/execution/tools/repl-tool.d.ts +46 -0
- package/dist/chat/execution/tools/repl-tool.js +207 -0
- package/dist/chat/execution/tools/sessions-send.d.ts +2 -2
- package/dist/chat/execution/tools/slack-actions.d.ts +2 -2
- package/dist/chat/execution/tools/system.d.ts +4 -4
- package/dist/chat/execution/tools/todo-tool.d.ts +72 -0
- package/dist/chat/execution/tools/todo-tool.js +152 -0
- package/dist/chat/execution/tools/tool-search.d.ts +50 -0
- package/dist/chat/execution/tools/tool-search.js +155 -0
- package/dist/chat/execution/types.d.ts +21 -14
- package/dist/chat/execution/workflows/executor.d.ts +11 -0
- package/dist/chat/execution/workflows/executor.js +99 -1
- package/dist/chat/execution/workflows/types.d.ts +35 -2
- package/dist/chat/format/index.d.ts +1 -0
- package/dist/chat/format/index.js +1 -0
- package/dist/chat/format/markdown-convert.d.ts +23 -0
- package/dist/chat/format/markdown-convert.js +149 -0
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/message-handler.js +58 -6
- package/dist/chat/proactive/index.d.ts +62 -0
- package/dist/chat/proactive/index.js +147 -0
- package/dist/chat/prompt-adapter.js +2 -0
- package/dist/chat/providers/irc/index.d.ts +2 -2
- package/dist/chat/providers/slack/index.d.ts +2 -2
- package/dist/chat/providers/telegram/index.d.ts +2 -0
- package/dist/chat/providers/telegram/index.js +21 -2
- package/dist/chat/system-prompts.d.ts +3 -3
- package/dist/chat/system-prompts.js +116 -61
- package/dist/chat/tools.d.ts +6 -6
- package/dist/cli/commands/auth.js +64 -1
- package/dist/cli/commands/chat.js +1327 -138
- package/dist/cli/commands/doctor.js +222 -16
- package/dist/cli/commands/history.d.ts +3 -0
- package/dist/cli/commands/history.js +138 -0
- package/dist/cli/commands/import.d.ts +44 -0
- package/dist/cli/commands/import.js +526 -0
- package/dist/cli/commands/init.d.ts +13 -0
- package/dist/cli/commands/init.js +381 -0
- package/dist/cli/commands/models.js +39 -26
- package/dist/cli/commands/onboard.js +263 -98
- package/dist/cli/commands/plan.d.ts +13 -0
- package/dist/cli/commands/plan.js +184 -0
- package/dist/cli/commands/serve.d.ts +7 -0
- package/dist/cli/commands/serve.js +77 -18
- package/dist/cli/commands/setup.js +375 -91
- package/dist/cli/commands/status.js +54 -0
- package/dist/cli/commands/tools.js +13 -13
- package/dist/cli/commands/tui.js +26 -1
- package/dist/cli/index.js +19 -6
- package/dist/cli/ink/App.d.ts +13 -0
- package/dist/cli/ink/App.js +6 -0
- package/dist/cli/ink/ChatApp.d.ts +60 -0
- package/dist/cli/ink/ChatApp.js +325 -0
- package/dist/cli/ink/DashboardApp.d.ts +3 -0
- package/dist/cli/ink/DashboardApp.js +143 -0
- package/dist/cli/ink/components/AgentStatus.d.ts +17 -0
- package/dist/cli/ink/components/AgentStatus.js +33 -0
- package/dist/cli/ink/components/ChannelList.d.ts +17 -0
- package/dist/cli/ink/components/ChannelList.js +33 -0
- package/dist/cli/ink/components/ConnectionStatus.d.ts +19 -0
- package/dist/cli/ink/components/ConnectionStatus.js +50 -0
- package/dist/cli/ink/components/CostBar.d.ts +19 -0
- package/dist/cli/ink/components/CostBar.js +35 -0
- package/dist/cli/ink/components/HookStatus.d.ts +15 -0
- package/dist/cli/ink/components/HookStatus.js +7 -0
- package/dist/cli/ink/components/PermissionPrompt.d.ts +21 -0
- package/dist/cli/ink/components/PermissionPrompt.js +51 -0
- package/dist/cli/ink/components/PlanView.d.ts +23 -0
- package/dist/cli/ink/components/PlanView.js +26 -0
- package/dist/cli/ink/components/ProviderList.d.ts +16 -0
- package/dist/cli/ink/components/ProviderList.js +16 -0
- package/dist/cli/ink/components/SessionHeader.d.ts +15 -0
- package/dist/cli/ink/components/SessionHeader.js +15 -0
- package/dist/cli/ink/components/StreamingMessage.d.ts +20 -0
- package/dist/cli/ink/components/StreamingMessage.js +27 -0
- package/dist/cli/ink/components/SuggestionBar.d.ts +15 -0
- package/dist/cli/ink/components/SuggestionBar.js +28 -0
- package/dist/cli/ink/components/SystemHealth.d.ts +20 -0
- package/dist/cli/ink/components/SystemHealth.js +39 -0
- package/dist/cli/ink/components/TaskList.d.ts +17 -0
- package/dist/cli/ink/components/TaskList.js +59 -0
- package/dist/cli/ink/components/ToolCall.d.ts +17 -0
- package/dist/cli/ink/components/ToolCall.js +43 -0
- package/dist/cli/ink/index.d.ts +23 -0
- package/dist/cli/ink/index.js +15 -0
- package/dist/cli/ink/keybindings.d.ts +35 -0
- package/dist/cli/ink/keybindings.js +105 -0
- package/dist/cli/ink/markdown-renderer.d.ts +47 -0
- package/dist/cli/ink/markdown-renderer.js +380 -0
- package/dist/cli/ink/output-styles.d.ts +39 -0
- package/dist/cli/ink/output-styles.js +119 -0
- package/dist/cli/interactive/auto-serve.d.ts +38 -0
- package/dist/cli/interactive/auto-serve.js +209 -0
- package/dist/cli/interactive/index.d.ts +25 -0
- package/dist/cli/interactive/index.js +23 -0
- package/dist/cli/interactive/picker.d.ts +28 -0
- package/dist/cli/interactive/picker.js +153 -0
- package/dist/cli/interactive/renderer.d.ts +26 -0
- package/dist/cli/interactive/renderer.js +555 -0
- package/dist/cli/interactive/repl.d.ts +14 -0
- package/dist/cli/interactive/repl.js +1516 -0
- package/dist/cli/interactive/stream-client.d.ts +59 -0
- package/dist/cli/interactive/stream-client.js +506 -0
- package/dist/cli/interactive/types.d.ts +121 -0
- package/dist/cli/interactive/types.js +10 -0
- package/dist/cli/providers.d.ts +15 -0
- package/dist/cli/providers.js +41 -0
- package/dist/cli/utils/api.d.ts +9 -0
- package/dist/cli/utils/api.js +58 -2
- package/dist/core/deployment.js +2 -0
- package/dist/cron/natural-language.d.ts +54 -0
- package/dist/cron/natural-language.js +569 -0
- package/dist/cron/scheduler.d.ts +34 -4
- package/dist/cron/scheduler.js +141 -9
- package/dist/cron/templates.d.ts +1 -1
- package/dist/cron/templates.js +219 -0
- package/dist/feeds/feed-engine.d.ts +149 -0
- package/dist/feeds/feed-engine.js +600 -0
- package/dist/feeds/index.d.ts +9 -0
- package/dist/feeds/index.js +8 -0
- package/dist/gateway/router.js +6 -1
- package/dist/hooks/built-in/audit-log.d.ts +11 -0
- package/dist/hooks/built-in/audit-log.js +84 -0
- package/dist/hooks/built-in/cost-warning.d.ts +10 -0
- package/dist/hooks/built-in/cost-warning.js +59 -0
- package/dist/hooks/built-in/dangerous-tool.d.ts +32 -0
- package/dist/hooks/built-in/dangerous-tool.js +80 -0
- package/dist/hooks/built-in/index.d.ts +14 -0
- package/dist/hooks/built-in/index.js +20 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/loader.d.ts +17 -0
- package/dist/hooks/loader.js +142 -0
- package/dist/hooks/registry.d.ts +62 -0
- package/dist/hooks/registry.js +127 -0
- package/dist/integrations/web-search.js +6 -3
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.js +2 -0
- package/dist/memory/memory-service.js +14 -13
- package/dist/memory/observational.d.ts +62 -0
- package/dist/memory/observational.js +396 -0
- package/dist/middleware/content-filter.d.ts +22 -0
- package/dist/middleware/content-filter.js +69 -0
- package/dist/middleware/request-validator.d.ts +159 -0
- package/dist/middleware/request-validator.js +93 -0
- package/dist/plugins/sdk.d.ts +22 -0
- package/dist/plugins/sdk.js +17 -1
- package/dist/projects/types.d.ts +10 -10
- package/dist/providers/ai-sdk.d.ts +11 -0
- package/dist/providers/ai-sdk.js +97 -18
- package/dist/providers/core/models.js +67 -1
- package/dist/providers/core/types.d.ts +3 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/providers/smart-router.d.ts +118 -0
- package/dist/providers/smart-router.js +685 -0
- package/dist/providers/types.d.ts +16 -16
- package/dist/routes/agents.js +50 -0
- package/dist/routes/auth.js +8 -1
- package/dist/routes/channels.d.ts +12 -0
- package/dist/routes/channels.js +166 -0
- package/dist/routes/chat.js +259 -14
- package/dist/routes/costs.js +32 -0
- package/dist/routes/cron.js +80 -5
- package/dist/routes/feeds.d.ts +10 -0
- package/dist/routes/feeds.js +168 -0
- package/dist/routes/mcp.js +21 -0
- package/dist/routes/memory.js +130 -0
- package/dist/routes/skills.js +129 -0
- package/dist/routes/teams.d.ts +9 -0
- package/dist/routes/teams.js +210 -0
- package/dist/routes/tools.js +14 -0
- package/dist/routes/users.js +2 -0
- package/dist/server/route-loader.js +4 -1
- package/dist/server/stream-bridge.d.ts +19 -0
- package/dist/server/stream-bridge.js +38 -0
- package/dist/server.js +421 -141
- package/dist/skills/marketplace.d.ts +87 -0
- package/dist/skills/marketplace.js +268 -0
- package/dist/storage/index.d.ts +14 -0
- package/dist/storage/index.js +64 -3
- package/dist/storage/schema.d.ts +4 -4
- package/dist/storage/schema.js +1 -1
- package/dist/teams/index.d.ts +110 -0
- package/dist/teams/index.js +365 -0
- package/dist/tickets/types.d.ts +39 -39
- package/dist/types/summary.d.ts +5 -5
- package/dist/utils/auto-update.d.ts +23 -0
- package/dist/utils/auto-update.js +157 -0
- package/dist/utils/offline-detect.d.ts +55 -0
- package/dist/utils/offline-detect.js +121 -0
- package/dist/utils/pid-file.d.ts +36 -0
- package/dist/utils/pid-file.js +125 -0
- package/dist/utils/prevent-sleep.d.ts +27 -0
- package/dist/utils/prevent-sleep.js +95 -0
- package/dist/utils/sanitizer.d.ts +57 -0
- package/dist/utils/sanitizer.js +174 -0
- package/docker-compose.yml +13 -137
- package/package.json +31 -6
- package/skills/deploy-cloudflare/SKILL.md +62 -0
- package/skills/deploy-vercel/SKILL.md +67 -0
- package/skills/docker-deploy/SKILL.md +158 -0
- package/skills/full-stack-builder/SKILL.md +92 -0
- package/skills/git-workflow/SKILL.md +3 -3
- package/skills/humanizer/SKILL.md +488 -0
- package/skills/profclaw-assistant/SKILL.md +85 -56
- package/ui/dist/assets/ActivityView-Da6HQ8ws.js +1 -0
- package/ui/dist/assets/AgentList-H58R0kX3.js +1 -0
- package/ui/dist/assets/AnalyticsDashboard-B28AeRsc.js +1 -0
- package/ui/dist/assets/AreaChart-DwLzeAQ8.js +1 -0
- package/ui/dist/assets/CartesianChart-piKQsTAR.js +36 -0
- package/ui/dist/assets/ChatView-Dbj8rxU5.js +10 -0
- package/ui/dist/assets/CostsDashboard-C6F5df0F.js +1 -0
- package/ui/dist/assets/EstimateSelect-wga0rUKX.js +1 -0
- package/ui/dist/assets/FeedDashboard-Ef6FEzEf.js +1 -0
- package/ui/dist/assets/FloatingChatbot-0yhkUeCq.js +2 -0
- package/ui/dist/assets/InviteCodeManagement-tUXfx4Bc.js +2 -0
- package/ui/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/ui/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/ui/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/ui/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/ui/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/ui/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/ui/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/ui/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/ui/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/ui/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/ui/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/ui/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/ui/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/ui/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/ui/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/ui/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/ui/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/ui/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/ui/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/ui/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/ui/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/ui/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/ui/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/ui/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/ui/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/ui/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/ui/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/ui/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/ui/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/ui/dist/assets/MarketplacePage-DGrLtolR.js +1 -0
- package/ui/dist/assets/{ProjectDetail-DlYUcOss.js → ProjectDetail-BgWvA6UP.js} +2 -2
- package/ui/dist/assets/ProjectIcon-TDuliqwg.js +1 -0
- package/ui/dist/assets/ProjectList-DXgM4187.js +1 -0
- package/ui/dist/assets/{Settings-CgPqzUvj.js → Settings-xA8Zhi3p.js} +3 -3
- package/ui/dist/assets/StatusIndicator-B8vfFAxg.js +1 -0
- package/ui/dist/assets/{SummaryDetail-CwLAfHgJ.js → SummaryDetail-eedRfTtF.js} +2 -2
- package/ui/dist/assets/SummaryList-CLNX2P84.js +1 -0
- package/ui/dist/assets/TaskDetail-BtWclNiR.js +1 -0
- package/ui/dist/assets/TaskList-JjODAgSc.js +1 -0
- package/ui/dist/assets/TeamsPage-CBK5iAyx.js +1 -0
- package/ui/dist/assets/TicketBoard-C9aJNNYp.js +1 -0
- package/ui/dist/assets/TicketDetail-CV5JmL31.js +1 -0
- package/ui/dist/assets/TicketList-68V4lzUz.js +1 -0
- package/ui/dist/assets/UserManagement-DKTb6UpE.js +2 -0
- package/ui/dist/assets/ViewSwitcher-BvdQht2Y.js +1 -0
- package/ui/dist/assets/alert-dialog-O6qBOv_f.js +1 -0
- package/ui/dist/assets/{archive-CGck7gxR.js → archive-CX7UvZpf.js} +1 -1
- package/ui/dist/assets/badge-BbfnwDJP.js +1 -0
- package/ui/dist/assets/{bug-DqSGPUUE.js → bug-3WX0394-.js} +1 -1
- package/ui/dist/assets/{calendar-BuZ4zbPW.js → calendar-buq77TaS.js} +1 -1
- package/ui/dist/assets/{chevron-up-DcJ4LL_N.js → chevron-up-4ymsBJRo.js} +1 -1
- package/ui/dist/assets/{circle-x-C78PNZjF.js → circle-x-ByXtwR6Y.js} +1 -1
- package/ui/dist/assets/constants-CVdDh7p0.js +1 -0
- package/ui/dist/assets/{cpu-Ck6AoG8c.js → cpu-CiuoCeDY.js} +1 -1
- package/ui/dist/assets/{database-CA2w8Lvt.js → database-BWXSBg5a.js} +1 -1
- package/ui/dist/assets/dialog-lDg4NvMV.js +1 -0
- package/ui/dist/assets/dollar-sign-Dmijd6DP.js +1 -0
- package/ui/dist/assets/{ellipsis-FhHKRbfl.js → ellipsis-vT-5SVIp.js} +1 -1
- package/ui/dist/assets/{ellipsis-vertical-CO0UqE4-.js → ellipsis-vertical-B4tAX_bL.js} +1 -1
- package/ui/dist/assets/feature-markdown-DBo5Q7uq.js +289 -0
- package/ui/dist/assets/{file-code-ChnhYYj1.js → file-code-ChOWdKXf.js} +1 -1
- package/ui/dist/assets/{folder-open-CHwA1-ve.js → folder-open-CkOUbIiP.js} +1 -1
- package/ui/dist/assets/{funnel-ByEjRFNB.js → funnel-uZkoSPP-.js} +1 -1
- package/ui/dist/assets/{git-branch-GTOPQgU4.js → git-branch-CwvUxj7C.js} +1 -1
- package/ui/dist/assets/{git-commit-horizontal-F5M84Kut.js → git-commit-horizontal-lxPzCvhD.js} +1 -1
- package/ui/dist/assets/{globe-CQWfr7hT.js → globe-D_WpJdsj.js} +1 -1
- package/ui/dist/assets/{hash-nKC9gtLg.js → hash-CA0hJ7vh.js} +1 -1
- package/ui/dist/assets/{history-DfFSA9xJ.js → history-CEWMLELs.js} +1 -1
- package/ui/dist/assets/inbox-ehtOptTV.js +1 -0
- package/ui/dist/assets/{index-a4Fxq0Hb.js → index-C1rhbml4.js} +3 -3
- package/ui/dist/assets/index-CR8gfCHv.js +1 -0
- package/ui/dist/assets/index-DVXMpWai.js +1 -0
- package/ui/dist/assets/index-DaDJMM2v.js +1 -0
- package/ui/dist/assets/index-Djdq_0xu.js +1 -0
- package/ui/dist/assets/index-M46Gcb8K.css +1 -0
- package/ui/dist/assets/index-sEBN7w8J.js +109 -0
- package/ui/dist/assets/layers-C6Mhf8Nk.js +1 -0
- package/ui/dist/assets/{layout-dashboard-WmgjMhWF.js → layout-dashboard-BRUM0kpT.js} +1 -1
- package/ui/dist/assets/{lightbulb-Bo8hEr7B.js → lightbulb-CN2q1O5l.js} +1 -1
- package/ui/dist/assets/{link-2-YqrpQXBH.js → link-2-CC4E28yJ.js} +1 -1
- package/ui/dist/assets/markdown-renderer-C6ENbB0u.js +10 -0
- package/ui/dist/assets/markdown-renderer-CfVKi3_s.css +1 -0
- package/ui/dist/assets/{message-square-CD0H5hot.js → message-square-Bbb241am.js} +1 -1
- package/ui/dist/assets/package-CwT3IzFx.js +1 -0
- package/ui/dist/assets/{pencil-DpFnj5dn.js → pencil-CDmiHzoj.js} +1 -1
- package/ui/dist/assets/{play-DVgea_jT.js → play-tjy5jMQX.js} +1 -1
- package/ui/dist/assets/popover-CFHZf3pE.js +1 -0
- package/ui/dist/assets/progress-BboUHuLf.js +1 -0
- package/ui/dist/assets/{rocket-BFxPYGx9.js → rocket--8ZHgdXJ.js} +1 -1
- package/ui/dist/assets/select-n108rXny.js +1 -0
- package/ui/dist/assets/{send-eYnW_7n-.js → send-Cu7MR2Qh.js} +1 -1
- package/ui/dist/assets/server-DmodxZp-.js +1 -0
- package/ui/dist/assets/{settings-2-scXUOuE_.js → settings-2-CkRNqkxj.js} +1 -1
- package/ui/dist/assets/sheet-7aUJkyzU.js +1 -0
- package/ui/dist/assets/{shield-check-PEr7nmVw.js → shield-check-ViI3nMKE.js} +1 -1
- package/ui/dist/assets/{shield-off-CLtXio62.js → shield-off-DN3tagkn.js} +1 -1
- package/ui/dist/assets/skeleton-C0E1Nfro.js +1 -0
- package/ui/dist/assets/{smartphone-DusFfY0U.js → smartphone-5FghiXpA.js} +1 -1
- package/ui/dist/assets/{square-e1yxB2eR.js → square-DiNSx8K7.js} +1 -1
- package/ui/dist/assets/star-DhdFVidS.js +1 -0
- package/ui/dist/assets/switch-CIgVbZqQ.js +1 -0
- package/ui/dist/assets/table-BC56FVMV.js +1 -0
- package/ui/dist/assets/{tag-tAwMmQ9G.js → tag-CH_vQliw.js} +1 -1
- package/ui/dist/assets/textarea-CxDiKFXZ.js +1 -0
- package/ui/dist/assets/{timer-Vel1N3RP.js → timer-CdGVTb60.js} +1 -1
- package/ui/dist/assets/tooltip-BuW9A5UO.js +1 -0
- package/ui/dist/assets/{trash-2-eM-CNwsZ.js → trash-2-CucZJL0N.js} +1 -1
- package/ui/dist/assets/trending-down-BCezC1z2.js +1 -0
- package/ui/dist/assets/{trending-up-BGafmjRo.js → trending-up-C5OYX2k2.js} +1 -1
- package/ui/dist/assets/vendor-query-C0p7b53x.js +4 -0
- package/ui/dist/assets/vendor-react-Mc5_kfYG.js +12 -0
- package/ui/dist/assets/vendor-ui-CXPAUBFv.js +51 -0
- package/ui/dist/assets/{wand-sparkles-DPvcd9Pi.js → wand-sparkles-BaH6pJnc.js} +1 -1
- package/ui/dist/assets/{wrench-B8s3zYVV.js → wrench-CjxjP6ok.js} +1 -1
- package/ui/dist/index.html +5 -2
- package/dist/chat/auto-reply.d.ts +0 -90
- package/dist/chat/auto-reply.js +0 -272
- package/dist/chat/execution/pty.d.ts +0 -92
- package/dist/chat/execution/pty.js +0 -285
- package/dist/chat/execution/tools/glinr-ops.d.ts +0 -202
- package/dist/chat/execution/tools/glinr-ops.js +0 -694
- package/dist/cli/commands/browser.d.ts +0 -3
- package/dist/cli/commands/browser.js +0 -138
- package/dist/cli/commands/canvas.d.ts +0 -3
- package/dist/cli/commands/canvas.js +0 -155
- package/dist/cli/commands/nodes.d.ts +0 -3
- package/dist/cli/commands/nodes.js +0 -193
- package/dist/diagnostics/exporters.d.ts +0 -21
- package/dist/diagnostics/exporters.js +0 -138
- package/dist/diagnostics/index.d.ts +0 -10
- package/dist/diagnostics/index.js +0 -9
- package/dist/diagnostics/middleware.d.ts +0 -12
- package/dist/diagnostics/middleware.js +0 -58
- package/dist/diagnostics/tracer.d.ts +0 -133
- package/dist/diagnostics/tracer.js +0 -257
- package/dist/discovery/index.d.ts +0 -8
- package/dist/discovery/index.js +0 -7
- package/dist/discovery/mdns.d.ts +0 -40
- package/dist/discovery/mdns.js +0 -249
- package/dist/plugins/registry.d.ts +0 -122
- package/dist/plugins/registry.js +0 -352
- package/dist/plugins/sandbox.d.ts +0 -77
- package/dist/plugins/sandbox.js +0 -287
- package/dist/plugins/search/brave.d.ts +0 -9
- package/dist/plugins/search/brave.js +0 -157
- package/dist/plugins/search/duckduckgo.d.ts +0 -9
- package/dist/plugins/search/duckduckgo.js +0 -171
- package/dist/plugins/search/index.d.ts +0 -13
- package/dist/plugins/search/index.js +0 -23
- package/dist/plugins/search/searxng.d.ts +0 -9
- package/dist/plugins/search/searxng.js +0 -170
- package/dist/plugins/search/serper.d.ts +0 -9
- package/dist/plugins/search/serper.js +0 -135
- package/dist/plugins/search/tavily.d.ts +0 -9
- package/dist/plugins/search/tavily.js +0 -146
- package/dist/providers/adapters/anthropic.d.ts +0 -26
- package/dist/providers/adapters/anthropic.js +0 -306
- package/dist/providers/adapters/base.d.ts +0 -53
- package/dist/providers/adapters/base.js +0 -99
- package/dist/providers/adapters/ollama.d.ts +0 -30
- package/dist/providers/adapters/ollama.js +0 -292
- package/dist/utils/ai-cache.d.ts +0 -72
- package/dist/utils/ai-cache.js +0 -204
- package/dist/utils/file-lock.d.ts +0 -85
- package/dist/utils/file-lock.js +0 -204
- package/ui/dist/assets/ActivityView-DIPQSJ_d.js +0 -1
- package/ui/dist/assets/AgentList-CqyaYrcq.js +0 -1
- package/ui/dist/assets/AnalyticsDashboard-C-mjuGHT.js +0 -1
- package/ui/dist/assets/AreaChart-CfYWmbtr.js +0 -1
- package/ui/dist/assets/CartesianChart-BaQ3It0c.js +0 -36
- package/ui/dist/assets/ChatView-DxxQy6pl.js +0 -10
- package/ui/dist/assets/CostsDashboard-CDBBcGkg.js +0 -1
- package/ui/dist/assets/EstimateSelect-CDjf5qKl.js +0 -1
- package/ui/dist/assets/FloatingChatbot-CZHjvJIe.js +0 -2
- package/ui/dist/assets/InviteCodeManagement-DTm-IPTm.js +0 -2
- package/ui/dist/assets/ProjectIcon-BMRpnM04.js +0 -1
- package/ui/dist/assets/ProjectList-D85TN0i0.js +0 -4
- package/ui/dist/assets/StatusIndicator-yig0uZEA.js +0 -1
- package/ui/dist/assets/SummaryList-BvS5Idnu.js +0 -1
- package/ui/dist/assets/TaskDetail-zarC1fOt.js +0 -1
- package/ui/dist/assets/TaskList-CyJq3ANE.js +0 -1
- package/ui/dist/assets/TicketBoard-BlWr3-iH.js +0 -1
- package/ui/dist/assets/TicketDetail-DmqWKj2W.js +0 -1
- package/ui/dist/assets/TicketList-Scj4pMWa.js +0 -1
- package/ui/dist/assets/UserManagement-BH7uG7dw.js +0 -2
- package/ui/dist/assets/ViewSwitcher-3HzZUdWn.js +0 -1
- package/ui/dist/assets/alert-dialog-DWPb2IfQ.js +0 -7
- package/ui/dist/assets/badge-DEmc3Z_l.js +0 -1
- package/ui/dist/assets/brain-CfFdLVqb.js +0 -1
- package/ui/dist/assets/constants-DhDjZe4P.js +0 -1
- package/ui/dist/assets/dialog-BOdGWhgE.js +0 -1
- package/ui/dist/assets/index--JkIxVXb.js +0 -67
- package/ui/dist/assets/index-Ca3vk7Gq.js +0 -1
- package/ui/dist/assets/index-DHGvP9mp.js +0 -1
- package/ui/dist/assets/index-DeI8lKRR.js +0 -1
- package/ui/dist/assets/index-WclMPci1.css +0 -1
- package/ui/dist/assets/index-Z4-RtZcs.js +0 -1
- package/ui/dist/assets/layers-DFeLExSa.js +0 -1
- package/ui/dist/assets/markdown-renderer-Croje6Xe.js +0 -36
- package/ui/dist/assets/popover-JXecfWG5.js +0 -1
- package/ui/dist/assets/progress-C1ghf1Fu.js +0 -1
- package/ui/dist/assets/select-MADP8m6Q.js +0 -1
- package/ui/dist/assets/server-CPMaysH8.js +0 -1
- package/ui/dist/assets/sheet-r6NSOxi-.js +0 -1
- package/ui/dist/assets/skeleton-C9oEzNlU.js +0 -1
- package/ui/dist/assets/switch-tNs0n-kz.js +0 -1
- package/ui/dist/assets/table-CXxtLicg.js +0 -1
- package/ui/dist/assets/textarea-BjiEeIWh.js +0 -1
- package/ui/dist/assets/tooltip-ZMwtfr1J.js +0 -1
package/dist/plugins/registry.js
DELETED
|
@@ -1,352 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* profClaw Plugin Registry
|
|
3
|
-
*
|
|
4
|
-
* Manages plugin registration, instantiation, and health monitoring.
|
|
5
|
-
*/
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// Search Provider Registry
|
|
8
|
-
// ============================================================================
|
|
9
|
-
class SearchProviderRegistry {
|
|
10
|
-
definitions = new Map();
|
|
11
|
-
instances = new Map();
|
|
12
|
-
configs = new Map();
|
|
13
|
-
healthCache = new Map();
|
|
14
|
-
HEALTH_CACHE_TTL = 60_000; // 1 minute
|
|
15
|
-
/**
|
|
16
|
-
* Register a search provider plugin
|
|
17
|
-
*/
|
|
18
|
-
register(definition) {
|
|
19
|
-
this.definitions.set(definition.metadata.id, definition);
|
|
20
|
-
console.log(`[Plugins] Registered search provider: ${definition.metadata.name}`);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Unregister a search provider
|
|
24
|
-
*/
|
|
25
|
-
unregister(pluginId) {
|
|
26
|
-
this.definitions.delete(pluginId);
|
|
27
|
-
// Remove any instances using this plugin
|
|
28
|
-
for (const [configId, config] of this.configs) {
|
|
29
|
-
if (config.pluginId === pluginId) {
|
|
30
|
-
this.instances.delete(configId);
|
|
31
|
-
this.configs.delete(configId);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Create a provider instance from config
|
|
37
|
-
*/
|
|
38
|
-
create(config) {
|
|
39
|
-
const definition = this.definitions.get(config.pluginId);
|
|
40
|
-
if (!definition) {
|
|
41
|
-
throw new Error(`Unknown search provider plugin: ${config.pluginId}`);
|
|
42
|
-
}
|
|
43
|
-
const instance = definition.factory(config);
|
|
44
|
-
this.instances.set(config.id, instance);
|
|
45
|
-
this.configs.set(config.id, config);
|
|
46
|
-
return instance;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Get provider by config ID
|
|
50
|
-
*/
|
|
51
|
-
get(configId) {
|
|
52
|
-
return this.instances.get(configId);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get all active (enabled) providers
|
|
56
|
-
*/
|
|
57
|
-
getActive() {
|
|
58
|
-
const active = [];
|
|
59
|
-
for (const [configId, config] of this.configs) {
|
|
60
|
-
if (config.enabled) {
|
|
61
|
-
const instance = this.instances.get(configId);
|
|
62
|
-
if (instance)
|
|
63
|
-
active.push(instance);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
// Sort by priority (higher first)
|
|
67
|
-
return active.sort((a, b) => {
|
|
68
|
-
const configA = this.getConfigByInstance(a);
|
|
69
|
-
const configB = this.getConfigByInstance(b);
|
|
70
|
-
return (configB?.priority || 0) - (configA?.priority || 0);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Get primary (highest priority enabled) provider
|
|
75
|
-
*/
|
|
76
|
-
getPrimary() {
|
|
77
|
-
const active = this.getActive();
|
|
78
|
-
return active[0];
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* List all registered plugin IDs
|
|
82
|
-
*/
|
|
83
|
-
listRegistered() {
|
|
84
|
-
return Array.from(this.definitions.keys());
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Get plugin metadata
|
|
88
|
-
*/
|
|
89
|
-
getMetadata(pluginId) {
|
|
90
|
-
return this.definitions.get(pluginId)?.metadata;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Get all plugin metadata
|
|
94
|
-
*/
|
|
95
|
-
getAllMetadata() {
|
|
96
|
-
return Array.from(this.definitions.values()).map((d) => d.metadata);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Get settings schema for a plugin
|
|
100
|
-
*/
|
|
101
|
-
getSettingsSchema(pluginId) {
|
|
102
|
-
return this.definitions.get(pluginId)?.settingsSchema;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get config by instance
|
|
106
|
-
*/
|
|
107
|
-
getConfigByInstance(instance) {
|
|
108
|
-
for (const [configId, inst] of this.instances) {
|
|
109
|
-
if (inst === instance) {
|
|
110
|
-
return this.configs.get(configId);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return undefined;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Get all configs
|
|
117
|
-
*/
|
|
118
|
-
getAllConfigs() {
|
|
119
|
-
return Array.from(this.configs.values());
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Update config
|
|
123
|
-
*/
|
|
124
|
-
updateConfig(configId, updates) {
|
|
125
|
-
const config = this.configs.get(configId);
|
|
126
|
-
if (config) {
|
|
127
|
-
const newConfig = { ...config, ...updates };
|
|
128
|
-
this.configs.set(configId, newConfig);
|
|
129
|
-
// Recreate instance with new config
|
|
130
|
-
const definition = this.definitions.get(config.pluginId);
|
|
131
|
-
if (definition) {
|
|
132
|
-
const instance = definition.factory(newConfig);
|
|
133
|
-
this.instances.set(configId, instance);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Delete config and instance
|
|
139
|
-
*/
|
|
140
|
-
deleteConfig(configId) {
|
|
141
|
-
this.instances.delete(configId);
|
|
142
|
-
this.configs.delete(configId);
|
|
143
|
-
this.healthCache.delete(configId);
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Get health status (cached)
|
|
147
|
-
*/
|
|
148
|
-
async getHealth(configId) {
|
|
149
|
-
const cached = this.healthCache.get(configId);
|
|
150
|
-
const now = Date.now();
|
|
151
|
-
if (cached && now - cached.timestamp < this.HEALTH_CACHE_TTL) {
|
|
152
|
-
return cached.health;
|
|
153
|
-
}
|
|
154
|
-
const instance = this.instances.get(configId);
|
|
155
|
-
if (!instance) {
|
|
156
|
-
return {
|
|
157
|
-
healthy: false,
|
|
158
|
-
lastCheck: new Date(),
|
|
159
|
-
errorMessage: 'Provider not initialized',
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
try {
|
|
163
|
-
const health = await instance.healthCheck();
|
|
164
|
-
this.healthCache.set(configId, { health, timestamp: now });
|
|
165
|
-
return health;
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
const health = {
|
|
169
|
-
healthy: false,
|
|
170
|
-
lastCheck: new Date(),
|
|
171
|
-
errorMessage: error instanceof Error ? error.message : 'Health check failed',
|
|
172
|
-
};
|
|
173
|
-
this.healthCache.set(configId, { health, timestamp: now });
|
|
174
|
-
return health;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Search with automatic fallback
|
|
179
|
-
*/
|
|
180
|
-
async search(query, options, preferredProvider) {
|
|
181
|
-
const providers = this.getActive();
|
|
182
|
-
if (providers.length === 0) {
|
|
183
|
-
throw new Error('No search providers available');
|
|
184
|
-
}
|
|
185
|
-
// Try preferred provider first
|
|
186
|
-
if (preferredProvider) {
|
|
187
|
-
const preferred = this.get(preferredProvider);
|
|
188
|
-
if (preferred) {
|
|
189
|
-
try {
|
|
190
|
-
return await preferred.search(query, options);
|
|
191
|
-
}
|
|
192
|
-
catch (error) {
|
|
193
|
-
console.warn(`[Plugins] Preferred provider ${preferredProvider} failed, falling back:`, error);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
// Try providers in priority order
|
|
198
|
-
for (const provider of providers) {
|
|
199
|
-
try {
|
|
200
|
-
const isAvailable = await provider.isAvailable();
|
|
201
|
-
if (!isAvailable)
|
|
202
|
-
continue;
|
|
203
|
-
return await provider.search(query, options);
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
console.warn(`[Plugins] Provider ${provider.metadata.id} failed:`, error);
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
throw new Error('All search providers failed');
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
// ============================================================================
|
|
214
|
-
// Tool Provider Registry
|
|
215
|
-
// ============================================================================
|
|
216
|
-
class ToolProviderRegistry {
|
|
217
|
-
definitions = new Map();
|
|
218
|
-
instances = new Map();
|
|
219
|
-
configs = new Map();
|
|
220
|
-
register(definition) {
|
|
221
|
-
this.definitions.set(definition.metadata.id, definition);
|
|
222
|
-
console.log(`[Plugins] Registered tool provider: ${definition.metadata.name}`);
|
|
223
|
-
}
|
|
224
|
-
unregister(pluginId) {
|
|
225
|
-
this.definitions.delete(pluginId);
|
|
226
|
-
for (const [configId, config] of this.configs) {
|
|
227
|
-
if (config.pluginId === pluginId) {
|
|
228
|
-
this.instances.delete(configId);
|
|
229
|
-
this.configs.delete(configId);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
create(config) {
|
|
234
|
-
const definition = this.definitions.get(config.pluginId);
|
|
235
|
-
if (!definition) {
|
|
236
|
-
throw new Error(`Unknown tool provider plugin: ${config.pluginId}`);
|
|
237
|
-
}
|
|
238
|
-
const instance = definition.factory(config);
|
|
239
|
-
this.instances.set(config.id, instance);
|
|
240
|
-
this.configs.set(config.id, config);
|
|
241
|
-
return instance;
|
|
242
|
-
}
|
|
243
|
-
get(configId) {
|
|
244
|
-
return this.instances.get(configId);
|
|
245
|
-
}
|
|
246
|
-
getActive() {
|
|
247
|
-
const active = [];
|
|
248
|
-
for (const [configId, config] of this.configs) {
|
|
249
|
-
if (config.enabled) {
|
|
250
|
-
const instance = this.instances.get(configId);
|
|
251
|
-
if (instance)
|
|
252
|
-
active.push(instance);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
return active;
|
|
256
|
-
}
|
|
257
|
-
listRegistered() {
|
|
258
|
-
return Array.from(this.definitions.keys());
|
|
259
|
-
}
|
|
260
|
-
getMetadata(pluginId) {
|
|
261
|
-
return this.definitions.get(pluginId)?.metadata;
|
|
262
|
-
}
|
|
263
|
-
getAllMetadata() {
|
|
264
|
-
return Array.from(this.definitions.values()).map((d) => d.metadata);
|
|
265
|
-
}
|
|
266
|
-
getSettingsSchema(pluginId) {
|
|
267
|
-
return this.definitions.get(pluginId)?.settingsSchema;
|
|
268
|
-
}
|
|
269
|
-
getAllConfigs() {
|
|
270
|
-
return Array.from(this.configs.values());
|
|
271
|
-
}
|
|
272
|
-
updateConfig(configId, updates) {
|
|
273
|
-
const config = this.configs.get(configId);
|
|
274
|
-
if (config) {
|
|
275
|
-
const newConfig = { ...config, ...updates };
|
|
276
|
-
this.configs.set(configId, newConfig);
|
|
277
|
-
const definition = this.definitions.get(config.pluginId);
|
|
278
|
-
if (definition) {
|
|
279
|
-
const instance = definition.factory(newConfig);
|
|
280
|
-
this.instances.set(configId, instance);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
deleteConfig(configId) {
|
|
285
|
-
this.instances.delete(configId);
|
|
286
|
-
this.configs.delete(configId);
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Get all available tools across all providers
|
|
290
|
-
*/
|
|
291
|
-
getAllTools() {
|
|
292
|
-
const tools = [];
|
|
293
|
-
for (const provider of this.getActive()) {
|
|
294
|
-
for (const tool of provider.tools) {
|
|
295
|
-
tools.push({ provider: provider.metadata.id, tool });
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return tools;
|
|
299
|
-
}
|
|
300
|
-
/**
|
|
301
|
-
* Execute a tool by name
|
|
302
|
-
*/
|
|
303
|
-
async execute(toolName, params) {
|
|
304
|
-
for (const provider of this.getActive()) {
|
|
305
|
-
const tool = provider.tools.find((t) => t.name === toolName);
|
|
306
|
-
if (tool) {
|
|
307
|
-
return provider.execute(toolName, params);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
throw new Error(`Tool not found: ${toolName}`);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
// ============================================================================
|
|
314
|
-
// Global Plugin Manager
|
|
315
|
-
// ============================================================================
|
|
316
|
-
class PluginManager {
|
|
317
|
-
search = new SearchProviderRegistry();
|
|
318
|
-
tools = new ToolProviderRegistry();
|
|
319
|
-
/**
|
|
320
|
-
* Initialize built-in plugins
|
|
321
|
-
*/
|
|
322
|
-
async initialize() {
|
|
323
|
-
// Built-in plugins will be registered here
|
|
324
|
-
// Import and register each plugin definition
|
|
325
|
-
console.log('[Plugins] Plugin manager initialized');
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Get all plugin metadata across categories
|
|
329
|
-
*/
|
|
330
|
-
getAllPlugins() {
|
|
331
|
-
const plugins = [];
|
|
332
|
-
for (const meta of this.search.getAllMetadata()) {
|
|
333
|
-
plugins.push({ ...meta, category: 'search' });
|
|
334
|
-
}
|
|
335
|
-
for (const meta of this.tools.getAllMetadata()) {
|
|
336
|
-
plugins.push({ ...meta, category: 'tool' });
|
|
337
|
-
}
|
|
338
|
-
return plugins;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// ============================================================================
|
|
342
|
-
// Singleton Instance
|
|
343
|
-
// ============================================================================
|
|
344
|
-
let manager = null;
|
|
345
|
-
export function getPluginManager() {
|
|
346
|
-
if (!manager) {
|
|
347
|
-
manager = new PluginManager();
|
|
348
|
-
}
|
|
349
|
-
return manager;
|
|
350
|
-
}
|
|
351
|
-
export { SearchProviderRegistry, ToolProviderRegistry, PluginManager };
|
|
352
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Sandbox
|
|
3
|
-
*
|
|
4
|
-
* Runs plugins in isolated Node.js Worker threads with restricted access.
|
|
5
|
-
* Plugins cannot access the filesystem, network, or process directly
|
|
6
|
-
* unless explicitly granted permissions.
|
|
7
|
-
*/
|
|
8
|
-
import { EventEmitter } from 'node:events';
|
|
9
|
-
export type PluginPermission = 'fs:read' | 'fs:write' | 'net:fetch' | 'env:read' | 'exec' | 'tools';
|
|
10
|
-
export interface SandboxConfig {
|
|
11
|
-
pluginId: string;
|
|
12
|
-
pluginPath: string;
|
|
13
|
-
permissions: PluginPermission[];
|
|
14
|
-
timeout: number;
|
|
15
|
-
memoryLimit: number;
|
|
16
|
-
}
|
|
17
|
-
export interface SandboxMessage {
|
|
18
|
-
type: 'init' | 'call' | 'result' | 'error' | 'log' | 'register-tool';
|
|
19
|
-
id?: string;
|
|
20
|
-
payload?: unknown;
|
|
21
|
-
}
|
|
22
|
-
export declare class PluginSandbox extends EventEmitter {
|
|
23
|
-
private worker;
|
|
24
|
-
private config;
|
|
25
|
-
private pendingCalls;
|
|
26
|
-
private callCounter;
|
|
27
|
-
private healthy;
|
|
28
|
-
constructor(config: SandboxConfig);
|
|
29
|
-
/**
|
|
30
|
-
* Start the sandbox worker
|
|
31
|
-
*/
|
|
32
|
-
start(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Call a plugin method
|
|
35
|
-
*/
|
|
36
|
-
call(method: string, args?: unknown[]): Promise<unknown>;
|
|
37
|
-
/**
|
|
38
|
-
* Stop the sandbox
|
|
39
|
-
*/
|
|
40
|
-
stop(): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Check if sandbox is healthy
|
|
43
|
-
*/
|
|
44
|
-
isHealthy(): boolean;
|
|
45
|
-
private handleMessage;
|
|
46
|
-
private handleError;
|
|
47
|
-
private handleExit;
|
|
48
|
-
}
|
|
49
|
-
declare class SandboxManager {
|
|
50
|
-
private sandboxes;
|
|
51
|
-
/**
|
|
52
|
-
* Create and start a sandbox for a plugin
|
|
53
|
-
*/
|
|
54
|
-
create(config: SandboxConfig): Promise<PluginSandbox>;
|
|
55
|
-
/**
|
|
56
|
-
* Get a running sandbox
|
|
57
|
-
*/
|
|
58
|
-
get(pluginId: string): PluginSandbox | undefined;
|
|
59
|
-
/**
|
|
60
|
-
* Stop a sandbox
|
|
61
|
-
*/
|
|
62
|
-
stop(pluginId: string): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
-
* Stop all sandboxes
|
|
65
|
-
*/
|
|
66
|
-
stopAll(): Promise<void>;
|
|
67
|
-
/**
|
|
68
|
-
* List running sandboxes
|
|
69
|
-
*/
|
|
70
|
-
list(): Array<{
|
|
71
|
-
pluginId: string;
|
|
72
|
-
healthy: boolean;
|
|
73
|
-
}>;
|
|
74
|
-
}
|
|
75
|
-
export declare function getSandboxManager(): SandboxManager;
|
|
76
|
-
export { SandboxManager };
|
|
77
|
-
//# sourceMappingURL=sandbox.d.ts.map
|
package/dist/plugins/sandbox.js
DELETED
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Sandbox
|
|
3
|
-
*
|
|
4
|
-
* Runs plugins in isolated Node.js Worker threads with restricted access.
|
|
5
|
-
* Plugins cannot access the filesystem, network, or process directly
|
|
6
|
-
* unless explicitly granted permissions.
|
|
7
|
-
*/
|
|
8
|
-
import { Worker, isMainThread, parentPort, workerData } from 'node:worker_threads';
|
|
9
|
-
import { EventEmitter } from 'node:events';
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// Sandbox Runner (main thread)
|
|
12
|
-
// =============================================================================
|
|
13
|
-
export class PluginSandbox extends EventEmitter {
|
|
14
|
-
worker = null;
|
|
15
|
-
config;
|
|
16
|
-
pendingCalls = new Map();
|
|
17
|
-
callCounter = 0;
|
|
18
|
-
healthy = false;
|
|
19
|
-
constructor(config) {
|
|
20
|
-
super();
|
|
21
|
-
this.config = config;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Start the sandbox worker
|
|
25
|
-
*/
|
|
26
|
-
async start() {
|
|
27
|
-
if (this.worker) {
|
|
28
|
-
throw new Error(`Sandbox for ${this.config.pluginId} is already running`);
|
|
29
|
-
}
|
|
30
|
-
this.worker = new Worker(new URL(import.meta.url), {
|
|
31
|
-
workerData: {
|
|
32
|
-
pluginPath: this.config.pluginPath,
|
|
33
|
-
permissions: this.config.permissions,
|
|
34
|
-
pluginId: this.config.pluginId,
|
|
35
|
-
},
|
|
36
|
-
resourceLimits: {
|
|
37
|
-
maxOldGenerationSizeMb: this.config.memoryLimit,
|
|
38
|
-
maxYoungGenerationSizeMb: Math.ceil(this.config.memoryLimit / 4),
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
this.worker.on('message', (msg) => this.handleMessage(msg));
|
|
42
|
-
this.worker.on('error', (err) => this.handleError(err));
|
|
43
|
-
this.worker.on('exit', (code) => this.handleExit(code));
|
|
44
|
-
// Wait for init confirmation
|
|
45
|
-
await new Promise((resolve, reject) => {
|
|
46
|
-
const timer = setTimeout(() => reject(new Error('Sandbox init timeout')), this.config.timeout);
|
|
47
|
-
const handler = (msg) => {
|
|
48
|
-
if (msg.type === 'init') {
|
|
49
|
-
clearTimeout(timer);
|
|
50
|
-
this.healthy = true;
|
|
51
|
-
this.worker?.removeListener('message', handler);
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
this.worker?.on('message', handler);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Call a plugin method
|
|
60
|
-
*/
|
|
61
|
-
async call(method, args = []) {
|
|
62
|
-
if (!this.worker || !this.healthy) {
|
|
63
|
-
throw new Error(`Sandbox for ${this.config.pluginId} is not running`);
|
|
64
|
-
}
|
|
65
|
-
const id = String(++this.callCounter);
|
|
66
|
-
return new Promise((resolve, reject) => {
|
|
67
|
-
const timer = setTimeout(() => {
|
|
68
|
-
this.pendingCalls.delete(id);
|
|
69
|
-
reject(new Error(`Plugin call ${method} timed out after ${this.config.timeout}ms`));
|
|
70
|
-
}, this.config.timeout);
|
|
71
|
-
this.pendingCalls.set(id, { resolve, reject, timer });
|
|
72
|
-
this.worker?.postMessage({
|
|
73
|
-
type: 'call',
|
|
74
|
-
id,
|
|
75
|
-
payload: { method, args },
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Stop the sandbox
|
|
81
|
-
*/
|
|
82
|
-
async stop() {
|
|
83
|
-
if (!this.worker)
|
|
84
|
-
return;
|
|
85
|
-
this.healthy = false;
|
|
86
|
-
// Reject all pending calls
|
|
87
|
-
for (const [id, pending] of this.pendingCalls) {
|
|
88
|
-
clearTimeout(pending.timer);
|
|
89
|
-
pending.reject(new Error('Sandbox stopped'));
|
|
90
|
-
this.pendingCalls.delete(id);
|
|
91
|
-
}
|
|
92
|
-
await this.worker.terminate();
|
|
93
|
-
this.worker = null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Check if sandbox is healthy
|
|
97
|
-
*/
|
|
98
|
-
isHealthy() {
|
|
99
|
-
return this.healthy;
|
|
100
|
-
}
|
|
101
|
-
// ===========================================================================
|
|
102
|
-
// Private
|
|
103
|
-
// ===========================================================================
|
|
104
|
-
handleMessage(msg) {
|
|
105
|
-
switch (msg.type) {
|
|
106
|
-
case 'result': {
|
|
107
|
-
const pending = this.pendingCalls.get(msg.id);
|
|
108
|
-
if (pending) {
|
|
109
|
-
clearTimeout(pending.timer);
|
|
110
|
-
this.pendingCalls.delete(msg.id);
|
|
111
|
-
pending.resolve(msg.payload);
|
|
112
|
-
}
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
case 'error': {
|
|
116
|
-
const pendingErr = this.pendingCalls.get(msg.id);
|
|
117
|
-
if (pendingErr) {
|
|
118
|
-
clearTimeout(pendingErr.timer);
|
|
119
|
-
this.pendingCalls.delete(msg.id);
|
|
120
|
-
pendingErr.reject(new Error(String(msg.payload)));
|
|
121
|
-
}
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
case 'log': {
|
|
125
|
-
this.emit('log', msg.payload);
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
case 'register-tool': {
|
|
129
|
-
this.emit('register-tool', msg.payload);
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
handleError(err) {
|
|
135
|
-
this.healthy = false;
|
|
136
|
-
this.emit('error', err);
|
|
137
|
-
}
|
|
138
|
-
handleExit(code) {
|
|
139
|
-
this.healthy = false;
|
|
140
|
-
this.worker = null;
|
|
141
|
-
// Reject all pending calls
|
|
142
|
-
for (const [id, pending] of this.pendingCalls) {
|
|
143
|
-
clearTimeout(pending.timer);
|
|
144
|
-
pending.reject(new Error(`Sandbox exited with code ${code}`));
|
|
145
|
-
this.pendingCalls.delete(id);
|
|
146
|
-
}
|
|
147
|
-
this.emit('exit', code);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
// =============================================================================
|
|
151
|
-
// Sandbox Manager
|
|
152
|
-
// =============================================================================
|
|
153
|
-
class SandboxManager {
|
|
154
|
-
sandboxes = new Map();
|
|
155
|
-
/**
|
|
156
|
-
* Create and start a sandbox for a plugin
|
|
157
|
-
*/
|
|
158
|
-
async create(config) {
|
|
159
|
-
if (this.sandboxes.has(config.pluginId)) {
|
|
160
|
-
throw new Error(`Sandbox already exists for ${config.pluginId}`);
|
|
161
|
-
}
|
|
162
|
-
const sandbox = new PluginSandbox(config);
|
|
163
|
-
await sandbox.start();
|
|
164
|
-
this.sandboxes.set(config.pluginId, sandbox);
|
|
165
|
-
sandbox.on('exit', () => {
|
|
166
|
-
this.sandboxes.delete(config.pluginId);
|
|
167
|
-
});
|
|
168
|
-
return sandbox;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Get a running sandbox
|
|
172
|
-
*/
|
|
173
|
-
get(pluginId) {
|
|
174
|
-
return this.sandboxes.get(pluginId);
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Stop a sandbox
|
|
178
|
-
*/
|
|
179
|
-
async stop(pluginId) {
|
|
180
|
-
const sandbox = this.sandboxes.get(pluginId);
|
|
181
|
-
if (sandbox) {
|
|
182
|
-
await sandbox.stop();
|
|
183
|
-
this.sandboxes.delete(pluginId);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Stop all sandboxes
|
|
188
|
-
*/
|
|
189
|
-
async stopAll() {
|
|
190
|
-
const promises = Array.from(this.sandboxes.values()).map((s) => s.stop());
|
|
191
|
-
await Promise.allSettled(promises);
|
|
192
|
-
this.sandboxes.clear();
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* List running sandboxes
|
|
196
|
-
*/
|
|
197
|
-
list() {
|
|
198
|
-
return Array.from(this.sandboxes.entries()).map(([id, sb]) => ({
|
|
199
|
-
pluginId: id,
|
|
200
|
-
healthy: sb.isHealthy(),
|
|
201
|
-
}));
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
// =============================================================================
|
|
205
|
-
// Worker Thread Entry (runs inside sandbox)
|
|
206
|
-
// =============================================================================
|
|
207
|
-
if (!isMainThread && parentPort && workerData) {
|
|
208
|
-
const { pluginPath, permissions, pluginId } = workerData;
|
|
209
|
-
// Create restricted API surface
|
|
210
|
-
const sandboxApi = {
|
|
211
|
-
log: (...args) => {
|
|
212
|
-
parentPort?.postMessage({
|
|
213
|
-
type: 'log',
|
|
214
|
-
payload: { pluginId, level: 'info', args: args.map(String) },
|
|
215
|
-
});
|
|
216
|
-
},
|
|
217
|
-
registerTool: (tool) => {
|
|
218
|
-
if (!permissions.includes('tools')) {
|
|
219
|
-
throw new Error('Plugin does not have "tools" permission');
|
|
220
|
-
}
|
|
221
|
-
parentPort?.postMessage({
|
|
222
|
-
type: 'register-tool',
|
|
223
|
-
payload: tool,
|
|
224
|
-
});
|
|
225
|
-
},
|
|
226
|
-
fetch: permissions.includes('net:fetch')
|
|
227
|
-
? globalThis.fetch
|
|
228
|
-
: () => { throw new Error('Plugin does not have "net:fetch" permission'); },
|
|
229
|
-
};
|
|
230
|
-
// Load plugin
|
|
231
|
-
(async () => {
|
|
232
|
-
try {
|
|
233
|
-
const pluginModule = await import(pluginPath);
|
|
234
|
-
const plugin = pluginModule.default || pluginModule;
|
|
235
|
-
// Call onLoad if present
|
|
236
|
-
if (typeof plugin.onLoad === 'function') {
|
|
237
|
-
await plugin.onLoad(sandboxApi);
|
|
238
|
-
}
|
|
239
|
-
// Notify main thread we're ready
|
|
240
|
-
parentPort?.postMessage({ type: 'init' });
|
|
241
|
-
// Handle calls from main thread
|
|
242
|
-
parentPort?.on('message', async (msg) => {
|
|
243
|
-
if (msg.type !== 'call' || !msg.id)
|
|
244
|
-
return;
|
|
245
|
-
const { method, args } = msg.payload;
|
|
246
|
-
try {
|
|
247
|
-
const fn = plugin[method];
|
|
248
|
-
if (typeof fn !== 'function') {
|
|
249
|
-
throw new Error(`Plugin method ${method} not found`);
|
|
250
|
-
}
|
|
251
|
-
const result = await fn.apply(plugin, args);
|
|
252
|
-
parentPort?.postMessage({
|
|
253
|
-
type: 'result',
|
|
254
|
-
id: msg.id,
|
|
255
|
-
payload: result,
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
catch (error) {
|
|
259
|
-
parentPort?.postMessage({
|
|
260
|
-
type: 'error',
|
|
261
|
-
id: msg.id,
|
|
262
|
-
payload: error instanceof Error ? error.message : String(error),
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
parentPort?.postMessage({
|
|
269
|
-
type: 'error',
|
|
270
|
-
payload: `Failed to load plugin: ${error instanceof Error ? error.message : String(error)}`,
|
|
271
|
-
});
|
|
272
|
-
process.exit(1);
|
|
273
|
-
}
|
|
274
|
-
})();
|
|
275
|
-
}
|
|
276
|
-
// =============================================================================
|
|
277
|
-
// Singleton
|
|
278
|
-
// =============================================================================
|
|
279
|
-
let manager = null;
|
|
280
|
-
export function getSandboxManager() {
|
|
281
|
-
if (!manager) {
|
|
282
|
-
manager = new SandboxManager();
|
|
283
|
-
}
|
|
284
|
-
return manager;
|
|
285
|
-
}
|
|
286
|
-
export { SandboxManager };
|
|
287
|
-
//# sourceMappingURL=sandbox.js.map
|