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/discovery/mdns.js
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mDNS/DNS-SD Local Discovery
|
|
3
|
-
*
|
|
4
|
-
* Announces profClaw instance on the local network using multicast DNS.
|
|
5
|
-
* Enables automatic discovery of profClaw nodes on the LAN.
|
|
6
|
-
* Uses Node.js dgram (UDP) - no external dependencies.
|
|
7
|
-
*/
|
|
8
|
-
import { createSocket } from 'dgram';
|
|
9
|
-
import { hostname, networkInterfaces } from 'os';
|
|
10
|
-
import { logger } from '../utils/logger.js';
|
|
11
|
-
const MDNS_ADDRESS = '224.0.0.251';
|
|
12
|
-
const MDNS_PORT = 5353;
|
|
13
|
-
// DNS record type constants
|
|
14
|
-
const DNS_TYPE_A = 1;
|
|
15
|
-
const DNS_TYPE_PTR = 12;
|
|
16
|
-
const DNS_TYPE_TXT = 16;
|
|
17
|
-
const DNS_TYPE_SRV = 33;
|
|
18
|
-
const DNS_CLASS_IN = 1;
|
|
19
|
-
const DNS_CACHE_FLUSH = 0x8000;
|
|
20
|
-
let socket = null;
|
|
21
|
-
let announceInterval = null;
|
|
22
|
-
const discoveredNodes = new Map();
|
|
23
|
-
/**
|
|
24
|
-
* Encode a DNS name (e.g. "_profclaw._tcp.local") into wire format
|
|
25
|
-
*/
|
|
26
|
-
function encodeName(name) {
|
|
27
|
-
const parts = name.split('.');
|
|
28
|
-
const buffers = [];
|
|
29
|
-
for (const part of parts) {
|
|
30
|
-
const len = Buffer.alloc(1);
|
|
31
|
-
len.writeUInt8(part.length);
|
|
32
|
-
buffers.push(len, Buffer.from(part, 'utf-8'));
|
|
33
|
-
}
|
|
34
|
-
buffers.push(Buffer.alloc(1)); // null terminator
|
|
35
|
-
return Buffer.concat(buffers);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Build an mDNS announcement packet
|
|
39
|
-
*/
|
|
40
|
-
function buildAnnouncementPacket(config) {
|
|
41
|
-
const instanceName = config.instanceName || `profclaw-${hostname()}`;
|
|
42
|
-
const serviceType = config.serviceType || '_profclaw._tcp.local';
|
|
43
|
-
const fullName = `${instanceName}.${serviceType}`;
|
|
44
|
-
const hostName = `${hostname()}.local`;
|
|
45
|
-
// Header: ID=0, flags=0x8400 (response, authoritative), 0 questions, 4 answers
|
|
46
|
-
const header = Buffer.alloc(12);
|
|
47
|
-
header.writeUInt16BE(0x0000, 0); // ID
|
|
48
|
-
header.writeUInt16BE(0x8400, 2); // Flags: response, authoritative
|
|
49
|
-
header.writeUInt16BE(0, 4); // Questions
|
|
50
|
-
header.writeUInt16BE(4, 6); // Answers (PTR + SRV + TXT + A)
|
|
51
|
-
header.writeUInt16BE(0, 8); // Authority
|
|
52
|
-
header.writeUInt16BE(0, 10); // Additional
|
|
53
|
-
const records = [header];
|
|
54
|
-
// PTR record: serviceType -> fullName
|
|
55
|
-
const ptrName = encodeName(serviceType);
|
|
56
|
-
const ptrData = encodeName(fullName);
|
|
57
|
-
const ptrRecord = Buffer.alloc(10);
|
|
58
|
-
ptrRecord.writeUInt16BE(DNS_TYPE_PTR, 0);
|
|
59
|
-
ptrRecord.writeUInt16BE(DNS_CLASS_IN, 2);
|
|
60
|
-
ptrRecord.writeUInt32BE(4500, 4); // TTL: 75 minutes
|
|
61
|
-
ptrRecord.writeUInt16BE(ptrData.length, 8);
|
|
62
|
-
records.push(ptrName, ptrRecord, ptrData);
|
|
63
|
-
// SRV record: fullName -> host:port
|
|
64
|
-
const srvName = encodeName(fullName);
|
|
65
|
-
const srvTarget = encodeName(hostName);
|
|
66
|
-
const srvRecord = Buffer.alloc(16);
|
|
67
|
-
srvRecord.writeUInt16BE(DNS_TYPE_SRV, 0);
|
|
68
|
-
srvRecord.writeUInt16BE(DNS_CLASS_IN | DNS_CACHE_FLUSH, 2);
|
|
69
|
-
srvRecord.writeUInt32BE(120, 4); // TTL: 2 minutes
|
|
70
|
-
srvRecord.writeUInt16BE(srvTarget.length + 6, 8); // data length
|
|
71
|
-
srvRecord.writeUInt16BE(0, 10); // Priority
|
|
72
|
-
srvRecord.writeUInt16BE(0, 12); // Weight
|
|
73
|
-
srvRecord.writeUInt16BE(config.port, 14);
|
|
74
|
-
records.push(srvName, srvRecord, srvTarget);
|
|
75
|
-
// TXT record
|
|
76
|
-
const txtName = encodeName(fullName);
|
|
77
|
-
const txtPairs = [];
|
|
78
|
-
const txt = {
|
|
79
|
-
version: '2.0.0',
|
|
80
|
-
mode: process.env.PROFCLAW_MODE ?? 'mini',
|
|
81
|
-
...config.txtRecords,
|
|
82
|
-
};
|
|
83
|
-
for (const [key, value] of Object.entries(txt)) {
|
|
84
|
-
const pair = `${key}=${value}`;
|
|
85
|
-
const pairBuf = Buffer.alloc(1 + pair.length);
|
|
86
|
-
pairBuf.writeUInt8(pair.length, 0);
|
|
87
|
-
pairBuf.write(pair, 1, 'utf-8');
|
|
88
|
-
txtPairs.push(pairBuf);
|
|
89
|
-
}
|
|
90
|
-
const txtData = Buffer.concat(txtPairs);
|
|
91
|
-
const txtRecord = Buffer.alloc(10);
|
|
92
|
-
txtRecord.writeUInt16BE(DNS_TYPE_TXT, 0);
|
|
93
|
-
txtRecord.writeUInt16BE(DNS_CLASS_IN | DNS_CACHE_FLUSH, 2);
|
|
94
|
-
txtRecord.writeUInt32BE(4500, 4);
|
|
95
|
-
txtRecord.writeUInt16BE(txtData.length, 8);
|
|
96
|
-
records.push(txtName, txtRecord, txtData);
|
|
97
|
-
// A record: hostname -> IP
|
|
98
|
-
const aName = encodeName(hostName);
|
|
99
|
-
const ip = getLocalIPv4();
|
|
100
|
-
const ipParts = ip.split('.').map(Number);
|
|
101
|
-
const aData = Buffer.from(ipParts);
|
|
102
|
-
const aRecord = Buffer.alloc(10);
|
|
103
|
-
aRecord.writeUInt16BE(DNS_TYPE_A, 0);
|
|
104
|
-
aRecord.writeUInt16BE(DNS_CLASS_IN | DNS_CACHE_FLUSH, 2);
|
|
105
|
-
aRecord.writeUInt32BE(120, 4);
|
|
106
|
-
aRecord.writeUInt16BE(4, 8);
|
|
107
|
-
records.push(aName, aRecord, aData);
|
|
108
|
-
return Buffer.concat(records);
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Get the primary local IPv4 address
|
|
112
|
-
*/
|
|
113
|
-
function getLocalIPv4() {
|
|
114
|
-
const interfaces = networkInterfaces();
|
|
115
|
-
for (const name of Object.keys(interfaces)) {
|
|
116
|
-
const addrs = interfaces[name];
|
|
117
|
-
if (!addrs)
|
|
118
|
-
continue;
|
|
119
|
-
for (const addr of addrs) {
|
|
120
|
-
if (addr.family === 'IPv4' && !addr.internal) {
|
|
121
|
-
return addr.address;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return '127.0.0.1';
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Handle incoming mDNS packet (discover other nodes)
|
|
129
|
-
*/
|
|
130
|
-
function handleIncomingPacket(msg, sourceAddress) {
|
|
131
|
-
try {
|
|
132
|
-
// Simple check: is this a profclaw announcement?
|
|
133
|
-
const content = msg.toString('utf-8', 0, Math.min(msg.length, 512));
|
|
134
|
-
if (!content.includes('_profclaw'))
|
|
135
|
-
return;
|
|
136
|
-
// Extract version and mode from TXT records (simplified parsing)
|
|
137
|
-
const versionMatch = content.match(/version=([^\x00]+)/);
|
|
138
|
-
const modeMatch = content.match(/mode=([^\x00]+)/);
|
|
139
|
-
const existing = discoveredNodes.get(sourceAddress);
|
|
140
|
-
discoveredNodes.set(sourceAddress, {
|
|
141
|
-
name: existing?.name || `profclaw@${sourceAddress}`,
|
|
142
|
-
host: sourceAddress,
|
|
143
|
-
port: existing?.port || 3000,
|
|
144
|
-
addresses: [sourceAddress],
|
|
145
|
-
txt: {
|
|
146
|
-
version: versionMatch?.[1] ?? 'unknown',
|
|
147
|
-
mode: modeMatch?.[1] ?? 'unknown',
|
|
148
|
-
},
|
|
149
|
-
lastSeen: Date.now(),
|
|
150
|
-
});
|
|
151
|
-
logger.debug('[mDNS] Discovered node', { address: sourceAddress });
|
|
152
|
-
}
|
|
153
|
-
catch {
|
|
154
|
-
// Ignore malformed packets
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Start mDNS announcement
|
|
159
|
-
*/
|
|
160
|
-
export function startMDNS(config) {
|
|
161
|
-
if (socket) {
|
|
162
|
-
logger.warn('[mDNS] Already running');
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
try {
|
|
166
|
-
socket = createSocket({ type: 'udp4', reuseAddr: true });
|
|
167
|
-
socket.on('error', (err) => {
|
|
168
|
-
// Port 5353 often requires elevated permissions
|
|
169
|
-
logger.warn('[mDNS] Socket error (may need elevated permissions)', { error: err.message });
|
|
170
|
-
stopMDNS();
|
|
171
|
-
});
|
|
172
|
-
socket.on('listening', () => {
|
|
173
|
-
try {
|
|
174
|
-
socket?.addMembership(MDNS_ADDRESS);
|
|
175
|
-
logger.info('[mDNS] Joined multicast group', { address: MDNS_ADDRESS, port: MDNS_PORT });
|
|
176
|
-
}
|
|
177
|
-
catch (err) {
|
|
178
|
-
logger.warn('[mDNS] Failed to join multicast group', {
|
|
179
|
-
error: err instanceof Error ? err.message : 'Unknown',
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
socket.on('message', (msg, rinfo) => {
|
|
184
|
-
handleIncomingPacket(msg, rinfo.address);
|
|
185
|
-
});
|
|
186
|
-
socket.bind(MDNS_PORT, () => {
|
|
187
|
-
// Send initial announcement
|
|
188
|
-
const packet = buildAnnouncementPacket(config);
|
|
189
|
-
socket?.send(packet, 0, packet.length, MDNS_PORT, MDNS_ADDRESS);
|
|
190
|
-
// Re-announce every 60 seconds
|
|
191
|
-
announceInterval = setInterval(() => {
|
|
192
|
-
if (socket) {
|
|
193
|
-
const pkt = buildAnnouncementPacket(config);
|
|
194
|
-
socket.send(pkt, 0, pkt.length, MDNS_PORT, MDNS_ADDRESS);
|
|
195
|
-
}
|
|
196
|
-
}, 60_000);
|
|
197
|
-
logger.info('[mDNS] Discovery started', {
|
|
198
|
-
name: config.instanceName || `profclaw-${hostname()}`,
|
|
199
|
-
port: config.port,
|
|
200
|
-
ip: getLocalIPv4(),
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
catch (err) {
|
|
205
|
-
logger.warn('[mDNS] Failed to start (non-fatal)', {
|
|
206
|
-
error: err instanceof Error ? err.message : 'Unknown',
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Stop mDNS announcement
|
|
212
|
-
*/
|
|
213
|
-
export function stopMDNS() {
|
|
214
|
-
if (announceInterval) {
|
|
215
|
-
clearInterval(announceInterval);
|
|
216
|
-
announceInterval = null;
|
|
217
|
-
}
|
|
218
|
-
if (socket) {
|
|
219
|
-
try {
|
|
220
|
-
socket.dropMembership(MDNS_ADDRESS);
|
|
221
|
-
}
|
|
222
|
-
catch {
|
|
223
|
-
// Ignore - socket may already be closed
|
|
224
|
-
}
|
|
225
|
-
socket.close();
|
|
226
|
-
socket = null;
|
|
227
|
-
logger.info('[mDNS] Discovery stopped');
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Get list of discovered profClaw nodes on the network
|
|
232
|
-
*/
|
|
233
|
-
export function getDiscoveredNodes() {
|
|
234
|
-
// Prune stale nodes (not seen in 5 minutes)
|
|
235
|
-
const staleThreshold = Date.now() - 300_000;
|
|
236
|
-
for (const [key, node] of discoveredNodes) {
|
|
237
|
-
if (node.lastSeen < staleThreshold) {
|
|
238
|
-
discoveredNodes.delete(key);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return Array.from(discoveredNodes.values());
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Check if mDNS is currently running
|
|
245
|
-
*/
|
|
246
|
-
export function isMDNSRunning() {
|
|
247
|
-
return socket !== null;
|
|
248
|
-
}
|
|
249
|
-
//# sourceMappingURL=mdns.js.map
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* profClaw Plugin Registry
|
|
3
|
-
*
|
|
4
|
-
* Manages plugin registration, instantiation, and health monitoring.
|
|
5
|
-
*/
|
|
6
|
-
import type { PluginConfig, PluginHealth, PluginMetadata, SearchProvider, SearchPluginDefinition, ToolProvider, ToolPluginDefinition, PluginSettingsSchema } from './types.js';
|
|
7
|
-
declare class SearchProviderRegistry {
|
|
8
|
-
private definitions;
|
|
9
|
-
private instances;
|
|
10
|
-
private configs;
|
|
11
|
-
private healthCache;
|
|
12
|
-
private readonly HEALTH_CACHE_TTL;
|
|
13
|
-
/**
|
|
14
|
-
* Register a search provider plugin
|
|
15
|
-
*/
|
|
16
|
-
register(definition: SearchPluginDefinition): void;
|
|
17
|
-
/**
|
|
18
|
-
* Unregister a search provider
|
|
19
|
-
*/
|
|
20
|
-
unregister(pluginId: string): void;
|
|
21
|
-
/**
|
|
22
|
-
* Create a provider instance from config
|
|
23
|
-
*/
|
|
24
|
-
create(config: PluginConfig): SearchProvider;
|
|
25
|
-
/**
|
|
26
|
-
* Get provider by config ID
|
|
27
|
-
*/
|
|
28
|
-
get(configId: string): SearchProvider | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Get all active (enabled) providers
|
|
31
|
-
*/
|
|
32
|
-
getActive(): SearchProvider[];
|
|
33
|
-
/**
|
|
34
|
-
* Get primary (highest priority enabled) provider
|
|
35
|
-
*/
|
|
36
|
-
getPrimary(): SearchProvider | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* List all registered plugin IDs
|
|
39
|
-
*/
|
|
40
|
-
listRegistered(): string[];
|
|
41
|
-
/**
|
|
42
|
-
* Get plugin metadata
|
|
43
|
-
*/
|
|
44
|
-
getMetadata(pluginId: string): PluginMetadata | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* Get all plugin metadata
|
|
47
|
-
*/
|
|
48
|
-
getAllMetadata(): PluginMetadata[];
|
|
49
|
-
/**
|
|
50
|
-
* Get settings schema for a plugin
|
|
51
|
-
*/
|
|
52
|
-
getSettingsSchema(pluginId: string): PluginSettingsSchema | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Get config by instance
|
|
55
|
-
*/
|
|
56
|
-
private getConfigByInstance;
|
|
57
|
-
/**
|
|
58
|
-
* Get all configs
|
|
59
|
-
*/
|
|
60
|
-
getAllConfigs(): PluginConfig[];
|
|
61
|
-
/**
|
|
62
|
-
* Update config
|
|
63
|
-
*/
|
|
64
|
-
updateConfig(configId: string, updates: Partial<PluginConfig>): void;
|
|
65
|
-
/**
|
|
66
|
-
* Delete config and instance
|
|
67
|
-
*/
|
|
68
|
-
deleteConfig(configId: string): void;
|
|
69
|
-
/**
|
|
70
|
-
* Get health status (cached)
|
|
71
|
-
*/
|
|
72
|
-
getHealth(configId: string): Promise<PluginHealth>;
|
|
73
|
-
/**
|
|
74
|
-
* Search with automatic fallback
|
|
75
|
-
*/
|
|
76
|
-
search(query: string, options?: Parameters<SearchProvider['search']>[1], preferredProvider?: string): Promise<ReturnType<SearchProvider['search']>>;
|
|
77
|
-
}
|
|
78
|
-
declare class ToolProviderRegistry {
|
|
79
|
-
private definitions;
|
|
80
|
-
private instances;
|
|
81
|
-
private configs;
|
|
82
|
-
register(definition: ToolPluginDefinition): void;
|
|
83
|
-
unregister(pluginId: string): void;
|
|
84
|
-
create(config: PluginConfig): ToolProvider;
|
|
85
|
-
get(configId: string): ToolProvider | undefined;
|
|
86
|
-
getActive(): ToolProvider[];
|
|
87
|
-
listRegistered(): string[];
|
|
88
|
-
getMetadata(pluginId: string): PluginMetadata | undefined;
|
|
89
|
-
getAllMetadata(): PluginMetadata[];
|
|
90
|
-
getSettingsSchema(pluginId: string): PluginSettingsSchema | undefined;
|
|
91
|
-
getAllConfigs(): PluginConfig[];
|
|
92
|
-
updateConfig(configId: string, updates: Partial<PluginConfig>): void;
|
|
93
|
-
deleteConfig(configId: string): void;
|
|
94
|
-
/**
|
|
95
|
-
* Get all available tools across all providers
|
|
96
|
-
*/
|
|
97
|
-
getAllTools(): Array<{
|
|
98
|
-
provider: string;
|
|
99
|
-
tool: ToolProvider['tools'][0];
|
|
100
|
-
}>;
|
|
101
|
-
/**
|
|
102
|
-
* Execute a tool by name
|
|
103
|
-
*/
|
|
104
|
-
execute(toolName: string, params: Record<string, unknown>): Promise<ReturnType<ToolProvider['execute']>>;
|
|
105
|
-
}
|
|
106
|
-
declare class PluginManager {
|
|
107
|
-
readonly search: SearchProviderRegistry;
|
|
108
|
-
readonly tools: ToolProviderRegistry;
|
|
109
|
-
/**
|
|
110
|
-
* Initialize built-in plugins
|
|
111
|
-
*/
|
|
112
|
-
initialize(): Promise<void>;
|
|
113
|
-
/**
|
|
114
|
-
* Get all plugin metadata across categories
|
|
115
|
-
*/
|
|
116
|
-
getAllPlugins(): Array<PluginMetadata & {
|
|
117
|
-
category: 'search' | 'tool';
|
|
118
|
-
}>;
|
|
119
|
-
}
|
|
120
|
-
export declare function getPluginManager(): PluginManager;
|
|
121
|
-
export { SearchProviderRegistry, ToolProviderRegistry, PluginManager };
|
|
122
|
-
//# sourceMappingURL=registry.d.ts.map
|