@mragentix/cli 4.2.37
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/LICENSE +21 -0
- package/README.md +149 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +772 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +16 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +29 -0
- package/dist/config.js.map +1 -0
- package/dist/core/agent-session.d.ts +87 -0
- package/dist/core/agent-session.d.ts.map +1 -0
- package/dist/core/agent-session.js +498 -0
- package/dist/core/agent-session.js.map +1 -0
- package/dist/core/agents.d.ts +30 -0
- package/dist/core/agents.d.ts.map +1 -0
- package/dist/core/agents.js +91 -0
- package/dist/core/agents.js.map +1 -0
- package/dist/core/auth-storage.d.ts +35 -0
- package/dist/core/auth-storage.d.ts.map +1 -0
- package/dist/core/auth-storage.js +144 -0
- package/dist/core/auth-storage.js.map +1 -0
- package/dist/core/auto-update.d.ts +8 -0
- package/dist/core/auto-update.d.ts.map +1 -0
- package/dist/core/auto-update.js +152 -0
- package/dist/core/auto-update.js.map +1 -0
- package/dist/core/compaction/compactor.d.ts +69 -0
- package/dist/core/compaction/compactor.d.ts.map +1 -0
- package/dist/core/compaction/compactor.js +405 -0
- package/dist/core/compaction/compactor.js.map +1 -0
- package/dist/core/compaction/compactor.test.d.ts +2 -0
- package/dist/core/compaction/compactor.test.d.ts.map +1 -0
- package/dist/core/compaction/compactor.test.js +461 -0
- package/dist/core/compaction/compactor.test.js.map +1 -0
- package/dist/core/compaction/token-estimator.d.ts +10 -0
- package/dist/core/compaction/token-estimator.d.ts.map +1 -0
- package/dist/core/compaction/token-estimator.js +75 -0
- package/dist/core/compaction/token-estimator.js.map +1 -0
- package/dist/core/compaction/token-estimator.test.d.ts +2 -0
- package/dist/core/compaction/token-estimator.test.d.ts.map +1 -0
- package/dist/core/compaction/token-estimator.test.js +137 -0
- package/dist/core/compaction/token-estimator.test.js.map +1 -0
- package/dist/core/custom-commands.d.ts +13 -0
- package/dist/core/custom-commands.d.ts.map +1 -0
- package/dist/core/custom-commands.js +40 -0
- package/dist/core/custom-commands.js.map +1 -0
- package/dist/core/event-bus.d.ts +95 -0
- package/dist/core/event-bus.d.ts.map +1 -0
- package/dist/core/event-bus.js +99 -0
- package/dist/core/event-bus.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +8 -0
- package/dist/core/extensions/loader.d.ts.map +1 -0
- package/dist/core/extensions/loader.js +48 -0
- package/dist/core/extensions/loader.js.map +1 -0
- package/dist/core/extensions/types.d.ts +19 -0
- package/dist/core/extensions/types.d.ts.map +1 -0
- package/dist/core/extensions/types.js +2 -0
- package/dist/core/extensions/types.js.map +1 -0
- package/dist/core/file-lock.d.ts +6 -0
- package/dist/core/file-lock.d.ts.map +1 -0
- package/dist/core/file-lock.js +76 -0
- package/dist/core/file-lock.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/logger.d.ts +26 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +132 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/mcp/client.d.ts +9 -0
- package/dist/core/mcp/client.d.ts.map +1 -0
- package/dist/core/mcp/client.js +126 -0
- package/dist/core/mcp/client.js.map +1 -0
- package/dist/core/mcp/defaults.d.ts +9 -0
- package/dist/core/mcp/defaults.d.ts.map +1 -0
- package/dist/core/mcp/defaults.js +47 -0
- package/dist/core/mcp/defaults.js.map +1 -0
- package/dist/core/mcp/index.d.ts +4 -0
- package/dist/core/mcp/index.d.ts.map +1 -0
- package/dist/core/mcp/index.js +3 -0
- package/dist/core/mcp/index.js.map +1 -0
- package/dist/core/mcp/types.d.ts +15 -0
- package/dist/core/mcp/types.d.ts.map +1 -0
- package/dist/core/mcp/types.js +2 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/model-registry.d.ts +25 -0
- package/dist/core/model-registry.d.ts.map +1 -0
- package/dist/core/model-registry.js +135 -0
- package/dist/core/model-registry.js.map +1 -0
- package/dist/core/oauth/anthropic.d.ts +4 -0
- package/dist/core/oauth/anthropic.d.ts.map +1 -0
- package/dist/core/oauth/anthropic.js +75 -0
- package/dist/core/oauth/anthropic.js.map +1 -0
- package/dist/core/oauth/openai.d.ts +4 -0
- package/dist/core/oauth/openai.d.ts.map +1 -0
- package/dist/core/oauth/openai.js +186 -0
- package/dist/core/oauth/openai.js.map +1 -0
- package/dist/core/oauth/pkce.d.ts +5 -0
- package/dist/core/oauth/pkce.d.ts.map +1 -0
- package/dist/core/oauth/pkce.js +17 -0
- package/dist/core/oauth/pkce.js.map +1 -0
- package/dist/core/oauth/types.d.ts +12 -0
- package/dist/core/oauth/types.d.ts.map +1 -0
- package/dist/core/oauth/types.js +2 -0
- package/dist/core/oauth/types.js.map +1 -0
- package/dist/core/process-manager.d.ts +30 -0
- package/dist/core/process-manager.d.ts.map +1 -0
- package/dist/core/process-manager.js +130 -0
- package/dist/core/process-manager.js.map +1 -0
- package/dist/core/prompt-commands.d.ts +14 -0
- package/dist/core/prompt-commands.d.ts.map +1 -0
- package/dist/core/prompt-commands.js +496 -0
- package/dist/core/prompt-commands.js.map +1 -0
- package/dist/core/session-manager.d.ts +112 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +326 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/settings-manager.d.ts +43 -0
- package/dist/core/settings-manager.d.ts.map +1 -0
- package/dist/core/settings-manager.js +64 -0
- package/dist/core/settings-manager.js.map +1 -0
- package/dist/core/skills.d.ts +23 -0
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/skills.js +89 -0
- package/dist/core/skills.js.map +1 -0
- package/dist/core/slash-commands.d.ts +35 -0
- package/dist/core/slash-commands.d.ts.map +1 -0
- package/dist/core/slash-commands.js +183 -0
- package/dist/core/slash-commands.js.map +1 -0
- package/dist/core/telegram.d.ts +94 -0
- package/dist/core/telegram.d.ts.map +1 -0
- package/dist/core/telegram.js +227 -0
- package/dist/core/telegram.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/interactive.d.ts +3 -0
- package/dist/interactive.d.ts.map +1 -0
- package/dist/interactive.js +173 -0
- package/dist/interactive.js.map +1 -0
- package/dist/modes/index.d.ts +3 -0
- package/dist/modes/index.d.ts.map +1 -0
- package/dist/modes/index.js +3 -0
- package/dist/modes/index.js.map +1 -0
- package/dist/modes/json-mode.d.ts +13 -0
- package/dist/modes/json-mode.d.ts.map +1 -0
- package/dist/modes/json-mode.js +74 -0
- package/dist/modes/json-mode.js.map +1 -0
- package/dist/modes/print-mode.d.ts +12 -0
- package/dist/modes/print-mode.d.ts.map +1 -0
- package/dist/modes/print-mode.js +49 -0
- package/dist/modes/print-mode.js.map +1 -0
- package/dist/modes/rpc-mode.d.ts +28 -0
- package/dist/modes/rpc-mode.d.ts.map +1 -0
- package/dist/modes/rpc-mode.js +145 -0
- package/dist/modes/rpc-mode.js.map +1 -0
- package/dist/modes/serve-mode.d.ts +21 -0
- package/dist/modes/serve-mode.d.ts.map +1 -0
- package/dist/modes/serve-mode.js +649 -0
- package/dist/modes/serve-mode.js.map +1 -0
- package/dist/session.d.ts +16 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +129 -0
- package/dist/session.js.map +1 -0
- package/dist/system-prompt.d.ts +6 -0
- package/dist/system-prompt.d.ts.map +1 -0
- package/dist/system-prompt.js +115 -0
- package/dist/system-prompt.js.map +1 -0
- package/dist/tools/bash.d.ts +13 -0
- package/dist/tools/bash.d.ts.map +1 -0
- package/dist/tools/bash.js +165 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/edit-diff.d.ts +18 -0
- package/dist/tools/edit-diff.d.ts.map +1 -0
- package/dist/tools/edit-diff.js +92 -0
- package/dist/tools/edit-diff.js.map +1 -0
- package/dist/tools/edit.d.ts +11 -0
- package/dist/tools/edit.d.ts.map +1 -0
- package/dist/tools/edit.js +57 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/find.d.ts +9 -0
- package/dist/tools/find.d.ts.map +1 -0
- package/dist/tools/find.js +59 -0
- package/dist/tools/find.js.map +1 -0
- package/dist/tools/grep.d.ts +13 -0
- package/dist/tools/grep.d.ts.map +1 -0
- package/dist/tools/grep.js +121 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +30 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +50 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/ls.d.ts +10 -0
- package/dist/tools/ls.d.ts.map +1 -0
- package/dist/tools/ls.js +56 -0
- package/dist/tools/ls.js.map +1 -0
- package/dist/tools/operations.d.ts +39 -0
- package/dist/tools/operations.d.ts.map +1 -0
- package/dist/tools/operations.js +27 -0
- package/dist/tools/operations.js.map +1 -0
- package/dist/tools/path-utils.d.ts +7 -0
- package/dist/tools/path-utils.d.ts.map +1 -0
- package/dist/tools/path-utils.js +27 -0
- package/dist/tools/path-utils.js.map +1 -0
- package/dist/tools/read.d.ts +12 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +113 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/subagent.d.ts +26 -0
- package/dist/tools/subagent.d.ts.map +1 -0
- package/dist/tools/subagent.js +210 -0
- package/dist/tools/subagent.js.map +1 -0
- package/dist/tools/task-output.d.ts +10 -0
- package/dist/tools/task-output.d.ts.map +1 -0
- package/dist/tools/task-output.js +33 -0
- package/dist/tools/task-output.js.map +1 -0
- package/dist/tools/task-stop.d.ts +9 -0
- package/dist/tools/task-stop.d.ts.map +1 -0
- package/dist/tools/task-stop.js +15 -0
- package/dist/tools/task-stop.js.map +1 -0
- package/dist/tools/tasks.d.ts +16 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +132 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/truncate.d.ts +19 -0
- package/dist/tools/truncate.d.ts.map +1 -0
- package/dist/tools/truncate.js +59 -0
- package/dist/tools/truncate.js.map +1 -0
- package/dist/tools/truncate.test.d.ts +2 -0
- package/dist/tools/truncate.test.d.ts.map +1 -0
- package/dist/tools/truncate.test.js +100 -0
- package/dist/tools/truncate.test.js.map +1 -0
- package/dist/tools/web-fetch.d.ts +9 -0
- package/dist/tools/web-fetch.d.ts.map +1 -0
- package/dist/tools/web-fetch.js +97 -0
- package/dist/tools/web-fetch.js.map +1 -0
- package/dist/tools/write.d.ts +10 -0
- package/dist/tools/write.d.ts.map +1 -0
- package/dist/tools/write.js +30 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/tools/write.test.d.ts +2 -0
- package/dist/tools/write.test.d.ts.map +1 -0
- package/dist/tools/write.test.js +84 -0
- package/dist/tools/write.test.js.map +1 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/ui/App.d.ts +148 -0
- package/dist/ui/App.d.ts.map +1 -0
- package/dist/ui/App.js +1191 -0
- package/dist/ui/App.js.map +1 -0
- package/dist/ui/components/ActivityIndicator.d.ts +13 -0
- package/dist/ui/components/ActivityIndicator.d.ts.map +1 -0
- package/dist/ui/components/ActivityIndicator.js +313 -0
- package/dist/ui/components/ActivityIndicator.js.map +1 -0
- package/dist/ui/components/AnimationContext.d.ts +22 -0
- package/dist/ui/components/AnimationContext.d.ts.map +1 -0
- package/dist/ui/components/AnimationContext.js +35 -0
- package/dist/ui/components/AnimationContext.js.map +1 -0
- package/dist/ui/components/AssistantMessage.d.ts +9 -0
- package/dist/ui/components/AssistantMessage.d.ts.map +1 -0
- package/dist/ui/components/AssistantMessage.js +11 -0
- package/dist/ui/components/AssistantMessage.js.map +1 -0
- package/dist/ui/components/BackgroundTasksBar.d.ts +15 -0
- package/dist/ui/components/BackgroundTasksBar.d.ts.map +1 -0
- package/dist/ui/components/BackgroundTasksBar.js +74 -0
- package/dist/ui/components/BackgroundTasksBar.js.map +1 -0
- package/dist/ui/components/Banner.d.ts +11 -0
- package/dist/ui/components/Banner.d.ts.map +1 -0
- package/dist/ui/components/Banner.js +55 -0
- package/dist/ui/components/Banner.js.map +1 -0
- package/dist/ui/components/CompactionNotice.d.ts +10 -0
- package/dist/ui/components/CompactionNotice.d.ts.map +1 -0
- package/dist/ui/components/CompactionNotice.js +27 -0
- package/dist/ui/components/CompactionNotice.js.map +1 -0
- package/dist/ui/components/DiffView.d.ts +4 -0
- package/dist/ui/components/DiffView.d.ts.map +1 -0
- package/dist/ui/components/DiffView.js +20 -0
- package/dist/ui/components/DiffView.js.map +1 -0
- package/dist/ui/components/Footer.d.ts +10 -0
- package/dist/ui/components/Footer.d.ts.map +1 -0
- package/dist/ui/components/Footer.js +105 -0
- package/dist/ui/components/Footer.js.map +1 -0
- package/dist/ui/components/InputArea.d.ts +21 -0
- package/dist/ui/components/InputArea.d.ts.map +1 -0
- package/dist/ui/components/InputArea.js +465 -0
- package/dist/ui/components/InputArea.js.map +1 -0
- package/dist/ui/components/Markdown.d.ts +9 -0
- package/dist/ui/components/Markdown.d.ts.map +1 -0
- package/dist/ui/components/Markdown.js +246 -0
- package/dist/ui/components/Markdown.js.map +1 -0
- package/dist/ui/components/ModelSelector.d.ts +11 -0
- package/dist/ui/components/ModelSelector.d.ts.map +1 -0
- package/dist/ui/components/ModelSelector.js +20 -0
- package/dist/ui/components/ModelSelector.js.map +1 -0
- package/dist/ui/components/Overlay.d.ts +8 -0
- package/dist/ui/components/Overlay.d.ts.map +1 -0
- package/dist/ui/components/Overlay.js +9 -0
- package/dist/ui/components/Overlay.js.map +1 -0
- package/dist/ui/components/SelectList.d.ts +14 -0
- package/dist/ui/components/SelectList.d.ts.map +1 -0
- package/dist/ui/components/SelectList.js +46 -0
- package/dist/ui/components/SelectList.js.map +1 -0
- package/dist/ui/components/ServerToolExecution.d.ts +17 -0
- package/dist/ui/components/ServerToolExecution.d.ts.map +1 -0
- package/dist/ui/components/ServerToolExecution.js +26 -0
- package/dist/ui/components/ServerToolExecution.js.map +1 -0
- package/dist/ui/components/SessionSelector.d.ts +9 -0
- package/dist/ui/components/SessionSelector.d.ts.map +1 -0
- package/dist/ui/components/SessionSelector.js +13 -0
- package/dist/ui/components/SessionSelector.js.map +1 -0
- package/dist/ui/components/SettingsSelector.d.ts +9 -0
- package/dist/ui/components/SettingsSelector.d.ts.map +1 -0
- package/dist/ui/components/SettingsSelector.js +13 -0
- package/dist/ui/components/SettingsSelector.js.map +1 -0
- package/dist/ui/components/SlashCommandMenu.d.ts +15 -0
- package/dist/ui/components/SlashCommandMenu.d.ts.map +1 -0
- package/dist/ui/components/SlashCommandMenu.js +32 -0
- package/dist/ui/components/SlashCommandMenu.js.map +1 -0
- package/dist/ui/components/Spinner.d.ts +4 -0
- package/dist/ui/components/Spinner.d.ts.map +1 -0
- package/dist/ui/components/Spinner.js +13 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StreamingArea.d.ts +10 -0
- package/dist/ui/components/StreamingArea.d.ts.map +1 -0
- package/dist/ui/components/StreamingArea.js +58 -0
- package/dist/ui/components/StreamingArea.js.map +1 -0
- package/dist/ui/components/SubAgentPanel.d.ts +21 -0
- package/dist/ui/components/SubAgentPanel.d.ts.map +1 -0
- package/dist/ui/components/SubAgentPanel.js +71 -0
- package/dist/ui/components/SubAgentPanel.js.map +1 -0
- package/dist/ui/components/TaskOverlay.d.ts +10 -0
- package/dist/ui/components/TaskOverlay.d.ts.map +1 -0
- package/dist/ui/components/TaskOverlay.js +263 -0
- package/dist/ui/components/TaskOverlay.js.map +1 -0
- package/dist/ui/components/ThinkingBlock.d.ts +11 -0
- package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/ui/components/ThinkingBlock.js +43 -0
- package/dist/ui/components/ThinkingBlock.js.map +1 -0
- package/dist/ui/components/ThinkingIndicator.d.ts +6 -0
- package/dist/ui/components/ThinkingIndicator.d.ts.map +1 -0
- package/dist/ui/components/ThinkingIndicator.js +144 -0
- package/dist/ui/components/ThinkingIndicator.js.map +1 -0
- package/dist/ui/components/ToolExecution.d.ts +16 -0
- package/dist/ui/components/ToolExecution.d.ts.map +1 -0
- package/dist/ui/components/ToolExecution.js +490 -0
- package/dist/ui/components/ToolExecution.js.map +1 -0
- package/dist/ui/components/ToolGroupExecution.d.ts +7 -0
- package/dist/ui/components/ToolGroupExecution.d.ts.map +1 -0
- package/dist/ui/components/ToolGroupExecution.js +115 -0
- package/dist/ui/components/ToolGroupExecution.js.map +1 -0
- package/dist/ui/components/UserMessage.d.ts +7 -0
- package/dist/ui/components/UserMessage.d.ts.map +1 -0
- package/dist/ui/components/UserMessage.js +16 -0
- package/dist/ui/components/UserMessage.js.map +1 -0
- package/dist/ui/components/index.d.ts +15 -0
- package/dist/ui/components/index.d.ts.map +1 -0
- package/dist/ui/components/index.js +15 -0
- package/dist/ui/components/index.js.map +1 -0
- package/dist/ui/hooks/useAgentLoop.d.ts +69 -0
- package/dist/ui/hooks/useAgentLoop.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentLoop.js +483 -0
- package/dist/ui/hooks/useAgentLoop.js.map +1 -0
- package/dist/ui/hooks/useSessionManager.d.ts +13 -0
- package/dist/ui/hooks/useSessionManager.d.ts.map +1 -0
- package/dist/ui/hooks/useSessionManager.js +43 -0
- package/dist/ui/hooks/useSessionManager.js.map +1 -0
- package/dist/ui/hooks/useSlashCommands.d.ts +7 -0
- package/dist/ui/hooks/useSlashCommands.d.ts.map +1 -0
- package/dist/ui/hooks/useSlashCommands.js +11 -0
- package/dist/ui/hooks/useSlashCommands.js.map +1 -0
- package/dist/ui/hooks/useTerminalSize.d.ts +20 -0
- package/dist/ui/hooks/useTerminalSize.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalSize.js +55 -0
- package/dist/ui/hooks/useTerminalSize.js.map +1 -0
- package/dist/ui/hooks/useTerminalTitle.d.ts +3 -0
- package/dist/ui/hooks/useTerminalTitle.d.ts.map +1 -0
- package/dist/ui/hooks/useTerminalTitle.js +41 -0
- package/dist/ui/hooks/useTerminalTitle.js.map +1 -0
- package/dist/ui/live-item-flush.d.ts +59 -0
- package/dist/ui/live-item-flush.d.ts.map +1 -0
- package/dist/ui/live-item-flush.js +135 -0
- package/dist/ui/live-item-flush.js.map +1 -0
- package/dist/ui/live-item-flush.test.d.ts +2 -0
- package/dist/ui/live-item-flush.test.d.ts.map +1 -0
- package/dist/ui/live-item-flush.test.js +307 -0
- package/dist/ui/live-item-flush.test.js.map +1 -0
- package/dist/ui/login.d.ts +3 -0
- package/dist/ui/login.d.ts.map +1 -0
- package/dist/ui/login.js +117 -0
- package/dist/ui/login.js.map +1 -0
- package/dist/ui/render.d.ts +38 -0
- package/dist/ui/render.d.ts.map +1 -0
- package/dist/ui/render.js +72 -0
- package/dist/ui/render.js.map +1 -0
- package/dist/ui/sessions.d.ts +2 -0
- package/dist/ui/sessions.d.ts.map +1 -0
- package/dist/ui/sessions.js +208 -0
- package/dist/ui/sessions.js.map +1 -0
- package/dist/ui/spinner-frames.d.ts +3 -0
- package/dist/ui/spinner-frames.d.ts.map +1 -0
- package/dist/ui/spinner-frames.js +7 -0
- package/dist/ui/spinner-frames.js.map +1 -0
- package/dist/ui/theme/dark.json +24 -0
- package/dist/ui/theme/detect-theme.d.ts +12 -0
- package/dist/ui/theme/detect-theme.d.ts.map +1 -0
- package/dist/ui/theme/detect-theme.js +152 -0
- package/dist/ui/theme/detect-theme.js.map +1 -0
- package/dist/ui/theme/light.json +24 -0
- package/dist/ui/theme/theme.d.ts +29 -0
- package/dist/ui/theme/theme.d.ts.map +1 -0
- package/dist/ui/theme/theme.js +11 -0
- package/dist/ui/theme/theme.js.map +1 -0
- package/dist/ui/utils/highlight.d.ts +8 -0
- package/dist/ui/utils/highlight.d.ts.map +1 -0
- package/dist/ui/utils/highlight.js +49 -0
- package/dist/ui/utils/highlight.js.map +1 -0
- package/dist/ui/utils/table-text.d.ts +25 -0
- package/dist/ui/utils/table-text.d.ts.map +1 -0
- package/dist/ui/utils/table-text.js +78 -0
- package/dist/ui/utils/table-text.js.map +1 -0
- package/dist/ui/utils/table-text.test.d.ts +2 -0
- package/dist/ui/utils/table-text.test.d.ts.map +1 -0
- package/dist/ui/utils/table-text.test.js +202 -0
- package/dist/ui/utils/table-text.test.js.map +1 -0
- package/dist/utils/error-handler.d.ts +5 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +120 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/format.d.ts +21 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +120 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/git.d.ts +2 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +13 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/image.d.ts +30 -0
- package/dist/utils/image.d.ts.map +1 -0
- package/dist/utils/image.js +231 -0
- package/dist/utils/image.js.map +1 -0
- package/dist/utils/markdown.d.ts +6 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +25 -0
- package/dist/utils/markdown.js.map +1 -0
- package/dist/utils/process.d.ts +6 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +19 -0
- package/dist/utils/process.js.map +1 -0
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -0
- package/dist/utils/shell.js +8 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/sound.d.ts +2 -0
- package/dist/utils/sound.d.ts.map +1 -0
- package/dist/utils/sound.js +11 -0
- package/dist/utils/sound.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import crypto from "node:crypto";
|
|
6
|
+
// ── Session Manager ────────────────────────────────────────
|
|
7
|
+
function encodeCwd(cwd) {
|
|
8
|
+
return cwd.replace(/[\\/]/g, "_").replace(/:/g, "").replace(/^_/, "");
|
|
9
|
+
}
|
|
10
|
+
export class SessionManager {
|
|
11
|
+
sessionsDir;
|
|
12
|
+
constructor(sessionsDir) {
|
|
13
|
+
this.sessionsDir = sessionsDir;
|
|
14
|
+
}
|
|
15
|
+
dirForCwd(cwd) {
|
|
16
|
+
return path.join(this.sessionsDir, encodeCwd(cwd));
|
|
17
|
+
}
|
|
18
|
+
async create(cwd, provider, model) {
|
|
19
|
+
const id = crypto.randomUUID();
|
|
20
|
+
const timestamp = new Date().toISOString();
|
|
21
|
+
const dir = this.dirForCwd(cwd);
|
|
22
|
+
await fs.mkdir(dir, { recursive: true });
|
|
23
|
+
const fileName = `${timestamp.replace(/[:.]/g, "-")}_${id.slice(0, 8)}.jsonl`;
|
|
24
|
+
const filePath = path.join(dir, fileName);
|
|
25
|
+
const header = {
|
|
26
|
+
type: "session",
|
|
27
|
+
version: 2,
|
|
28
|
+
id,
|
|
29
|
+
timestamp,
|
|
30
|
+
cwd,
|
|
31
|
+
provider,
|
|
32
|
+
model,
|
|
33
|
+
leafId: null,
|
|
34
|
+
};
|
|
35
|
+
await fs.appendFile(filePath, JSON.stringify(header) + "\n", "utf-8");
|
|
36
|
+
return { id, path: filePath, header };
|
|
37
|
+
}
|
|
38
|
+
async load(sessionPath) {
|
|
39
|
+
// Stream the JSONL file line-by-line instead of loading the entire
|
|
40
|
+
// file into memory. For large sessions (100MB+) this avoids holding
|
|
41
|
+
// the raw string, the split array, and the parsed objects all at once.
|
|
42
|
+
let header = null;
|
|
43
|
+
const entries = [];
|
|
44
|
+
const rl = createInterface({
|
|
45
|
+
input: createReadStream(sessionPath, { encoding: "utf-8" }),
|
|
46
|
+
crlfDelay: Infinity,
|
|
47
|
+
});
|
|
48
|
+
for await (const line of rl) {
|
|
49
|
+
if (!line)
|
|
50
|
+
continue;
|
|
51
|
+
try {
|
|
52
|
+
const parsed = JSON.parse(line);
|
|
53
|
+
if (parsed.type === "session") {
|
|
54
|
+
if (parsed.version === 2) {
|
|
55
|
+
header = parsed;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// Upgrade v1 to v2
|
|
59
|
+
const v1 = parsed;
|
|
60
|
+
header = {
|
|
61
|
+
type: "session",
|
|
62
|
+
version: 2,
|
|
63
|
+
id: v1.id,
|
|
64
|
+
timestamp: v1.timestamp,
|
|
65
|
+
cwd: v1.cwd,
|
|
66
|
+
provider: v1.provider,
|
|
67
|
+
model: v1.model,
|
|
68
|
+
leafId: null,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (parsed.type === "message") {
|
|
73
|
+
// v1 compat: entries without id/parentId
|
|
74
|
+
const entry = parsed;
|
|
75
|
+
if (!entry.id) {
|
|
76
|
+
entry.id = crypto.randomUUID();
|
|
77
|
+
entry.parentId = null;
|
|
78
|
+
}
|
|
79
|
+
entries.push(entry);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
entries.push(parsed);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// Skip malformed JSON lines — a corrupt line shouldn't crash the session
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (!header) {
|
|
90
|
+
throw new Error(`Invalid session file: no header found in ${sessionPath}`);
|
|
91
|
+
}
|
|
92
|
+
return { header, entries };
|
|
93
|
+
}
|
|
94
|
+
async list(cwd) {
|
|
95
|
+
const dir = this.dirForCwd(cwd);
|
|
96
|
+
let files;
|
|
97
|
+
try {
|
|
98
|
+
files = await fs.readdir(dir);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
const sessions = [];
|
|
104
|
+
for (const file of files) {
|
|
105
|
+
if (!file.endsWith(".jsonl"))
|
|
106
|
+
continue;
|
|
107
|
+
const filePath = path.join(dir, file);
|
|
108
|
+
try {
|
|
109
|
+
// Stream line-by-line to avoid loading entire file for listing
|
|
110
|
+
const rl = createInterface({
|
|
111
|
+
input: createReadStream(filePath, { encoding: "utf-8" }),
|
|
112
|
+
crlfDelay: Infinity,
|
|
113
|
+
});
|
|
114
|
+
let first = null;
|
|
115
|
+
let messageCount = 0;
|
|
116
|
+
for await (const line of rl) {
|
|
117
|
+
if (!line)
|
|
118
|
+
continue;
|
|
119
|
+
try {
|
|
120
|
+
const parsed = JSON.parse(line);
|
|
121
|
+
if (!first) {
|
|
122
|
+
if (parsed.type !== "session")
|
|
123
|
+
break;
|
|
124
|
+
first = parsed;
|
|
125
|
+
}
|
|
126
|
+
else if (parsed.type === "message") {
|
|
127
|
+
messageCount++;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
// Skip malformed lines
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!first || first.type !== "session")
|
|
135
|
+
continue;
|
|
136
|
+
sessions.push({
|
|
137
|
+
id: first.id,
|
|
138
|
+
path: filePath,
|
|
139
|
+
timestamp: first.timestamp,
|
|
140
|
+
cwd: first.cwd,
|
|
141
|
+
messageCount,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
// Skip corrupt files
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
sessions.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
|
149
|
+
return sessions;
|
|
150
|
+
}
|
|
151
|
+
async getMostRecent(cwd) {
|
|
152
|
+
const sessions = await this.list(cwd);
|
|
153
|
+
const withMessages = sessions.find((s) => s.messageCount > 0);
|
|
154
|
+
return withMessages?.path ?? null;
|
|
155
|
+
}
|
|
156
|
+
async appendEntry(sessionPath, entry) {
|
|
157
|
+
await fs.appendFile(sessionPath, JSON.stringify(entry) + "\n", "utf-8");
|
|
158
|
+
}
|
|
159
|
+
async updateLeaf(sessionPath, leafId) {
|
|
160
|
+
// Read only the first line (the header) instead of loading the entire file.
|
|
161
|
+
// For large session files (100MB+), this avoids a full file read+write.
|
|
162
|
+
const fd = await fs.open(sessionPath, "r+");
|
|
163
|
+
try {
|
|
164
|
+
// Read enough bytes to cover the header line (typically <500 bytes)
|
|
165
|
+
const buf = Buffer.alloc(4096);
|
|
166
|
+
const { bytesRead } = await fd.read(buf, 0, 4096, 0);
|
|
167
|
+
const chunk = buf.toString("utf-8", 0, bytesRead);
|
|
168
|
+
const newlineIdx = chunk.indexOf("\n");
|
|
169
|
+
if (newlineIdx === -1)
|
|
170
|
+
return;
|
|
171
|
+
const headerLine = chunk.slice(0, newlineIdx);
|
|
172
|
+
const header = JSON.parse(headerLine);
|
|
173
|
+
if (header.type !== "session")
|
|
174
|
+
return;
|
|
175
|
+
header.leafId = leafId;
|
|
176
|
+
const newHeaderLine = JSON.stringify(header);
|
|
177
|
+
if (newHeaderLine.length === headerLine.length) {
|
|
178
|
+
// Same length — overwrite in place (fast path)
|
|
179
|
+
await fd.write(newHeaderLine, 0, "utf-8");
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
// Different length — must rewrite the file (rare: only on first leafId set)
|
|
183
|
+
await fd.close();
|
|
184
|
+
const content = await fs.readFile(sessionPath, "utf-8");
|
|
185
|
+
const firstNewline = content.indexOf("\n");
|
|
186
|
+
await fs.writeFile(sessionPath, newHeaderLine + content.slice(firstNewline), "utf-8");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
// fd.close() may have already been called in the else branch above,
|
|
192
|
+
// but calling it again on a closed handle is a no-op in Node >= 20.
|
|
193
|
+
await fd.close().catch(() => { });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get messages for the current branch. If leafId is set, walks the
|
|
198
|
+
* DAG from leaf to root. Otherwise returns all entries linearly.
|
|
199
|
+
*/
|
|
200
|
+
getMessages(entries, leafId) {
|
|
201
|
+
const branch = leafId ? this.getBranch(entries, leafId) : entries;
|
|
202
|
+
const messages = branch
|
|
203
|
+
.filter((e) => e.type === "message")
|
|
204
|
+
.map((e) => e.message)
|
|
205
|
+
.filter((m) => m.role !== "system");
|
|
206
|
+
// Repair orphaned tool_use blocks that lack matching tool_result messages.
|
|
207
|
+
// This can happen when a session is interrupted mid-tool-execution.
|
|
208
|
+
return SessionManager.repairToolPairs(messages);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Ensure every assistant message with tool_use blocks is followed by a tool
|
|
212
|
+
* message containing matching tool_result entries. Inserts synthetic
|
|
213
|
+
* tool_result messages where needed to prevent Anthropic API 400 errors.
|
|
214
|
+
*/
|
|
215
|
+
static repairToolPairs(messages) {
|
|
216
|
+
const repaired = [];
|
|
217
|
+
for (let i = 0; i < messages.length; i++) {
|
|
218
|
+
const msg = messages[i];
|
|
219
|
+
repaired.push(msg);
|
|
220
|
+
if (msg.role !== "assistant")
|
|
221
|
+
continue;
|
|
222
|
+
const content = Array.isArray(msg.content) ? msg.content : [];
|
|
223
|
+
const toolUseIds = content
|
|
224
|
+
.filter((p) => p.type === "tool_call")
|
|
225
|
+
.map((p) => p.id);
|
|
226
|
+
if (toolUseIds.length === 0)
|
|
227
|
+
continue;
|
|
228
|
+
// Check if the next message is a tool message with matching results
|
|
229
|
+
const next = messages[i + 1];
|
|
230
|
+
if (next?.role === "tool" && Array.isArray(next.content)) {
|
|
231
|
+
const existingIds = new Set(next.content.map((r) => r.toolCallId));
|
|
232
|
+
const missing = toolUseIds.filter((id) => !existingIds.has(id));
|
|
233
|
+
if (missing.length > 0) {
|
|
234
|
+
// Patch the existing tool message with missing results
|
|
235
|
+
for (const id of missing) {
|
|
236
|
+
next.content.push({
|
|
237
|
+
type: "tool_result",
|
|
238
|
+
toolCallId: id,
|
|
239
|
+
content: "Tool execution was interrupted.",
|
|
240
|
+
isError: true,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
// No tool message follows — insert a synthetic one
|
|
247
|
+
repaired.push({
|
|
248
|
+
role: "tool",
|
|
249
|
+
content: toolUseIds.map((id) => ({
|
|
250
|
+
type: "tool_result",
|
|
251
|
+
toolCallId: id,
|
|
252
|
+
content: "Tool execution was interrupted.",
|
|
253
|
+
isError: true,
|
|
254
|
+
})),
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return repaired;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Build a lookup Map from entry id → entry. Reusable across multiple
|
|
262
|
+
* getBranch / listBranches calls on the same entry set.
|
|
263
|
+
*/
|
|
264
|
+
buildIndex(entries) {
|
|
265
|
+
return new Map(entries.map((e) => [e.id, e]));
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Walk the DAG from a leaf entry back to the root, returning entries
|
|
269
|
+
* in chronological order (root → leaf). This is the "branch" — the
|
|
270
|
+
* path through the conversation tree that leads to the given leaf.
|
|
271
|
+
*
|
|
272
|
+
* Accepts an optional pre-built index to avoid redundant Map allocations
|
|
273
|
+
* when called in a loop.
|
|
274
|
+
*/
|
|
275
|
+
getBranch(entries, leafId, byId) {
|
|
276
|
+
if (!leafId)
|
|
277
|
+
return entries;
|
|
278
|
+
const index = byId ?? this.buildIndex(entries);
|
|
279
|
+
const branch = [];
|
|
280
|
+
let current = leafId;
|
|
281
|
+
while (current) {
|
|
282
|
+
const entry = index.get(current);
|
|
283
|
+
if (!entry)
|
|
284
|
+
break;
|
|
285
|
+
branch.push(entry);
|
|
286
|
+
current = entry.parentId;
|
|
287
|
+
}
|
|
288
|
+
return branch.reverse();
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* List all branches (leaf nodes) in a session's entry DAG.
|
|
292
|
+
* A leaf is any entry whose id is not referenced as a parentId by any other entry.
|
|
293
|
+
*/
|
|
294
|
+
listBranches(entries) {
|
|
295
|
+
if (entries.length === 0)
|
|
296
|
+
return [];
|
|
297
|
+
// Build shared index once — reused by every getBranch call below
|
|
298
|
+
const byId = this.buildIndex(entries);
|
|
299
|
+
// Find all ids that are referenced as parentId
|
|
300
|
+
const parentIds = new Set(entries.map((e) => e.parentId).filter(Boolean));
|
|
301
|
+
// Leaves = entries whose id is NOT in parentIds
|
|
302
|
+
const leaves = entries.filter((e) => !parentIds.has(e.id));
|
|
303
|
+
// Build childCount once — was previously rebuilt per-leaf (O(n²))
|
|
304
|
+
const childCount = new Map();
|
|
305
|
+
for (const e of entries) {
|
|
306
|
+
childCount.set(e.parentId, (childCount.get(e.parentId) ?? 0) + 1);
|
|
307
|
+
}
|
|
308
|
+
return leaves.map((leaf) => {
|
|
309
|
+
const branch = this.getBranch(entries, leaf.id, byId);
|
|
310
|
+
let branchPointId = branch[0]?.id ?? leaf.id;
|
|
311
|
+
for (const e of branch) {
|
|
312
|
+
if ((childCount.get(e.parentId) ?? 0) > 1) {
|
|
313
|
+
branchPointId = e.id;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return {
|
|
318
|
+
branchPointId,
|
|
319
|
+
leafId: leaf.id,
|
|
320
|
+
entryCount: branch.length,
|
|
321
|
+
timestamp: branch[0]?.timestamp ?? leaf.timestamp,
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
//# sourceMappingURL=session-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-manager.js","sourceRoot":"","sources":["../../src/core/session-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe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ACpE,CAAC;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACzB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;YAEtD,IAAI,aAAa,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;YAC7C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;gBACvB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC1C,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC;oBACrB,MAAM;gBACR,CAAC;YACH,CAAC;YAED,OAAO;gBACL,aAAa;gBACb,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,UAAU,EAAE,MAAM,CAAC,MAAM;gBACzB,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,IAAI,CAAC,SAAS;aAClD,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const SettingsSchema: z.ZodObject<{
|
|
3
|
+
autoCompact: z.ZodDefault<z.ZodBoolean>;
|
|
4
|
+
compactThreshold: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
defaultProvider: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
anthropic: "anthropic";
|
|
7
|
+
openai: "openai";
|
|
8
|
+
glm: "glm";
|
|
9
|
+
moonshot: "moonshot";
|
|
10
|
+
}>>;
|
|
11
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
12
|
+
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
13
|
+
thinkingEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
thinkingLevel: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
low: "low";
|
|
16
|
+
medium: "medium";
|
|
17
|
+
high: "high";
|
|
18
|
+
max: "max";
|
|
19
|
+
}>>;
|
|
20
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
21
|
+
light: "light";
|
|
22
|
+
dark: "dark";
|
|
23
|
+
auto: "auto";
|
|
24
|
+
}>>;
|
|
25
|
+
showTokenUsage: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
showThinking: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
enabledTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type Settings = z.infer<typeof SettingsSchema>;
|
|
30
|
+
export declare const DEFAULT_SETTINGS: Settings;
|
|
31
|
+
export declare class SettingsManager {
|
|
32
|
+
private settings;
|
|
33
|
+
private filePath;
|
|
34
|
+
private loaded;
|
|
35
|
+
constructor(filePath?: string);
|
|
36
|
+
load(): Promise<Settings>;
|
|
37
|
+
save(): Promise<void>;
|
|
38
|
+
get<K extends keyof Settings>(key: K): Settings[K];
|
|
39
|
+
set<K extends keyof Settings>(key: K, value: Settings[K]): Promise<void>;
|
|
40
|
+
getAll(): Settings;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=settings-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-manager.d.ts","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYlB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,gBAAgB,EAAE,QAS9B,CAAC;AAIF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAEX,QAAQ,CAAC,EAAE,MAAM;IAIvB,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC;IAazB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,GAAG,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC;IAI5C,GAAG,CAAC,CAAC,SAAS,MAAM,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAK9E,MAAM,IAAI,QAAQ;CAGnB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { getAppPaths } from "../config.js";
|
|
4
|
+
// ── Settings Schema ────────────────────────────────────────
|
|
5
|
+
const SettingsSchema = z.object({
|
|
6
|
+
autoCompact: z.boolean().default(true),
|
|
7
|
+
compactThreshold: z.number().min(0.1).max(1.0).default(0.8),
|
|
8
|
+
defaultProvider: z.enum(["anthropic", "openai", "glm", "moonshot"]).default("anthropic"),
|
|
9
|
+
defaultModel: z.string().optional(),
|
|
10
|
+
maxTokens: z.number().int().min(256).default(16384),
|
|
11
|
+
thinkingEnabled: z.boolean().default(false),
|
|
12
|
+
thinkingLevel: z.enum(["low", "medium", "high", "max"]).optional(),
|
|
13
|
+
theme: z.enum(["auto", "dark", "light"]).default("auto"),
|
|
14
|
+
showTokenUsage: z.boolean().default(true),
|
|
15
|
+
showThinking: z.boolean().default(true),
|
|
16
|
+
enabledTools: z.array(z.string()).optional(),
|
|
17
|
+
});
|
|
18
|
+
export const DEFAULT_SETTINGS = {
|
|
19
|
+
autoCompact: true,
|
|
20
|
+
compactThreshold: 0.8,
|
|
21
|
+
defaultProvider: "anthropic",
|
|
22
|
+
maxTokens: 16384,
|
|
23
|
+
thinkingEnabled: false,
|
|
24
|
+
theme: "auto",
|
|
25
|
+
showTokenUsage: true,
|
|
26
|
+
showThinking: true,
|
|
27
|
+
};
|
|
28
|
+
// ── Settings Manager ───────────────────────────────────────
|
|
29
|
+
export class SettingsManager {
|
|
30
|
+
settings = { ...DEFAULT_SETTINGS };
|
|
31
|
+
filePath;
|
|
32
|
+
loaded = false;
|
|
33
|
+
constructor(filePath) {
|
|
34
|
+
this.filePath = filePath ?? getAppPaths().settingsFile;
|
|
35
|
+
}
|
|
36
|
+
async load() {
|
|
37
|
+
try {
|
|
38
|
+
const content = await fs.readFile(this.filePath, "utf-8");
|
|
39
|
+
const raw = JSON.parse(content);
|
|
40
|
+
// Merge with defaults so new fields get default values
|
|
41
|
+
this.settings = SettingsSchema.parse({ ...DEFAULT_SETTINGS, ...raw });
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
this.settings = { ...DEFAULT_SETTINGS };
|
|
45
|
+
}
|
|
46
|
+
this.loaded = true;
|
|
47
|
+
return this.settings;
|
|
48
|
+
}
|
|
49
|
+
async save() {
|
|
50
|
+
const content = JSON.stringify(this.settings, null, 2);
|
|
51
|
+
await fs.writeFile(this.filePath, content, "utf-8");
|
|
52
|
+
}
|
|
53
|
+
get(key) {
|
|
54
|
+
return this.settings[key];
|
|
55
|
+
}
|
|
56
|
+
async set(key, value) {
|
|
57
|
+
this.settings[key] = value;
|
|
58
|
+
await this.save();
|
|
59
|
+
}
|
|
60
|
+
getAll() {
|
|
61
|
+
return { ...this.settings };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=settings-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-manager.js","sourceRoot":"","sources":["../../src/core/settings-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;A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GAAG,CAA2B,GAAM;QAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,GAAG,CAA2B,GAAM,EAAE,KAAkB;QAC5D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC3B,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface Skill {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
content: string;
|
|
5
|
+
source: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Discover skills from global and project-local skill directories.
|
|
9
|
+
*/
|
|
10
|
+
export declare function discoverSkills(options: {
|
|
11
|
+
globalSkillsDir: string;
|
|
12
|
+
projectDir?: string;
|
|
13
|
+
}): Promise<Skill[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Parse a skill file with optional frontmatter.
|
|
16
|
+
* Supports simple key: value frontmatter between --- delimiters.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseSkillFile(raw: string, source: string): Skill;
|
|
19
|
+
/**
|
|
20
|
+
* Format skills into a system prompt section.
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatSkillsForPrompt(skills: Skill[]): string;
|
|
23
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE;IAC5C,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAenB;AA+BD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,KAAK,CAwBjE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAW7D"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Discover skills from global and project-local skill directories.
|
|
5
|
+
*/
|
|
6
|
+
export async function discoverSkills(options) {
|
|
7
|
+
const skills = [];
|
|
8
|
+
// Global skills: ~/.mragentix/skills/*.md
|
|
9
|
+
const globalSkills = await loadSkillsFromDir(options.globalSkillsDir, "global");
|
|
10
|
+
skills.push(...globalSkills);
|
|
11
|
+
// Project skills: {cwd}/.mragentix/skills/*.md
|
|
12
|
+
if (options.projectDir) {
|
|
13
|
+
const projectSkillsDir = path.join(options.projectDir, ".mragentix", "skills");
|
|
14
|
+
const projectSkills = await loadSkillsFromDir(projectSkillsDir, "project");
|
|
15
|
+
skills.push(...projectSkills);
|
|
16
|
+
}
|
|
17
|
+
return skills;
|
|
18
|
+
}
|
|
19
|
+
async function loadSkillsFromDir(dir, source) {
|
|
20
|
+
const skills = [];
|
|
21
|
+
let files;
|
|
22
|
+
try {
|
|
23
|
+
files = await fs.readdir(dir);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return skills;
|
|
27
|
+
}
|
|
28
|
+
for (const file of files) {
|
|
29
|
+
if (!file.endsWith(".md"))
|
|
30
|
+
continue;
|
|
31
|
+
const filePath = path.join(dir, file);
|
|
32
|
+
try {
|
|
33
|
+
const content = await fs.readFile(filePath, "utf-8");
|
|
34
|
+
const skill = parseSkillFile(content, source);
|
|
35
|
+
if (!skill.name) {
|
|
36
|
+
skill.name = path.basename(file, ".md");
|
|
37
|
+
}
|
|
38
|
+
skills.push(skill);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Skip unreadable files
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return skills;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse a skill file with optional frontmatter.
|
|
48
|
+
* Supports simple key: value frontmatter between --- delimiters.
|
|
49
|
+
*/
|
|
50
|
+
export function parseSkillFile(raw, source) {
|
|
51
|
+
let name = "";
|
|
52
|
+
let description = "";
|
|
53
|
+
let content = raw;
|
|
54
|
+
// Check for frontmatter
|
|
55
|
+
if (raw.startsWith("---")) {
|
|
56
|
+
const endIndex = raw.indexOf("---", 3);
|
|
57
|
+
if (endIndex !== -1) {
|
|
58
|
+
const frontmatter = raw.slice(3, endIndex).trim();
|
|
59
|
+
content = raw.slice(endIndex + 3).trim();
|
|
60
|
+
for (const line of frontmatter.split("\n")) {
|
|
61
|
+
const colonIndex = line.indexOf(":");
|
|
62
|
+
if (colonIndex === -1)
|
|
63
|
+
continue;
|
|
64
|
+
const key = line.slice(0, colonIndex).trim().toLowerCase();
|
|
65
|
+
const value = line.slice(colonIndex + 1).trim();
|
|
66
|
+
if (key === "name")
|
|
67
|
+
name = value;
|
|
68
|
+
else if (key === "description")
|
|
69
|
+
description = value;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { name, description, content, source };
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Format skills into a system prompt section.
|
|
77
|
+
*/
|
|
78
|
+
export function formatSkillsForPrompt(skills) {
|
|
79
|
+
if (skills.length === 0)
|
|
80
|
+
return "";
|
|
81
|
+
const parts = ["## Skills\n"];
|
|
82
|
+
for (const skill of skills) {
|
|
83
|
+
parts.push(`### ${skill.name}${skill.description ? ` — ${skill.description}` : ""}`);
|
|
84
|
+
parts.push(skill.content);
|
|
85
|
+
parts.push("");
|
|
86
|
+
}
|
|
87
|
+
return parts.join("\n");
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/core/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAS7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,OAGpC;IACC,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,0CAA0C;IAC1C,MAAM,YAAY,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IAChF,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,CAAC;IAE7B,+CAA+C;IAC/C,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC/E,MAAM,aAAa,GAAG,MAAM,iBAAiB,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;QAC3E,MAAM,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,GAAW,EAAE,MAAc;IAC1D,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,IAAI,KAAe,CAAC;IACpB,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ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;
|
|
3
|
+
compact: () => Promise<void>;
|
|
4
|
+
newSession: () => Promise<void>;
|
|
5
|
+
listSessions: () => Promise<string>;
|
|
6
|
+
getSettings: () => Record<string, unknown>;
|
|
7
|
+
setSetting: (key: string, value: unknown) => Promise<void>;
|
|
8
|
+
getModelList: () => string;
|
|
9
|
+
quit: () => void;
|
|
10
|
+
/** Create a branch (rewind N messages and fork). */
|
|
11
|
+
branch: (stepsBack?: number) => Promise<string>;
|
|
12
|
+
/** List all branches in the current session. */
|
|
13
|
+
listBranches: () => Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
export interface SlashCommand {
|
|
16
|
+
name: string;
|
|
17
|
+
aliases: string[];
|
|
18
|
+
description: string;
|
|
19
|
+
usage: string;
|
|
20
|
+
execute: (args: string, context: SlashCommandContext) => Promise<string> | string;
|
|
21
|
+
}
|
|
22
|
+
export declare class SlashCommandRegistry {
|
|
23
|
+
private commands;
|
|
24
|
+
register(command: SlashCommand): void;
|
|
25
|
+
unregister(name: string): void;
|
|
26
|
+
get(name: string): SlashCommand | undefined;
|
|
27
|
+
getAll(): SlashCommand[];
|
|
28
|
+
parse(input: string): {
|
|
29
|
+
name: string;
|
|
30
|
+
args: string;
|
|
31
|
+
} | null;
|
|
32
|
+
execute(input: string, context: SlashCommandContext): Promise<string | null>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createBuiltinCommands(): SlashCommand[];
|
|
35
|
+
//# sourceMappingURL=slash-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAElC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,UAAU,EAAE,MAAM,OAAO,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