indusagi 0.12.24 → 0.12.26
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/README.md +63 -0
- package/local-dist/bot/actions/composio/accounts.d.ts +23 -0
- package/local-dist/bot/actions/composio/accounts.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/accounts.js +40 -0
- package/local-dist/bot/actions/composio/accounts.js.map +1 -0
- package/local-dist/bot/actions/composio/client.d.ts +40 -0
- package/local-dist/bot/actions/composio/client.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/client.js +361 -0
- package/local-dist/bot/actions/composio/client.js.map +1 -0
- package/local-dist/bot/actions/composio/connect.d.ts +20 -0
- package/local-dist/bot/actions/composio/connect.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/connect.js +41 -0
- package/local-dist/bot/actions/composio/connect.js.map +1 -0
- package/local-dist/bot/actions/composio/enable.d.ts +26 -0
- package/local-dist/bot/actions/composio/enable.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/enable.js +66 -0
- package/local-dist/bot/actions/composio/enable.js.map +1 -0
- package/local-dist/bot/actions/composio/execute.d.ts +27 -0
- package/local-dist/bot/actions/composio/execute.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/execute.js +46 -0
- package/local-dist/bot/actions/composio/execute.js.map +1 -0
- package/local-dist/bot/actions/composio/helpers.d.ts +17 -0
- package/local-dist/bot/actions/composio/helpers.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/helpers.js +533 -0
- package/local-dist/bot/actions/composio/helpers.js.map +1 -0
- package/local-dist/bot/actions/composio/index.d.ts +10 -0
- package/local-dist/bot/actions/composio/index.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/index.js +9 -0
- package/local-dist/bot/actions/composio/index.js.map +1 -0
- package/local-dist/bot/actions/composio/provider.d.ts +9 -0
- package/local-dist/bot/actions/composio/provider.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/provider.js +54 -0
- package/local-dist/bot/actions/composio/provider.js.map +1 -0
- package/local-dist/bot/actions/composio/toolkits.d.ts +23 -0
- package/local-dist/bot/actions/composio/toolkits.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/toolkits.js +40 -0
- package/local-dist/bot/actions/composio/toolkits.js.map +1 -0
- package/local-dist/bot/actions/composio/tools.d.ts +29 -0
- package/local-dist/bot/actions/composio/tools.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/tools.js +72 -0
- package/local-dist/bot/actions/composio/tools.js.map +1 -0
- package/local-dist/bot/actions/composio/types.d.ts +126 -0
- package/local-dist/bot/actions/composio/types.d.ts.map +1 -0
- package/local-dist/bot/actions/composio/types.js +2 -0
- package/local-dist/bot/actions/composio/types.js.map +1 -0
- package/{dist → local-dist}/bot/actions/index.d.ts +111 -0
- package/local-dist/bot/actions/index.d.ts.map +1 -0
- package/{dist → local-dist}/bot/actions/index.js +108 -2
- package/local-dist/bot/actions/index.js.map +1 -0
- package/{dist → local-dist}/index.d.ts +1 -0
- package/{dist → local-dist}/index.d.ts.map +1 -1
- package/{dist → local-dist}/index.js +1 -0
- package/{dist → local-dist}/index.js.map +1 -1
- package/local-dist/react-host/index.d.ts +10 -0
- package/local-dist/react-host/index.d.ts.map +1 -0
- package/local-dist/react-host/index.js +9 -0
- package/local-dist/react-host/index.js.map +1 -0
- package/local-dist/react-host/ink.d.ts +5 -0
- package/local-dist/react-host/ink.d.ts.map +1 -0
- package/local-dist/react-host/ink.js +6 -0
- package/local-dist/react-host/ink.js.map +1 -0
- package/local-dist/react-host/jsx-runtime.d.ts +5 -0
- package/local-dist/react-host/jsx-runtime.d.ts.map +1 -0
- package/local-dist/react-host/jsx-runtime.js +6 -0
- package/local-dist/react-host/jsx-runtime.js.map +1 -0
- package/local-dist/react-host/loader.d.ts +4 -0
- package/local-dist/react-host/loader.d.ts.map +1 -0
- package/local-dist/react-host/loader.js +83 -0
- package/local-dist/react-host/loader.js.map +1 -0
- package/local-dist/react-ink/components/ChangelogBlock.d.ts +9 -0
- package/local-dist/react-ink/components/ChangelogBlock.d.ts.map +1 -0
- package/local-dist/react-ink/components/ChangelogBlock.js +58 -0
- package/local-dist/react-ink/components/ChangelogBlock.js.map +1 -0
- package/local-dist/react-ink/components/DisplayBlockView.d.ts +9 -0
- package/local-dist/react-ink/components/DisplayBlockView.d.ts.map +1 -0
- package/local-dist/react-ink/components/DisplayBlockView.js +11 -0
- package/local-dist/react-ink/components/DisplayBlockView.js.map +1 -0
- package/local-dist/react-ink/components/Footer.d.ts +12 -0
- package/local-dist/react-ink/components/Footer.d.ts.map +1 -0
- package/local-dist/react-ink/components/Footer.js +109 -0
- package/local-dist/react-ink/components/Footer.js.map +1 -0
- package/local-dist/react-ink/components/MessageList.d.ts +15 -0
- package/local-dist/react-ink/components/MessageList.d.ts.map +1 -0
- package/local-dist/react-ink/components/MessageList.js +43 -0
- package/local-dist/react-ink/components/MessageList.js.map +1 -0
- package/local-dist/react-ink/components/MessageRow.d.ts +14 -0
- package/local-dist/react-ink/components/MessageRow.d.ts.map +1 -0
- package/local-dist/react-ink/components/MessageRow.js +35 -0
- package/local-dist/react-ink/components/MessageRow.js.map +1 -0
- package/local-dist/react-ink/components/StatusLine.d.ts +10 -0
- package/local-dist/react-ink/components/StatusLine.d.ts.map +1 -0
- package/local-dist/react-ink/components/StatusLine.js +39 -0
- package/local-dist/react-ink/components/StatusLine.js.map +1 -0
- package/local-dist/react-ink/components/TaskPanel.d.ts +12 -0
- package/local-dist/react-ink/components/TaskPanel.d.ts.map +1 -0
- package/local-dist/react-ink/components/TaskPanel.js +23 -0
- package/local-dist/react-ink/components/TaskPanel.js.map +1 -0
- package/local-dist/react-ink/components/ToolEventBlock.d.ts +18 -0
- package/local-dist/react-ink/components/ToolEventBlock.d.ts.map +1 -0
- package/local-dist/react-ink/components/ToolEventBlock.js +61 -0
- package/local-dist/react-ink/components/ToolEventBlock.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/DialogFrame.d.ts +9 -0
- package/local-dist/react-ink/components/dialogs/DialogFrame.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/DialogFrame.js +6 -0
- package/local-dist/react-ink/components/dialogs/DialogFrame.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/LoginDialog.d.ts +15 -0
- package/local-dist/react-ink/components/dialogs/LoginDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/LoginDialog.js +10 -0
- package/local-dist/react-ink/components/dialogs/LoginDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/ModelDialog.d.ts +10 -0
- package/local-dist/react-ink/components/dialogs/ModelDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/ModelDialog.js +64 -0
- package/local-dist/react-ink/components/dialogs/ModelDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/OAuthDialog.d.ts +10 -0
- package/local-dist/react-ink/components/dialogs/OAuthDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/OAuthDialog.js +24 -0
- package/local-dist/react-ink/components/dialogs/OAuthDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/ScopedModelsDialog.d.ts +10 -0
- package/local-dist/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/ScopedModelsDialog.js +95 -0
- package/local-dist/react-ink/components/dialogs/ScopedModelsDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/SelectableDialog.d.ts +17 -0
- package/local-dist/react-ink/components/dialogs/SelectableDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/SelectableDialog.js +66 -0
- package/local-dist/react-ink/components/dialogs/SelectableDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/SessionDialog.d.ts +14 -0
- package/local-dist/react-ink/components/dialogs/SessionDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/SessionDialog.js +201 -0
- package/local-dist/react-ink/components/dialogs/SessionDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/SettingsDialog.d.ts +15 -0
- package/local-dist/react-ink/components/dialogs/SettingsDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/SettingsDialog.js +79 -0
- package/local-dist/react-ink/components/dialogs/SettingsDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/StartupSessionPicker.d.ts +10 -0
- package/local-dist/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/StartupSessionPicker.js +100 -0
- package/local-dist/react-ink/components/dialogs/StartupSessionPicker.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/ThemeDialog.d.ts +8 -0
- package/local-dist/react-ink/components/dialogs/ThemeDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/ThemeDialog.js +7 -0
- package/local-dist/react-ink/components/dialogs/ThemeDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/TreeDialog.d.ts +9 -0
- package/local-dist/react-ink/components/dialogs/TreeDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/TreeDialog.js +7 -0
- package/local-dist/react-ink/components/dialogs/TreeDialog.js.map +1 -0
- package/local-dist/react-ink/components/dialogs/UserMessageDialog.d.ts +9 -0
- package/local-dist/react-ink/components/dialogs/UserMessageDialog.d.ts.map +1 -0
- package/local-dist/react-ink/components/dialogs/UserMessageDialog.js +7 -0
- package/local-dist/react-ink/components/dialogs/UserMessageDialog.js.map +1 -0
- package/local-dist/react-ink/components/messages/AssistantMessage.d.ts +13 -0
- package/local-dist/react-ink/components/messages/AssistantMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/AssistantMessage.js +20 -0
- package/local-dist/react-ink/components/messages/AssistantMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/BashMessage.d.ts +9 -0
- package/local-dist/react-ink/components/messages/BashMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/BashMessage.js +11 -0
- package/local-dist/react-ink/components/messages/BashMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/BranchSummaryMessage.d.ts +9 -0
- package/local-dist/react-ink/components/messages/BranchSummaryMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/BranchSummaryMessage.js +6 -0
- package/local-dist/react-ink/components/messages/BranchSummaryMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/CompactionMessage.d.ts +9 -0
- package/local-dist/react-ink/components/messages/CompactionMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/CompactionMessage.js +6 -0
- package/local-dist/react-ink/components/messages/CompactionMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/CustomMessage.d.ts +10 -0
- package/local-dist/react-ink/components/messages/CustomMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/CustomMessage.js +9 -0
- package/local-dist/react-ink/components/messages/CustomMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/SkillInvocationMessage.d.ts +8 -0
- package/local-dist/react-ink/components/messages/SkillInvocationMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/SkillInvocationMessage.js +10 -0
- package/local-dist/react-ink/components/messages/SkillInvocationMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/ToolCallMessage.d.ts +9 -0
- package/local-dist/react-ink/components/messages/ToolCallMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/ToolCallMessage.js +8 -0
- package/local-dist/react-ink/components/messages/ToolCallMessage.js.map +1 -0
- package/local-dist/react-ink/components/messages/ToolResultBlock.d.ts +13 -0
- package/local-dist/react-ink/components/messages/ToolResultBlock.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/ToolResultBlock.js +8 -0
- package/local-dist/react-ink/components/messages/ToolResultBlock.js.map +1 -0
- package/local-dist/react-ink/components/messages/UserMessage.d.ts +10 -0
- package/local-dist/react-ink/components/messages/UserMessage.d.ts.map +1 -0
- package/local-dist/react-ink/components/messages/UserMessage.js +9 -0
- package/local-dist/react-ink/components/messages/UserMessage.js.map +1 -0
- package/local-dist/react-ink/index.d.ts +35 -0
- package/local-dist/react-ink/index.d.ts.map +1 -0
- package/local-dist/react-ink/index.js +35 -0
- package/local-dist/react-ink/index.js.map +1 -0
- package/local-dist/react-ink/theme-adapter.d.ts +10 -0
- package/local-dist/react-ink/theme-adapter.d.ts.map +1 -0
- package/local-dist/react-ink/theme-adapter.js +44 -0
- package/local-dist/react-ink/theme-adapter.js.map +1 -0
- package/local-dist/react-ink/types.d.ts +134 -0
- package/local-dist/react-ink/types.d.ts.map +1 -0
- package/local-dist/react-ink/types.js +2 -0
- package/local-dist/react-ink/types.js.map +1 -0
- package/local-dist/react-ink/utils/message-groups.d.ts +26 -0
- package/local-dist/react-ink/utils/message-groups.d.ts.map +1 -0
- package/local-dist/react-ink/utils/message-groups.js +240 -0
- package/local-dist/react-ink/utils/message-groups.js.map +1 -0
- package/local-dist/react-ink/utils/selection-dialog.d.ts +3 -0
- package/local-dist/react-ink/utils/selection-dialog.d.ts.map +1 -0
- package/local-dist/react-ink/utils/selection-dialog.js +18 -0
- package/local-dist/react-ink/utils/selection-dialog.js.map +1 -0
- package/local-dist/react-ink/utils/session-browser.d.ts +28 -0
- package/local-dist/react-ink/utils/session-browser.d.ts.map +1 -0
- package/local-dist/react-ink/utils/session-browser.js +191 -0
- package/local-dist/react-ink/utils/session-browser.js.map +1 -0
- package/local-dist/react-ink/utils/tool-display.d.ts +22 -0
- package/local-dist/react-ink/utils/tool-display.d.ts.map +1 -0
- package/local-dist/react-ink/utils/tool-display.js +349 -0
- package/local-dist/react-ink/utils/tool-display.js.map +1 -0
- package/local-dist/react-ink.d.ts +3 -0
- package/local-dist/react-ink.d.ts.map +1 -0
- package/local-dist/react-ink.js +2 -0
- package/local-dist/react-ink.js.map +1 -0
- package/local-dist/tui.d.ts +9 -0
- package/local-dist/tui.d.ts.map +1 -0
- package/local-dist/tui.js +8 -0
- package/local-dist/tui.js.map +1 -0
- package/local-dist/ui/contracts.d.ts +39 -0
- package/local-dist/ui/contracts.d.ts.map +1 -0
- package/local-dist/ui/contracts.js +2 -0
- package/local-dist/ui/contracts.js.map +1 -0
- package/{dist → local-dist}/ui/editor-component.d.ts +1 -1
- package/local-dist/ui/editor-component.d.ts.map +1 -0
- package/local-dist/ui/index.d.ts +9 -0
- package/local-dist/ui/index.d.ts.map +1 -0
- package/local-dist/ui/index.js +6 -0
- package/local-dist/ui/index.js.map +1 -0
- package/local-dist/ui/theme-types.d.ts +37 -0
- package/local-dist/ui/theme-types.d.ts.map +1 -0
- package/local-dist/ui/theme-types.js +2 -0
- package/local-dist/ui/theme-types.js.map +1 -0
- package/package.json +39 -17
- package/dist/bot/actions/index.d.ts.map +0 -1
- package/dist/bot/actions/index.js.map +0 -1
- package/dist/tui.d.ts +0 -6
- package/dist/tui.d.ts.map +0 -1
- package/dist/tui.js +0 -6
- package/dist/tui.js.map +0 -1
- package/dist/ui/editor-component.d.ts.map +0 -1
- package/dist/ui/index.d.ts +0 -23
- package/dist/ui/index.d.ts.map +0 -1
- package/dist/ui/index.js +0 -32
- package/dist/ui/index.js.map +0 -1
- package/dist/ui/parts/box.d.ts +0 -19
- package/dist/ui/parts/box.d.ts.map +0 -1
- package/dist/ui/parts/box.js +0 -134
- package/dist/ui/parts/box.js.map +0 -1
- package/dist/ui/parts/cancellable-loader.d.ts +0 -26
- package/dist/ui/parts/cancellable-loader.d.ts.map +0 -1
- package/dist/ui/parts/cancellable-loader.js +0 -39
- package/dist/ui/parts/cancellable-loader.js.map +0 -1
- package/dist/ui/parts/editor.d.ts +0 -189
- package/dist/ui/parts/editor.d.ts.map +0 -1
- package/dist/ui/parts/editor.js +0 -1546
- package/dist/ui/parts/editor.js.map +0 -1
- package/dist/ui/parts/image.d.ts +0 -30
- package/dist/ui/parts/image.d.ts.map +0 -1
- package/dist/ui/parts/image.js +0 -105
- package/dist/ui/parts/image.js.map +0 -1
- package/dist/ui/parts/input.d.ts +0 -21
- package/dist/ui/parts/input.d.ts.map +0 -1
- package/dist/ui/parts/input.js +0 -305
- package/dist/ui/parts/input.js.map +0 -1
- package/dist/ui/parts/loader.d.ts +0 -23
- package/dist/ui/parts/loader.d.ts.map +0 -1
- package/dist/ui/parts/loader.js +0 -57
- package/dist/ui/parts/loader.js.map +0 -1
- package/dist/ui/parts/markdown.d.ts +0 -59
- package/dist/ui/parts/markdown.d.ts.map +0 -1
- package/dist/ui/parts/markdown.js +0 -511
- package/dist/ui/parts/markdown.js.map +0 -1
- package/dist/ui/parts/select-list.d.ts +0 -33
- package/dist/ui/parts/select-list.d.ts.map +0 -1
- package/dist/ui/parts/select-list.js +0 -157
- package/dist/ui/parts/select-list.js.map +0 -1
- package/dist/ui/parts/settings-list.d.ts +0 -50
- package/dist/ui/parts/settings-list.d.ts.map +0 -1
- package/dist/ui/parts/settings-list.js +0 -196
- package/dist/ui/parts/settings-list.js.map +0 -1
- package/dist/ui/parts/spacer.d.ts +0 -13
- package/dist/ui/parts/spacer.d.ts.map +0 -1
- package/dist/ui/parts/spacer.js +0 -42
- package/dist/ui/parts/spacer.js.map +0 -1
- package/dist/ui/parts/text-renderer.d.ts +0 -7
- package/dist/ui/parts/text-renderer.d.ts.map +0 -1
- package/dist/ui/parts/text-renderer.js +0 -25
- package/dist/ui/parts/text-renderer.js.map +0 -1
- package/dist/ui/parts/text.d.ts +0 -17
- package/dist/ui/parts/text.d.ts.map +0 -1
- package/dist/ui/parts/text.js +0 -89
- package/dist/ui/parts/text.js.map +0 -1
- package/dist/ui/parts/truncated-text.d.ts +0 -17
- package/dist/ui/parts/truncated-text.d.ts.map +0 -1
- package/dist/ui/parts/truncated-text.js +0 -54
- package/dist/ui/parts/truncated-text.js.map +0 -1
- package/dist/ui/stdin-buffer.d.ts +0 -53
- package/dist/ui/stdin-buffer.d.ts.map +0 -1
- package/dist/ui/stdin-buffer.js +0 -332
- package/dist/ui/stdin-buffer.js.map +0 -1
- package/dist/ui/terminal-image.d.ts +0 -72
- package/dist/ui/terminal-image.d.ts.map +0 -1
- package/dist/ui/terminal-image.js +0 -291
- package/dist/ui/terminal-image.js.map +0 -1
- package/dist/ui/terminal.d.ts +0 -55
- package/dist/ui/terminal.d.ts.map +0 -1
- package/dist/ui/terminal.js +0 -210
- package/dist/ui/terminal.js.map +0 -1
- package/dist/ui/tui.d.ts +0 -250
- package/dist/ui/tui.d.ts.map +0 -1
- package/dist/ui/tui.js +0 -928
- package/dist/ui/tui.js.map +0 -1
- /package/{dist → local-dist}/agent.d.ts +0 -0
- /package/{dist → local-dist}/agent.d.ts.map +0 -0
- /package/{dist → local-dist}/agent.js +0 -0
- /package/{dist → local-dist}/agent.js.map +0 -0
- /package/{dist → local-dist}/ai.d.ts +0 -0
- /package/{dist → local-dist}/ai.d.ts.map +0 -0
- /package/{dist → local-dist}/ai.js +0 -0
- /package/{dist → local-dist}/ai.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/bash.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/bash.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/bash.js +0 -0
- /package/{dist → local-dist}/bot/actions/bash.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/activity-tracker.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/activity-tracker.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/activity-tracker.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/activity-tracker.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/cleanup.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/cleanup.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/cleanup.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/cleanup.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/fs-lock.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/fs-lock.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/fs-lock.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/fs-lock.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/index.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/index.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/index.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/index.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/mailbox.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/mailbox.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/mailbox.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/mailbox.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/model-policy.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/model-policy.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/model-policy.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/model-policy.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/names.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/names.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/names.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/names.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/protocol.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/protocol.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/protocol.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/protocol.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/task-store.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/task-store.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/task-store.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/task-store.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-attach-claim.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-attach-claim.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-attach-claim.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-attach-claim.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-config.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-config.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-config.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/team-config.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/worktree.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/crew/worktree.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/crew/worktree.js +0 -0
- /package/{dist → local-dist}/bot/actions/crew/worktree.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/edit-diff.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/edit-diff.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/edit-diff.js +0 -0
- /package/{dist → local-dist}/bot/actions/edit-diff.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/edit.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/edit.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/edit.js +0 -0
- /package/{dist → local-dist}/bot/actions/edit.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/find.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/find.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/find.js +0 -0
- /package/{dist → local-dist}/bot/actions/find.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/grep.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/grep.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/grep.js +0 -0
- /package/{dist → local-dist}/bot/actions/grep.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/hook-runner.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/kit/hook-runner.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/hook-runner.js +0 -0
- /package/{dist → local-dist}/bot/actions/kit/hook-runner.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/image-resize.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/kit/image-resize.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/image-resize.js +0 -0
- /package/{dist → local-dist}/bot/actions/kit/image-resize.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/mime.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/kit/mime.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/mime.js +0 -0
- /package/{dist → local-dist}/bot/actions/kit/mime.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/shell.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/kit/shell.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/kit/shell.js +0 -0
- /package/{dist → local-dist}/bot/actions/kit/shell.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/ls.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/ls.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/ls.js +0 -0
- /package/{dist → local-dist}/bot/actions/ls.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/path-utils.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/path-utils.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/path-utils.js +0 -0
- /package/{dist → local-dist}/bot/actions/path-utils.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-controller.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/process-controller.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-controller.js +0 -0
- /package/{dist → local-dist}/bot/actions/process-controller.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-manager.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/process-manager.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-manager.js +0 -0
- /package/{dist → local-dist}/bot/actions/process-manager.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-types.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/process-types.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/process-types.js +0 -0
- /package/{dist → local-dist}/bot/actions/process-types.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/process.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/process.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/process.js +0 -0
- /package/{dist → local-dist}/bot/actions/process.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/read.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/read.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/read.js +0 -0
- /package/{dist → local-dist}/bot/actions/read.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/registry.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/registry.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/registry.js +0 -0
- /package/{dist → local-dist}/bot/actions/registry.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo-store.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/todo-store.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo-store.js +0 -0
- /package/{dist → local-dist}/bot/actions/todo-store.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo-types.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/todo-types.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo-types.js +0 -0
- /package/{dist → local-dist}/bot/actions/todo-types.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/todo.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/todo.js +0 -0
- /package/{dist → local-dist}/bot/actions/todo.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/truncate.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/truncate.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/truncate.js +0 -0
- /package/{dist → local-dist}/bot/actions/truncate.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/webfetch.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/webfetch.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/webfetch.js +0 -0
- /package/{dist → local-dist}/bot/actions/webfetch.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/websearch.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/websearch.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/websearch.js +0 -0
- /package/{dist → local-dist}/bot/actions/websearch.js.map +0 -0
- /package/{dist → local-dist}/bot/actions/write.d.ts +0 -0
- /package/{dist → local-dist}/bot/actions/write.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/actions/write.js +0 -0
- /package/{dist → local-dist}/bot/actions/write.js.map +0 -0
- /package/{dist → local-dist}/bot/agent-loop.d.ts +0 -0
- /package/{dist → local-dist}/bot/agent-loop.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/agent-loop.js +0 -0
- /package/{dist → local-dist}/bot/agent-loop.js.map +0 -0
- /package/{dist → local-dist}/bot/agent.d.ts +0 -0
- /package/{dist → local-dist}/bot/agent.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/agent.js +0 -0
- /package/{dist → local-dist}/bot/agent.js.map +0 -0
- /package/{dist → local-dist}/bot/error-handler.d.ts +0 -0
- /package/{dist → local-dist}/bot/error-handler.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/error-handler.js +0 -0
- /package/{dist → local-dist}/bot/error-handler.js.map +0 -0
- /package/{dist → local-dist}/bot/event-bus.d.ts +0 -0
- /package/{dist → local-dist}/bot/event-bus.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/event-bus.js +0 -0
- /package/{dist → local-dist}/bot/event-bus.js.map +0 -0
- /package/{dist → local-dist}/bot/index.d.ts +0 -0
- /package/{dist → local-dist}/bot/index.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/index.js +0 -0
- /package/{dist → local-dist}/bot/index.js.map +0 -0
- /package/{dist → local-dist}/bot/messages.d.ts +0 -0
- /package/{dist → local-dist}/bot/messages.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/messages.js +0 -0
- /package/{dist → local-dist}/bot/messages.js.map +0 -0
- /package/{dist → local-dist}/bot/proxy.d.ts +0 -0
- /package/{dist → local-dist}/bot/proxy.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/proxy.js +0 -0
- /package/{dist → local-dist}/bot/proxy.js.map +0 -0
- /package/{dist → local-dist}/bot/session-manager.d.ts +0 -0
- /package/{dist → local-dist}/bot/session-manager.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/session-manager.js +0 -0
- /package/{dist → local-dist}/bot/session-manager.js.map +0 -0
- /package/{dist → local-dist}/bot/state-manager.d.ts +0 -0
- /package/{dist → local-dist}/bot/state-manager.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/state-manager.js +0 -0
- /package/{dist → local-dist}/bot/state-manager.js.map +0 -0
- /package/{dist → local-dist}/bot/telemetry.d.ts +0 -0
- /package/{dist → local-dist}/bot/telemetry.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/telemetry.js +0 -0
- /package/{dist → local-dist}/bot/telemetry.js.map +0 -0
- /package/{dist → local-dist}/bot/types.d.ts +0 -0
- /package/{dist → local-dist}/bot/types.d.ts.map +0 -0
- /package/{dist → local-dist}/bot/types.js +0 -0
- /package/{dist → local-dist}/bot/types.js.map +0 -0
- /package/{dist → local-dist}/cli.d.ts +0 -0
- /package/{dist → local-dist}/cli.d.ts.map +0 -0
- /package/{dist → local-dist}/cli.js +0 -0
- /package/{dist → local-dist}/cli.js.map +0 -0
- /package/{dist → local-dist}/mcp/client-pool.d.ts +0 -0
- /package/{dist → local-dist}/mcp/client-pool.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/client-pool.js +0 -0
- /package/{dist → local-dist}/mcp/client-pool.js.map +0 -0
- /package/{dist → local-dist}/mcp/client.d.ts +0 -0
- /package/{dist → local-dist}/mcp/client.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/client.js +0 -0
- /package/{dist → local-dist}/mcp/client.js.map +0 -0
- /package/{dist → local-dist}/mcp/config.d.ts +0 -0
- /package/{dist → local-dist}/mcp/config.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/config.js +0 -0
- /package/{dist → local-dist}/mcp/config.js.map +0 -0
- /package/{dist → local-dist}/mcp/errors.d.ts +0 -0
- /package/{dist → local-dist}/mcp/errors.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/errors.js +0 -0
- /package/{dist → local-dist}/mcp/errors.js.map +0 -0
- /package/{dist → local-dist}/mcp/index.d.ts +0 -0
- /package/{dist → local-dist}/mcp/index.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/index.js +0 -0
- /package/{dist → local-dist}/mcp/index.js.map +0 -0
- /package/{dist → local-dist}/mcp/schema-converter.d.ts +0 -0
- /package/{dist → local-dist}/mcp/schema-converter.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/schema-converter.js +0 -0
- /package/{dist → local-dist}/mcp/schema-converter.js.map +0 -0
- /package/{dist → local-dist}/mcp/server.d.ts +0 -0
- /package/{dist → local-dist}/mcp/server.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/server.js +0 -0
- /package/{dist → local-dist}/mcp/server.js.map +0 -0
- /package/{dist → local-dist}/mcp/tool-factory.d.ts +0 -0
- /package/{dist → local-dist}/mcp/tool-factory.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/tool-factory.js +0 -0
- /package/{dist → local-dist}/mcp/tool-factory.js.map +0 -0
- /package/{dist → local-dist}/mcp/types.d.ts +0 -0
- /package/{dist → local-dist}/mcp/types.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp/types.js +0 -0
- /package/{dist → local-dist}/mcp/types.js.map +0 -0
- /package/{dist → local-dist}/mcp.d.ts +0 -0
- /package/{dist → local-dist}/mcp.d.ts.map +0 -0
- /package/{dist → local-dist}/mcp.js +0 -0
- /package/{dist → local-dist}/mcp.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/amazon-bedrock.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/amazon-bedrock.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/amazon-bedrock.js +0 -0
- /package/{dist → local-dist}/ml/adapters/amazon-bedrock.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/anthropic.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/anthropic.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/anthropic.js +0 -0
- /package/{dist → local-dist}/ml/adapters/anthropic.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/azure-openai-responses.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/azure-openai-responses.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/azure-openai-responses.js +0 -0
- /package/{dist → local-dist}/ml/adapters/azure-openai-responses.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google-shared.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/google-shared.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google-shared.js +0 -0
- /package/{dist → local-dist}/ml/adapters/google-shared.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google-vertex.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/google-vertex.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google-vertex.js +0 -0
- /package/{dist → local-dist}/ml/adapters/google-vertex.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/google.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/google.js +0 -0
- /package/{dist → local-dist}/ml/adapters/google.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/kimi.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/kimi.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/kimi.js +0 -0
- /package/{dist → local-dist}/ml/adapters/kimi.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/mock.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/mock.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/mock.js +0 -0
- /package/{dist → local-dist}/ml/adapters/mock.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-codex-responses.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-codex-responses.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-codex-responses.js +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-codex-responses.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-completions.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-completions.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-completions.js +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-completions.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses-shared.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses-shared.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses-shared.js +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses-shared.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses.js +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-responses.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-scaffold.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-scaffold.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-scaffold.js +0 -0
- /package/{dist → local-dist}/ml/adapters/openai-scaffold.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/register-builtins.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/register-builtins.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/register-builtins.js +0 -0
- /package/{dist → local-dist}/ml/adapters/register-builtins.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/simple-options.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/simple-options.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/simple-options.js +0 -0
- /package/{dist → local-dist}/ml/adapters/simple-options.js.map +0 -0
- /package/{dist → local-dist}/ml/adapters/transform-messages.d.ts +0 -0
- /package/{dist → local-dist}/ml/adapters/transform-messages.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/adapters/transform-messages.js +0 -0
- /package/{dist → local-dist}/ml/adapters/transform-messages.js.map +0 -0
- /package/{dist → local-dist}/ml/api-registry.d.ts +0 -0
- /package/{dist → local-dist}/ml/api-registry.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/api-registry.js +0 -0
- /package/{dist → local-dist}/ml/api-registry.js.map +0 -0
- /package/{dist → local-dist}/ml/cli.d.ts +0 -0
- /package/{dist → local-dist}/ml/cli.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/cli.js +0 -0
- /package/{dist → local-dist}/ml/cli.js.map +0 -0
- /package/{dist → local-dist}/ml/env-api-keys.d.ts +0 -0
- /package/{dist → local-dist}/ml/env-api-keys.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/env-api-keys.js +0 -0
- /package/{dist → local-dist}/ml/env-api-keys.js.map +0 -0
- /package/{dist → local-dist}/ml/index.d.ts +0 -0
- /package/{dist → local-dist}/ml/index.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/index.js +0 -0
- /package/{dist → local-dist}/ml/index.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/anthropic.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/anthropic.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/anthropic.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/anthropic.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/github-copilot.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/github-copilot.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/github-copilot.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/github-copilot.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/index.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/index.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/index.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/index.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/kimi.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/kimi.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/kimi.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/kimi.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/openai-codex.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/openai-codex.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/openai-codex.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/openai-codex.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/pkce.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/pkce.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/pkce.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/pkce.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/types.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/auth/types.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/auth/types.js +0 -0
- /package/{dist → local-dist}/ml/kit/auth/types.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/base-stream-handler.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/base-stream-handler.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/base-stream-handler.js +0 -0
- /package/{dist → local-dist}/ml/kit/base-stream-handler.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/event-stream.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/event-stream.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/event-stream.js +0 -0
- /package/{dist → local-dist}/ml/kit/event-stream.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/index.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/index.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/index.js +0 -0
- /package/{dist → local-dist}/ml/kit/index.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/json-parse.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/json-parse.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/json-parse.js +0 -0
- /package/{dist → local-dist}/ml/kit/json-parse.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/message-transform.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/message-transform.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/message-transform.js +0 -0
- /package/{dist → local-dist}/ml/kit/message-transform.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/output-factory.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/output-factory.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/output-factory.js +0 -0
- /package/{dist → local-dist}/ml/kit/output-factory.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/overflow.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/overflow.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/overflow.js +0 -0
- /package/{dist → local-dist}/ml/kit/overflow.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-adapter.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/provider-adapter.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-adapter.js +0 -0
- /package/{dist → local-dist}/ml/kit/provider-adapter.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-client-builder.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/provider-client-builder.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-client-builder.js +0 -0
- /package/{dist → local-dist}/ml/kit/provider-client-builder.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-consolidation.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/provider-consolidation.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-consolidation.js +0 -0
- /package/{dist → local-dist}/ml/kit/provider-consolidation.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-constants.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/provider-constants.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-constants.js +0 -0
- /package/{dist → local-dist}/ml/kit/provider-constants.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-errors.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/provider-errors.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/provider-errors.js +0 -0
- /package/{dist → local-dist}/ml/kit/provider-errors.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/sanitize-unicode.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/sanitize-unicode.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/sanitize-unicode.js +0 -0
- /package/{dist → local-dist}/ml/kit/sanitize-unicode.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/stream-event-helper.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/stream-event-helper.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/stream-event-helper.js +0 -0
- /package/{dist → local-dist}/ml/kit/stream-event-helper.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/stream-handler-types.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/stream-handler-types.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/stream-handler-types.js +0 -0
- /package/{dist → local-dist}/ml/kit/stream-handler-types.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/streaming-state-manager.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/streaming-state-manager.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/streaming-state-manager.js +0 -0
- /package/{dist → local-dist}/ml/kit/streaming-state-manager.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/tool-converter.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/tool-converter.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/tool-converter.js +0 -0
- /package/{dist → local-dist}/ml/kit/tool-converter.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/typebox-helpers.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/typebox-helpers.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/typebox-helpers.js +0 -0
- /package/{dist → local-dist}/ml/kit/typebox-helpers.js.map +0 -0
- /package/{dist → local-dist}/ml/kit/validation.d.ts +0 -0
- /package/{dist → local-dist}/ml/kit/validation.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/kit/validation.js +0 -0
- /package/{dist → local-dist}/ml/kit/validation.js.map +0 -0
- /package/{dist → local-dist}/ml/models.d.ts +0 -0
- /package/{dist → local-dist}/ml/models.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/models.generated.d.ts +0 -0
- /package/{dist → local-dist}/ml/models.generated.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/models.generated.js +0 -0
- /package/{dist → local-dist}/ml/models.generated.js.map +0 -0
- /package/{dist → local-dist}/ml/models.js +0 -0
- /package/{dist → local-dist}/ml/models.js.map +0 -0
- /package/{dist → local-dist}/ml/stream.d.ts +0 -0
- /package/{dist → local-dist}/ml/stream.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/stream.js +0 -0
- /package/{dist → local-dist}/ml/stream.js.map +0 -0
- /package/{dist → local-dist}/ml/types.d.ts +0 -0
- /package/{dist → local-dist}/ml/types.d.ts.map +0 -0
- /package/{dist → local-dist}/ml/types.js +0 -0
- /package/{dist → local-dist}/ml/types.js.map +0 -0
- /package/{dist → local-dist}/observability.d.ts +0 -0
- /package/{dist → local-dist}/observability.d.ts.map +0 -0
- /package/{dist → local-dist}/observability.js +0 -0
- /package/{dist → local-dist}/observability.js.map +0 -0
- /package/{dist → local-dist}/ui/autocomplete.d.ts +0 -0
- /package/{dist → local-dist}/ui/autocomplete.d.ts.map +0 -0
- /package/{dist → local-dist}/ui/autocomplete.js +0 -0
- /package/{dist → local-dist}/ui/autocomplete.js.map +0 -0
- /package/{dist → local-dist}/ui/editor-component.js +0 -0
- /package/{dist → local-dist}/ui/editor-component.js.map +0 -0
- /package/{dist → local-dist}/ui/fuzzy.d.ts +0 -0
- /package/{dist → local-dist}/ui/fuzzy.d.ts.map +0 -0
- /package/{dist → local-dist}/ui/fuzzy.js +0 -0
- /package/{dist → local-dist}/ui/fuzzy.js.map +0 -0
- /package/{dist → local-dist}/ui/keybindings.d.ts +0 -0
- /package/{dist → local-dist}/ui/keybindings.d.ts.map +0 -0
- /package/{dist → local-dist}/ui/keybindings.js +0 -0
- /package/{dist → local-dist}/ui/keybindings.js.map +0 -0
- /package/{dist → local-dist}/ui/keys.d.ts +0 -0
- /package/{dist → local-dist}/ui/keys.d.ts.map +0 -0
- /package/{dist → local-dist}/ui/keys.js +0 -0
- /package/{dist → local-dist}/ui/keys.js.map +0 -0
- /package/{dist → local-dist}/ui/utils.d.ts +0 -0
- /package/{dist → local-dist}/ui/utils.d.ts.map +0 -0
- /package/{dist → local-dist}/ui/utils.js +0 -0
- /package/{dist → local-dist}/ui/utils.js.map +0 -0
package/dist/ui/tui.js
DELETED
|
@@ -1,928 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal TUI implementation with differential rendering
|
|
3
|
-
*/
|
|
4
|
-
import * as fs from "node:fs";
|
|
5
|
-
import * as os from "node:os";
|
|
6
|
-
import * as path from "node:path";
|
|
7
|
-
import { isKeyRelease, matchesKey } from "./keys.js";
|
|
8
|
-
import { getCapabilities, setCellDimensions } from "./terminal-image.js";
|
|
9
|
-
import { extractSegments, sliceByColumn, sliceWithWidth, truncateToWidth, visibleWidth } from "./utils.js";
|
|
10
|
-
export class ComponentBase {
|
|
11
|
-
_cachedWidth;
|
|
12
|
-
_cachedRender;
|
|
13
|
-
wantsKeyRelease;
|
|
14
|
-
invalidate() {
|
|
15
|
-
this._cachedWidth = undefined;
|
|
16
|
-
this._cachedRender = undefined;
|
|
17
|
-
}
|
|
18
|
-
renderCached(width, renderFn) {
|
|
19
|
-
if (this._cachedRender && this._cachedWidth === width) {
|
|
20
|
-
return this._cachedRender;
|
|
21
|
-
}
|
|
22
|
-
const rendered = renderFn();
|
|
23
|
-
this._cachedWidth = width;
|
|
24
|
-
this._cachedRender = rendered;
|
|
25
|
-
return rendered;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
/** Type guard to check if a component implements Focusable */
|
|
29
|
-
export function isFocusable(component) {
|
|
30
|
-
return component !== null && "focused" in component;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Cursor position marker - APC (Application Program Command) sequence.
|
|
34
|
-
* This is a zero-width escape sequence that terminals ignore.
|
|
35
|
-
* Components emit this at the cursor position when focused.
|
|
36
|
-
* TUI finds and strips this marker, then positions the hardware cursor there.
|
|
37
|
-
*/
|
|
38
|
-
export const CURSOR_MARKER = "\x1b_pi:c\x07";
|
|
39
|
-
export { visibleWidth };
|
|
40
|
-
/** Parse a SizeValue into absolute value given a reference size */
|
|
41
|
-
function parseSizeValue(value, referenceSize) {
|
|
42
|
-
if (value === undefined)
|
|
43
|
-
return undefined;
|
|
44
|
-
if (typeof value === "number")
|
|
45
|
-
return value;
|
|
46
|
-
// Parse percentage string like "50%"
|
|
47
|
-
const match = value.match(/^(\d+(?:\.\d+)?)%$/);
|
|
48
|
-
if (match) {
|
|
49
|
-
return Math.floor((referenceSize * parseFloat(match[1])) / 100);
|
|
50
|
-
}
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
export class FocusManager {
|
|
54
|
-
focused = null;
|
|
55
|
-
setFocus(component) {
|
|
56
|
-
const previous = this.focused;
|
|
57
|
-
if (isFocusable(previous))
|
|
58
|
-
previous.focused = false;
|
|
59
|
-
previous?.onBlur?.();
|
|
60
|
-
this.focused = component;
|
|
61
|
-
if (isFocusable(component))
|
|
62
|
-
component.focused = true;
|
|
63
|
-
component?.onFocus?.();
|
|
64
|
-
return { previous, current: component };
|
|
65
|
-
}
|
|
66
|
-
getFocus() {
|
|
67
|
-
return this.focused;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
export class RenderEngine {
|
|
71
|
-
diffLines(oldLines, newLines) {
|
|
72
|
-
let firstChanged = -1;
|
|
73
|
-
let lastChanged = -1;
|
|
74
|
-
const maxLines = Math.max(newLines.length, oldLines.length);
|
|
75
|
-
for (let i = 0; i < maxLines; i++) {
|
|
76
|
-
const oldLine = i < oldLines.length ? oldLines[i] : "";
|
|
77
|
-
const newLine = i < newLines.length ? newLines[i] : "";
|
|
78
|
-
if (oldLine !== newLine) {
|
|
79
|
-
if (firstChanged === -1)
|
|
80
|
-
firstChanged = i;
|
|
81
|
-
lastChanged = i;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const appended = newLines.length > oldLines.length;
|
|
85
|
-
if (appended) {
|
|
86
|
-
if (firstChanged === -1)
|
|
87
|
-
firstChanged = oldLines.length;
|
|
88
|
-
lastChanged = newLines.length - 1;
|
|
89
|
-
}
|
|
90
|
-
return { firstChanged, lastChanged, appended };
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
export class LayoutEngine {
|
|
94
|
-
resolveOverlayLayout(options, overlayHeight, termWidth, termHeight) {
|
|
95
|
-
const opt = options ?? {};
|
|
96
|
-
const margin = typeof opt.margin === "number"
|
|
97
|
-
? { top: opt.margin, right: opt.margin, bottom: opt.margin, left: opt.margin }
|
|
98
|
-
: (opt.margin ?? {});
|
|
99
|
-
const marginTop = Math.max(0, margin.top ?? 0);
|
|
100
|
-
const marginRight = Math.max(0, margin.right ?? 0);
|
|
101
|
-
const marginBottom = Math.max(0, margin.bottom ?? 0);
|
|
102
|
-
const marginLeft = Math.max(0, margin.left ?? 0);
|
|
103
|
-
const availWidth = Math.max(1, termWidth - marginLeft - marginRight);
|
|
104
|
-
const availHeight = Math.max(1, termHeight - marginTop - marginBottom);
|
|
105
|
-
let width = parseSizeValue(opt.width, termWidth) ?? Math.min(80, availWidth);
|
|
106
|
-
if (opt.minWidth !== undefined)
|
|
107
|
-
width = Math.max(width, opt.minWidth);
|
|
108
|
-
width = Math.max(1, Math.min(width, availWidth));
|
|
109
|
-
let maxHeight = parseSizeValue(opt.maxHeight, termHeight);
|
|
110
|
-
if (maxHeight !== undefined)
|
|
111
|
-
maxHeight = Math.max(1, Math.min(maxHeight, availHeight));
|
|
112
|
-
const effectiveHeight = maxHeight !== undefined ? Math.min(overlayHeight, maxHeight) : overlayHeight;
|
|
113
|
-
let row;
|
|
114
|
-
let col;
|
|
115
|
-
if (opt.row !== undefined) {
|
|
116
|
-
if (typeof opt.row === "string") {
|
|
117
|
-
const match = opt.row.match(/^(\d+(?:\.\d+)?)%$/);
|
|
118
|
-
if (match) {
|
|
119
|
-
const maxRow = Math.max(0, availHeight - effectiveHeight);
|
|
120
|
-
row = marginTop + Math.floor(maxRow * (parseFloat(match[1]) / 100));
|
|
121
|
-
}
|
|
122
|
-
else
|
|
123
|
-
row = this.resolveAnchorRow("center", effectiveHeight, availHeight, marginTop);
|
|
124
|
-
}
|
|
125
|
-
else
|
|
126
|
-
row = opt.row;
|
|
127
|
-
}
|
|
128
|
-
else
|
|
129
|
-
row = this.resolveAnchorRow(opt.anchor ?? "center", effectiveHeight, availHeight, marginTop);
|
|
130
|
-
if (opt.col !== undefined) {
|
|
131
|
-
if (typeof opt.col === "string") {
|
|
132
|
-
const match = opt.col.match(/^(\d+(?:\.\d+)?)%$/);
|
|
133
|
-
if (match) {
|
|
134
|
-
const maxCol = Math.max(0, availWidth - width);
|
|
135
|
-
col = marginLeft + Math.floor(maxCol * (parseFloat(match[1]) / 100));
|
|
136
|
-
}
|
|
137
|
-
else
|
|
138
|
-
col = this.resolveAnchorCol("center", width, availWidth, marginLeft);
|
|
139
|
-
}
|
|
140
|
-
else
|
|
141
|
-
col = opt.col;
|
|
142
|
-
}
|
|
143
|
-
else
|
|
144
|
-
col = this.resolveAnchorCol(opt.anchor ?? "center", width, availWidth, marginLeft);
|
|
145
|
-
if (opt.offsetY !== undefined)
|
|
146
|
-
row += opt.offsetY;
|
|
147
|
-
if (opt.offsetX !== undefined)
|
|
148
|
-
col += opt.offsetX;
|
|
149
|
-
row = Math.max(marginTop, Math.min(row, termHeight - marginBottom - effectiveHeight));
|
|
150
|
-
col = Math.max(marginLeft, Math.min(col, termWidth - marginRight - width));
|
|
151
|
-
return { width, row, col, maxHeight };
|
|
152
|
-
}
|
|
153
|
-
resolveAnchorRow(anchor, height, availHeight, marginTop) {
|
|
154
|
-
switch (anchor) {
|
|
155
|
-
case "top-left":
|
|
156
|
-
case "top-center":
|
|
157
|
-
case "top-right":
|
|
158
|
-
return marginTop;
|
|
159
|
-
case "bottom-left":
|
|
160
|
-
case "bottom-center":
|
|
161
|
-
case "bottom-right":
|
|
162
|
-
return marginTop + availHeight - height;
|
|
163
|
-
default:
|
|
164
|
-
return marginTop + Math.floor((availHeight - height) / 2);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
resolveAnchorCol(anchor, width, availWidth, marginLeft) {
|
|
168
|
-
switch (anchor) {
|
|
169
|
-
case "top-left":
|
|
170
|
-
case "left-center":
|
|
171
|
-
case "bottom-left":
|
|
172
|
-
return marginLeft;
|
|
173
|
-
case "top-right":
|
|
174
|
-
case "right-center":
|
|
175
|
-
case "bottom-right":
|
|
176
|
-
return marginLeft + availWidth - width;
|
|
177
|
-
default:
|
|
178
|
-
return marginLeft + Math.floor((availWidth - width) / 2);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Container - a component that contains other components
|
|
184
|
-
*/
|
|
185
|
-
export class Container extends ComponentBase {
|
|
186
|
-
children = [];
|
|
187
|
-
addChild(component) {
|
|
188
|
-
this.children.push(component);
|
|
189
|
-
component.onMount?.();
|
|
190
|
-
}
|
|
191
|
-
removeChild(component) {
|
|
192
|
-
const index = this.children.indexOf(component);
|
|
193
|
-
if (index !== -1) {
|
|
194
|
-
this.children.splice(index, 1);
|
|
195
|
-
component.onUnmount?.();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
clear() {
|
|
199
|
-
for (const child of this.children)
|
|
200
|
-
child.onUnmount?.();
|
|
201
|
-
this.children = [];
|
|
202
|
-
}
|
|
203
|
-
invalidate() {
|
|
204
|
-
for (const child of this.children) {
|
|
205
|
-
child.invalidate?.();
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
render(width) {
|
|
209
|
-
const lines = [];
|
|
210
|
-
for (const child of this.children) {
|
|
211
|
-
lines.push(...child.render(width));
|
|
212
|
-
}
|
|
213
|
-
return lines;
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
class OverlayRegistry {
|
|
217
|
-
stack = [];
|
|
218
|
-
create(component, options, preFocus) {
|
|
219
|
-
const entry = { component, options, preFocus, hidden: false };
|
|
220
|
-
this.stack.push(entry);
|
|
221
|
-
return entry;
|
|
222
|
-
}
|
|
223
|
-
remove(entry) {
|
|
224
|
-
const index = this.stack.indexOf(entry);
|
|
225
|
-
if (index === -1)
|
|
226
|
-
return false;
|
|
227
|
-
this.stack.splice(index, 1);
|
|
228
|
-
return true;
|
|
229
|
-
}
|
|
230
|
-
pop() {
|
|
231
|
-
return this.stack.pop();
|
|
232
|
-
}
|
|
233
|
-
values() {
|
|
234
|
-
return this.stack;
|
|
235
|
-
}
|
|
236
|
-
count() {
|
|
237
|
-
return this.stack.length;
|
|
238
|
-
}
|
|
239
|
-
isVisible(entry, termWidth, termHeight) {
|
|
240
|
-
if (entry.hidden)
|
|
241
|
-
return false;
|
|
242
|
-
if (!entry.options?.visible)
|
|
243
|
-
return true;
|
|
244
|
-
return entry.options.visible(termWidth, termHeight);
|
|
245
|
-
}
|
|
246
|
-
topVisible(termWidth, termHeight) {
|
|
247
|
-
for (let i = this.stack.length - 1; i >= 0; i--) {
|
|
248
|
-
const entry = this.stack[i];
|
|
249
|
-
if (this.isVisible(entry, termWidth, termHeight))
|
|
250
|
-
return entry;
|
|
251
|
-
}
|
|
252
|
-
return undefined;
|
|
253
|
-
}
|
|
254
|
-
hasVisible(termWidth, termHeight) {
|
|
255
|
-
return this.stack.some((entry) => this.isVisible(entry, termWidth, termHeight));
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
class InputDispatchEngine {
|
|
259
|
-
applyListeners(data, listeners) {
|
|
260
|
-
if (listeners.size === 0)
|
|
261
|
-
return data;
|
|
262
|
-
let current = data;
|
|
263
|
-
for (const listener of listeners) {
|
|
264
|
-
const result = listener(current);
|
|
265
|
-
if (result?.consume)
|
|
266
|
-
return null;
|
|
267
|
-
if (result?.data !== undefined)
|
|
268
|
-
current = result.data;
|
|
269
|
-
}
|
|
270
|
-
return current.length > 0 ? current : null;
|
|
271
|
-
}
|
|
272
|
-
dispatchToFocused(data, focused) {
|
|
273
|
-
if (!focused?.handleInput)
|
|
274
|
-
return false;
|
|
275
|
-
if (isKeyRelease(data) && !focused.wantsKeyRelease)
|
|
276
|
-
return false;
|
|
277
|
-
focused.handleInput(data);
|
|
278
|
-
return true;
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
class CursorPlacementResolver {
|
|
282
|
-
static extract(lines) {
|
|
283
|
-
for (let row = 0; row < lines.length; row++) {
|
|
284
|
-
const line = lines[row];
|
|
285
|
-
const markerIndex = line.indexOf(CURSOR_MARKER);
|
|
286
|
-
if (markerIndex === -1)
|
|
287
|
-
continue;
|
|
288
|
-
const col = visibleWidth(line.slice(0, markerIndex));
|
|
289
|
-
lines[row] = line.slice(0, markerIndex) + line.slice(markerIndex + CURSOR_MARKER.length);
|
|
290
|
-
return { row, col };
|
|
291
|
-
}
|
|
292
|
-
return null;
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* TUI - Main class for managing terminal UI with differential rendering
|
|
297
|
-
*/
|
|
298
|
-
export class TUI extends Container {
|
|
299
|
-
terminal;
|
|
300
|
-
previousLines = [];
|
|
301
|
-
previousWidth = 0;
|
|
302
|
-
focusedComponent = null;
|
|
303
|
-
inputListeners = new Set();
|
|
304
|
-
focusManager = new FocusManager();
|
|
305
|
-
renderEngine = new RenderEngine();
|
|
306
|
-
layoutEngine = new LayoutEngine();
|
|
307
|
-
inputDispatcher = new InputDispatchEngine();
|
|
308
|
-
overlayRegistry = new OverlayRegistry();
|
|
309
|
-
/** Global callback for debug key (Shift+Ctrl+D). Called before input is forwarded to focused component. */
|
|
310
|
-
onDebug;
|
|
311
|
-
renderRequested = false;
|
|
312
|
-
cursorRow = 0; // Logical cursor row (end of rendered content)
|
|
313
|
-
hardwareCursorRow = 0; // Actual terminal cursor row (may differ due to IME positioning)
|
|
314
|
-
inputBuffer = ""; // Buffer for parsing terminal responses
|
|
315
|
-
cellSizeQueryPending = false;
|
|
316
|
-
showHardwareCursor = process.env.INDUSAGI_HARDWARE_CURSOR === "1";
|
|
317
|
-
maxLinesRendered = 0; // Track terminal's working area (max lines ever rendered)
|
|
318
|
-
previousViewportTop = 0; // Track previous viewport top for resize-aware cursor moves
|
|
319
|
-
fullRedrawCount = 0;
|
|
320
|
-
// Overlay stack for modal components rendered on top of base content is maintained by OverlayRegistry
|
|
321
|
-
constructor(terminal, showHardwareCursor) {
|
|
322
|
-
super();
|
|
323
|
-
this.terminal = terminal;
|
|
324
|
-
if (showHardwareCursor !== undefined) {
|
|
325
|
-
this.showHardwareCursor = showHardwareCursor;
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
get fullRedraws() {
|
|
329
|
-
return this.fullRedrawCount;
|
|
330
|
-
}
|
|
331
|
-
getShowHardwareCursor() {
|
|
332
|
-
return this.showHardwareCursor;
|
|
333
|
-
}
|
|
334
|
-
setShowHardwareCursor(enabled) {
|
|
335
|
-
if (this.showHardwareCursor === enabled)
|
|
336
|
-
return;
|
|
337
|
-
this.showHardwareCursor = enabled;
|
|
338
|
-
if (!enabled) {
|
|
339
|
-
this.terminal.hideCursor();
|
|
340
|
-
}
|
|
341
|
-
this.requestRender();
|
|
342
|
-
}
|
|
343
|
-
setFocus(component) {
|
|
344
|
-
this.focusManager.setFocus(component);
|
|
345
|
-
this.focusedComponent = this.focusManager.getFocus();
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Show an overlay component with configurable positioning and sizing.
|
|
349
|
-
* Returns a handle to control the overlay's visibility.
|
|
350
|
-
*/
|
|
351
|
-
showOverlay(component, options) {
|
|
352
|
-
const entry = this.overlayRegistry.create(component, options, this.focusedComponent);
|
|
353
|
-
if (this.isOverlayVisible(entry)) {
|
|
354
|
-
this.setFocus(component);
|
|
355
|
-
}
|
|
356
|
-
this.terminal.hideCursor();
|
|
357
|
-
this.requestRender();
|
|
358
|
-
return {
|
|
359
|
-
hide: () => {
|
|
360
|
-
if (!this.overlayRegistry.remove(entry))
|
|
361
|
-
return;
|
|
362
|
-
if (this.focusedComponent === component) {
|
|
363
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
364
|
-
this.setFocus(topVisible?.component ?? entry.preFocus);
|
|
365
|
-
}
|
|
366
|
-
if (this.overlayRegistry.count() === 0)
|
|
367
|
-
this.terminal.hideCursor();
|
|
368
|
-
this.requestRender();
|
|
369
|
-
},
|
|
370
|
-
setHidden: (hidden) => {
|
|
371
|
-
if (entry.hidden === hidden)
|
|
372
|
-
return;
|
|
373
|
-
entry.hidden = hidden;
|
|
374
|
-
if (hidden) {
|
|
375
|
-
if (this.focusedComponent === component) {
|
|
376
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
377
|
-
this.setFocus(topVisible?.component ?? entry.preFocus);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
else if (this.isOverlayVisible(entry)) {
|
|
381
|
-
this.setFocus(component);
|
|
382
|
-
}
|
|
383
|
-
this.requestRender();
|
|
384
|
-
},
|
|
385
|
-
isHidden: () => entry.hidden,
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
/** Hide the topmost overlay and restore previous focus. */
|
|
389
|
-
hideOverlay() {
|
|
390
|
-
const overlay = this.overlayRegistry.pop();
|
|
391
|
-
if (!overlay)
|
|
392
|
-
return;
|
|
393
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
394
|
-
this.setFocus(topVisible?.component ?? overlay.preFocus);
|
|
395
|
-
if (this.overlayRegistry.count() === 0)
|
|
396
|
-
this.terminal.hideCursor();
|
|
397
|
-
this.requestRender();
|
|
398
|
-
}
|
|
399
|
-
/** Check if there are any visible overlays */
|
|
400
|
-
hasOverlay() {
|
|
401
|
-
return this.overlayRegistry.hasVisible(this.terminal.columns, this.terminal.rows);
|
|
402
|
-
}
|
|
403
|
-
/** Check if an overlay entry is currently visible */
|
|
404
|
-
isOverlayVisible(entry) {
|
|
405
|
-
return this.overlayRegistry.isVisible(entry, this.terminal.columns, this.terminal.rows);
|
|
406
|
-
}
|
|
407
|
-
/** Find the topmost visible overlay, if any */
|
|
408
|
-
getTopmostVisibleOverlay() {
|
|
409
|
-
return this.overlayRegistry.topVisible(this.terminal.columns, this.terminal.rows);
|
|
410
|
-
}
|
|
411
|
-
invalidate() {
|
|
412
|
-
super.invalidate();
|
|
413
|
-
for (const overlay of this.overlayRegistry.values()) {
|
|
414
|
-
overlay.component.invalidate?.();
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
start() {
|
|
418
|
-
this.terminal.start((data) => this.handleInput(data), () => this.requestRender());
|
|
419
|
-
this.terminal.hideCursor();
|
|
420
|
-
this.queryCellSize();
|
|
421
|
-
this.requestRender();
|
|
422
|
-
}
|
|
423
|
-
addInputListener(listener) {
|
|
424
|
-
this.inputListeners.add(listener);
|
|
425
|
-
return () => {
|
|
426
|
-
this.inputListeners.delete(listener);
|
|
427
|
-
};
|
|
428
|
-
}
|
|
429
|
-
removeInputListener(listener) {
|
|
430
|
-
this.inputListeners.delete(listener);
|
|
431
|
-
}
|
|
432
|
-
queryCellSize() {
|
|
433
|
-
// Only query if terminal supports images (cell size is only used for image rendering)
|
|
434
|
-
if (!getCapabilities().images) {
|
|
435
|
-
return;
|
|
436
|
-
}
|
|
437
|
-
// Query terminal for cell size in pixels: CSI 16 t
|
|
438
|
-
// Response format: CSI 6 ; height ; width t
|
|
439
|
-
this.cellSizeQueryPending = true;
|
|
440
|
-
this.terminal.write("\x1b[16t");
|
|
441
|
-
}
|
|
442
|
-
stop() {
|
|
443
|
-
// Move cursor to the end of the content to prevent overwriting/artifacts on exit
|
|
444
|
-
if (this.previousLines.length > 0) {
|
|
445
|
-
const targetRow = this.previousLines.length; // Line after the last content
|
|
446
|
-
const lineDiff = targetRow - this.hardwareCursorRow;
|
|
447
|
-
if (lineDiff > 0) {
|
|
448
|
-
this.terminal.write(`\x1b[${lineDiff}B`);
|
|
449
|
-
}
|
|
450
|
-
else if (lineDiff < 0) {
|
|
451
|
-
this.terminal.write(`\x1b[${-lineDiff}A`);
|
|
452
|
-
}
|
|
453
|
-
this.terminal.write("\r\n");
|
|
454
|
-
}
|
|
455
|
-
this.terminal.showCursor();
|
|
456
|
-
this.terminal.stop();
|
|
457
|
-
}
|
|
458
|
-
requestRender(force = false) {
|
|
459
|
-
if (force) {
|
|
460
|
-
this.previousLines = [];
|
|
461
|
-
this.previousWidth = -1; // -1 triggers widthChanged, forcing a full clear
|
|
462
|
-
this.cursorRow = 0;
|
|
463
|
-
this.hardwareCursorRow = 0;
|
|
464
|
-
this.maxLinesRendered = 0;
|
|
465
|
-
this.previousViewportTop = 0;
|
|
466
|
-
}
|
|
467
|
-
if (this.renderRequested)
|
|
468
|
-
return;
|
|
469
|
-
this.renderRequested = true;
|
|
470
|
-
process.nextTick(() => {
|
|
471
|
-
this.renderRequested = false;
|
|
472
|
-
this.doRender();
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
handleInput(data) {
|
|
476
|
-
const listenerData = this.inputDispatcher.applyListeners(data, this.inputListeners);
|
|
477
|
-
if (listenerData === null)
|
|
478
|
-
return;
|
|
479
|
-
data = listenerData;
|
|
480
|
-
if (this.cellSizeQueryPending) {
|
|
481
|
-
this.inputBuffer += data;
|
|
482
|
-
const filtered = this.parseCellSizeResponse();
|
|
483
|
-
if (filtered.length === 0)
|
|
484
|
-
return;
|
|
485
|
-
data = filtered;
|
|
486
|
-
}
|
|
487
|
-
if (matchesKey(data, "shift+ctrl+d") && this.onDebug) {
|
|
488
|
-
this.onDebug();
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
const focusedOverlay = this.overlayRegistry.values().find((entry) => entry.component === this.focusedComponent);
|
|
492
|
-
if (focusedOverlay && !this.isOverlayVisible(focusedOverlay)) {
|
|
493
|
-
const topVisible = this.getTopmostVisibleOverlay();
|
|
494
|
-
this.setFocus(topVisible?.component ?? focusedOverlay.preFocus);
|
|
495
|
-
}
|
|
496
|
-
if (this.inputDispatcher.dispatchToFocused(data, this.focusedComponent)) {
|
|
497
|
-
this.requestRender();
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
parseCellSizeResponse() {
|
|
501
|
-
// Response format: ESC [ 6 ; height ; width t
|
|
502
|
-
// Match the response pattern
|
|
503
|
-
const responsePattern = /\x1b\[6;(\d+);(\d+)t/;
|
|
504
|
-
const match = this.inputBuffer.match(responsePattern);
|
|
505
|
-
if (match) {
|
|
506
|
-
const heightPx = parseInt(match[1], 10);
|
|
507
|
-
const widthPx = parseInt(match[2], 10);
|
|
508
|
-
if (heightPx > 0 && widthPx > 0) {
|
|
509
|
-
setCellDimensions({ widthPx, heightPx });
|
|
510
|
-
// Invalidate all components so images re-render with correct dimensions
|
|
511
|
-
this.invalidate();
|
|
512
|
-
this.requestRender();
|
|
513
|
-
}
|
|
514
|
-
// Remove the response from buffer
|
|
515
|
-
this.inputBuffer = this.inputBuffer.replace(responsePattern, "");
|
|
516
|
-
this.cellSizeQueryPending = false;
|
|
517
|
-
}
|
|
518
|
-
// Check if we have a partial cell size response starting (wait for more data)
|
|
519
|
-
// Patterns that could be incomplete cell size response: \x1b, \x1b[, \x1b[6, \x1b[6;...(no t yet)
|
|
520
|
-
const partialCellSizePattern = /\x1b(\[6?;?[\d;]*)?$/;
|
|
521
|
-
if (partialCellSizePattern.test(this.inputBuffer)) {
|
|
522
|
-
// Check if it's actually a complete different escape sequence (ends with a letter)
|
|
523
|
-
// Cell size response ends with 't', Kitty keyboard ends with 'u', arrows end with A-D, etc.
|
|
524
|
-
const lastChar = this.inputBuffer[this.inputBuffer.length - 1];
|
|
525
|
-
if (!/[a-zA-Z~]/.test(lastChar)) {
|
|
526
|
-
// Doesn't end with a terminator, might be incomplete - wait for more
|
|
527
|
-
return "";
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
// No cell size response found, return buffered data as user input
|
|
531
|
-
const result = this.inputBuffer;
|
|
532
|
-
this.inputBuffer = "";
|
|
533
|
-
this.cellSizeQueryPending = false; // Give up waiting
|
|
534
|
-
return result;
|
|
535
|
-
}
|
|
536
|
-
containsImage(line) {
|
|
537
|
-
return line.includes("\x1b_G") || line.includes("\x1b]1337;File=");
|
|
538
|
-
}
|
|
539
|
-
/**
|
|
540
|
-
* Resolve overlay layout from options.
|
|
541
|
-
* Returns { width, row, col, maxHeight } for rendering.
|
|
542
|
-
*/
|
|
543
|
-
resolveOverlayLayout(options, overlayHeight, termWidth, termHeight) {
|
|
544
|
-
return this.layoutEngine.resolveOverlayLayout(options, overlayHeight, termWidth, termHeight);
|
|
545
|
-
}
|
|
546
|
-
/** Composite all overlays into content lines (in stack order, later = on top). */
|
|
547
|
-
compositeOverlays(lines, termWidth, termHeight) {
|
|
548
|
-
const overlays = this.overlayRegistry.values();
|
|
549
|
-
if (overlays.length === 0)
|
|
550
|
-
return lines;
|
|
551
|
-
const result = [...lines];
|
|
552
|
-
const rendered = this.collectRenderedOverlays(overlays, termWidth, termHeight, result.length);
|
|
553
|
-
this.ensureOverlayWorkingHeight(result, rendered.minLinesNeeded);
|
|
554
|
-
const viewportStart = Math.max(0, result.length - termHeight);
|
|
555
|
-
const modified = this.compositeRenderedOverlays(result, rendered.items, viewportStart, termWidth);
|
|
556
|
-
this.clampCompositeWidth(result, modified, termWidth);
|
|
557
|
-
return result;
|
|
558
|
-
}
|
|
559
|
-
collectRenderedOverlays(overlays, termWidth, termHeight, initialMinLines) {
|
|
560
|
-
const items = [];
|
|
561
|
-
let minLinesNeeded = initialMinLines;
|
|
562
|
-
for (const entry of overlays) {
|
|
563
|
-
if (!this.isOverlayVisible(entry))
|
|
564
|
-
continue;
|
|
565
|
-
const { width, maxHeight } = this.resolveOverlayLayout(entry.options, 0, termWidth, termHeight);
|
|
566
|
-
const rawLines = entry.component.render(width);
|
|
567
|
-
const overlayLines = maxHeight !== undefined && rawLines.length > maxHeight ? rawLines.slice(0, maxHeight) : rawLines;
|
|
568
|
-
const finalPos = this.resolveOverlayLayout(entry.options, overlayLines.length, termWidth, termHeight);
|
|
569
|
-
items.push({ overlayLines, row: finalPos.row, col: finalPos.col, width });
|
|
570
|
-
minLinesNeeded = Math.max(minLinesNeeded, finalPos.row + overlayLines.length);
|
|
571
|
-
}
|
|
572
|
-
return { items, minLinesNeeded };
|
|
573
|
-
}
|
|
574
|
-
ensureOverlayWorkingHeight(result, minLinesNeeded) {
|
|
575
|
-
const workingHeight = Math.max(this.maxLinesRendered, minLinesNeeded);
|
|
576
|
-
while (result.length < workingHeight) {
|
|
577
|
-
result.push("");
|
|
578
|
-
}
|
|
579
|
-
}
|
|
580
|
-
compositeRenderedOverlays(result, rendered, viewportStart, termWidth) {
|
|
581
|
-
const modifiedLines = new Set();
|
|
582
|
-
for (const renderedOverlay of rendered) {
|
|
583
|
-
for (let localRow = 0; localRow < renderedOverlay.overlayLines.length; localRow++) {
|
|
584
|
-
const targetRow = viewportStart + renderedOverlay.row + localRow;
|
|
585
|
-
if (targetRow < 0 || targetRow >= result.length)
|
|
586
|
-
continue;
|
|
587
|
-
const originalOverlayLine = renderedOverlay.overlayLines[localRow];
|
|
588
|
-
const overlayLine = visibleWidth(originalOverlayLine) > renderedOverlay.width
|
|
589
|
-
? sliceByColumn(originalOverlayLine, 0, renderedOverlay.width, true)
|
|
590
|
-
: originalOverlayLine;
|
|
591
|
-
result[targetRow] = this.compositeLineAt(result[targetRow], overlayLine, renderedOverlay.col, renderedOverlay.width, termWidth);
|
|
592
|
-
modifiedLines.add(targetRow);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
return modifiedLines;
|
|
596
|
-
}
|
|
597
|
-
clampCompositeWidth(result, modified, termWidth) {
|
|
598
|
-
for (const row of modified) {
|
|
599
|
-
if (visibleWidth(result[row]) <= termWidth)
|
|
600
|
-
continue;
|
|
601
|
-
result[row] = sliceByColumn(result[row], 0, termWidth, true);
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
static SEGMENT_RESET = "\x1b[0m\x1b]8;;\x07";
|
|
605
|
-
applyLineResets(lines) {
|
|
606
|
-
const reset = TUI.SEGMENT_RESET;
|
|
607
|
-
return lines.map((line) => (this.containsImage(line) ? line : line + reset));
|
|
608
|
-
}
|
|
609
|
-
/** Splice overlay content into a base line at a specific column. Single-pass optimized. */
|
|
610
|
-
compositeLineAt(baseLine, overlayLine, startCol, overlayWidth, totalWidth) {
|
|
611
|
-
if (this.containsImage(baseLine))
|
|
612
|
-
return baseLine;
|
|
613
|
-
// Single pass through baseLine extracts both before and after segments
|
|
614
|
-
const afterStart = startCol + overlayWidth;
|
|
615
|
-
const base = extractSegments(baseLine, startCol, afterStart, totalWidth - afterStart, true);
|
|
616
|
-
// Extract overlay with width tracking (strict=true to exclude wide chars at boundary)
|
|
617
|
-
const overlay = sliceWithWidth(overlayLine, 0, overlayWidth, true);
|
|
618
|
-
// Pad segments to target widths
|
|
619
|
-
const beforePad = Math.max(0, startCol - base.beforeWidth);
|
|
620
|
-
const overlayPad = Math.max(0, overlayWidth - overlay.width);
|
|
621
|
-
const actualBeforeWidth = Math.max(startCol, base.beforeWidth);
|
|
622
|
-
const actualOverlayWidth = Math.max(overlayWidth, overlay.width);
|
|
623
|
-
const afterTarget = Math.max(0, totalWidth - actualBeforeWidth - actualOverlayWidth);
|
|
624
|
-
const afterPad = Math.max(0, afterTarget - base.afterWidth);
|
|
625
|
-
// Compose result
|
|
626
|
-
const r = TUI.SEGMENT_RESET;
|
|
627
|
-
const result = base.before +
|
|
628
|
-
" ".repeat(beforePad) +
|
|
629
|
-
r +
|
|
630
|
-
overlay.text +
|
|
631
|
-
" ".repeat(overlayPad) +
|
|
632
|
-
r +
|
|
633
|
-
base.after +
|
|
634
|
-
" ".repeat(afterPad);
|
|
635
|
-
// CRITICAL: Always verify and truncate to terminal width.
|
|
636
|
-
// This is the final safeguard against width overflow which would crash the TUI.
|
|
637
|
-
// Width tracking can drift from actual visible width due to:
|
|
638
|
-
// - Complex ANSI/OSC sequences (hyperlinks, colors)
|
|
639
|
-
// - Wide characters at segment boundaries
|
|
640
|
-
// - Edge cases in segment extraction
|
|
641
|
-
const resultWidth = visibleWidth(result);
|
|
642
|
-
if (resultWidth <= totalWidth) {
|
|
643
|
-
return result;
|
|
644
|
-
}
|
|
645
|
-
// Truncate with strict=true to ensure we don't exceed totalWidth
|
|
646
|
-
return sliceByColumn(result, 0, totalWidth, true);
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Find and extract cursor position from rendered lines.
|
|
650
|
-
* Searches for CURSOR_MARKER, calculates its position, and strips it from the output.
|
|
651
|
-
* @returns Cursor position { row, col } or null if no marker found
|
|
652
|
-
*/
|
|
653
|
-
extractCursorPosition(lines) {
|
|
654
|
-
return CursorPlacementResolver.extract(lines);
|
|
655
|
-
}
|
|
656
|
-
renderFullFrame(newLines, width, height, cursorPos, clear) {
|
|
657
|
-
this.fullRedrawCount += 1;
|
|
658
|
-
let buffer = "\x1b[?2026h";
|
|
659
|
-
if (clear)
|
|
660
|
-
buffer += "\x1b[3J\x1b[2J\x1b[H";
|
|
661
|
-
for (let i = 0; i < newLines.length; i++) {
|
|
662
|
-
if (i > 0)
|
|
663
|
-
buffer += "\r\n";
|
|
664
|
-
buffer += newLines[i];
|
|
665
|
-
}
|
|
666
|
-
buffer += "\x1b[?2026l";
|
|
667
|
-
this.terminal.write(buffer);
|
|
668
|
-
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
669
|
-
this.hardwareCursorRow = this.cursorRow;
|
|
670
|
-
if (clear) {
|
|
671
|
-
this.maxLinesRendered = newLines.length;
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
675
|
-
}
|
|
676
|
-
this.previousViewportTop = Math.max(0, this.maxLinesRendered - height);
|
|
677
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
678
|
-
this.previousLines = newLines;
|
|
679
|
-
this.previousWidth = width;
|
|
680
|
-
}
|
|
681
|
-
prepareRenderFrame(width, height) {
|
|
682
|
-
let newLines = this.render(width);
|
|
683
|
-
if (this.overlayRegistry.count() > 0) {
|
|
684
|
-
newLines = this.compositeOverlays(newLines, width, height);
|
|
685
|
-
}
|
|
686
|
-
const cursorPos = this.extractCursorPosition(newLines);
|
|
687
|
-
newLines = this.applyLineResets(newLines);
|
|
688
|
-
return { newLines, cursorPos };
|
|
689
|
-
}
|
|
690
|
-
computeRenderDiff(newLines) {
|
|
691
|
-
const { firstChanged, lastChanged, appended: appendedLines } = this.renderEngine.diffLines(this.previousLines, newLines);
|
|
692
|
-
const appendStart = appendedLines && firstChanged === this.previousLines.length && firstChanged > 0;
|
|
693
|
-
return { firstChanged, lastChanged, appendedLines, appendStart };
|
|
694
|
-
}
|
|
695
|
-
doRender() {
|
|
696
|
-
const width = this.terminal.columns;
|
|
697
|
-
const height = this.terminal.rows;
|
|
698
|
-
let viewportTop = Math.max(0, this.maxLinesRendered - height);
|
|
699
|
-
let prevViewportTop = this.previousViewportTop;
|
|
700
|
-
let hardwareCursorRow = this.hardwareCursorRow;
|
|
701
|
-
const computeLineDiff = (targetRow) => {
|
|
702
|
-
const currentScreenRow = hardwareCursorRow - prevViewportTop;
|
|
703
|
-
const targetScreenRow = targetRow - viewportTop;
|
|
704
|
-
return targetScreenRow - currentScreenRow;
|
|
705
|
-
};
|
|
706
|
-
const { newLines, cursorPos } = this.prepareRenderFrame(width, height);
|
|
707
|
-
// Width changed - need full re-render
|
|
708
|
-
const widthChanged = this.previousWidth !== 0 && this.previousWidth !== width;
|
|
709
|
-
const fullRender = (clear) => {
|
|
710
|
-
this.renderFullFrame(newLines, width, height, cursorPos, clear);
|
|
711
|
-
};
|
|
712
|
-
// First render - just output everything without clearing (assumes clean screen)
|
|
713
|
-
if (this.previousLines.length === 0 && !widthChanged) {
|
|
714
|
-
fullRender(false);
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
// Width changed - full re-render
|
|
718
|
-
if (widthChanged) {
|
|
719
|
-
fullRender(true);
|
|
720
|
-
return;
|
|
721
|
-
}
|
|
722
|
-
// Find first and last changed lines via RenderEngine
|
|
723
|
-
let { firstChanged, lastChanged, appendedLines, appendStart } = this.computeRenderDiff(newLines);
|
|
724
|
-
// No changes - but still need to update hardware cursor position if it moved
|
|
725
|
-
if (firstChanged === -1) {
|
|
726
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
727
|
-
this.previousViewportTop = Math.max(0, this.maxLinesRendered - height);
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
// All changes are in deleted lines (nothing to render, just clear)
|
|
731
|
-
if (firstChanged >= newLines.length) {
|
|
732
|
-
if (this.previousLines.length > newLines.length) {
|
|
733
|
-
let buffer = "\x1b[?2026h";
|
|
734
|
-
// Move to end of new content (clamp to 0 for empty content)
|
|
735
|
-
const targetRow = Math.max(0, newLines.length - 1);
|
|
736
|
-
const lineDiff = computeLineDiff(targetRow);
|
|
737
|
-
if (lineDiff > 0)
|
|
738
|
-
buffer += `\x1b[${lineDiff}B`;
|
|
739
|
-
else if (lineDiff < 0)
|
|
740
|
-
buffer += `\x1b[${-lineDiff}A`;
|
|
741
|
-
buffer += "\r";
|
|
742
|
-
// Clear extra lines without scrolling
|
|
743
|
-
const extraLines = this.previousLines.length - newLines.length;
|
|
744
|
-
if (extraLines > height) {
|
|
745
|
-
fullRender(true);
|
|
746
|
-
return;
|
|
747
|
-
}
|
|
748
|
-
if (extraLines > 0) {
|
|
749
|
-
buffer += "\x1b[1B";
|
|
750
|
-
}
|
|
751
|
-
for (let i = 0; i < extraLines; i++) {
|
|
752
|
-
buffer += "\r\x1b[2K";
|
|
753
|
-
if (i < extraLines - 1)
|
|
754
|
-
buffer += "\x1b[1B";
|
|
755
|
-
}
|
|
756
|
-
if (extraLines > 0) {
|
|
757
|
-
buffer += `\x1b[${extraLines}A`;
|
|
758
|
-
}
|
|
759
|
-
buffer += "\x1b[?2026l";
|
|
760
|
-
this.terminal.write(buffer);
|
|
761
|
-
this.cursorRow = targetRow;
|
|
762
|
-
this.hardwareCursorRow = targetRow;
|
|
763
|
-
}
|
|
764
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
765
|
-
this.previousLines = newLines;
|
|
766
|
-
this.previousWidth = width;
|
|
767
|
-
this.previousViewportTop = Math.max(0, this.maxLinesRendered - height);
|
|
768
|
-
return;
|
|
769
|
-
}
|
|
770
|
-
// Check if firstChanged is outside the viewport
|
|
771
|
-
// Viewport is based on max lines ever rendered (terminal's working area)
|
|
772
|
-
if (firstChanged < viewportTop) {
|
|
773
|
-
// First change is above viewport - need full re-render
|
|
774
|
-
fullRender(true);
|
|
775
|
-
return;
|
|
776
|
-
}
|
|
777
|
-
// Render from first changed line to end
|
|
778
|
-
// Build buffer with all updates wrapped in synchronized output
|
|
779
|
-
let buffer = "\x1b[?2026h"; // Begin synchronized output
|
|
780
|
-
const prevViewportBottom = prevViewportTop + height - 1;
|
|
781
|
-
const moveTargetRow = appendStart ? firstChanged - 1 : firstChanged;
|
|
782
|
-
if (moveTargetRow > prevViewportBottom) {
|
|
783
|
-
const currentScreenRow = Math.max(0, Math.min(height - 1, hardwareCursorRow - prevViewportTop));
|
|
784
|
-
const moveToBottom = height - 1 - currentScreenRow;
|
|
785
|
-
if (moveToBottom > 0) {
|
|
786
|
-
buffer += `\x1b[${moveToBottom}B`;
|
|
787
|
-
}
|
|
788
|
-
const scroll = moveTargetRow - prevViewportBottom;
|
|
789
|
-
buffer += "\r\n".repeat(scroll);
|
|
790
|
-
prevViewportTop += scroll;
|
|
791
|
-
viewportTop += scroll;
|
|
792
|
-
hardwareCursorRow = moveTargetRow;
|
|
793
|
-
}
|
|
794
|
-
// Move cursor to first changed line (use hardwareCursorRow for actual position)
|
|
795
|
-
const lineDiff = computeLineDiff(moveTargetRow);
|
|
796
|
-
if (lineDiff > 0) {
|
|
797
|
-
buffer += `\x1b[${lineDiff}B`; // Move down
|
|
798
|
-
}
|
|
799
|
-
else if (lineDiff < 0) {
|
|
800
|
-
buffer += `\x1b[${-lineDiff}A`; // Move up
|
|
801
|
-
}
|
|
802
|
-
buffer += appendStart ? "\r\n" : "\r"; // Move to column 0
|
|
803
|
-
// Only render changed lines (firstChanged to lastChanged), not all lines to end
|
|
804
|
-
// This reduces flicker when only a single line changes (e.g., spinner animation)
|
|
805
|
-
const renderEnd = Math.min(lastChanged, newLines.length - 1);
|
|
806
|
-
for (let i = firstChanged; i <= renderEnd; i++) {
|
|
807
|
-
if (i > firstChanged)
|
|
808
|
-
buffer += "\r\n";
|
|
809
|
-
buffer += "\x1b[2K"; // Clear current line
|
|
810
|
-
const line = newLines[i];
|
|
811
|
-
const isImageLine = this.containsImage(line);
|
|
812
|
-
if (!isImageLine && visibleWidth(line) > width) {
|
|
813
|
-
// Log all lines to crash file for debugging
|
|
814
|
-
const crashLogPath = path.join(os.homedir(), ".indusagi", "agent", "indus-crash.log");
|
|
815
|
-
const crashData = [
|
|
816
|
-
`Overflow at ${new Date().toISOString()}`,
|
|
817
|
-
`Terminal width: ${width}`,
|
|
818
|
-
`Line ${i} visible width: ${visibleWidth(line)}`,
|
|
819
|
-
"",
|
|
820
|
-
"=== All rendered lines ===",
|
|
821
|
-
...newLines.map((l, idx) => `[${idx}] (w=${visibleWidth(l)}) ${l}`),
|
|
822
|
-
"",
|
|
823
|
-
].join("\n");
|
|
824
|
-
fs.mkdirSync(path.dirname(crashLogPath), { recursive: true });
|
|
825
|
-
fs.writeFileSync(crashLogPath, crashData);
|
|
826
|
-
buffer += truncateToWidth(line, width, "");
|
|
827
|
-
continue;
|
|
828
|
-
}
|
|
829
|
-
buffer += line;
|
|
830
|
-
}
|
|
831
|
-
// Track where cursor ended up after rendering
|
|
832
|
-
let finalCursorRow = renderEnd;
|
|
833
|
-
// If we had more lines before, clear them and move cursor back
|
|
834
|
-
if (this.previousLines.length > newLines.length) {
|
|
835
|
-
// Move to end of new content first if we stopped before it
|
|
836
|
-
if (renderEnd < newLines.length - 1) {
|
|
837
|
-
const moveDown = newLines.length - 1 - renderEnd;
|
|
838
|
-
buffer += `\x1b[${moveDown}B`;
|
|
839
|
-
finalCursorRow = newLines.length - 1;
|
|
840
|
-
}
|
|
841
|
-
const extraLines = this.previousLines.length - newLines.length;
|
|
842
|
-
for (let i = newLines.length; i < this.previousLines.length; i++) {
|
|
843
|
-
buffer += "\r\n\x1b[2K";
|
|
844
|
-
}
|
|
845
|
-
// Move cursor back to end of new content
|
|
846
|
-
buffer += `\x1b[${extraLines}A`;
|
|
847
|
-
}
|
|
848
|
-
buffer += "\x1b[?2026l"; // End synchronized output
|
|
849
|
-
if (process.env.INDUSAGI_TUI_DEBUG === "1") {
|
|
850
|
-
const debugDir = "/tmp/tui";
|
|
851
|
-
fs.mkdirSync(debugDir, { recursive: true });
|
|
852
|
-
const debugPath = path.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
|
|
853
|
-
const debugData = [
|
|
854
|
-
`firstChanged: ${firstChanged}`,
|
|
855
|
-
`viewportTop: ${viewportTop}`,
|
|
856
|
-
`cursorRow: ${this.cursorRow}`,
|
|
857
|
-
`height: ${height}`,
|
|
858
|
-
`lineDiff: ${lineDiff}`,
|
|
859
|
-
`hardwareCursorRow: ${hardwareCursorRow}`,
|
|
860
|
-
`renderEnd: ${renderEnd}`,
|
|
861
|
-
`finalCursorRow: ${finalCursorRow}`,
|
|
862
|
-
`cursorPos: ${JSON.stringify(cursorPos)}`,
|
|
863
|
-
`newLines.length: ${newLines.length}`,
|
|
864
|
-
`previousLines.length: ${this.previousLines.length}`,
|
|
865
|
-
"",
|
|
866
|
-
"=== newLines ===",
|
|
867
|
-
JSON.stringify(newLines, null, 2),
|
|
868
|
-
"",
|
|
869
|
-
"=== previousLines ===",
|
|
870
|
-
JSON.stringify(this.previousLines, null, 2),
|
|
871
|
-
"",
|
|
872
|
-
"=== buffer ===",
|
|
873
|
-
JSON.stringify(buffer),
|
|
874
|
-
].join("\n");
|
|
875
|
-
fs.writeFileSync(debugPath, debugData);
|
|
876
|
-
}
|
|
877
|
-
// Write entire buffer at once
|
|
878
|
-
this.terminal.write(buffer);
|
|
879
|
-
// Track cursor position for next render
|
|
880
|
-
// cursorRow tracks end of content (for viewport calculation)
|
|
881
|
-
// hardwareCursorRow tracks actual terminal cursor position (for movement)
|
|
882
|
-
this.cursorRow = Math.max(0, newLines.length - 1);
|
|
883
|
-
this.hardwareCursorRow = finalCursorRow;
|
|
884
|
-
// Track terminal's working area (grows but doesn't shrink unless cleared)
|
|
885
|
-
this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
|
|
886
|
-
this.previousViewportTop = Math.max(0, this.maxLinesRendered - height);
|
|
887
|
-
// Position hardware cursor for IME
|
|
888
|
-
this.positionHardwareCursor(cursorPos, newLines.length);
|
|
889
|
-
this.previousLines = newLines;
|
|
890
|
-
this.previousWidth = width;
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* Position the hardware cursor for IME candidate window.
|
|
894
|
-
* @param cursorPos The cursor position extracted from rendered output, or null
|
|
895
|
-
* @param totalLines Total number of rendered lines
|
|
896
|
-
*/
|
|
897
|
-
positionHardwareCursor(cursorPos, totalLines) {
|
|
898
|
-
if (!cursorPos || totalLines <= 0) {
|
|
899
|
-
this.terminal.hideCursor();
|
|
900
|
-
return;
|
|
901
|
-
}
|
|
902
|
-
// Clamp cursor position to valid range
|
|
903
|
-
const targetRow = Math.max(0, Math.min(cursorPos.row, totalLines - 1));
|
|
904
|
-
const targetCol = Math.max(0, cursorPos.col);
|
|
905
|
-
// Move cursor from current position to target
|
|
906
|
-
const rowDelta = targetRow - this.hardwareCursorRow;
|
|
907
|
-
let buffer = "";
|
|
908
|
-
if (rowDelta > 0) {
|
|
909
|
-
buffer += `\x1b[${rowDelta}B`; // Move down
|
|
910
|
-
}
|
|
911
|
-
else if (rowDelta < 0) {
|
|
912
|
-
buffer += `\x1b[${-rowDelta}A`; // Move up
|
|
913
|
-
}
|
|
914
|
-
// Move to absolute column (1-indexed)
|
|
915
|
-
buffer += `\x1b[${targetCol + 1}G`;
|
|
916
|
-
if (buffer) {
|
|
917
|
-
this.terminal.write(buffer);
|
|
918
|
-
}
|
|
919
|
-
this.hardwareCursorRow = targetRow;
|
|
920
|
-
if (this.showHardwareCursor) {
|
|
921
|
-
this.terminal.showCursor();
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
924
|
-
this.terminal.hideCursor();
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
//# sourceMappingURL=tui.js.map
|