indusagi-coding-agent 0.1.46 → 0.1.48
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/CHANGELOG.md +12 -0
- package/dist/command-line/args.js +1 -1
- package/dist/command-line/args.js.map +1 -1
- package/dist/command-line/login-handler.d.ts.map +1 -1
- package/dist/command-line/login-handler.js +3 -1
- package/dist/command-line/login-handler.js.map +1 -1
- package/dist/command-line/session-picker.d.ts.map +1 -1
- package/dist/command-line/session-picker.js +26 -48
- package/dist/command-line/session-picker.js.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/helpers/open-auth-url.d.ts +2 -0
- package/dist/helpers/open-auth-url.d.ts.map +1 -0
- package/dist/helpers/open-auth-url.js +54 -0
- package/dist/helpers/open-auth-url.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +1 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/react-ink/adapters/command-router.d.ts +19 -0
- package/dist/interfaces/react-ink/adapters/command-router.d.ts.map +1 -0
- package/dist/interfaces/react-ink/adapters/command-router.js +674 -0
- package/dist/interfaces/react-ink/adapters/command-router.js.map +1 -0
- package/dist/interfaces/react-ink/adapters/session-events.d.ts +5 -0
- package/dist/interfaces/react-ink/adapters/session-events.d.ts.map +1 -0
- package/dist/interfaces/react-ink/adapters/session-events.js +76 -0
- package/dist/interfaces/react-ink/adapters/session-events.js.map +1 -0
- package/dist/interfaces/react-ink/adapters/session-history.d.ts +14 -0
- package/dist/interfaces/react-ink/adapters/session-history.d.ts.map +1 -0
- package/dist/interfaces/react-ink/adapters/session-history.js +83 -0
- package/dist/interfaces/react-ink/adapters/session-history.js.map +1 -0
- package/dist/interfaces/react-ink/adapters/tool-state.d.ts +4 -0
- package/dist/interfaces/react-ink/adapters/tool-state.d.ts.map +1 -0
- package/dist/interfaces/react-ink/adapters/tool-state.js +67 -0
- package/dist/interfaces/react-ink/adapters/tool-state.js.map +1 -0
- package/dist/interfaces/react-ink/components/AppShell.d.ts +17 -0
- package/dist/interfaces/react-ink/components/AppShell.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/AppShell.js +1465 -0
- package/dist/interfaces/react-ink/components/AppShell.js.map +1 -0
- package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts +9 -0
- package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/ChangelogBlock.js +58 -0
- package/dist/interfaces/react-ink/components/ChangelogBlock.js.map +1 -0
- package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts +9 -0
- package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/DisplayBlockView.js +11 -0
- package/dist/interfaces/react-ink/components/DisplayBlockView.js.map +1 -0
- package/dist/interfaces/react-ink/components/Footer.d.ts +11 -0
- package/dist/interfaces/react-ink/components/Footer.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/Footer.js +18 -0
- package/dist/interfaces/react-ink/components/Footer.js.map +1 -0
- package/dist/interfaces/react-ink/components/Header.d.ts +14 -0
- package/dist/interfaces/react-ink/components/Header.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/Header.js +24 -0
- package/dist/interfaces/react-ink/components/Header.js.map +1 -0
- package/dist/interfaces/react-ink/components/MessageList.d.ts +14 -0
- package/dist/interfaces/react-ink/components/MessageList.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/MessageList.js +43 -0
- package/dist/interfaces/react-ink/components/MessageList.js.map +1 -0
- package/dist/interfaces/react-ink/components/MessageRow.d.ts +13 -0
- package/dist/interfaces/react-ink/components/MessageRow.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/MessageRow.js +35 -0
- package/dist/interfaces/react-ink/components/MessageRow.js.map +1 -0
- package/dist/interfaces/react-ink/components/PromptInput.d.ts +35 -0
- package/dist/interfaces/react-ink/components/PromptInput.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/PromptInput.js +319 -0
- package/dist/interfaces/react-ink/components/PromptInput.js.map +1 -0
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts +9 -0
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js +14 -0
- package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js.map +1 -0
- package/dist/interfaces/react-ink/components/StatusLine.d.ts +10 -0
- package/dist/interfaces/react-ink/components/StatusLine.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/StatusLine.js +39 -0
- package/dist/interfaces/react-ink/components/StatusLine.js.map +1 -0
- package/dist/interfaces/react-ink/components/TaskPanel.d.ts +10 -0
- package/dist/interfaces/react-ink/components/TaskPanel.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/TaskPanel.js +23 -0
- package/dist/interfaces/react-ink/components/TaskPanel.js.map +1 -0
- package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts +18 -0
- package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/ToolEventBlock.js +61 -0
- package/dist/interfaces/react-ink/components/ToolEventBlock.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts +9 -0
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js +6 -0
- package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts +15 -0
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js +10 -0
- package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts +10 -0
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js +64 -0
- package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts +10 -0
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js +24 -0
- package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts +10 -0
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js +95 -0
- package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts +17 -0
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js +66 -0
- package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts +11 -0
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js +10 -0
- package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts +15 -0
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js +79 -0
- package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts +10 -0
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js +99 -0
- package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts +8 -0
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js +7 -0
- package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts +9 -0
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js +7 -0
- package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts +9 -0
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js +7 -0
- package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js.map +1 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts +30 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js +106 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js.map +1 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts +20 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js +144 -0
- package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts +12 -0
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.js +20 -0
- package/dist/interfaces/react-ink/components/messages/AssistantMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts +9 -0
- package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/BashMessage.js +11 -0
- package/dist/interfaces/react-ink/components/messages/BashMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts +9 -0
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js +6 -0
- package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts +9 -0
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.js +6 -0
- package/dist/interfaces/react-ink/components/messages/CompactionMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts +10 -0
- package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/CustomMessage.js +9 -0
- package/dist/interfaces/react-ink/components/messages/CustomMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts +8 -0
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js +10 -0
- package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts +9 -0
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js +8 -0
- package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts +12 -0
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js +8 -0
- package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js.map +1 -0
- package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts +10 -0
- package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts.map +1 -0
- package/dist/interfaces/react-ink/components/messages/UserMessage.js +7 -0
- package/dist/interfaces/react-ink/components/messages/UserMessage.js.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts +8 -0
- package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-agent-session.js +34 -0
- package/dist/interfaces/react-ink/hooks/use-agent-session.js.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts +12 -0
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.js +17 -0
- package/dist/interfaces/react-ink/hooks/use-app-keybindings.js.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts +7 -0
- package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-footer-data.js +17 -0
- package/dist/interfaces/react-ink/hooks/use-footer-data.js.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts +17 -0
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.js +66 -0
- package/dist/interfaces/react-ink/hooks/use-prompt-submit.js.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-session-history.d.ts +8 -0
- package/dist/interfaces/react-ink/hooks/use-session-history.d.ts.map +1 -0
- package/dist/interfaces/react-ink/hooks/use-session-history.js +8 -0
- package/dist/interfaces/react-ink/hooks/use-session-history.js.map +1 -0
- package/dist/interfaces/react-ink/index.d.ts +8 -0
- package/dist/interfaces/react-ink/index.d.ts.map +1 -0
- package/dist/interfaces/react-ink/index.js +8 -0
- package/dist/interfaces/react-ink/index.js.map +1 -0
- package/dist/interfaces/react-ink/interactive-mode.d.ts +24 -0
- package/dist/interfaces/react-ink/interactive-mode.d.ts.map +1 -0
- package/dist/interfaces/react-ink/interactive-mode.js +57 -0
- package/dist/interfaces/react-ink/interactive-mode.js.map +1 -0
- package/dist/interfaces/react-ink/render-root.d.ts +19 -0
- package/dist/interfaces/react-ink/render-root.d.ts.map +1 -0
- package/dist/interfaces/react-ink/render-root.js +6 -0
- package/dist/interfaces/react-ink/render-root.js.map +1 -0
- package/dist/interfaces/react-ink/state/reducer.d.ts +51 -0
- package/dist/interfaces/react-ink/state/reducer.d.ts.map +1 -0
- package/dist/interfaces/react-ink/state/reducer.js +122 -0
- package/dist/interfaces/react-ink/state/reducer.js.map +1 -0
- package/dist/interfaces/react-ink/state/store.d.ts +4 -0
- package/dist/interfaces/react-ink/state/store.d.ts.map +1 -0
- package/dist/interfaces/react-ink/state/store.js +5 -0
- package/dist/interfaces/react-ink/state/store.js.map +1 -0
- package/dist/interfaces/react-ink/state/ui-state.d.ts +5 -0
- package/dist/interfaces/react-ink/state/ui-state.d.ts.map +1 -0
- package/dist/interfaces/react-ink/state/ui-state.js +20 -0
- package/dist/interfaces/react-ink/state/ui-state.js.map +1 -0
- package/dist/interfaces/react-ink/theme-adapter.d.ts +4 -0
- package/dist/interfaces/react-ink/theme-adapter.d.ts.map +1 -0
- package/dist/interfaces/react-ink/theme-adapter.js +15 -0
- package/dist/interfaces/react-ink/theme-adapter.js.map +1 -0
- package/dist/interfaces/react-ink/types.d.ts +51 -0
- package/dist/interfaces/react-ink/types.d.ts.map +1 -0
- package/dist/interfaces/react-ink/types.js +2 -0
- package/dist/interfaces/react-ink/types.js.map +1 -0
- package/dist/interfaces/react-ink/utils/changelog.d.ts +7 -0
- package/dist/interfaces/react-ink/utils/changelog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/changelog.js +40 -0
- package/dist/interfaces/react-ink/utils/changelog.js.map +1 -0
- package/dist/interfaces/react-ink/utils/key-data.d.ts +22 -0
- package/dist/interfaces/react-ink/utils/key-data.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/key-data.js +123 -0
- package/dist/interfaces/react-ink/utils/key-data.js.map +1 -0
- package/dist/interfaces/react-ink/utils/message-groups.d.ts +26 -0
- package/dist/interfaces/react-ink/utils/message-groups.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/message-groups.js +230 -0
- package/dist/interfaces/react-ink/utils/message-groups.js.map +1 -0
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts +20 -0
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.js +46 -0
- package/dist/interfaces/react-ink/utils/prompt-autocomplete.js.map +1 -0
- package/dist/interfaces/react-ink/utils/selection-dialog.d.ts +3 -0
- package/dist/interfaces/react-ink/utils/selection-dialog.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/selection-dialog.js +18 -0
- package/dist/interfaces/react-ink/utils/selection-dialog.js.map +1 -0
- package/dist/interfaces/react-ink/utils/session-actions.d.ts +10 -0
- package/dist/interfaces/react-ink/utils/session-actions.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/session-actions.js +66 -0
- package/dist/interfaces/react-ink/utils/session-actions.js.map +1 -0
- package/dist/interfaces/react-ink/utils/slash-commands.d.ts +10 -0
- package/dist/interfaces/react-ink/utils/slash-commands.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/slash-commands.js +111 -0
- package/dist/interfaces/react-ink/utils/slash-commands.js.map +1 -0
- package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts +7 -0
- package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/startup-diagnostics.js +111 -0
- package/dist/interfaces/react-ink/utils/startup-diagnostics.js.map +1 -0
- package/dist/interfaces/react-ink/utils/tool-display.d.ts +22 -0
- package/dist/interfaces/react-ink/utils/tool-display.d.ts.map +1 -0
- package/dist/interfaces/react-ink/utils/tool-display.js +349 -0
- package/dist/interfaces/react-ink/utils/tool-display.js.map +1 -0
- package/dist/interfaces/service-api/rpc-mode.js +1 -1
- package/dist/interfaces/service-api/rpc-mode.js.map +1 -1
- package/dist/interfaces/{terminal-ui/theme → theme}/dark.json +1 -1
- package/dist/interfaces/{terminal-ui/theme → theme}/light.json +1 -1
- package/dist/interfaces/theme/theme.d.ts.map +1 -0
- package/dist/interfaces/{terminal-ui/theme → theme}/theme.js +1 -1
- package/dist/interfaces/theme/theme.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/runtime/agent-session.js +1 -1
- package/dist/runtime/agent-session.js.map +1 -1
- package/dist/runtime/html-export/index.js +1 -1
- package/dist/runtime/html-export/index.js.map +1 -1
- package/dist/runtime/html-export/index.ts +1 -2
- package/dist/runtime/html-export/tool-renderer.d.ts +1 -1
- package/dist/runtime/html-export/tool-renderer.d.ts.map +1 -1
- package/dist/runtime/html-export/tool-renderer.ts +1 -1
- package/dist/runtime/plugins/runner.js +1 -1
- package/dist/runtime/plugins/runner.js.map +1 -1
- package/dist/runtime/plugins/types.d.ts +1 -1
- package/dist/runtime/plugins/types.d.ts.map +1 -1
- package/dist/runtime/resource-loader.d.ts +1 -1
- package/dist/runtime/resource-loader.d.ts.map +1 -1
- package/dist/runtime/resource-loader.js +1 -1
- package/dist/runtime/resource-loader.js.map +1 -1
- package/dist/runtime/system-prompt.js +1 -1
- package/dist/runtime/system-prompt.js.map +1 -1
- package/dist/runtime/tooling/composio-compat.d.ts +169 -0
- package/dist/runtime/tooling/composio-compat.d.ts.map +1 -0
- package/dist/runtime/tooling/composio-compat.js +163 -0
- package/dist/runtime/tooling/composio-compat.js.map +1 -0
- package/dist/runtime/tooling/index.d.ts +12 -25
- package/dist/runtime/tooling/index.d.ts.map +1 -1
- package/dist/runtime/tooling/index.js +3 -3
- package/dist/runtime/tooling/index.js.map +1 -1
- package/guides/INDUSVX_OBSERVE_FULL_INTEGRATION_REPORT.md +2 -2
- package/package.json +9 -5
- package/dist/interfaces/induscode-ui-delegate.d.ts +0 -3
- package/dist/interfaces/induscode-ui-delegate.d.ts.map +0 -1
- package/dist/interfaces/induscode-ui-delegate.js +0 -148
- package/dist/interfaces/induscode-ui-delegate.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/armin.d.ts +0 -19
- package/dist/interfaces/terminal-ui/components/armin.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/armin.js +0 -280
- package/dist/interfaces/terminal-ui/components/armin.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/assistant-message.d.ts +0 -13
- package/dist/interfaces/terminal-ui/components/assistant-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/assistant-message.js +0 -95
- package/dist/interfaces/terminal-ui/components/assistant-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/bash-execution.d.ts +0 -24
- package/dist/interfaces/terminal-ui/components/bash-execution.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/bash-execution.js +0 -135
- package/dist/interfaces/terminal-ui/components/bash-execution.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts +0 -14
- package/dist/interfaces/terminal-ui/components/bordered-loader.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/bordered-loader.js +0 -78
- package/dist/interfaces/terminal-ui/components/bordered-loader.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts +0 -16
- package/dist/interfaces/terminal-ui/components/branch-summary-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/branch-summary-message.js +0 -55
- package/dist/interfaces/terminal-ui/components/branch-summary-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts +0 -16
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.js +0 -60
- package/dist/interfaces/terminal-ui/components/compaction-summary-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/config-selector.d.ts +0 -71
- package/dist/interfaces/terminal-ui/components/config-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/config-selector.js +0 -459
- package/dist/interfaces/terminal-ui/components/config-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts +0 -10
- package/dist/interfaces/terminal-ui/components/countdown-timer.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/countdown-timer.js +0 -42
- package/dist/interfaces/terminal-ui/components/countdown-timer.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/custom-editor.d.ts +0 -17
- package/dist/interfaces/terminal-ui/components/custom-editor.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/custom-editor.js +0 -72
- package/dist/interfaces/terminal-ui/components/custom-editor.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/custom-message.d.ts +0 -19
- package/dist/interfaces/terminal-ui/components/custom-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/custom-message.js +0 -71
- package/dist/interfaces/terminal-ui/components/custom-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/diff.d.ts +0 -9
- package/dist/interfaces/terminal-ui/components/diff.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/diff.js +0 -126
- package/dist/interfaces/terminal-ui/components/diff.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts +0 -20
- package/dist/interfaces/terminal-ui/components/dynamic-border.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/dynamic-border.js +0 -40
- package/dist/interfaces/terminal-ui/components/dynamic-border.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-editor.d.ts +0 -13
- package/dist/interfaces/terminal-ui/components/extension-editor.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-editor.js +0 -94
- package/dist/interfaces/terminal-ui/components/extension-editor.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-input.d.ts +0 -18
- package/dist/interfaces/terminal-ui/components/extension-input.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-input.js +0 -72
- package/dist/interfaces/terminal-ui/components/extension-input.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-selector.d.ts +0 -19
- package/dist/interfaces/terminal-ui/components/extension-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/extension-selector.js +0 -93
- package/dist/interfaces/terminal-ui/components/extension-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/footer.d.ts +0 -17
- package/dist/interfaces/terminal-ui/components/footer.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/footer.js +0 -160
- package/dist/interfaces/terminal-ui/components/footer.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/index.d.ts +0 -80
- package/dist/interfaces/terminal-ui/components/index.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/index.js +0 -74
- package/dist/interfaces/terminal-ui/components/index.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts +0 -23
- package/dist/interfaces/terminal-ui/components/keybinding-hints.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/keybinding-hints.js +0 -54
- package/dist/interfaces/terminal-ui/components/keybinding-hints.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/login-dialog.d.ts +0 -29
- package/dist/interfaces/terminal-ui/components/login-dialog.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/login-dialog.js +0 -143
- package/dist/interfaces/terminal-ui/components/login-dialog.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/model-selector.d.ts +0 -43
- package/dist/interfaces/terminal-ui/components/model-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/model-selector.js +0 -201
- package/dist/interfaces/terminal-ui/components/model-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts +0 -75
- package/dist/interfaces/terminal-ui/components/oauth-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/oauth-selector.js +0 -374
- package/dist/interfaces/terminal-ui/components/oauth-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts +0 -39
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.js +0 -242
- package/dist/interfaces/terminal-ui/components/scoped-models-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts +0 -21
- package/dist/interfaces/terminal-ui/components/session-selector-search.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/session-selector-search.js +0 -135
- package/dist/interfaces/terminal-ui/components/session-selector-search.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/session-selector.d.ts +0 -85
- package/dist/interfaces/terminal-ui/components/session-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/session-selector.js +0 -688
- package/dist/interfaces/terminal-ui/components/session-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/settings-selector.d.ts +0 -49
- package/dist/interfaces/terminal-ui/components/settings-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/settings-selector.js +0 -159
- package/dist/interfaces/terminal-ui/components/settings-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts +0 -10
- package/dist/interfaces/terminal-ui/components/show-images-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/show-images-selector.js +0 -32
- package/dist/interfaces/terminal-ui/components/show-images-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts +0 -17
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.js +0 -55
- package/dist/interfaces/terminal-ui/components/skill-invocation-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/theme-selector.d.ts +0 -11
- package/dist/interfaces/terminal-ui/components/theme-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/theme-selector.js +0 -39
- package/dist/interfaces/terminal-ui/components/theme-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts +0 -11
- package/dist/interfaces/terminal-ui/components/thinking-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/thinking-selector.js +0 -45
- package/dist/interfaces/terminal-ui/components/thinking-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/tool-execution.d.ts +0 -72
- package/dist/interfaces/terminal-ui/components/tool-execution.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/tool-execution.js +0 -1162
- package/dist/interfaces/terminal-ui/components/tool-execution.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/tree-selector.d.ts +0 -62
- package/dist/interfaces/terminal-ui/components/tree-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/tree-selector.js +0 -886
- package/dist/interfaces/terminal-ui/components/tree-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts +0 -24
- package/dist/interfaces/terminal-ui/components/user-message-selector.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/user-message-selector.js +0 -99
- package/dist/interfaces/terminal-ui/components/user-message-selector.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/user-message.d.ts +0 -193
- package/dist/interfaces/terminal-ui/components/user-message.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/user-message.js +0 -201
- package/dist/interfaces/terminal-ui/components/user-message.js.map +0 -1
- package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts +0 -12
- package/dist/interfaces/terminal-ui/components/visual-truncate.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/components/visual-truncate.js +0 -25
- package/dist/interfaces/terminal-ui/components/visual-truncate.js.map +0 -1
- package/dist/interfaces/terminal-ui/interactive-mode.d.ts +0 -1941
- package/dist/interfaces/terminal-ui/interactive-mode.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/interactive-mode.js +0 -5940
- package/dist/interfaces/terminal-ui/interactive-mode.js.map +0 -1
- package/dist/interfaces/terminal-ui/theme/theme.d.ts.map +0 -1
- package/dist/interfaces/terminal-ui/theme/theme.js.map +0 -1
- /package/dist/interfaces/{terminal-ui/theme → theme}/theme-schema.json +0 -0
- /package/dist/interfaces/{terminal-ui/theme → theme}/theme.d.ts +0 -0
|
@@ -0,0 +1,674 @@
|
|
|
1
|
+
import { spawnSync } from "child_process";
|
|
2
|
+
import { existsSync, mkdirSync, unlinkSync, writeFileSync } from "fs";
|
|
3
|
+
import { tmpdir } from "os";
|
|
4
|
+
import { dirname, join } from "path";
|
|
5
|
+
import { getAuthPath, getDebugLogPath, getMCPConfigPath, getShareViewerUrl, } from "../../../config.js";
|
|
6
|
+
import { resolveModelScope } from "../../../runtime/model-resolver.js";
|
|
7
|
+
import { setTheme } from "../../theme/theme.js";
|
|
8
|
+
import { flattenSessionTree, listUserMessages } from "./session-history.js";
|
|
9
|
+
import { buildLoginProviders, buildSavedAccounts, copyLastAssistantMessage, formatSessionStats, setSessionName, } from "../utils/session-actions.js";
|
|
10
|
+
import { getFullChangelogMarkdown } from "../utils/changelog.js";
|
|
11
|
+
import { formatSlashCommandList } from "../utils/slash-commands.js";
|
|
12
|
+
function ensureLeadingSlash(name) {
|
|
13
|
+
return name.startsWith("/") ? name : `/${name}`;
|
|
14
|
+
}
|
|
15
|
+
function buildOAuthOverlay(provider) {
|
|
16
|
+
return {
|
|
17
|
+
kind: "oauth",
|
|
18
|
+
providerId: provider.id,
|
|
19
|
+
providerName: provider.label,
|
|
20
|
+
mode: "apiKey",
|
|
21
|
+
inputLabel: `API key for ${provider.id}`,
|
|
22
|
+
inputValue: "",
|
|
23
|
+
accountId: "default",
|
|
24
|
+
accountName: "Default",
|
|
25
|
+
progress: `Credentials will be saved to ${getAuthPath()}.`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function formatHotkeys() {
|
|
29
|
+
return [
|
|
30
|
+
"Keyboard Shortcuts:",
|
|
31
|
+
" Escape Cancel active work, clear the prompt, or double-tap for tree/fork",
|
|
32
|
+
" Ctrl+C Clear the prompt; press twice quickly to exit",
|
|
33
|
+
" Ctrl+D Exit when the prompt is empty",
|
|
34
|
+
" Ctrl+Z Suspend to the background",
|
|
35
|
+
" Ctrl+P Next model",
|
|
36
|
+
" Shift+Ctrl+P Previous model",
|
|
37
|
+
" Ctrl+L Open model selector",
|
|
38
|
+
" Shift+Tab Cycle thinking level",
|
|
39
|
+
" Ctrl+O Toggle tool output expansion",
|
|
40
|
+
" Ctrl+T Toggle thinking blocks",
|
|
41
|
+
" Ctrl+G Open the external editor",
|
|
42
|
+
" Alt+Enter Queue a follow-up message",
|
|
43
|
+
" Alt+Up Restore queued messages to the prompt",
|
|
44
|
+
" Ctrl+V Paste an image from the clipboard",
|
|
45
|
+
" Ctrl+, Open settings",
|
|
46
|
+
" Ctrl+R Open session resume",
|
|
47
|
+
" Ctrl+S Queue a steering message",
|
|
48
|
+
" Ctrl+J Insert a new line",
|
|
49
|
+
" Ctrl+U Clear the prompt",
|
|
50
|
+
" Enter Submit prompt",
|
|
51
|
+
" / Slash commands",
|
|
52
|
+
" ! Run a bash command",
|
|
53
|
+
" !! Run a bash command without adding it to context",
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
function ensureParentDirectory(filePath) {
|
|
57
|
+
const parent = dirname(filePath);
|
|
58
|
+
if (!existsSync(parent)) {
|
|
59
|
+
mkdirSync(parent, { recursive: true });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function getCompactionErrorMessage(error) {
|
|
63
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
64
|
+
if (message === "Nothing to compact (session too small)") {
|
|
65
|
+
return { text: "Nothing to compact yet.", kind: "warning" };
|
|
66
|
+
}
|
|
67
|
+
if (message === "Already compacted") {
|
|
68
|
+
return { text: "Nothing to compact right now.", kind: "warning" };
|
|
69
|
+
}
|
|
70
|
+
if (message === "Compaction cancelled" || (error instanceof Error && error.name === "AbortError")) {
|
|
71
|
+
return { text: "Compaction cancelled.", kind: "warning" };
|
|
72
|
+
}
|
|
73
|
+
return { text: `Compaction failed: ${message}`, kind: "error", asError: true };
|
|
74
|
+
}
|
|
75
|
+
function writeDebugLog(session) {
|
|
76
|
+
const debugPath = getDebugLogPath();
|
|
77
|
+
const stats = session.getSessionStats();
|
|
78
|
+
const debugData = [
|
|
79
|
+
`Debug output at ${new Date().toISOString()}`,
|
|
80
|
+
`Session ID: ${stats.sessionId}`,
|
|
81
|
+
stats.sessionFile ? `Session file: ${stats.sessionFile}` : "Session file: (none)",
|
|
82
|
+
`Messages: ${stats.totalMessages}`,
|
|
83
|
+
`Tool calls: ${stats.toolCalls}`,
|
|
84
|
+
`Tokens: ${stats.tokens.total}`,
|
|
85
|
+
`Cost: ${stats.cost.toFixed(4)}`,
|
|
86
|
+
"",
|
|
87
|
+
"=== Messages (JSONL) ===",
|
|
88
|
+
...session.messages.map((message) => JSON.stringify(message)),
|
|
89
|
+
"",
|
|
90
|
+
].join("\n");
|
|
91
|
+
ensureParentDirectory(debugPath);
|
|
92
|
+
writeFileSync(debugPath, debugData, "utf-8");
|
|
93
|
+
return debugPath;
|
|
94
|
+
}
|
|
95
|
+
async function handleThemeCommand(searchTerm, ctx) {
|
|
96
|
+
if (!searchTerm) {
|
|
97
|
+
ctx.setOverlay({ kind: "theme" });
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const result = setTheme(searchTerm, true);
|
|
101
|
+
if (!result.success) {
|
|
102
|
+
ctx.setError(result.error ?? `Unable to load theme "${searchTerm}".`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
ctx.session.settingsManager.setTheme(searchTerm);
|
|
106
|
+
ctx.setStatus(`Theme set to ${searchTerm}.`, "success");
|
|
107
|
+
}
|
|
108
|
+
async function handleModelCommand(searchTerm, ctx) {
|
|
109
|
+
if (!searchTerm) {
|
|
110
|
+
ctx.setOverlay({ kind: "model" });
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const normalized = searchTerm.toLowerCase();
|
|
114
|
+
const match = ctx.session.modelRegistry
|
|
115
|
+
.getAvailable()
|
|
116
|
+
.find((model) => `${model.provider}/${model.id}`.toLowerCase() === normalized || model.id.toLowerCase() === normalized);
|
|
117
|
+
if (!match) {
|
|
118
|
+
ctx.setError(`No model matched "${searchTerm}".`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
await ctx.session.setModel(match);
|
|
122
|
+
ctx.setStatus(`Model set to ${match.provider}/${match.id}.`, "success");
|
|
123
|
+
}
|
|
124
|
+
async function handleScopedModelsCommand(ctx) {
|
|
125
|
+
ctx.session.modelRegistry.refresh();
|
|
126
|
+
const models = ctx.session.modelRegistry.getAvailable();
|
|
127
|
+
if (models.length === 0) {
|
|
128
|
+
ctx.setError("No authenticated models are available yet.");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
let selectedIds = ctx.session.scopedModels.map((entry) => `${entry.model.provider}/${entry.model.id}`);
|
|
132
|
+
if (selectedIds.length === 0) {
|
|
133
|
+
const patterns = ctx.session.settingsManager.getEnabledModels();
|
|
134
|
+
if (patterns && patterns.length > 0) {
|
|
135
|
+
const resolved = await resolveModelScope(patterns, ctx.session.modelRegistry);
|
|
136
|
+
selectedIds = resolved.map((entry) => `${entry.model.provider}/${entry.model.id}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
ctx.setOverlay({
|
|
140
|
+
kind: "scopedModels",
|
|
141
|
+
models,
|
|
142
|
+
selectedIds,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
async function handleResumeCommand(ctx) {
|
|
146
|
+
ctx.setOverlay({ kind: "session" });
|
|
147
|
+
}
|
|
148
|
+
async function handleMCPCommand(subCommand, ctx) {
|
|
149
|
+
switch (subCommand) {
|
|
150
|
+
case "":
|
|
151
|
+
case "status": {
|
|
152
|
+
const servers = await ctx.session.getMCPStatus();
|
|
153
|
+
const toolNames = ctx.session.getMCPToolNames();
|
|
154
|
+
if (servers.length === 0) {
|
|
155
|
+
ctx.setStatus("MCP: no servers are configured or connected.");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
const lines = servers.map((server) => `${server.name}: ${server.connected ? "connected" : "disconnected"}${server.toolCount ? ` (${server.toolCount} tools)` : ""}`);
|
|
159
|
+
ctx.setStatus(`MCP Servers:\n${lines.join("\n")}\n\nTools: ${toolNames.length} available`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
case "connect":
|
|
163
|
+
case "reconnect": {
|
|
164
|
+
const toolCount = await ctx.session.reconnectMCP(getMCPConfigPath());
|
|
165
|
+
ctx.setStatus(`Reconnected MCP servers. ${toolCount} tools available.`, "success");
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
case "disconnect":
|
|
169
|
+
await ctx.session.disconnectMCP();
|
|
170
|
+
ctx.setStatus("Disconnected MCP servers.", "success");
|
|
171
|
+
return;
|
|
172
|
+
case "tools": {
|
|
173
|
+
const tools = ctx.session.getMCPToolNames();
|
|
174
|
+
ctx.setStatus(tools.length > 0 ? `MCP Tools:\n${tools.join("\n")}` : "MCP: no tools are loaded.");
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
default:
|
|
178
|
+
ctx.setError("Usage: /mcp [status|connect|reconnect|disconnect|tools]");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function handleMemoryCommand(subCommand, ctx) {
|
|
182
|
+
const trimmed = subCommand.trim();
|
|
183
|
+
const [command = "", ...rest] = trimmed.split(/\s+/).filter(Boolean);
|
|
184
|
+
const apiKey = rest.join(" ").trim();
|
|
185
|
+
switch (command) {
|
|
186
|
+
case "":
|
|
187
|
+
case "status": {
|
|
188
|
+
const savedOpenAIKey = await ctx.session.modelRegistry.getApiKeyForProvider("openai");
|
|
189
|
+
const memorySettings = ctx.session.settingsManager.getMemorySettings();
|
|
190
|
+
const enabledText = ctx.session.isMemoryEnabled() ? "Enabled for this session" : "Disabled for this session";
|
|
191
|
+
const defaultText = memorySettings.enabled && memorySettings.autoConnect ? "ON" : "OFF";
|
|
192
|
+
const toolCount = ctx.session.getMemoryToolNames().length;
|
|
193
|
+
ctx.setStatus(`Memory: ${enabledText}\n\nDefault startup: ${defaultText}\nSaved OpenAI key: ${savedOpenAIKey ? "Configured" : "Missing"}\nTools available: ${toolCount}`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
case "on":
|
|
197
|
+
try {
|
|
198
|
+
await ctx.session.enableMemory({ persistSettings: true });
|
|
199
|
+
ctx.setStatus("Memory enabled. It will now auto-start for future sessions too.", "success");
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
ctx.setError(`Could not enable memory: ${error instanceof Error ? error.message : "Unknown error"}\n\nTip: run /memory setup <OPENAI_API_KEY> first.`);
|
|
203
|
+
}
|
|
204
|
+
return;
|
|
205
|
+
case "off":
|
|
206
|
+
await ctx.session.disableMemory({ persistSettings: true });
|
|
207
|
+
ctx.setStatus("Memory disabled. Future sessions will start with memory off.", "success");
|
|
208
|
+
return;
|
|
209
|
+
case "setup":
|
|
210
|
+
if (!apiKey) {
|
|
211
|
+
const savedOpenAIKey = await ctx.session.modelRegistry.getApiKeyForProvider("openai");
|
|
212
|
+
if (!savedOpenAIKey) {
|
|
213
|
+
ctx.setError("Usage: /memory setup <OPENAI_API_KEY>");
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
await ctx.session.enableMemory({ persistSettings: true });
|
|
217
|
+
ctx.setStatus("Memory enabled using your saved OpenAI API key.", "success");
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
await ctx.session.enableMemory({ apiKey, persistSettings: true });
|
|
221
|
+
ctx.setStatus("OpenAI API key saved and memory enabled.", "success");
|
|
222
|
+
return;
|
|
223
|
+
case "clear":
|
|
224
|
+
if (!ctx.session.isMemoryEnabled()) {
|
|
225
|
+
ctx.setError("Memory is not enabled. Run /memory on first.");
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
await ctx.session.clearMemory();
|
|
229
|
+
ctx.setStatus("Memory cleared for the current thread.", "success");
|
|
230
|
+
return;
|
|
231
|
+
case "working":
|
|
232
|
+
if (!ctx.session.isMemoryEnabled()) {
|
|
233
|
+
ctx.setError("Memory is not enabled. Run /memory on first.");
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
{
|
|
237
|
+
const workingMemory = await ctx.session.getWorkingMemory();
|
|
238
|
+
ctx.setStatus(workingMemory
|
|
239
|
+
? `Working Memory:\n\n${workingMemory}`
|
|
240
|
+
: "Working Memory: not set yet. The updateWorkingMemory tool can write to it once memory is enabled.");
|
|
241
|
+
}
|
|
242
|
+
return;
|
|
243
|
+
case "tools": {
|
|
244
|
+
const tools = ctx.session.getMemoryToolNames();
|
|
245
|
+
ctx.setStatus(tools.length > 0 ? `Memory Tools:\n${tools.join("\n")}` : "Memory tools are not enabled.");
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
default:
|
|
249
|
+
ctx.setError("Usage: /memory [status|on|off|setup <OPENAI_API_KEY>|clear|working|tools]");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function asRecord(value) {
|
|
253
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : undefined;
|
|
254
|
+
}
|
|
255
|
+
function asNonEmptyString(value) {
|
|
256
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
257
|
+
}
|
|
258
|
+
function collectUrls(value, seen = new WeakSet(), urls = []) {
|
|
259
|
+
if (value == null) {
|
|
260
|
+
return urls;
|
|
261
|
+
}
|
|
262
|
+
if (Array.isArray(value)) {
|
|
263
|
+
for (const item of value) {
|
|
264
|
+
collectUrls(item, seen, urls);
|
|
265
|
+
}
|
|
266
|
+
return urls;
|
|
267
|
+
}
|
|
268
|
+
const record = asRecord(value);
|
|
269
|
+
if (!record) {
|
|
270
|
+
return urls;
|
|
271
|
+
}
|
|
272
|
+
if (seen.has(record)) {
|
|
273
|
+
return urls;
|
|
274
|
+
}
|
|
275
|
+
seen.add(record);
|
|
276
|
+
for (const key of [
|
|
277
|
+
"authUri",
|
|
278
|
+
"auth_uri",
|
|
279
|
+
"authUrl",
|
|
280
|
+
"auth_url",
|
|
281
|
+
"authorizationUrl",
|
|
282
|
+
"authorization_url",
|
|
283
|
+
"redirectUrl",
|
|
284
|
+
"redirect_url",
|
|
285
|
+
"composio_link_redirect_url",
|
|
286
|
+
"account_url",
|
|
287
|
+
"accountUrl",
|
|
288
|
+
"borneo_dashboard_url",
|
|
289
|
+
]) {
|
|
290
|
+
const candidate = asNonEmptyString(record[key]);
|
|
291
|
+
if (!candidate || urls.includes(candidate)) {
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
const parsed = new URL(candidate);
|
|
296
|
+
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
|
|
297
|
+
urls.push(candidate);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
catch {
|
|
301
|
+
// Ignore malformed URLs from provider payloads.
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
for (const nested of Object.values(record)) {
|
|
305
|
+
collectUrls(nested, seen, urls);
|
|
306
|
+
}
|
|
307
|
+
return urls;
|
|
308
|
+
}
|
|
309
|
+
function formatComposioAccount(account) {
|
|
310
|
+
const record = asRecord(account) ?? {};
|
|
311
|
+
const toolkit = asNonEmptyString(asRecord(record.toolkit)?.slug) ?? "unknown";
|
|
312
|
+
const status = asNonEmptyString(record.status) ?? "UNKNOWN";
|
|
313
|
+
const accountId = asNonEmptyString(record.id) ?? "unknown";
|
|
314
|
+
const authConfig = asNonEmptyString(asRecord(record.authConfig)?.id) ?? asNonEmptyString(asRecord(record.auth_config)?.id);
|
|
315
|
+
const reason = asNonEmptyString(record.statusReason) ?? asNonEmptyString(record.status_reason);
|
|
316
|
+
const urls = collectUrls(account).slice(0, 2);
|
|
317
|
+
const lines = [` • ${toolkit} account ${accountId} [${status}]${authConfig ? ` authConfig=${authConfig}` : ""}`];
|
|
318
|
+
if (reason && status !== "ACTIVE") {
|
|
319
|
+
lines.push(` reason: ${reason}`);
|
|
320
|
+
}
|
|
321
|
+
for (const url of urls) {
|
|
322
|
+
lines.push(` open: ${url}`);
|
|
323
|
+
}
|
|
324
|
+
return lines.join("\n");
|
|
325
|
+
}
|
|
326
|
+
async function handleComposioCommand(subCommand, ctx) {
|
|
327
|
+
const trimmed = subCommand.trim();
|
|
328
|
+
const [command = "", ...rest] = trimmed.split(/\s+/).filter(Boolean);
|
|
329
|
+
const toolkitArg = rest.join(" ").trim();
|
|
330
|
+
const parsedToolkits = toolkitArg
|
|
331
|
+
.split(",")
|
|
332
|
+
.map((toolkit) => toolkit.trim())
|
|
333
|
+
.filter(Boolean);
|
|
334
|
+
const controlTools = [
|
|
335
|
+
"composio_toolkits",
|
|
336
|
+
"composio_tools",
|
|
337
|
+
"composio_execute",
|
|
338
|
+
"composio_enable",
|
|
339
|
+
"composio_connect",
|
|
340
|
+
"composio_accounts",
|
|
341
|
+
];
|
|
342
|
+
switch (command) {
|
|
343
|
+
case "":
|
|
344
|
+
case "status": {
|
|
345
|
+
const settings = ctx.session.settingsManager.getComposioSettings();
|
|
346
|
+
const activeControlTools = controlTools.filter((tool) => ctx.session.getActiveToolNames().includes(tool));
|
|
347
|
+
const enabledTools = ctx.session.getComposioToolNames();
|
|
348
|
+
ctx.setStatus(`Composio: ${settings.enabled ? "enabled" : "disabled"}\n\nControl tools active: ${activeControlTools.length}/${controlTools.length}\nHydrated toolkit tools: ${enabledTools.length}\nDefault mode: ${settings.mode}\nDefault auto-connect: ${settings.autoConnect ? "ON" : "OFF"}\nDefault toolkits: ${settings.defaultToolkits.length > 0 ? settings.defaultToolkits.join(", ") : "(none)"}`);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
case "connect": {
|
|
352
|
+
if (!toolkitArg) {
|
|
353
|
+
ctx.setError("Usage: /composio connect <toolkit|connectedAccountId>");
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const isAccountId = toolkitArg.startsWith("ca_");
|
|
357
|
+
const result = await ctx.session.connectComposio({
|
|
358
|
+
toolkit: isAccountId ? undefined : toolkitArg,
|
|
359
|
+
connectedAccountId: isAccountId ? toolkitArg : undefined,
|
|
360
|
+
});
|
|
361
|
+
const lines = [`Composio Connect: ${result.toolkit ?? "account"} ${result.accountId} [${result.status}]`];
|
|
362
|
+
if (result.redirectUrl) {
|
|
363
|
+
lines.push("", "Open this URL to finish auth:", result.redirectUrl);
|
|
364
|
+
}
|
|
365
|
+
else if (result.action === "already_connected") {
|
|
366
|
+
lines.push("", "This account is already active and ready to use.");
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
lines.push("", "No auth URL was returned. Run /composio accounts again in a few seconds.");
|
|
370
|
+
}
|
|
371
|
+
ctx.setStatus(lines.join("\n"), result.redirectUrl ? "warning" : "info");
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
case "enable": {
|
|
375
|
+
if (parsedToolkits.length === 0) {
|
|
376
|
+
ctx.setError("Usage: /composio enable <toolkit[,toolkit]>");
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
const tools = await ctx.session.enableComposio({
|
|
380
|
+
toolkits: parsedToolkits,
|
|
381
|
+
persistSettings: false,
|
|
382
|
+
});
|
|
383
|
+
ctx.setStatus(`Composio: enabled ${tools.length} toolkit tool${tools.length === 1 ? "" : "s"} from ${parsedToolkits.join(", ")}`, "success");
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
case "tools": {
|
|
387
|
+
const tools = ctx.session.getComposioTools();
|
|
388
|
+
if (tools.length === 0) {
|
|
389
|
+
ctx.setStatus("Composio: no toolkit tools are hydrated in this session yet.");
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
ctx.setStatus(`Composio Toolkit Tools:\n${tools
|
|
393
|
+
.map((tool) => ` • ${tool.name} (${tool.composio.slug}${tool.composio.toolkit ? ` / ${tool.composio.toolkit}` : ""})`)
|
|
394
|
+
.join("\n")}`);
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
case "accounts": {
|
|
398
|
+
const result = await ctx.session.listComposioAccounts({
|
|
399
|
+
toolkits: parsedToolkits.length > 0 ? parsedToolkits : undefined,
|
|
400
|
+
});
|
|
401
|
+
const items = Array.isArray(result.items) ? result.items : [];
|
|
402
|
+
if (items.length === 0) {
|
|
403
|
+
ctx.setStatus("Composio: no connected accounts found for the current user.");
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
ctx.setStatus(`Composio Accounts:\n${items.map((account) => formatComposioAccount(account)).join("\n")}`);
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
case "clear":
|
|
410
|
+
await ctx.session.clearComposioTools({ persistSettings: true });
|
|
411
|
+
ctx.setStatus("Composio toolkit tools cleared from the current session.", "success");
|
|
412
|
+
return;
|
|
413
|
+
default:
|
|
414
|
+
ctx.setError("Usage: /composio [status|connect <toolkit|connectedAccountId>|enable <toolkit[,toolkit]>|tools|accounts [toolkit[,toolkit]]|clear]");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
function handleLoginProvider(providerId, ctx) {
|
|
418
|
+
const normalized = providerId.trim().toLowerCase();
|
|
419
|
+
const provider = buildLoginProviders(ctx.session).find((entry) => entry.id.toLowerCase() === normalized);
|
|
420
|
+
if (!provider) {
|
|
421
|
+
ctx.setError(`Unknown auth provider "${providerId}".`);
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
if (provider.authKind === "oauth" && ctx.startOAuthLogin) {
|
|
425
|
+
void ctx.startOAuthLogin(provider);
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
ctx.setOverlay(buildOAuthOverlay(provider));
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
function handleShareCommand(ctx) {
|
|
432
|
+
let authResult;
|
|
433
|
+
try {
|
|
434
|
+
authResult = spawnSync("gh", ["auth", "status"], { encoding: "utf-8" });
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
ctx.setError("GitHub CLI (gh) is not installed. Install it and retry.");
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (authResult.status !== 0) {
|
|
441
|
+
ctx.setError("GitHub CLI is not logged in. Run `gh auth login` first.");
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const tempFile = join(tmpdir(), `indusagi-session-${Date.now()}.html`);
|
|
445
|
+
void (async () => {
|
|
446
|
+
try {
|
|
447
|
+
await ctx.session.exportToHtml(tempFile);
|
|
448
|
+
const gistResult = spawnSync("gh", ["gist", "create", "--public=false", tempFile], {
|
|
449
|
+
encoding: "utf-8",
|
|
450
|
+
});
|
|
451
|
+
if (gistResult.status !== 0) {
|
|
452
|
+
ctx.setError(String(gistResult.stderr || "Failed to create gist.").trim());
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const gistUrl = String(gistResult.stdout).trim().split(/\s+/)[0];
|
|
456
|
+
const gistId = gistUrl.split("/").pop();
|
|
457
|
+
if (!gistId) {
|
|
458
|
+
ctx.setError("Failed to parse gist ID from GitHub CLI output.");
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
ctx.setStatus(`Share URL: ${getShareViewerUrl(gistId)}\nGist: ${gistUrl}`, "success");
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
ctx.setError(`Failed to share session: ${error instanceof Error ? error.message : String(error)}`);
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
try {
|
|
468
|
+
unlinkSync(tempFile);
|
|
469
|
+
}
|
|
470
|
+
catch {
|
|
471
|
+
// Ignore cleanup errors.
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
})();
|
|
475
|
+
}
|
|
476
|
+
export async function runSlashCommand(input, ctx) {
|
|
477
|
+
const trimmed = input.trim();
|
|
478
|
+
if (!trimmed.startsWith("/")) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
if (trimmed === "/settings") {
|
|
482
|
+
ctx.setOverlay({ kind: "settings" });
|
|
483
|
+
return true;
|
|
484
|
+
}
|
|
485
|
+
if (trimmed === "/model" || trimmed.startsWith("/model ")) {
|
|
486
|
+
await handleModelCommand(trimmed === "/model" ? undefined : trimmed.slice(7).trim(), ctx);
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
if (trimmed === "/scoped-models") {
|
|
490
|
+
await handleScopedModelsCommand(ctx);
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
if (trimmed === "/theme" || trimmed.startsWith("/theme ")) {
|
|
494
|
+
await handleThemeCommand(trimmed === "/theme" ? undefined : trimmed.slice(7).trim(), ctx);
|
|
495
|
+
return true;
|
|
496
|
+
}
|
|
497
|
+
if (trimmed === "/session") {
|
|
498
|
+
ctx.setStatus(formatSessionStats(ctx.session));
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
if (trimmed === "/resume") {
|
|
502
|
+
await handleResumeCommand(ctx);
|
|
503
|
+
return true;
|
|
504
|
+
}
|
|
505
|
+
if (trimmed === "/tree") {
|
|
506
|
+
ctx.setOverlay({ kind: "tree", items: flattenSessionTree(ctx.session) });
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
if (trimmed === "/fork") {
|
|
510
|
+
ctx.setOverlay({ kind: "userMessage", items: listUserMessages(ctx.session) });
|
|
511
|
+
return true;
|
|
512
|
+
}
|
|
513
|
+
if (trimmed === "/login") {
|
|
514
|
+
ctx.setOverlay({ kind: "login", providers: buildLoginProviders(ctx.session) });
|
|
515
|
+
return true;
|
|
516
|
+
}
|
|
517
|
+
if (trimmed.startsWith("/login ")) {
|
|
518
|
+
return handleLoginProvider(trimmed.slice(7).trim(), ctx);
|
|
519
|
+
}
|
|
520
|
+
if (trimmed === "/logout") {
|
|
521
|
+
ctx.setOverlay({ kind: "logout", accounts: buildSavedAccounts(ctx.session) });
|
|
522
|
+
return true;
|
|
523
|
+
}
|
|
524
|
+
if (trimmed === "/new" || trimmed === "/clear") {
|
|
525
|
+
const started = await ctx.session.newSession();
|
|
526
|
+
if (!started) {
|
|
527
|
+
ctx.setStatus("Starting a new session was cancelled.", "warning");
|
|
528
|
+
return true;
|
|
529
|
+
}
|
|
530
|
+
ctx.resetSessionView?.();
|
|
531
|
+
ctx.setInput("");
|
|
532
|
+
ctx.setStatus("Started a new session.", "success");
|
|
533
|
+
return true;
|
|
534
|
+
}
|
|
535
|
+
if (trimmed === "/compact" || trimmed.startsWith("/compact ")) {
|
|
536
|
+
const customInstructions = trimmed === "/compact" ? undefined : trimmed.slice(9).trim();
|
|
537
|
+
try {
|
|
538
|
+
const compactionPromise = ctx.session.compact(customInstructions || undefined);
|
|
539
|
+
ctx.refreshSessionView?.();
|
|
540
|
+
ctx.setStatus("Compacting conversation context... Press Esc to cancel.", "busy");
|
|
541
|
+
await compactionPromise;
|
|
542
|
+
ctx.refreshSessionView?.();
|
|
543
|
+
ctx.setStatus("Compaction completed.", "success");
|
|
544
|
+
}
|
|
545
|
+
catch (error) {
|
|
546
|
+
ctx.refreshSessionView?.();
|
|
547
|
+
const failure = getCompactionErrorMessage(error);
|
|
548
|
+
if (failure.asError) {
|
|
549
|
+
ctx.setError(failure.text);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
ctx.setStatus(failure.text, failure.kind);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return true;
|
|
556
|
+
}
|
|
557
|
+
if (trimmed === "/reload") {
|
|
558
|
+
ctx.onBeforeReload?.();
|
|
559
|
+
await ctx.session.reload();
|
|
560
|
+
ctx.setStatus("Reloaded extensions, prompts, skills, and themes.", "success");
|
|
561
|
+
return true;
|
|
562
|
+
}
|
|
563
|
+
if (trimmed === "/copy") {
|
|
564
|
+
copyLastAssistantMessage(ctx.session);
|
|
565
|
+
ctx.setStatus("Copied the last assistant response to your clipboard.", "success");
|
|
566
|
+
return true;
|
|
567
|
+
}
|
|
568
|
+
if (trimmed === "/help") {
|
|
569
|
+
ctx.setStatus(formatSlashCommandList(ctx.session));
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
if (trimmed === "/hotkeys") {
|
|
573
|
+
ctx.setStatus(formatHotkeys());
|
|
574
|
+
return true;
|
|
575
|
+
}
|
|
576
|
+
if (trimmed === "/changelog") {
|
|
577
|
+
if (ctx.appendDisplayBlock) {
|
|
578
|
+
ctx.appendDisplayBlock({
|
|
579
|
+
kind: "changelog",
|
|
580
|
+
title: "What's New",
|
|
581
|
+
markdown: getFullChangelogMarkdown(),
|
|
582
|
+
});
|
|
583
|
+
ctx.clearStatus?.();
|
|
584
|
+
}
|
|
585
|
+
else {
|
|
586
|
+
ctx.setStatus(getFullChangelogMarkdown());
|
|
587
|
+
}
|
|
588
|
+
return true;
|
|
589
|
+
}
|
|
590
|
+
if (trimmed === "/debug") {
|
|
591
|
+
const debugPath = writeDebugLog(ctx.session);
|
|
592
|
+
ctx.setStatus(`Debug log written to ${debugPath}`, "success");
|
|
593
|
+
return true;
|
|
594
|
+
}
|
|
595
|
+
if (trimmed === "/share") {
|
|
596
|
+
handleShareCommand(ctx);
|
|
597
|
+
return true;
|
|
598
|
+
}
|
|
599
|
+
if (trimmed === "/mcp" || trimmed.startsWith("/mcp ")) {
|
|
600
|
+
await handleMCPCommand(trimmed.startsWith("/mcp ") ? trimmed.slice(5).trim() : "", ctx);
|
|
601
|
+
return true;
|
|
602
|
+
}
|
|
603
|
+
if (trimmed === "/memory" || trimmed.startsWith("/memory ")) {
|
|
604
|
+
await handleMemoryCommand(trimmed.startsWith("/memory ") ? trimmed.slice(8).trim() : "", ctx);
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
if (trimmed === "/composio" || trimmed.startsWith("/composio ")) {
|
|
608
|
+
await handleComposioCommand(trimmed.startsWith("/composio ") ? trimmed.slice(10).trim() : "", ctx);
|
|
609
|
+
return true;
|
|
610
|
+
}
|
|
611
|
+
if (trimmed === "/name") {
|
|
612
|
+
const currentName = ctx.session.sessionManager.getSessionName();
|
|
613
|
+
ctx.setStatus(currentName ? `Session name: ${currentName}` : "Session has no custom name yet.");
|
|
614
|
+
return true;
|
|
615
|
+
}
|
|
616
|
+
if (trimmed.startsWith("/name ")) {
|
|
617
|
+
const name = trimmed.slice(6).trim();
|
|
618
|
+
if (!name) {
|
|
619
|
+
ctx.setError("Usage: /name <name>");
|
|
620
|
+
return true;
|
|
621
|
+
}
|
|
622
|
+
const nextName = setSessionName(ctx.session, name);
|
|
623
|
+
ctx.setStatus(`Session name set to "${nextName}".`, "success");
|
|
624
|
+
return true;
|
|
625
|
+
}
|
|
626
|
+
if (trimmed === "/export" || trimmed.startsWith("/export ")) {
|
|
627
|
+
const outputPath = trimmed === "/export" ? undefined : trimmed.slice(8).trim() || undefined;
|
|
628
|
+
const exported = await ctx.session.exportToHtml(outputPath);
|
|
629
|
+
ctx.setStatus(`Exported session HTML to ${exported}.`, "success");
|
|
630
|
+
return true;
|
|
631
|
+
}
|
|
632
|
+
if ((trimmed === "/quit" || trimmed === "/exit") && ctx.onExit) {
|
|
633
|
+
ctx.onExit();
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
636
|
+
// Let prompt templates, extension commands, and /skill:* commands fall through to the runtime.
|
|
637
|
+
if (trimmed.startsWith("/")) {
|
|
638
|
+
const builtins = new Set([
|
|
639
|
+
"/settings",
|
|
640
|
+
"/model",
|
|
641
|
+
"/scoped-models",
|
|
642
|
+
"/theme",
|
|
643
|
+
"/session",
|
|
644
|
+
"/resume",
|
|
645
|
+
"/tree",
|
|
646
|
+
"/fork",
|
|
647
|
+
"/login",
|
|
648
|
+
"/logout",
|
|
649
|
+
"/new",
|
|
650
|
+
"/clear",
|
|
651
|
+
"/compact",
|
|
652
|
+
"/reload",
|
|
653
|
+
"/copy",
|
|
654
|
+
"/help",
|
|
655
|
+
"/hotkeys",
|
|
656
|
+
"/changelog",
|
|
657
|
+
"/debug",
|
|
658
|
+
"/share",
|
|
659
|
+
"/mcp",
|
|
660
|
+
"/memory",
|
|
661
|
+
"/composio",
|
|
662
|
+
"/name",
|
|
663
|
+
"/export",
|
|
664
|
+
"/quit",
|
|
665
|
+
"/exit",
|
|
666
|
+
]);
|
|
667
|
+
const baseCommand = ensureLeadingSlash(trimmed.split(/\s+/, 1)[0]);
|
|
668
|
+
if (!builtins.has(baseCommand)) {
|
|
669
|
+
return false;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
//# sourceMappingURL=command-router.js.map
|