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
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Init Command
|
|
3
|
+
*
|
|
4
|
+
* Scans the current project directory and generates a `.profclaw/context.md`
|
|
5
|
+
* file describing the tech stack, structure, build/test commands, and conventions.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* profclaw init # interactive (asks before overwriting)
|
|
9
|
+
* profclaw init --force # overwrite without prompting
|
|
10
|
+
*/
|
|
11
|
+
import { Command } from 'commander';
|
|
12
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
13
|
+
import fs from 'node:fs/promises';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import { execSync } from 'node:child_process';
|
|
16
|
+
import { confirm } from '@inquirer/prompts';
|
|
17
|
+
import { success, error, info, spinner } from '../utils/output.js';
|
|
18
|
+
// ── Manifest readers ──────────────────────────────────────────────────────────
|
|
19
|
+
function readJson(filePath) {
|
|
20
|
+
try {
|
|
21
|
+
return JSON.parse(readFileSync(filePath, 'utf-8'));
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function readText(filePath) {
|
|
28
|
+
try {
|
|
29
|
+
return readFileSync(filePath, 'utf-8');
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function fileExists(filePath) {
|
|
36
|
+
return existsSync(filePath);
|
|
37
|
+
}
|
|
38
|
+
// ── Detectors ─────────────────────────────────────────────────────────────────
|
|
39
|
+
function detectLanguage(cwd) {
|
|
40
|
+
if (fileExists(path.join(cwd, 'Cargo.toml')))
|
|
41
|
+
return 'Rust';
|
|
42
|
+
if (fileExists(path.join(cwd, 'go.mod')))
|
|
43
|
+
return 'Go';
|
|
44
|
+
if (fileExists(path.join(cwd, 'pyproject.toml')) || fileExists(path.join(cwd, 'setup.py')))
|
|
45
|
+
return 'Python';
|
|
46
|
+
if (fileExists(path.join(cwd, 'tsconfig.json')))
|
|
47
|
+
return 'TypeScript';
|
|
48
|
+
if (fileExists(path.join(cwd, 'package.json')))
|
|
49
|
+
return 'JavaScript';
|
|
50
|
+
if (fileExists(path.join(cwd, 'pom.xml')) || fileExists(path.join(cwd, 'build.gradle')))
|
|
51
|
+
return 'Java';
|
|
52
|
+
if (fileExists(path.join(cwd, 'mix.exs')))
|
|
53
|
+
return 'Elixir';
|
|
54
|
+
if (fileExists(path.join(cwd, 'Gemfile')))
|
|
55
|
+
return 'Ruby';
|
|
56
|
+
return 'Unknown';
|
|
57
|
+
}
|
|
58
|
+
function detectPackageManager(cwd) {
|
|
59
|
+
if (fileExists(path.join(cwd, 'pnpm-lock.yaml')))
|
|
60
|
+
return 'pnpm';
|
|
61
|
+
if (fileExists(path.join(cwd, 'yarn.lock')))
|
|
62
|
+
return 'yarn';
|
|
63
|
+
if (fileExists(path.join(cwd, 'bun.lockb')))
|
|
64
|
+
return 'bun';
|
|
65
|
+
if (fileExists(path.join(cwd, 'package-lock.json')))
|
|
66
|
+
return 'npm';
|
|
67
|
+
return 'npm';
|
|
68
|
+
}
|
|
69
|
+
function detectFramework(cwd, pkg) {
|
|
70
|
+
const deps = {
|
|
71
|
+
...(pkg?.dependencies ?? {}),
|
|
72
|
+
...(pkg?.devDependencies ?? {}),
|
|
73
|
+
};
|
|
74
|
+
const hasDep = (name) => name in deps;
|
|
75
|
+
if (hasDep('next'))
|
|
76
|
+
return 'Next.js';
|
|
77
|
+
if (hasDep('nuxt'))
|
|
78
|
+
return 'Nuxt';
|
|
79
|
+
if (hasDep('astro'))
|
|
80
|
+
return 'Astro';
|
|
81
|
+
if (hasDep('remix'))
|
|
82
|
+
return 'Remix';
|
|
83
|
+
if (hasDep('@sveltejs/kit'))
|
|
84
|
+
return 'SvelteKit';
|
|
85
|
+
if (hasDep('svelte'))
|
|
86
|
+
return 'Svelte';
|
|
87
|
+
if (hasDep('react'))
|
|
88
|
+
return 'React';
|
|
89
|
+
if (hasDep('vue'))
|
|
90
|
+
return 'Vue';
|
|
91
|
+
if (hasDep('express'))
|
|
92
|
+
return 'Express';
|
|
93
|
+
if (hasDep('fastify'))
|
|
94
|
+
return 'Fastify';
|
|
95
|
+
if (hasDep('hono'))
|
|
96
|
+
return 'Hono';
|
|
97
|
+
if (hasDep('@nestjs/core'))
|
|
98
|
+
return 'NestJS';
|
|
99
|
+
if (hasDep('commander'))
|
|
100
|
+
return 'CLI (commander)';
|
|
101
|
+
if (hasDep('ink'))
|
|
102
|
+
return 'CLI (ink/TUI)';
|
|
103
|
+
if (fileExists(path.join(cwd, 'pyproject.toml'))) {
|
|
104
|
+
const content = readText(path.join(cwd, 'pyproject.toml')) ?? '';
|
|
105
|
+
if (content.includes('fastapi'))
|
|
106
|
+
return 'FastAPI';
|
|
107
|
+
if (content.includes('flask'))
|
|
108
|
+
return 'Flask';
|
|
109
|
+
if (content.includes('django'))
|
|
110
|
+
return 'Django';
|
|
111
|
+
}
|
|
112
|
+
if (fileExists(path.join(cwd, 'Cargo.toml'))) {
|
|
113
|
+
const content = readText(path.join(cwd, 'Cargo.toml')) ?? '';
|
|
114
|
+
if (content.includes('axum'))
|
|
115
|
+
return 'Axum';
|
|
116
|
+
if (content.includes('actix-web'))
|
|
117
|
+
return 'Actix-web';
|
|
118
|
+
if (content.includes('rocket'))
|
|
119
|
+
return 'Rocket';
|
|
120
|
+
}
|
|
121
|
+
if (fileExists(path.join(cwd, 'go.mod'))) {
|
|
122
|
+
const content = readText(path.join(cwd, 'go.mod')) ?? '';
|
|
123
|
+
if (content.includes('gin-gonic'))
|
|
124
|
+
return 'Gin';
|
|
125
|
+
if (content.includes('echo'))
|
|
126
|
+
return 'Echo';
|
|
127
|
+
if (content.includes('fiber'))
|
|
128
|
+
return 'Fiber';
|
|
129
|
+
}
|
|
130
|
+
return 'None detected';
|
|
131
|
+
}
|
|
132
|
+
function detectBuildAndTestCommands(cwd, pkg, pm, language) {
|
|
133
|
+
const scripts = pkg?.scripts ?? {};
|
|
134
|
+
const run = (script) => `${pm} run ${script}`;
|
|
135
|
+
const build = scripts['build'] ? run('build') :
|
|
136
|
+
language === 'Rust' ? 'cargo build --release' :
|
|
137
|
+
language === 'Go' ? 'go build ./...' :
|
|
138
|
+
language === 'Python' ? (fileExists(path.join(cwd, 'pyproject.toml')) ? 'python -m build' : 'python setup.py build') :
|
|
139
|
+
scripts['compile'] ? run('compile') :
|
|
140
|
+
'N/A';
|
|
141
|
+
const test = scripts['test'] ? run('test') :
|
|
142
|
+
language === 'Rust' ? 'cargo test' :
|
|
143
|
+
language === 'Go' ? 'go test ./...' :
|
|
144
|
+
language === 'Python' ? 'pytest' :
|
|
145
|
+
scripts['check'] ? run('check') :
|
|
146
|
+
'N/A';
|
|
147
|
+
const dev = scripts['dev'] ? run('dev') :
|
|
148
|
+
scripts['start'] ? run('start') :
|
|
149
|
+
scripts['serve'] ? run('serve') :
|
|
150
|
+
'N/A';
|
|
151
|
+
return { build, test, dev };
|
|
152
|
+
}
|
|
153
|
+
function detectKeyDirs(cwd) {
|
|
154
|
+
const candidates = [
|
|
155
|
+
{ name: 'src', purpose: 'Source code' },
|
|
156
|
+
{ name: 'app', purpose: 'Application code' },
|
|
157
|
+
{ name: 'lib', purpose: 'Library / shared utilities' },
|
|
158
|
+
{ name: 'packages', purpose: 'Monorepo packages' },
|
|
159
|
+
{ name: 'apps', purpose: 'Monorepo applications' },
|
|
160
|
+
{ name: 'tests', purpose: 'Test files' },
|
|
161
|
+
{ name: 'test', purpose: 'Test files' },
|
|
162
|
+
{ name: '__tests__', purpose: 'Jest test files' },
|
|
163
|
+
{ name: 'docs', purpose: 'Documentation' },
|
|
164
|
+
{ name: 'scripts', purpose: 'Build / utility scripts' },
|
|
165
|
+
{ name: 'public', purpose: 'Static assets' },
|
|
166
|
+
{ name: 'assets', purpose: 'Static assets' },
|
|
167
|
+
{ name: 'api', purpose: 'API layer' },
|
|
168
|
+
{ name: 'components', purpose: 'UI components' },
|
|
169
|
+
{ name: 'pages', purpose: 'Page components / routes' },
|
|
170
|
+
{ name: 'hooks', purpose: 'React hooks' },
|
|
171
|
+
{ name: 'services', purpose: 'Service / business logic layer' },
|
|
172
|
+
{ name: 'utils', purpose: 'Utility functions' },
|
|
173
|
+
{ name: 'config', purpose: 'Configuration files' },
|
|
174
|
+
{ name: 'migrations', purpose: 'Database migrations' },
|
|
175
|
+
{ name: 'prisma', purpose: 'Prisma schema and migrations' },
|
|
176
|
+
{ name: 'drizzle', purpose: 'Drizzle ORM schema' },
|
|
177
|
+
{ name: '.github', purpose: 'GitHub Actions / workflows' },
|
|
178
|
+
{ name: 'docker', purpose: 'Docker configuration' },
|
|
179
|
+
{ name: 'infra', purpose: 'Infrastructure / IaC' },
|
|
180
|
+
{ name: 'k8s', purpose: 'Kubernetes manifests' },
|
|
181
|
+
];
|
|
182
|
+
return candidates
|
|
183
|
+
.filter(c => fileExists(path.join(cwd, c.name)))
|
|
184
|
+
.map(c => ({ path: c.name, purpose: c.purpose }));
|
|
185
|
+
}
|
|
186
|
+
function detectConventions(cwd, pkg) {
|
|
187
|
+
const conventions = [];
|
|
188
|
+
// Linting
|
|
189
|
+
if (fileExists(path.join(cwd, '.eslintrc.js')) ||
|
|
190
|
+
fileExists(path.join(cwd, '.eslintrc.json')) ||
|
|
191
|
+
fileExists(path.join(cwd, 'eslint.config.js')) ||
|
|
192
|
+
fileExists(path.join(cwd, 'eslint.config.ts'))) {
|
|
193
|
+
conventions.push('ESLint for linting');
|
|
194
|
+
}
|
|
195
|
+
if (fileExists(path.join(cwd, '.prettierrc')) ||
|
|
196
|
+
fileExists(path.join(cwd, '.prettierrc.json')) ||
|
|
197
|
+
fileExists(path.join(cwd, 'prettier.config.js')) ||
|
|
198
|
+
fileExists(path.join(cwd, 'prettier.config.ts'))) {
|
|
199
|
+
conventions.push('Prettier for formatting');
|
|
200
|
+
}
|
|
201
|
+
if (fileExists(path.join(cwd, 'biome.json')) || fileExists(path.join(cwd, 'biome.jsonc'))) {
|
|
202
|
+
conventions.push('Biome for linting and formatting');
|
|
203
|
+
}
|
|
204
|
+
// Editor config
|
|
205
|
+
if (fileExists(path.join(cwd, '.editorconfig'))) {
|
|
206
|
+
const content = readText(path.join(cwd, '.editorconfig')) ?? '';
|
|
207
|
+
const indentMatch = content.match(/indent_style\s*=\s*(\w+)/);
|
|
208
|
+
const sizeMatch = content.match(/indent_size\s*=\s*(\d+)/);
|
|
209
|
+
if (indentMatch && sizeMatch) {
|
|
210
|
+
conventions.push(`${indentMatch[1] === 'tab' ? 'Tabs' : `${sizeMatch[1]}-space`} indentation (from .editorconfig)`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// TypeScript strictness
|
|
214
|
+
if (fileExists(path.join(cwd, 'tsconfig.json'))) {
|
|
215
|
+
const tsconfig = readJson(path.join(cwd, 'tsconfig.json'));
|
|
216
|
+
const co = tsconfig?.compilerOptions;
|
|
217
|
+
if (co?.strict === true)
|
|
218
|
+
conventions.push('TypeScript strict mode enabled');
|
|
219
|
+
if (co?.noUncheckedIndexedAccess === true)
|
|
220
|
+
conventions.push('noUncheckedIndexedAccess enforced');
|
|
221
|
+
}
|
|
222
|
+
// Git hooks
|
|
223
|
+
if (fileExists(path.join(cwd, '.husky')))
|
|
224
|
+
conventions.push('Husky git hooks');
|
|
225
|
+
// Commit conventions
|
|
226
|
+
if (fileExists(path.join(cwd, 'commitlint.config.js')) ||
|
|
227
|
+
fileExists(path.join(cwd, 'commitlint.config.ts'))) {
|
|
228
|
+
conventions.push('commitlint for conventional commits');
|
|
229
|
+
}
|
|
230
|
+
const scripts = pkg?.scripts ?? {};
|
|
231
|
+
if (scripts['lint'])
|
|
232
|
+
conventions.push(`Lint command: \`${scripts['lint']}\``);
|
|
233
|
+
if (scripts['format'])
|
|
234
|
+
conventions.push(`Format command: \`${scripts['format']}\``);
|
|
235
|
+
if (scripts['typecheck'] || scripts['type-check']) {
|
|
236
|
+
conventions.push(`Type-check command: \`${scripts['typecheck'] ?? scripts['type-check']}\``);
|
|
237
|
+
}
|
|
238
|
+
return conventions;
|
|
239
|
+
}
|
|
240
|
+
function detectRecentActivity(cwd) {
|
|
241
|
+
try {
|
|
242
|
+
const log = execSync('git log --oneline --no-merges -10', { cwd, encoding: 'utf-8', timeout: 5000, stdio: ['pipe', 'pipe', 'pipe'] }).trim();
|
|
243
|
+
if (!log)
|
|
244
|
+
return 'No git history found.';
|
|
245
|
+
return log;
|
|
246
|
+
}
|
|
247
|
+
catch {
|
|
248
|
+
return 'No git repository or git unavailable.';
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
function extractDescription(cwd, pkg) {
|
|
252
|
+
if (pkg?.description && typeof pkg.description === 'string' && pkg.description.trim()) {
|
|
253
|
+
return pkg.description.trim();
|
|
254
|
+
}
|
|
255
|
+
const readme = readText(path.join(cwd, 'README.md')) ?? readText(path.join(cwd, 'readme.md'));
|
|
256
|
+
if (readme) {
|
|
257
|
+
// Take the first non-heading paragraph (strip markdown headings)
|
|
258
|
+
const lines = readme.split('\n');
|
|
259
|
+
for (const line of lines) {
|
|
260
|
+
const trimmed = line.trim();
|
|
261
|
+
if (trimmed && !trimmed.startsWith('#') && !trimmed.startsWith('!') && trimmed.length > 20) {
|
|
262
|
+
return trimmed.replace(/[*_`]/g, '').slice(0, 200);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return 'No description found. Add one in README.md or package.json.';
|
|
267
|
+
}
|
|
268
|
+
// ── Main scan function ────────────────────────────────────────────────────────
|
|
269
|
+
async function scanProject(cwd) {
|
|
270
|
+
const pkg = readJson(path.join(cwd, 'package.json'));
|
|
271
|
+
const language = detectLanguage(cwd);
|
|
272
|
+
const pm = detectPackageManager(cwd);
|
|
273
|
+
const framework = detectFramework(cwd, pkg);
|
|
274
|
+
const { build, test, dev } = detectBuildAndTestCommands(cwd, pkg, pm, language);
|
|
275
|
+
const keyDirs = detectKeyDirs(cwd);
|
|
276
|
+
const conventions = detectConventions(cwd, pkg);
|
|
277
|
+
const recentActivity = detectRecentActivity(cwd);
|
|
278
|
+
const description = extractDescription(cwd, pkg);
|
|
279
|
+
const name = pkg?.name ?? path.basename(cwd);
|
|
280
|
+
return {
|
|
281
|
+
name,
|
|
282
|
+
description,
|
|
283
|
+
language,
|
|
284
|
+
framework,
|
|
285
|
+
buildCommand: build,
|
|
286
|
+
testCommand: test,
|
|
287
|
+
devCommand: dev,
|
|
288
|
+
keyDirs,
|
|
289
|
+
conventions,
|
|
290
|
+
recentActivity,
|
|
291
|
+
packageManager: pm,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
// ── Context file generator ────────────────────────────────────────────────────
|
|
295
|
+
function generateContextMarkdown(info) {
|
|
296
|
+
const now = new Date().toISOString().slice(0, 10);
|
|
297
|
+
const structureLines = info.keyDirs.length > 0
|
|
298
|
+
? info.keyDirs.map(d => `- \`${d.path}/\` — ${d.purpose}`).join('\n')
|
|
299
|
+
: '- No key directories detected automatically.';
|
|
300
|
+
const conventionLines = info.conventions.length > 0
|
|
301
|
+
? info.conventions.map(c => `- ${c}`).join('\n')
|
|
302
|
+
: '- No convention files detected.';
|
|
303
|
+
return `# Project Context
|
|
304
|
+
> Auto-generated by \`profclaw init\` on ${now}. Edit freely — this file is yours.
|
|
305
|
+
|
|
306
|
+
## Overview
|
|
307
|
+
|
|
308
|
+
${info.description}
|
|
309
|
+
|
|
310
|
+
**Project name:** \`${info.name}\`
|
|
311
|
+
|
|
312
|
+
## Tech Stack
|
|
313
|
+
|
|
314
|
+
- **Language:** ${info.language}
|
|
315
|
+
- **Framework:** ${info.framework}
|
|
316
|
+
- **Package manager:** ${info.packageManager}
|
|
317
|
+
- **Build:** \`${info.buildCommand}\`
|
|
318
|
+
- **Test:** \`${info.testCommand}\`
|
|
319
|
+
- **Dev server:** \`${info.devCommand}\`
|
|
320
|
+
|
|
321
|
+
## Structure
|
|
322
|
+
|
|
323
|
+
${structureLines}
|
|
324
|
+
|
|
325
|
+
## Conventions
|
|
326
|
+
|
|
327
|
+
${conventionLines}
|
|
328
|
+
|
|
329
|
+
## Recent Activity
|
|
330
|
+
|
|
331
|
+
\`\`\`
|
|
332
|
+
${info.recentActivity}
|
|
333
|
+
\`\`\`
|
|
334
|
+
`;
|
|
335
|
+
}
|
|
336
|
+
// ── Command ───────────────────────────────────────────────────────────────────
|
|
337
|
+
export function initCommand() {
|
|
338
|
+
const cmd = new Command('init')
|
|
339
|
+
.description('Scan the project and generate .profclaw/context.md')
|
|
340
|
+
.option('-f, --force', 'Overwrite existing context.md without prompting')
|
|
341
|
+
.option('--dir <path>', 'Project directory to scan (default: cwd)')
|
|
342
|
+
.action(async (options) => {
|
|
343
|
+
const cwd = options.dir ? path.resolve(options.dir) : process.cwd();
|
|
344
|
+
const outputDir = path.join(cwd, '.profclaw');
|
|
345
|
+
const outputPath = path.join(outputDir, 'context.md');
|
|
346
|
+
// Check for existing file
|
|
347
|
+
if (fileExists(outputPath) && !options.force) {
|
|
348
|
+
const overwrite = await confirm({
|
|
349
|
+
message: '.profclaw/context.md already exists. Overwrite?',
|
|
350
|
+
default: false,
|
|
351
|
+
});
|
|
352
|
+
if (!overwrite) {
|
|
353
|
+
info('Aborted. Use --force to overwrite without prompting.');
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const spin = spinner('Scanning project...').start();
|
|
358
|
+
try {
|
|
359
|
+
const projectInfo = await scanProject(cwd);
|
|
360
|
+
spin.stop();
|
|
361
|
+
const markdown = generateContextMarkdown(projectInfo);
|
|
362
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
363
|
+
await fs.writeFile(outputPath, markdown, 'utf-8');
|
|
364
|
+
success(`Context written to .profclaw/context.md`);
|
|
365
|
+
console.log('');
|
|
366
|
+
console.log(` Project : ${projectInfo.name}`);
|
|
367
|
+
console.log(` Language: ${projectInfo.language}`);
|
|
368
|
+
console.log(` Framework: ${projectInfo.framework}`);
|
|
369
|
+
console.log(` Dirs scanned: ${projectInfo.keyDirs.length}`);
|
|
370
|
+
console.log('');
|
|
371
|
+
info('Edit .profclaw/context.md to add your own notes and conventions.');
|
|
372
|
+
}
|
|
373
|
+
catch (err) {
|
|
374
|
+
spin.stop();
|
|
375
|
+
error(err instanceof Error ? err.message : 'Init failed');
|
|
376
|
+
process.exit(1);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
return cmd;
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -16,6 +16,13 @@ function formatCostPair(input, output) {
|
|
|
16
16
|
return chalk.dim('-');
|
|
17
17
|
return `$${input.toFixed(2)}/$${output.toFixed(2)}`;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Extract the provider type from a model ID (e.g. "anthropic/claude-3" -> "anthropic")
|
|
21
|
+
*/
|
|
22
|
+
function extractProvider(modelId) {
|
|
23
|
+
const slash = modelId.indexOf('/');
|
|
24
|
+
return slash > 0 ? modelId.slice(0, slash) : undefined;
|
|
25
|
+
}
|
|
19
26
|
export function modelsCommands() {
|
|
20
27
|
const cmd = new Command('models')
|
|
21
28
|
.description('Manage AI model configuration');
|
|
@@ -29,13 +36,13 @@ export function modelsCommands() {
|
|
|
29
36
|
const spin = spinner('Fetching models...').start();
|
|
30
37
|
try {
|
|
31
38
|
const params = options.provider ? `?provider=${encodeURIComponent(options.provider)}` : '';
|
|
32
|
-
const result = await api.get(`/api/
|
|
39
|
+
const result = await api.get(`/api/chat/models${params}`);
|
|
33
40
|
spin.stop();
|
|
34
41
|
if (!result.ok) {
|
|
35
42
|
error(result.error || 'Failed to fetch models');
|
|
36
43
|
process.exit(1);
|
|
37
44
|
}
|
|
38
|
-
const { models
|
|
45
|
+
const { models } = result.data;
|
|
39
46
|
if (options.json) {
|
|
40
47
|
console.log(JSON.stringify(result.data, null, 2));
|
|
41
48
|
return;
|
|
@@ -44,21 +51,17 @@ export function modelsCommands() {
|
|
|
44
51
|
info('No models available.');
|
|
45
52
|
return;
|
|
46
53
|
}
|
|
47
|
-
const table = createTable(['Model', 'Provider', 'Context', 'Cost (in/out)'
|
|
54
|
+
const table = createTable(['Model', 'Provider', 'Context', 'Cost (in/out)']);
|
|
48
55
|
for (const m of models) {
|
|
49
|
-
const isDefault = m.id === defaultModel || m.isDefault;
|
|
50
56
|
table.push([
|
|
51
|
-
|
|
57
|
+
truncate(m.id, 40),
|
|
52
58
|
m.provider,
|
|
53
59
|
formatContext(m.contextWindow),
|
|
54
60
|
formatCostPair(m.costPer1MInput, m.costPer1MOutput),
|
|
55
|
-
isDefault ? chalk.yellow('yes') : chalk.dim('no'),
|
|
56
61
|
]);
|
|
57
62
|
}
|
|
58
63
|
console.log(table.toString());
|
|
59
64
|
console.log(chalk.dim(`\n${models.length} model${models.length !== 1 ? 's' : ''}`));
|
|
60
|
-
if (defaultModel)
|
|
61
|
-
console.log(chalk.dim(`Default: ${defaultModel}`));
|
|
62
65
|
}
|
|
63
66
|
catch (err) {
|
|
64
67
|
spin.stop();
|
|
@@ -73,13 +76,17 @@ export function modelsCommands() {
|
|
|
73
76
|
.action(async (model, options) => {
|
|
74
77
|
const spin = spinner(`Fetching info for ${model}...`).start();
|
|
75
78
|
try {
|
|
76
|
-
const result = await api.get(
|
|
79
|
+
const result = await api.get('/api/chat/models');
|
|
77
80
|
spin.stop();
|
|
78
81
|
if (!result.ok) {
|
|
79
|
-
error(result.error ||
|
|
82
|
+
error(result.error || 'Failed to fetch models');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
const m = result.data.models.find((entry) => entry.id === model || entry.id.endsWith(`/${model}`));
|
|
86
|
+
if (!m) {
|
|
87
|
+
error(`Model ${model} not found`);
|
|
80
88
|
process.exit(1);
|
|
81
89
|
}
|
|
82
|
-
const m = result.data;
|
|
83
90
|
if (options.json) {
|
|
84
91
|
console.log(JSON.stringify(m, null, 2));
|
|
85
92
|
return;
|
|
@@ -102,12 +109,18 @@ export function modelsCommands() {
|
|
|
102
109
|
});
|
|
103
110
|
cmd
|
|
104
111
|
.command('set-default <model>')
|
|
105
|
-
.description('Set the default model')
|
|
112
|
+
.description('Set the default model for a provider')
|
|
106
113
|
.option('--json', 'Output as JSON')
|
|
107
114
|
.action(async (model, options) => {
|
|
115
|
+
const provider = extractProvider(model);
|
|
116
|
+
if (!provider) {
|
|
117
|
+
error('Model must include provider prefix (e.g. anthropic/claude-sonnet-4-20250514)');
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
108
120
|
const spin = spinner(`Setting default model to ${model}...`).start();
|
|
109
121
|
try {
|
|
110
|
-
const
|
|
122
|
+
const modelName = model.slice(provider.length + 1);
|
|
123
|
+
const result = await api.post(`/api/chat/providers/${encodeURIComponent(provider)}/configure`, { defaultModel: modelName });
|
|
111
124
|
spin.stop();
|
|
112
125
|
if (!result.ok) {
|
|
113
126
|
error(result.error || 'Failed to set default model');
|
|
@@ -132,7 +145,7 @@ export function modelsCommands() {
|
|
|
132
145
|
.action(async (options) => {
|
|
133
146
|
const spin = spinner('Fetching aliases...').start();
|
|
134
147
|
try {
|
|
135
|
-
const result = await api.get('/api/
|
|
148
|
+
const result = await api.get('/api/chat/models');
|
|
136
149
|
spin.stop();
|
|
137
150
|
if (!result.ok) {
|
|
138
151
|
error(result.error || 'Failed to fetch aliases');
|
|
@@ -143,14 +156,13 @@ export function modelsCommands() {
|
|
|
143
156
|
console.log(JSON.stringify(aliases, null, 2));
|
|
144
157
|
return;
|
|
145
158
|
}
|
|
146
|
-
|
|
147
|
-
if (entries.length === 0) {
|
|
159
|
+
if (!aliases || aliases.length === 0) {
|
|
148
160
|
info('No model aliases configured.');
|
|
149
161
|
return;
|
|
150
162
|
}
|
|
151
|
-
const table = createTable(['Alias', '
|
|
152
|
-
for (const
|
|
153
|
-
table.push([chalk.cyan(alias),
|
|
163
|
+
const table = createTable(['Alias', 'Provider', 'Model']);
|
|
164
|
+
for (const entry of aliases) {
|
|
165
|
+
table.push([chalk.cyan(entry.alias), entry.provider, entry.model]);
|
|
154
166
|
}
|
|
155
167
|
console.log(table.toString());
|
|
156
168
|
}
|
|
@@ -162,15 +174,16 @@ export function modelsCommands() {
|
|
|
162
174
|
});
|
|
163
175
|
cmd
|
|
164
176
|
.command('test <model>')
|
|
165
|
-
.description('Test a model
|
|
177
|
+
.description('Test a model provider health check')
|
|
166
178
|
.option('--json', 'Output as JSON')
|
|
167
179
|
.action(async (model, options) => {
|
|
168
|
-
const
|
|
180
|
+
const provider = extractProvider(model) ?? model;
|
|
181
|
+
const spin = spinner(`Testing ${provider}...`).start();
|
|
169
182
|
try {
|
|
170
|
-
const result = await api.post(`/api/providers
|
|
183
|
+
const result = await api.post(`/api/chat/providers/${encodeURIComponent(provider)}/health`);
|
|
171
184
|
spin.stop();
|
|
172
185
|
if (!result.ok) {
|
|
173
|
-
error(result.error || `Failed to test ${
|
|
186
|
+
error(result.error || `Failed to test ${provider}`);
|
|
174
187
|
process.exit(1);
|
|
175
188
|
}
|
|
176
189
|
const data = result.data;
|
|
@@ -178,12 +191,12 @@ export function modelsCommands() {
|
|
|
178
191
|
console.log(JSON.stringify(data, null, 2));
|
|
179
192
|
return;
|
|
180
193
|
}
|
|
181
|
-
if (data.
|
|
194
|
+
if (data.healthy) {
|
|
182
195
|
const latency = data.latencyMs != null ? chalk.dim(` (${data.latencyMs}ms)`) : '';
|
|
183
|
-
success(`${chalk.cyan(
|
|
196
|
+
success(`${chalk.cyan(provider)} is healthy${latency}`);
|
|
184
197
|
}
|
|
185
198
|
else {
|
|
186
|
-
error(`${chalk.cyan(
|
|
199
|
+
error(`${chalk.cyan(provider)} health check failed: ${data.message || 'Unknown error'}`);
|
|
187
200
|
}
|
|
188
201
|
}
|
|
189
202
|
catch (err) {
|