openhorse 0.1.5
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 +460 -0
- package/bin/openhorse +56 -0
- package/dist/agents/coder.d.ts +12 -0
- package/dist/agents/coder.d.ts.map +1 -0
- package/dist/agents/coder.js +48 -0
- package/dist/agents/coder.js.map +1 -0
- package/dist/agents/leader.d.ts +12 -0
- package/dist/agents/leader.d.ts.map +1 -0
- package/dist/agents/leader.js +49 -0
- package/dist/agents/leader.js.map +1 -0
- package/dist/agents/router.d.ts +59 -0
- package/dist/agents/router.d.ts.map +1 -0
- package/dist/agents/router.js +193 -0
- package/dist/agents/router.js.map +1 -0
- package/dist/cli-ink.d.ts +7 -0
- package/dist/cli-ink.d.ts.map +1 -0
- package/dist/cli-ink.js +135 -0
- package/dist/cli-ink.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +638 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/index.d.ts +12 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +1095 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/parser.d.ts +26 -0
- package/dist/commands/parser.d.ts.map +1 -0
- package/dist/commands/parser.js +61 -0
- package/dist/commands/parser.js.map +1 -0
- package/dist/commands/types.d.ts +61 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +32 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/core/agent.d.ts +66 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +55 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/brain.d.ts +41 -0
- package/dist/core/brain.d.ts.map +1 -0
- package/dist/core/brain.js +92 -0
- package/dist/core/brain.js.map +1 -0
- package/dist/core/cost-tracker.d.ts +107 -0
- package/dist/core/cost-tracker.d.ts.map +1 -0
- package/dist/core/cost-tracker.js +199 -0
- package/dist/core/cost-tracker.js.map +1 -0
- package/dist/core/strategy-tracker.d.ts +61 -0
- package/dist/core/strategy-tracker.d.ts.map +1 -0
- package/dist/core/strategy-tracker.js +124 -0
- package/dist/core/strategy-tracker.js.map +1 -0
- package/dist/framework/index.d.ts +20 -0
- package/dist/framework/index.d.ts.map +1 -0
- package/dist/framework/index.js +29 -0
- package/dist/framework/index.js.map +1 -0
- package/dist/framework/prompt.d.ts +40 -0
- package/dist/framework/prompt.d.ts.map +1 -0
- package/dist/framework/prompt.js +112 -0
- package/dist/framework/prompt.js.map +1 -0
- package/dist/framework/query.d.ts +86 -0
- package/dist/framework/query.d.ts.map +1 -0
- package/dist/framework/query.js +177 -0
- package/dist/framework/query.js.map +1 -0
- package/dist/framework/store.d.ts +64 -0
- package/dist/framework/store.d.ts.map +1 -0
- package/dist/framework/store.js +78 -0
- package/dist/framework/store.js.map +1 -0
- package/dist/framework/tool-state.d.ts +22 -0
- package/dist/framework/tool-state.d.ts.map +1 -0
- package/dist/framework/tool-state.js +40 -0
- package/dist/framework/tool-state.js.map +1 -0
- package/dist/framework/tool.d.ts +88 -0
- package/dist/framework/tool.d.ts.map +1 -0
- package/dist/framework/tool.js +60 -0
- package/dist/framework/tool.js.map +1 -0
- package/dist/harness/harness.d.ts +96 -0
- package/dist/harness/harness.d.ts.map +1 -0
- package/dist/harness/harness.js +224 -0
- package/dist/harness/harness.js.map +1 -0
- package/dist/harness/safety.d.ts +89 -0
- package/dist/harness/safety.d.ts.map +1 -0
- package/dist/harness/safety.js +178 -0
- package/dist/harness/safety.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +178 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +473 -0
- package/dist/init.js.map +1 -0
- package/dist/ink/bidi.d.ts +16 -0
- package/dist/ink/bidi.d.ts.map +1 -0
- package/dist/ink/bidi.js +124 -0
- package/dist/ink/bidi.js.map +1 -0
- package/dist/ink/clearTerminal.d.ts +14 -0
- package/dist/ink/clearTerminal.d.ts.map +1 -0
- package/dist/ink/clearTerminal.js +63 -0
- package/dist/ink/clearTerminal.js.map +1 -0
- package/dist/ink/colorize.d.ts +17 -0
- package/dist/ink/colorize.d.ts.map +1 -0
- package/dist/ink/colorize.js +208 -0
- package/dist/ink/colorize.js.map +1 -0
- package/dist/ink/components/App.d.ts +73 -0
- package/dist/ink/components/App.d.ts.map +1 -0
- package/dist/ink/components/App.js +646 -0
- package/dist/ink/components/App.js.map +1 -0
- package/dist/ink/components/AppContext.d.ts +12 -0
- package/dist/ink/components/AppContext.d.ts.map +1 -0
- package/dist/ink/components/AppContext.js +14 -0
- package/dist/ink/components/AppContext.js.map +1 -0
- package/dist/ink/components/Box.d.ts +44 -0
- package/dist/ink/components/Box.d.ts.map +1 -0
- package/dist/ink/components/Box.js +191 -0
- package/dist/ink/components/Box.js.map +1 -0
- package/dist/ink/components/ClockContext.d.ts +9 -0
- package/dist/ink/components/ClockContext.d.ts.map +1 -0
- package/dist/ink/components/ClockContext.js +146 -0
- package/dist/ink/components/ClockContext.js.map +1 -0
- package/dist/ink/components/CursorDeclarationContext.d.ts +23 -0
- package/dist/ink/components/CursorDeclarationContext.d.ts.map +1 -0
- package/dist/ink/components/CursorDeclarationContext.js +6 -0
- package/dist/ink/components/CursorDeclarationContext.js.map +1 -0
- package/dist/ink/components/ErrorOverview.d.ts +6 -0
- package/dist/ink/components/ErrorOverview.d.ts.map +1 -0
- package/dist/ink/components/ErrorOverview.js +27 -0
- package/dist/ink/components/ErrorOverview.js.map +1 -0
- package/dist/ink/components/Newline.d.ts +13 -0
- package/dist/ink/components/Newline.d.ts.map +1 -0
- package/dist/ink/components/Newline.js +36 -0
- package/dist/ink/components/Newline.js.map +1 -0
- package/dist/ink/components/NoSelect.d.ts +20 -0
- package/dist/ink/components/NoSelect.d.ts.map +1 -0
- package/dist/ink/components/NoSelect.js +63 -0
- package/dist/ink/components/NoSelect.js.map +1 -0
- package/dist/ink/components/RawAnsi.d.ts +17 -0
- package/dist/ink/components/RawAnsi.d.ts.map +1 -0
- package/dist/ink/components/RawAnsi.js +52 -0
- package/dist/ink/components/RawAnsi.js.map +1 -0
- package/dist/ink/components/Spacer.d.ts +6 -0
- package/dist/ink/components/Spacer.d.ts.map +1 -0
- package/dist/ink/components/Spacer.js +26 -0
- package/dist/ink/components/Spacer.js.map +1 -0
- package/dist/ink/components/StdinContext.d.ts +28 -0
- package/dist/ink/components/StdinContext.d.ts.map +1 -0
- package/dist/ink/components/StdinContext.js +19 -0
- package/dist/ink/components/StdinContext.js.map +1 -0
- package/dist/ink/components/TerminalFocusContext.d.ts +10 -0
- package/dist/ink/components/TerminalFocusContext.d.ts.map +1 -0
- package/dist/ink/components/TerminalFocusContext.js +81 -0
- package/dist/ink/components/TerminalFocusContext.js.map +1 -0
- package/dist/ink/components/TerminalSizeContext.d.ts +6 -0
- package/dist/ink/components/TerminalSizeContext.d.ts.map +1 -0
- package/dist/ink/components/TerminalSizeContext.js +6 -0
- package/dist/ink/components/TerminalSizeContext.js.map +1 -0
- package/dist/ink/components/Text.d.ts +56 -0
- package/dist/ink/components/Text.d.ts.map +1 -0
- package/dist/ink/components/Text.js +201 -0
- package/dist/ink/components/Text.js.map +1 -0
- package/dist/ink/constants.d.ts +2 -0
- package/dist/ink/constants.d.ts.map +1 -0
- package/dist/ink/constants.js +6 -0
- package/dist/ink/constants.js.map +1 -0
- package/dist/ink/devtools.d.ts +3 -0
- package/dist/ink/devtools.d.ts.map +1 -0
- package/dist/ink/devtools.js +5 -0
- package/dist/ink/devtools.js.map +1 -0
- package/dist/ink/dom.d.ts +77 -0
- package/dist/ink/dom.d.ts.map +1 -0
- package/dist/ink/dom.js +322 -0
- package/dist/ink/dom.js.map +1 -0
- package/dist/ink/events/click-event.d.ts +32 -0
- package/dist/ink/events/click-event.d.ts.map +1 -0
- package/dist/ink/events/click-event.js +30 -0
- package/dist/ink/events/click-event.js.map +1 -0
- package/dist/ink/events/dispatcher.d.ts +41 -0
- package/dist/ink/events/dispatcher.d.ts.map +1 -0
- package/dist/ink/events/dispatcher.js +181 -0
- package/dist/ink/events/dispatcher.js.map +1 -0
- package/dist/ink/events/emitter.d.ts +6 -0
- package/dist/ink/events/emitter.d.ts.map +1 -0
- package/dist/ink/events/emitter.js +36 -0
- package/dist/ink/events/emitter.js.map +1 -0
- package/dist/ink/events/event-handlers.d.ts +47 -0
- package/dist/ink/events/event-handlers.d.ts.map +1 -0
- package/dist/ink/events/event-handlers.js +34 -0
- package/dist/ink/events/event-handlers.js.map +1 -0
- package/dist/ink/events/event.d.ts +6 -0
- package/dist/ink/events/event.d.ts.map +1 -0
- package/dist/ink/events/event.js +16 -0
- package/dist/ink/events/event.js.map +1 -0
- package/dist/ink/events/focus-event.d.ts +14 -0
- package/dist/ink/events/focus-event.d.ts.map +1 -0
- package/dist/ink/events/focus-event.js +20 -0
- package/dist/ink/events/focus-event.js.map +1 -0
- package/dist/ink/events/input-event.d.ts +31 -0
- package/dist/ink/events/input-event.d.ts.map +1 -0
- package/dist/ink/events/input-event.js +163 -0
- package/dist/ink/events/input-event.js.map +1 -0
- package/dist/ink/events/keyboard-event.d.ts +20 -0
- package/dist/ink/events/keyboard-event.d.ts.map +1 -0
- package/dist/ink/events/keyboard-event.js +44 -0
- package/dist/ink/events/keyboard-event.js.map +1 -0
- package/dist/ink/events/terminal-event.d.ts +55 -0
- package/dist/ink/events/terminal-event.d.ts.map +1 -0
- package/dist/ink/events/terminal-event.js +79 -0
- package/dist/ink/events/terminal-event.js.map +1 -0
- package/dist/ink/events/terminal-focus-event.d.ts +14 -0
- package/dist/ink/events/terminal-focus-event.d.ts.map +1 -0
- package/dist/ink/events/terminal-focus-event.js +19 -0
- package/dist/ink/events/terminal-focus-event.js.map +1 -0
- package/dist/ink/focus.d.ts +44 -0
- package/dist/ink/focus.d.ts.map +1 -0
- package/dist/ink/focus.js +164 -0
- package/dist/ink/focus.js.map +1 -0
- package/dist/ink/frame.d.ts +95 -0
- package/dist/ink/frame.d.ts.map +1 -0
- package/dist/ink/frame.js +35 -0
- package/dist/ink/frame.js.map +1 -0
- package/dist/ink/get-max-width.d.ts +18 -0
- package/dist/ink/get-max-width.d.ts.map +1 -0
- package/dist/ink/get-max-width.js +26 -0
- package/dist/ink/get-max-width.js.map +1 -0
- package/dist/ink/hit-test.d.ts +34 -0
- package/dist/ink/hit-test.d.ts.map +1 -0
- package/dist/ink/hit-test.js +119 -0
- package/dist/ink/hit-test.js.map +1 -0
- package/dist/ink/hooks/use-animation-frame.d.ts +27 -0
- package/dist/ink/hooks/use-animation-frame.d.ts.map +1 -0
- package/dist/ink/hooks/use-animation-frame.js +52 -0
- package/dist/ink/hooks/use-animation-frame.js.map +1 -0
- package/dist/ink/hooks/use-app.d.ts +6 -0
- package/dist/ink/hooks/use-app.d.ts.map +1 -0
- package/dist/ink/hooks/use-app.js +13 -0
- package/dist/ink/hooks/use-app.js.map +1 -0
- package/dist/ink/hooks/use-declared-cursor.d.ts +27 -0
- package/dist/ink/hooks/use-declared-cursor.d.ts.map +1 -0
- package/dist/ink/hooks/use-declared-cursor.js +67 -0
- package/dist/ink/hooks/use-declared-cursor.js.map +1 -0
- package/dist/ink/hooks/use-input.d.ts +38 -0
- package/dist/ink/hooks/use-input.d.ts.map +1 -0
- package/dist/ink/hooks/use-input.js +86 -0
- package/dist/ink/hooks/use-input.js.map +1 -0
- package/dist/ink/hooks/use-interval.d.ts +19 -0
- package/dist/ink/hooks/use-interval.d.ts.map +1 -0
- package/dist/ink/hooks/use-interval.js +59 -0
- package/dist/ink/hooks/use-interval.js.map +1 -0
- package/dist/ink/hooks/use-search-highlight.d.ts +31 -0
- package/dist/ink/hooks/use-search-highlight.d.ts.map +1 -0
- package/dist/ink/hooks/use-search-highlight.js +39 -0
- package/dist/ink/hooks/use-search-highlight.js.map +1 -0
- package/dist/ink/hooks/use-selection.d.ts +40 -0
- package/dist/ink/hooks/use-selection.d.ts.map +1 -0
- package/dist/ink/hooks/use-selection.js +68 -0
- package/dist/ink/hooks/use-selection.js.map +1 -0
- package/dist/ink/hooks/use-stdin.d.ts +6 -0
- package/dist/ink/hooks/use-stdin.d.ts.map +1 -0
- package/dist/ink/hooks/use-stdin.js +13 -0
- package/dist/ink/hooks/use-stdin.js.map +1 -0
- package/dist/ink/hooks/use-tab-status.d.ts +14 -0
- package/dist/ink/hooks/use-tab-status.d.ts.map +1 -0
- package/dist/ink/hooks/use-tab-status.js +61 -0
- package/dist/ink/hooks/use-tab-status.js.map +1 -0
- package/dist/ink/hooks/use-terminal-focus.d.ts +11 -0
- package/dist/ink/hooks/use-terminal-focus.d.ts.map +1 -0
- package/dist/ink/hooks/use-terminal-focus.js +22 -0
- package/dist/ink/hooks/use-terminal-focus.js.map +1 -0
- package/dist/ink/hooks/use-terminal-title.d.ts +13 -0
- package/dist/ink/hooks/use-terminal-title.d.ts.map +1 -0
- package/dist/ink/hooks/use-terminal-title.js +36 -0
- package/dist/ink/hooks/use-terminal-title.js.map +1 -0
- package/dist/ink/hooks/use-terminal-viewport.d.ts +30 -0
- package/dist/ink/hooks/use-terminal-viewport.d.ts.map +1 -0
- package/dist/ink/hooks/use-terminal-viewport.js +81 -0
- package/dist/ink/hooks/use-terminal-viewport.js.map +1 -0
- package/dist/ink/index.d.ts +54 -0
- package/dist/ink/index.d.ts.map +1 -0
- package/dist/ink/index.js +111 -0
- package/dist/ink/index.js.map +1 -0
- package/dist/ink/ink.d.ts +371 -0
- package/dist/ink/ink.d.ts.map +1 -0
- package/dist/ink/ink.js +1686 -0
- package/dist/ink/ink.js.map +1 -0
- package/dist/ink/instances.d.ts +4 -0
- package/dist/ink/instances.d.ts.map +1 -0
- package/dist/ink/instances.js +10 -0
- package/dist/ink/instances.js.map +1 -0
- package/dist/ink/line-width-cache.d.ts +2 -0
- package/dist/ink/line-width-cache.d.ts.map +1 -0
- package/dist/ink/line-width-cache.js +23 -0
- package/dist/ink/line-width-cache.js.map +1 -0
- package/dist/ink/log-update.d.ts +18 -0
- package/dist/ink/log-update.d.ts.map +1 -0
- package/dist/ink/log-update.js +637 -0
- package/dist/ink/log-update.js.map +1 -0
- package/dist/ink/measure-element.d.ts +17 -0
- package/dist/ink/measure-element.d.ts.map +1 -0
- package/dist/ink/measure-element.js +11 -0
- package/dist/ink/measure-element.js.map +1 -0
- package/dist/ink/measure-text.d.ts +7 -0
- package/dist/ink/measure-text.d.ts.map +1 -0
- package/dist/ink/measure-text.js +38 -0
- package/dist/ink/measure-text.js.map +1 -0
- package/dist/ink/node-cache.d.ts +21 -0
- package/dist/ink/node-cache.d.ts.map +1 -0
- package/dist/ink/node-cache.js +36 -0
- package/dist/ink/node-cache.js.map +1 -0
- package/dist/ink/optimizer.d.ts +16 -0
- package/dist/ink/optimizer.d.ts.map +1 -0
- package/dist/ink/optimizer.js +85 -0
- package/dist/ink/optimizer.js.map +1 -0
- package/dist/ink/output.d.ts +120 -0
- package/dist/ink/output.d.ts.map +1 -0
- package/dist/ink/output.js +559 -0
- package/dist/ink/output.js.map +1 -0
- package/dist/ink/parse-keypress.d.ts +112 -0
- package/dist/ink/parse-keypress.d.ts.map +1 -0
- package/dist/ink/parse-keypress.js +719 -0
- package/dist/ink/parse-keypress.js.map +1 -0
- package/dist/ink/parse-keypress.test.d.ts +2 -0
- package/dist/ink/parse-keypress.test.d.ts.map +1 -0
- package/dist/ink/parse-keypress.test.js +37 -0
- package/dist/ink/parse-keypress.test.js.map +1 -0
- package/dist/ink/reconciler.d.ts +12 -0
- package/dist/ink/reconciler.d.ts.map +1 -0
- package/dist/ink/reconciler.js +456 -0
- package/dist/ink/reconciler.js.map +1 -0
- package/dist/ink/render-border.d.ts +25 -0
- package/dist/ink/render-border.d.ts.map +1 -0
- package/dist/ink/render-border.js +141 -0
- package/dist/ink/render-border.js.map +1 -0
- package/dist/ink/render-node-to-output.d.ts +46 -0
- package/dist/ink/render-node-to-output.d.ts.map +1 -0
- package/dist/ink/render-node-to-output.js +1257 -0
- package/dist/ink/render-node-to-output.js.map +1 -0
- package/dist/ink/render-to-screen.d.ts +47 -0
- package/dist/ink/render-to-screen.d.ts.map +1 -0
- package/dist/ink/render-to-screen.js +213 -0
- package/dist/ink/render-to-screen.js.map +1 -0
- package/dist/ink/renderer.d.ts +15 -0
- package/dist/ink/renderer.d.ts.map +1 -0
- package/dist/ink/renderer.js +169 -0
- package/dist/ink/renderer.js.map +1 -0
- package/dist/ink/root.d.ts +75 -0
- package/dist/ink/root.d.ts.map +1 -0
- package/dist/ink/root.js +89 -0
- package/dist/ink/root.js.map +1 -0
- package/dist/ink/screen.d.ts +270 -0
- package/dist/ink/screen.d.ts.map +1 -0
- package/dist/ink/screen.js +1194 -0
- package/dist/ink/screen.js.map +1 -0
- package/dist/ink/searchHighlight.d.ts +21 -0
- package/dist/ink/searchHighlight.d.ts.map +1 -0
- package/dist/ink/searchHighlight.js +82 -0
- package/dist/ink/searchHighlight.js.map +1 -0
- package/dist/ink/selection.d.ts +230 -0
- package/dist/ink/selection.d.ts.map +1 -0
- package/dist/ink/selection.js +814 -0
- package/dist/ink/selection.js.map +1 -0
- package/dist/ink/squash-text-nodes.d.ts +23 -0
- package/dist/ink/squash-text-nodes.d.ts.map +1 -0
- package/dist/ink/squash-text-nodes.js +60 -0
- package/dist/ink/squash-text-nodes.js.map +1 -0
- package/dist/ink/stringWidth.d.ts +2 -0
- package/dist/ink/stringWidth.d.ts.map +1 -0
- package/dist/ink/stringWidth.js +207 -0
- package/dist/ink/stringWidth.js.map +1 -0
- package/dist/ink/styles.d.ts +307 -0
- package/dist/ink/styles.d.ts.map +1 -0
- package/dist/ink/styles.js +302 -0
- package/dist/ink/styles.js.map +1 -0
- package/dist/ink/supports-hyperlinks.d.ts +14 -0
- package/dist/ink/supports-hyperlinks.d.ts.map +1 -0
- package/dist/ink/supports-hyperlinks.js +48 -0
- package/dist/ink/supports-hyperlinks.js.map +1 -0
- package/dist/ink/tabstops.d.ts +2 -0
- package/dist/ink/tabstops.d.ts.map +1 -0
- package/dist/ink/tabstops.js +43 -0
- package/dist/ink/tabstops.js.map +1 -0
- package/dist/ink/terminal-focus-state.d.ts +7 -0
- package/dist/ink/terminal-focus-state.d.ts.map +1 -0
- package/dist/ink/terminal-focus-state.js +43 -0
- package/dist/ink/terminal-focus-state.js.map +1 -0
- package/dist/ink/terminal-querier.d.ts +130 -0
- package/dist/ink/terminal-querier.d.ts.map +1 -0
- package/dist/ink/terminal-querier.js +184 -0
- package/dist/ink/terminal-querier.js.map +1 -0
- package/dist/ink/terminal.d.ts +56 -0
- package/dist/ink/terminal.d.ts.map +1 -0
- package/dist/ink/terminal.js +249 -0
- package/dist/ink/terminal.js.map +1 -0
- package/dist/ink/termio/csi.d.ts +166 -0
- package/dist/ink/termio/csi.d.ts.map +1 -0
- package/dist/ink/termio/csi.js +285 -0
- package/dist/ink/termio/csi.js.map +1 -0
- package/dist/ink/termio/dec.d.ts +38 -0
- package/dist/ink/termio/dec.d.ts.map +1 -0
- package/dist/ink/termio/dec.js +59 -0
- package/dist/ink/termio/dec.js.map +1 -0
- package/dist/ink/termio.d.ts +25 -0
- package/dist/ink/termio.d.ts.map +1 -0
- package/dist/ink/termio.js +32 -0
- package/dist/ink/termio.js.map +1 -0
- package/dist/ink/useTerminalNotification.d.ts +27 -0
- package/dist/ink/useTerminalNotification.d.ts.map +1 -0
- package/dist/ink/useTerminalNotification.js +62 -0
- package/dist/ink/useTerminalNotification.js.map +1 -0
- package/dist/ink/warn.d.ts +2 -0
- package/dist/ink/warn.d.ts.map +1 -0
- package/dist/ink/warn.js +14 -0
- package/dist/ink/warn.js.map +1 -0
- package/dist/ink/widest-line.d.ts +2 -0
- package/dist/ink/widest-line.d.ts.map +1 -0
- package/dist/ink/widest-line.js +18 -0
- package/dist/ink/widest-line.js.map +1 -0
- package/dist/ink/wrap-text.d.ts +3 -0
- package/dist/ink/wrap-text.d.ts.map +1 -0
- package/dist/ink/wrap-text.js +61 -0
- package/dist/ink/wrap-text.js.map +1 -0
- package/dist/ink/wrapAnsi.d.ts +8 -0
- package/dist/ink/wrapAnsi.d.ts.map +1 -0
- package/dist/ink/wrapAnsi.js +13 -0
- package/dist/ink/wrapAnsi.js.map +1 -0
- package/dist/memory/embeddings.d.ts +33 -0
- package/dist/memory/embeddings.d.ts.map +1 -0
- package/dist/memory/embeddings.js +123 -0
- package/dist/memory/embeddings.js.map +1 -0
- package/dist/memory/index.d.ts +14 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +31 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/prompts.d.ts +12 -0
- package/dist/memory/prompts.d.ts.map +1 -0
- package/dist/memory/prompts.js +117 -0
- package/dist/memory/prompts.js.map +1 -0
- package/dist/memory/semantic-search.d.ts +45 -0
- package/dist/memory/semantic-search.d.ts.map +1 -0
- package/dist/memory/semantic-search.js +112 -0
- package/dist/memory/semantic-search.js.map +1 -0
- package/dist/memory/storage.d.ts +79 -0
- package/dist/memory/storage.d.ts.map +1 -0
- package/dist/memory/storage.js +285 -0
- package/dist/memory/storage.js.map +1 -0
- package/dist/memory/store.d.ts +103 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +226 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/types.d.ts +40 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +71 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory/validation.d.ts +28 -0
- package/dist/memory/validation.d.ts.map +1 -0
- package/dist/memory/validation.js +147 -0
- package/dist/memory/validation.js.map +1 -0
- package/dist/memory/vector-store.d.ts +49 -0
- package/dist/memory/vector-store.d.ts.map +1 -0
- package/dist/memory/vector-store.js +259 -0
- package/dist/memory/vector-store.js.map +1 -0
- package/dist/screens/REPL.d.ts +21 -0
- package/dist/screens/REPL.d.ts.map +1 -0
- package/dist/screens/REPL.js +139 -0
- package/dist/screens/REPL.js.map +1 -0
- package/dist/services/agent-runner.d.ts +68 -0
- package/dist/services/agent-runner.d.ts.map +1 -0
- package/dist/services/agent-runner.js +186 -0
- package/dist/services/agent-runner.js.map +1 -0
- package/dist/services/atomic-write.d.ts +12 -0
- package/dist/services/atomic-write.d.ts.map +1 -0
- package/dist/services/atomic-write.js +27 -0
- package/dist/services/atomic-write.js.map +1 -0
- package/dist/services/config-dir.d.ts +55 -0
- package/dist/services/config-dir.d.ts.map +1 -0
- package/dist/services/config-dir.js +136 -0
- package/dist/services/config-dir.js.map +1 -0
- package/dist/services/config.d.ts +54 -0
- package/dist/services/config.d.ts.map +1 -0
- package/dist/services/config.js +98 -0
- package/dist/services/config.js.map +1 -0
- package/dist/services/file-glob.d.ts +26 -0
- package/dist/services/file-glob.d.ts.map +1 -0
- package/dist/services/file-glob.js +134 -0
- package/dist/services/file-glob.js.map +1 -0
- package/dist/services/global-config.d.ts +109 -0
- package/dist/services/global-config.d.ts.map +1 -0
- package/dist/services/global-config.js +211 -0
- package/dist/services/global-config.js.map +1 -0
- package/dist/services/llm.d.ts +139 -0
- package/dist/services/llm.d.ts.map +1 -0
- package/dist/services/llm.js +376 -0
- package/dist/services/llm.js.map +1 -0
- package/dist/services/memory.d.ts +39 -0
- package/dist/services/memory.d.ts.map +1 -0
- package/dist/services/memory.js +88 -0
- package/dist/services/memory.js.map +1 -0
- package/dist/services/session-storage.d.ts +136 -0
- package/dist/services/session-storage.d.ts.map +1 -0
- package/dist/services/session-storage.js +304 -0
- package/dist/services/session-storage.js.map +1 -0
- package/dist/services/task-manager.d.ts +154 -0
- package/dist/services/task-manager.d.ts.map +1 -0
- package/dist/services/task-manager.js +288 -0
- package/dist/services/task-manager.js.map +1 -0
- package/dist/services/yaml-config.d.ts +57 -0
- package/dist/services/yaml-config.d.ts.map +1 -0
- package/dist/services/yaml-config.js +176 -0
- package/dist/services/yaml-config.js.map +1 -0
- package/dist/skills/discovery.d.ts +22 -0
- package/dist/skills/discovery.d.ts.map +1 -0
- package/dist/skills/discovery.js +75 -0
- package/dist/skills/discovery.js.map +1 -0
- package/dist/skills/index.d.ts +10 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +26 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/loader.d.ts +48 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +231 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/registry.d.ts +37 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +134 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/skills/types.d.ts +89 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +24 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/tools/bash_security.d.ts +64 -0
- package/dist/tools/bash_security.d.ts.map +1 -0
- package/dist/tools/bash_security.js +291 -0
- package/dist/tools/bash_security.js.map +1 -0
- package/dist/tools/index.d.ts +23 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +965 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/mcp.d.ts +72 -0
- package/dist/tools/mcp.d.ts.map +1 -0
- package/dist/tools/mcp.js +422 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/plan.d.ts +18 -0
- package/dist/tools/plan.d.ts.map +1 -0
- package/dist/tools/plan.js +75 -0
- package/dist/tools/plan.js.map +1 -0
- package/dist/tools/todo.d.ts +18 -0
- package/dist/tools/todo.d.ts.map +1 -0
- package/dist/tools/todo.js +153 -0
- package/dist/tools/todo.js.map +1 -0
- package/dist/tools/web.d.ts +13 -0
- package/dist/tools/web.d.ts.map +1 -0
- package/dist/tools/web.js +377 -0
- package/dist/tools/web.js.map +1 -0
- package/dist/ui/box.d.ts +56 -0
- package/dist/ui/box.d.ts.map +1 -0
- package/dist/ui/box.js +241 -0
- package/dist/ui/box.js.map +1 -0
- package/dist/ui/command-panel.d.ts +55 -0
- package/dist/ui/command-panel.d.ts.map +1 -0
- package/dist/ui/command-panel.js +212 -0
- package/dist/ui/command-panel.js.map +1 -0
- package/dist/ui/file-completion.d.ts +62 -0
- package/dist/ui/file-completion.d.ts.map +1 -0
- package/dist/ui/file-completion.js +209 -0
- package/dist/ui/file-completion.js.map +1 -0
- package/dist/ui/markdown.d.ts +12 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +215 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/multiline-input.d.ts +47 -0
- package/dist/ui/multiline-input.d.ts.map +1 -0
- package/dist/ui/multiline-input.js +94 -0
- package/dist/ui/multiline-input.js.map +1 -0
- package/dist/ui/status-bar.d.ts +33 -0
- package/dist/ui/status-bar.d.ts.map +1 -0
- package/dist/ui/status-bar.js +96 -0
- package/dist/ui/status-bar.js.map +1 -0
- package/dist/ui/stream-markdown.d.ts +35 -0
- package/dist/ui/stream-markdown.d.ts.map +1 -0
- package/dist/ui/stream-markdown.js +138 -0
- package/dist/ui/stream-markdown.js.map +1 -0
- package/dist/ui/suggestions.d.ts +35 -0
- package/dist/ui/suggestions.d.ts.map +1 -0
- package/dist/ui/suggestions.js +118 -0
- package/dist/ui/suggestions.js.map +1 -0
- package/dist/ui/tool-preview.d.ts +34 -0
- package/dist/ui/tool-preview.d.ts.map +1 -0
- package/dist/ui/tool-preview.js +128 -0
- package/dist/ui/tool-preview.js.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSearchHighlight = useSearchHighlight;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const StdinContext_js_1 = __importDefault(require("../components/StdinContext.js"));
|
|
9
|
+
const instances_js_1 = __importDefault(require("../instances.js"));
|
|
10
|
+
/**
|
|
11
|
+
* Set the search highlight query on the Ink instance. Non-empty → all
|
|
12
|
+
* visible occurrences are inverted on the next frame (SGR 7, screen-buffer
|
|
13
|
+
* overlay, same damage machinery as selection). Empty → clears.
|
|
14
|
+
*
|
|
15
|
+
* This is a screen-space highlight — it matches the RENDERED text, not the
|
|
16
|
+
* source message text. Works for anything visible (bash output, file paths,
|
|
17
|
+
* error messages) regardless of where it came from in the message tree. A
|
|
18
|
+
* query that matched in source but got truncated/ellipsized in rendering
|
|
19
|
+
* won't highlight; that's acceptable — we highlight what you see.
|
|
20
|
+
*/
|
|
21
|
+
function useSearchHighlight() {
|
|
22
|
+
(0, react_1.useContext)(StdinContext_js_1.default); // anchor to App subtree for hook rules
|
|
23
|
+
const ink = instances_js_1.default.get(process.stdout);
|
|
24
|
+
return (0, react_1.useMemo)(() => {
|
|
25
|
+
if (!ink) {
|
|
26
|
+
return {
|
|
27
|
+
setQuery: () => { },
|
|
28
|
+
scanElement: () => [],
|
|
29
|
+
setPositions: () => { },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
setQuery: (query) => ink.setSearchHighlight(query),
|
|
34
|
+
scanElement: (el) => ink.scanElementSubtree(el),
|
|
35
|
+
setPositions: state => ink.setSearchPositions(state),
|
|
36
|
+
};
|
|
37
|
+
}, [ink]);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=use-search-highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-search-highlight.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-search-highlight.ts"],"names":[],"mappings":";;;;;AAiBA,gDAmCC;AApDD,iCAA2C;AAC3C,oFAAwD;AAExD,mEAAuC;AAGvC;;;;;;;;;;GAUG;AACH,SAAgB,kBAAkB;IAmBhC,IAAA,kBAAU,EAAC,yBAAY,CAAC,CAAA,CAAC,uCAAuC;IAChE,MAAM,GAAG,GAAG,sBAAS,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;gBAClB,WAAW,EAAE,GAAG,EAAE,CAAC,EAAE;gBACrB,YAAY,EAAE,GAAG,EAAE,GAAE,CAAC;aACvB,CAAA;QACH,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC;YAC1D,WAAW,EAAE,CAAC,EAAc,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC3D,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC;SACrD,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type FocusMove, type SelectionState } from '../selection.js';
|
|
2
|
+
/**
|
|
3
|
+
* Access to text selection operations on the Ink instance (fullscreen only).
|
|
4
|
+
* Returns no-op functions when fullscreen mode is disabled.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useSelection(): {
|
|
7
|
+
copySelection: () => string;
|
|
8
|
+
/** Copy without clearing the highlight (for copy-on-select). */
|
|
9
|
+
copySelectionNoClear: () => string;
|
|
10
|
+
clearSelection: () => void;
|
|
11
|
+
hasSelection: () => boolean;
|
|
12
|
+
/** Read the raw mutable selection state (for drag-to-scroll). */
|
|
13
|
+
getState: () => SelectionState | null;
|
|
14
|
+
/** Subscribe to selection mutations (start/update/finish/clear). */
|
|
15
|
+
subscribe: (cb: () => void) => () => void;
|
|
16
|
+
/** Shift the anchor row by dRow, clamped to [minRow, maxRow]. */
|
|
17
|
+
shiftAnchor: (dRow: number, minRow: number, maxRow: number) => void;
|
|
18
|
+
/** Shift anchor AND focus by dRow (keyboard scroll: whole selection
|
|
19
|
+
* tracks content). Clamped points get col reset to the full-width edge
|
|
20
|
+
* since their content was captured by captureScrolledRows. Reads
|
|
21
|
+
* screen.width from the ink instance for the col-reset boundary. */
|
|
22
|
+
shiftSelection: (dRow: number, minRow: number, maxRow: number) => void;
|
|
23
|
+
/** Keyboard selection extension (shift+arrow): move focus, anchor fixed.
|
|
24
|
+
* Left/right wrap across rows; up/down clamp at viewport edges. */
|
|
25
|
+
moveFocus: (move: FocusMove) => void;
|
|
26
|
+
/** Capture text from rows about to scroll out of the viewport (call
|
|
27
|
+
* BEFORE scrollBy so the screen buffer still has the outgoing rows). */
|
|
28
|
+
captureScrolledRows: (firstRow: number, lastRow: number, side: 'above' | 'below') => void;
|
|
29
|
+
/** Set the selection highlight bg color (theme-piping; solid bg
|
|
30
|
+
* replaces the old SGR-7 inverse so syntax highlighting stays readable
|
|
31
|
+
* under selection). Call once on mount + whenever theme changes. */
|
|
32
|
+
setSelectionBgColor: (color: string) => void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Reactive selection-exists state. Re-renders the caller when a text
|
|
36
|
+
* selection is created or cleared. Always returns false outside
|
|
37
|
+
* fullscreen mode (selection is only available in alt-screen).
|
|
38
|
+
*/
|
|
39
|
+
export declare function useHasSelection(): boolean;
|
|
40
|
+
//# sourceMappingURL=use-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-selection.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-selection.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,SAAS,EACd,KAAK,cAAc,EAEpB,MAAM,iBAAiB,CAAA;AAExB;;;GAGG;AACH,wBAAgB,YAAY,IAAI;IAC9B,aAAa,EAAE,MAAM,MAAM,CAAA;IAC3B,gEAAgE;IAChE,oBAAoB,EAAE,MAAM,MAAM,CAAA;IAClC,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,YAAY,EAAE,MAAM,OAAO,CAAA;IAC3B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,cAAc,GAAG,IAAI,CAAA;IACrC,oEAAoE;IACpE,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;IACzC,iEAAiE;IACjE,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACnE;;;yEAGqE;IACrE,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE;wEACoE;IACpE,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAA;IACpC;6EACyE;IACzE,mBAAmB,EAAE,CACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,GAAG,OAAO,KACpB,IAAI,CAAA;IACT;;yEAEqE;IACrE,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC7C,CA0CA;AAKD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAOzC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useSelection = useSelection;
|
|
7
|
+
exports.useHasSelection = useHasSelection;
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const StdinContext_js_1 = __importDefault(require("../components/StdinContext.js"));
|
|
10
|
+
const instances_js_1 = __importDefault(require("../instances.js"));
|
|
11
|
+
const selection_js_1 = require("../selection.js");
|
|
12
|
+
/**
|
|
13
|
+
* Access to text selection operations on the Ink instance (fullscreen only).
|
|
14
|
+
* Returns no-op functions when fullscreen mode is disabled.
|
|
15
|
+
*/
|
|
16
|
+
function useSelection() {
|
|
17
|
+
// Look up the Ink instance via stdout — same pattern as instances map.
|
|
18
|
+
// StdinContext is available (it's always provided), and the Ink instance
|
|
19
|
+
// is keyed by stdout which we can get from process.stdout since there's
|
|
20
|
+
// only one Ink instance per process in practice.
|
|
21
|
+
(0, react_1.useContext)(StdinContext_js_1.default); // anchor to App subtree for hook rules
|
|
22
|
+
const ink = instances_js_1.default.get(process.stdout);
|
|
23
|
+
// Memoize so callers can safely use the return value in dependency arrays.
|
|
24
|
+
// ink is a singleton per stdout — stable across renders.
|
|
25
|
+
return (0, react_1.useMemo)(() => {
|
|
26
|
+
if (!ink) {
|
|
27
|
+
return {
|
|
28
|
+
copySelection: () => '',
|
|
29
|
+
copySelectionNoClear: () => '',
|
|
30
|
+
clearSelection: () => { },
|
|
31
|
+
hasSelection: () => false,
|
|
32
|
+
getState: () => null,
|
|
33
|
+
subscribe: () => () => { },
|
|
34
|
+
shiftAnchor: () => { },
|
|
35
|
+
shiftSelection: () => { },
|
|
36
|
+
moveFocus: () => { },
|
|
37
|
+
captureScrolledRows: () => { },
|
|
38
|
+
setSelectionBgColor: () => { },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
copySelection: () => ink.copySelection(),
|
|
43
|
+
copySelectionNoClear: () => ink.copySelectionNoClear(),
|
|
44
|
+
clearSelection: () => ink.clearTextSelection(),
|
|
45
|
+
hasSelection: () => ink.hasTextSelection(),
|
|
46
|
+
getState: () => ink.selection,
|
|
47
|
+
subscribe: (cb) => ink.subscribeToSelectionChange(cb),
|
|
48
|
+
shiftAnchor: (dRow, minRow, maxRow) => (0, selection_js_1.shiftAnchor)(ink.selection, dRow, minRow, maxRow),
|
|
49
|
+
shiftSelection: (dRow, minRow, maxRow) => ink.shiftSelectionForScroll(dRow, minRow, maxRow),
|
|
50
|
+
moveFocus: (move) => ink.moveSelectionFocus(move),
|
|
51
|
+
captureScrolledRows: (firstRow, lastRow, side) => ink.captureScrolledRows(firstRow, lastRow, side),
|
|
52
|
+
setSelectionBgColor: (color) => ink.setSelectionBgColor(color),
|
|
53
|
+
};
|
|
54
|
+
}, [ink]);
|
|
55
|
+
}
|
|
56
|
+
const NO_SUBSCRIBE = () => () => { };
|
|
57
|
+
const ALWAYS_FALSE = () => false;
|
|
58
|
+
/**
|
|
59
|
+
* Reactive selection-exists state. Re-renders the caller when a text
|
|
60
|
+
* selection is created or cleared. Always returns false outside
|
|
61
|
+
* fullscreen mode (selection is only available in alt-screen).
|
|
62
|
+
*/
|
|
63
|
+
function useHasSelection() {
|
|
64
|
+
(0, react_1.useContext)(StdinContext_js_1.default);
|
|
65
|
+
const ink = instances_js_1.default.get(process.stdout);
|
|
66
|
+
return (0, react_1.useSyncExternalStore)(ink ? ink.subscribeToSelectionChange : NO_SUBSCRIBE, ink ? ink.hasTextSelection : ALWAYS_FALSE);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=use-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-selection.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-selection.ts"],"names":[],"mappings":";;;;;AAaA,oCAyEC;AAUD,0CAOC;AAvGD,iCAAiE;AACjE,oFAAwD;AACxD,mEAAuC;AACvC,kDAIwB;AAExB;;;GAGG;AACH,SAAgB,YAAY;IAgC1B,uEAAuE;IACvE,yEAAyE;IACzE,wEAAwE;IACxE,iDAAiD;IACjD,IAAA,kBAAU,EAAC,yBAAY,CAAC,CAAA,CAAC,uCAAuC;IAChE,MAAM,GAAG,GAAG,sBAAS,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,2EAA2E;IAC3E,yDAAyD;IACzD,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO;gBACL,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE;gBACvB,oBAAoB,EAAE,GAAG,EAAE,CAAC,EAAE;gBAC9B,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;gBACxB,YAAY,EAAE,GAAG,EAAE,CAAC,KAAK;gBACzB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;gBACpB,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;gBACzB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;gBACrB,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;gBACxB,SAAS,EAAE,GAAG,EAAE,GAAE,CAAC;gBACnB,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;gBAC7B,mBAAmB,EAAE,GAAG,EAAE,GAAE,CAAC;aAC9B,CAAA;QACH,CAAC;QACD,OAAO;YACL,aAAa,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,aAAa,EAAE;YACxC,oBAAoB,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACtD,cAAc,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,kBAAkB,EAAE;YAC9C,YAAY,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,gBAAgB,EAAE;YAC1C,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS;YAC7B,SAAS,EAAE,CAAC,EAAc,EAAE,EAAE,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAAE,CAAC;YACjE,WAAW,EAAE,CAAC,IAAY,EAAE,MAAc,EAAE,MAAc,EAAE,EAAE,CAC5D,IAAA,0BAAW,EAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;YAClD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,CACvC,GAAG,CAAC,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;YACnD,SAAS,EAAE,CAAC,IAAe,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC5D,mBAAmB,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAC/C,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;YAClD,mBAAmB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,CAAC;SACvE,CAAA;IACH,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;AACX,CAAC;AAED,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC,CAAA;AACnC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,KAAK,CAAA;AAEhC;;;;GAIG;AACH,SAAgB,eAAe;IAC7B,IAAA,kBAAU,EAAC,yBAAY,CAAC,CAAA;IACxB,MAAM,GAAG,GAAG,sBAAS,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,IAAA,4BAAoB,EACzB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAC,YAAY,EACnD,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,YAAY,CAC1C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stdin.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-stdin.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,QAAA,MAAM,QAAQ,WAAiC,CAAA;AAC/C,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const StdinContext_js_1 = __importDefault(require("../components/StdinContext.js"));
|
|
8
|
+
/**
|
|
9
|
+
* `useStdin` is a React hook, which exposes stdin stream.
|
|
10
|
+
*/
|
|
11
|
+
const useStdin = () => (0, react_1.useContext)(StdinContext_js_1.default);
|
|
12
|
+
exports.default = useStdin;
|
|
13
|
+
//# sourceMappingURL=use-stdin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stdin.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-stdin.ts"],"names":[],"mappings":";;;;;AAAA,iCAAkC;AAClC,oFAAwD;AAExD;;GAEG;AACH,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAA,kBAAU,EAAC,yBAAY,CAAC,CAAA;AAC/C,kBAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TabStatusKind = 'idle' | 'busy' | 'waiting';
|
|
2
|
+
/**
|
|
3
|
+
* Declaratively set the tab-status indicator (OSC 21337).
|
|
4
|
+
*
|
|
5
|
+
* Emits a colored dot + short status text to the tab sidebar. Terminals
|
|
6
|
+
* that don't support OSC 21337 discard the sequence silently, so this is
|
|
7
|
+
* safe to call unconditionally. Wrapped for tmux/screen passthrough.
|
|
8
|
+
*
|
|
9
|
+
* Pass `null` to opt out. If a status was previously set, transitioning to
|
|
10
|
+
* `null` emits CLEAR_TAB_STATUS so toggling off mid-session doesn't leave
|
|
11
|
+
* a stale dot. Process-exit cleanup is handled by ink.tsx's unmount path.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useTabStatus(kind: TabStatusKind | null): void;
|
|
14
|
+
//# sourceMappingURL=use-tab-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tab-status.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-tab-status.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AA+BvD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAmB7D"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTabStatus = useTabStatus;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const osc_js_1 = require("../termio/osc.js");
|
|
6
|
+
const useTerminalNotification_js_1 = require("../useTerminalNotification.js");
|
|
7
|
+
const rgb = (r, g, b) => ({
|
|
8
|
+
type: 'rgb',
|
|
9
|
+
r,
|
|
10
|
+
g,
|
|
11
|
+
b,
|
|
12
|
+
});
|
|
13
|
+
// Per the OSC 21337 usage guide's suggested mapping.
|
|
14
|
+
const TAB_STATUS_PRESETS = {
|
|
15
|
+
idle: {
|
|
16
|
+
indicator: rgb(0, 215, 95),
|
|
17
|
+
status: 'Idle',
|
|
18
|
+
statusColor: rgb(136, 136, 136),
|
|
19
|
+
},
|
|
20
|
+
busy: {
|
|
21
|
+
indicator: rgb(255, 149, 0),
|
|
22
|
+
status: 'Working…',
|
|
23
|
+
statusColor: rgb(255, 149, 0),
|
|
24
|
+
},
|
|
25
|
+
waiting: {
|
|
26
|
+
indicator: rgb(95, 135, 255),
|
|
27
|
+
status: 'Waiting',
|
|
28
|
+
statusColor: rgb(95, 135, 255),
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Declaratively set the tab-status indicator (OSC 21337).
|
|
33
|
+
*
|
|
34
|
+
* Emits a colored dot + short status text to the tab sidebar. Terminals
|
|
35
|
+
* that don't support OSC 21337 discard the sequence silently, so this is
|
|
36
|
+
* safe to call unconditionally. Wrapped for tmux/screen passthrough.
|
|
37
|
+
*
|
|
38
|
+
* Pass `null` to opt out. If a status was previously set, transitioning to
|
|
39
|
+
* `null` emits CLEAR_TAB_STATUS so toggling off mid-session doesn't leave
|
|
40
|
+
* a stale dot. Process-exit cleanup is handled by ink.tsx's unmount path.
|
|
41
|
+
*/
|
|
42
|
+
function useTabStatus(kind) {
|
|
43
|
+
const writeRaw = (0, react_1.useContext)(useTerminalNotification_js_1.TerminalWriteContext);
|
|
44
|
+
const prevKindRef = (0, react_1.useRef)(null);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
// When kind transitions from non-null to null (e.g. user toggles off
|
|
47
|
+
// showStatusInTerminalTab mid-session), clear the stale dot.
|
|
48
|
+
if (kind === null) {
|
|
49
|
+
if (prevKindRef.current !== null && writeRaw && (0, osc_js_1.supportsTabStatus)()) {
|
|
50
|
+
writeRaw((0, osc_js_1.wrapForMultiplexer)(osc_js_1.CLEAR_TAB_STATUS));
|
|
51
|
+
}
|
|
52
|
+
prevKindRef.current = null;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
prevKindRef.current = kind;
|
|
56
|
+
if (!writeRaw || !(0, osc_js_1.supportsTabStatus)())
|
|
57
|
+
return;
|
|
58
|
+
writeRaw((0, osc_js_1.wrapForMultiplexer)((0, osc_js_1.tabStatus)(TAB_STATUS_PRESETS[kind])));
|
|
59
|
+
}, [kind, writeRaw]);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=use-tab-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-tab-status.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-tab-status.ts"],"names":[],"mappings":";;AAoDA,oCAmBC;AAvED,iCAAqD;AACrD,6CAKyB;AAEzB,8EAAoE;AAIpE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS,EAAS,EAAE,CAAC,CAAC;IACvD,IAAI,EAAE,KAAK;IACX,CAAC;IACD,CAAC;IACD,CAAC;CACF,CAAC,CAAA;AAEF,qDAAqD;AACrD,MAAM,kBAAkB,GAGpB;IACF,IAAI,EAAE;QACJ,SAAS,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC;QAC1B,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;KAChC;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,UAAU;QAClB,WAAW,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;KAC9B;IACD,OAAO,EAAE;QACP,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;QAC5B,MAAM,EAAE,SAAS;QACjB,WAAW,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC;KAC/B;CACF,CAAA;AAED;;;;;;;;;;GAUG;AACH,SAAgB,YAAY,CAAC,IAA0B;IACrD,MAAM,QAAQ,GAAG,IAAA,kBAAU,EAAC,iDAAoB,CAAC,CAAA;IACjD,MAAM,WAAW,GAAG,IAAA,cAAM,EAAuB,IAAI,CAAC,CAAA;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,qEAAqE;QACrE,6DAA6D;QAC7D,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,IAAI,WAAW,CAAC,OAAO,KAAK,IAAI,IAAI,QAAQ,IAAI,IAAA,0BAAiB,GAAE,EAAE,CAAC;gBACpE,QAAQ,CAAC,IAAA,2BAAkB,EAAC,yBAAgB,CAAC,CAAC,CAAA;YAChD,CAAC;YACD,WAAW,CAAC,OAAO,GAAG,IAAI,CAAA;YAC1B,OAAM;QACR,CAAC;QAED,WAAW,CAAC,OAAO,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAA,0BAAiB,GAAE;YAAE,OAAM;QAC7C,QAAQ,CAAC,IAAA,2BAAkB,EAAC,IAAA,kBAAS,EAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IACnE,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAA;AACtB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to check if the terminal has focus.
|
|
3
|
+
*
|
|
4
|
+
* Uses DECSET 1004 focus reporting - the terminal sends escape sequences
|
|
5
|
+
* when it gains or loses focus. These are handled automatically
|
|
6
|
+
* by Ink and filtered from useInput.
|
|
7
|
+
*
|
|
8
|
+
* @returns true if the terminal is focused (or focus state is unknown)
|
|
9
|
+
*/
|
|
10
|
+
export declare function useTerminalFocus(): boolean;
|
|
11
|
+
//# sourceMappingURL=use-terminal-focus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-focus.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-focus.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useTerminalFocus = useTerminalFocus;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const TerminalFocusContext_js_1 = __importDefault(require("../components/TerminalFocusContext.js"));
|
|
9
|
+
/**
|
|
10
|
+
* Hook to check if the terminal has focus.
|
|
11
|
+
*
|
|
12
|
+
* Uses DECSET 1004 focus reporting - the terminal sends escape sequences
|
|
13
|
+
* when it gains or loses focus. These are handled automatically
|
|
14
|
+
* by Ink and filtered from useInput.
|
|
15
|
+
*
|
|
16
|
+
* @returns true if the terminal is focused (or focus state is unknown)
|
|
17
|
+
*/
|
|
18
|
+
function useTerminalFocus() {
|
|
19
|
+
const { isTerminalFocused } = (0, react_1.useContext)(TerminalFocusContext_js_1.default);
|
|
20
|
+
return isTerminalFocused;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=use-terminal-focus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-focus.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-focus.ts"],"names":[],"mappings":";;;;;AAYA,4CAGC;AAfD,iCAAkC;AAClC,oGAAwE;AAExE;;;;;;;;GAQG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,kBAAU,EAAC,iCAAoB,CAAC,CAAA;IAC9D,OAAO,iBAAiB,CAAA;AAC1B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declaratively set the terminal tab/window title.
|
|
3
|
+
*
|
|
4
|
+
* Pass a string to set the title. ANSI escape sequences are stripped
|
|
5
|
+
* automatically so callers don't need to know about terminal encoding.
|
|
6
|
+
* Pass `null` to opt out — the hook becomes a no-op and leaves the
|
|
7
|
+
* terminal title untouched.
|
|
8
|
+
*
|
|
9
|
+
* On Windows, uses `process.title` (classic conhost doesn't support OSC).
|
|
10
|
+
* Elsewhere, writes OSC 0 (set title+icon) via Ink's stdout.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useTerminalTitle(title: string | null): void;
|
|
13
|
+
//# sourceMappingURL=use-terminal-title.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-title.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-title.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAc3D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useTerminalTitle = useTerminalTitle;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
9
|
+
const osc_js_1 = require("../termio/osc.js");
|
|
10
|
+
const useTerminalNotification_js_1 = require("../useTerminalNotification.js");
|
|
11
|
+
/**
|
|
12
|
+
* Declaratively set the terminal tab/window title.
|
|
13
|
+
*
|
|
14
|
+
* Pass a string to set the title. ANSI escape sequences are stripped
|
|
15
|
+
* automatically so callers don't need to know about terminal encoding.
|
|
16
|
+
* Pass `null` to opt out — the hook becomes a no-op and leaves the
|
|
17
|
+
* terminal title untouched.
|
|
18
|
+
*
|
|
19
|
+
* On Windows, uses `process.title` (classic conhost doesn't support OSC).
|
|
20
|
+
* Elsewhere, writes OSC 0 (set title+icon) via Ink's stdout.
|
|
21
|
+
*/
|
|
22
|
+
function useTerminalTitle(title) {
|
|
23
|
+
const writeRaw = (0, react_1.useContext)(useTerminalNotification_js_1.TerminalWriteContext);
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
if (title === null || !writeRaw)
|
|
26
|
+
return;
|
|
27
|
+
const clean = (0, strip_ansi_1.default)(title);
|
|
28
|
+
if (process.platform === 'win32') {
|
|
29
|
+
process.title = clean;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
writeRaw((0, osc_js_1.osc)(osc_js_1.OSC.SET_TITLE_AND_ICON, clean));
|
|
33
|
+
}
|
|
34
|
+
}, [title, writeRaw]);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=use-terminal-title.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-title.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-title.ts"],"names":[],"mappings":";;;;;AAgBA,4CAcC;AA9BD,iCAA6C;AAC7C,4DAAkC;AAClC,6CAA2C;AAC3C,8EAAoE;AAEpE;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAAC,KAAoB;IACnD,MAAM,QAAQ,GAAG,IAAA,kBAAU,EAAC,iDAAoB,CAAC,CAAA;IAEjD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAM;QAEvC,MAAM,KAAK,GAAG,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAA;QAE9B,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;YACjC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAA;QACvB,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,IAAA,YAAG,EAAC,YAAG,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC,CAAA;QAC9C,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAA;AACvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DOMElement } from '../dom.js';
|
|
2
|
+
type ViewportEntry = {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the element is currently within the terminal viewport
|
|
5
|
+
*/
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Hook to detect if a component is within the terminal viewport.
|
|
10
|
+
*
|
|
11
|
+
* Returns a callback ref and a viewport entry object.
|
|
12
|
+
* Attach the ref to the component you want to track.
|
|
13
|
+
*
|
|
14
|
+
* The entry is updated during the layout phase (useLayoutEffect) so callers
|
|
15
|
+
* always read fresh values during render. Visibility changes do NOT trigger
|
|
16
|
+
* re-renders on their own — callers that re-render for other reasons (e.g.
|
|
17
|
+
* animation ticks, state changes) will pick up the latest value naturally.
|
|
18
|
+
* This avoids infinite update loops when combined with other layout effects
|
|
19
|
+
* that also call setState.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const [ref, entry] = useTerminalViewport()
|
|
23
|
+
* return <Box ref={ref}><Animation enabled={entry.isVisible}>...</Animation></Box>
|
|
24
|
+
*/
|
|
25
|
+
export declare function useTerminalViewport(): [
|
|
26
|
+
ref: (element: DOMElement | null) => void,
|
|
27
|
+
entry: ViewportEntry
|
|
28
|
+
];
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=use-terminal-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-viewport.d.ts","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-viewport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAE3C,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,IAAI;IACrC,GAAG,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI;IACzC,KAAK,EAAE,aAAa;CACrB,CAgEA"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTerminalViewport = useTerminalViewport;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const TerminalSizeContext_js_1 = require("../components/TerminalSizeContext.js");
|
|
6
|
+
/**
|
|
7
|
+
* Hook to detect if a component is within the terminal viewport.
|
|
8
|
+
*
|
|
9
|
+
* Returns a callback ref and a viewport entry object.
|
|
10
|
+
* Attach the ref to the component you want to track.
|
|
11
|
+
*
|
|
12
|
+
* The entry is updated during the layout phase (useLayoutEffect) so callers
|
|
13
|
+
* always read fresh values during render. Visibility changes do NOT trigger
|
|
14
|
+
* re-renders on their own — callers that re-render for other reasons (e.g.
|
|
15
|
+
* animation ticks, state changes) will pick up the latest value naturally.
|
|
16
|
+
* This avoids infinite update loops when combined with other layout effects
|
|
17
|
+
* that also call setState.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* const [ref, entry] = useTerminalViewport()
|
|
21
|
+
* return <Box ref={ref}><Animation enabled={entry.isVisible}>...</Animation></Box>
|
|
22
|
+
*/
|
|
23
|
+
function useTerminalViewport() {
|
|
24
|
+
const terminalSize = (0, react_1.useContext)(TerminalSizeContext_js_1.TerminalSizeContext);
|
|
25
|
+
const elementRef = (0, react_1.useRef)(null);
|
|
26
|
+
const entryRef = (0, react_1.useRef)({ isVisible: true });
|
|
27
|
+
const setElement = (0, react_1.useCallback)((el) => {
|
|
28
|
+
elementRef.current = el;
|
|
29
|
+
}, []);
|
|
30
|
+
// Runs on every render because yoga layout values can change
|
|
31
|
+
// without React being aware. Only updates the ref — no setState
|
|
32
|
+
// to avoid cascading re-renders during the commit phase.
|
|
33
|
+
// Walks the DOM ancestor chain fresh each time to avoid holding stale
|
|
34
|
+
// references after yoga tree rebuilds.
|
|
35
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
36
|
+
const element = elementRef.current;
|
|
37
|
+
if (!element?.yogaNode || !terminalSize) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const height = element.yogaNode.getComputedHeight();
|
|
41
|
+
const rows = terminalSize.rows;
|
|
42
|
+
// Walk the DOM parent chain (not yoga.getParent()) so we can detect
|
|
43
|
+
// scroll containers and subtract their scrollTop. Yoga computes layout
|
|
44
|
+
// positions without scroll offset — scrollTop is applied at render time.
|
|
45
|
+
// Without this, an element inside a ScrollBox whose yoga position exceeds
|
|
46
|
+
// terminalRows would be considered offscreen even when scrolled into view
|
|
47
|
+
// (e.g., the spinner in fullscreen mode after enough messages accumulate).
|
|
48
|
+
let absoluteTop = element.yogaNode.getComputedTop();
|
|
49
|
+
let parent = element.parentNode;
|
|
50
|
+
let root = element.yogaNode;
|
|
51
|
+
while (parent) {
|
|
52
|
+
if (parent.yogaNode) {
|
|
53
|
+
absoluteTop += parent.yogaNode.getComputedTop();
|
|
54
|
+
root = parent.yogaNode;
|
|
55
|
+
}
|
|
56
|
+
// scrollTop is only ever set on scroll containers (by ScrollBox + renderer).
|
|
57
|
+
// Non-scroll nodes have undefined scrollTop → falsy fast-path.
|
|
58
|
+
if (parent.scrollTop)
|
|
59
|
+
absoluteTop -= parent.scrollTop;
|
|
60
|
+
parent = parent.parentNode;
|
|
61
|
+
}
|
|
62
|
+
// Only the root's height matters
|
|
63
|
+
const screenHeight = root.getComputedHeight();
|
|
64
|
+
const bottom = absoluteTop + height;
|
|
65
|
+
// When content overflows the viewport (screenHeight > rows), the
|
|
66
|
+
// cursor-restore at frame end scrolls one extra row into scrollback.
|
|
67
|
+
// log-update.ts accounts for this with scrollbackRows = viewportY + 1.
|
|
68
|
+
// We must match, otherwise an element at the boundary is considered
|
|
69
|
+
// "visible" here (animation keeps ticking) but its row is treated as
|
|
70
|
+
// scrollback by log-update (content change → full reset → flicker).
|
|
71
|
+
const cursorRestoreScroll = screenHeight > rows ? 1 : 0;
|
|
72
|
+
const viewportY = Math.max(0, screenHeight - rows) + cursorRestoreScroll;
|
|
73
|
+
const viewportBottom = viewportY + rows;
|
|
74
|
+
const visible = bottom > viewportY && absoluteTop < viewportBottom;
|
|
75
|
+
if (visible !== entryRef.current.isVisible) {
|
|
76
|
+
entryRef.current = { isVisible: visible };
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
return [setElement, entryRef.current];
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=use-terminal-viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-terminal-viewport.js","sourceRoot":"","sources":["../../../src/ink/hooks/use-terminal-viewport.ts"],"names":[],"mappings":";;AA4BA,kDAmEC;AA/FD,iCAAwE;AACxE,iFAA0E;AAU1E;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,mBAAmB;IAIjC,MAAM,YAAY,GAAG,IAAA,kBAAU,EAAC,4CAAmB,CAAC,CAAA;IACpD,MAAM,UAAU,GAAG,IAAA,cAAM,EAAoB,IAAI,CAAC,CAAA;IAClD,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAgB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAE3D,MAAM,UAAU,GAAG,IAAA,mBAAW,EAAC,CAAC,EAAqB,EAAE,EAAE;QACvD,UAAU,CAAC,OAAO,GAAG,EAAE,CAAA;IACzB,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,6DAA6D;IAC7D,gEAAgE;IAChE,yDAAyD;IACzD,sEAAsE;IACtE,uCAAuC;IACvC,IAAA,uBAAe,EAAC,GAAG,EAAE;QACnB,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;QAClC,IAAI,CAAC,OAAO,EAAE,QAAQ,IAAI,CAAC,YAAY,EAAE,CAAC;YACxC,OAAM;QACR,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,iBAAiB,EAAE,CAAA;QACnD,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAA;QAE9B,oEAAoE;QACpE,uEAAuE;QACvE,yEAAyE;QACzE,0EAA0E;QAC1E,0EAA0E;QAC1E,2EAA2E;QAC3E,IAAI,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAA;QACnD,IAAI,MAAM,GAA2B,OAAO,CAAC,UAAU,CAAA;QACvD,IAAI,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAA;QAC3B,OAAO,MAAM,EAAE,CAAC;YACd,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,CAAA;gBAC/C,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAA;YACxB,CAAC;YACD,6EAA6E;YAC7E,+DAA+D;YAC/D,IAAI,MAAM,CAAC,SAAS;gBAAE,WAAW,IAAI,MAAM,CAAC,SAAS,CAAA;YACrD,MAAM,GAAG,MAAM,CAAC,UAAU,CAAA;QAC5B,CAAC;QAED,iCAAiC;QACjC,MAAM,YAAY,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAE7C,MAAM,MAAM,GAAG,WAAW,GAAG,MAAM,CAAA;QACnC,iEAAiE;QACjE,qEAAqE;QACrE,uEAAuE;QACvE,oEAAoE;QACpE,qEAAqE;QACrE,oEAAoE;QACpE,MAAM,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC,GAAG,mBAAmB,CAAA;QACxE,MAAM,cAAc,GAAG,SAAS,GAAG,IAAI,CAAA;QACvC,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,IAAI,WAAW,GAAG,cAAc,CAAA;QAElE,IAAI,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YAC3C,QAAQ,CAAC,OAAO,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;QAC3C,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenHorse - Minimal Terminal UI Utilities
|
|
3
|
+
*
|
|
4
|
+
* 简化的终端 UI 工具,不依赖 React hooks
|
|
5
|
+
*/
|
|
6
|
+
export declare const COLORS: {
|
|
7
|
+
black: string;
|
|
8
|
+
red: string;
|
|
9
|
+
green: string;
|
|
10
|
+
yellow: string;
|
|
11
|
+
blue: string;
|
|
12
|
+
magenta: string;
|
|
13
|
+
cyan: string;
|
|
14
|
+
white: string;
|
|
15
|
+
gray: string;
|
|
16
|
+
brightRed: string;
|
|
17
|
+
brightGreen: string;
|
|
18
|
+
brightYellow: string;
|
|
19
|
+
brightBlue: string;
|
|
20
|
+
brightMagenta: string;
|
|
21
|
+
brightCyan: string;
|
|
22
|
+
brightWhite: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const STYLES: {
|
|
25
|
+
bold: string;
|
|
26
|
+
dim: string;
|
|
27
|
+
italic: string;
|
|
28
|
+
underline: string;
|
|
29
|
+
reset: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const CURSOR: {
|
|
32
|
+
hide: string;
|
|
33
|
+
show: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const SCREEN: {
|
|
36
|
+
clear: string;
|
|
37
|
+
home: string;
|
|
38
|
+
clearLine: string;
|
|
39
|
+
};
|
|
40
|
+
export declare const SPINNER_FRAMES: string[];
|
|
41
|
+
export declare function createSpinner(onUpdate: (frame: string) => void): {
|
|
42
|
+
start: () => void;
|
|
43
|
+
stop: () => void;
|
|
44
|
+
};
|
|
45
|
+
export declare function setupRawInput(onChar: (char: string, key: {
|
|
46
|
+
name: string;
|
|
47
|
+
ctrl: boolean;
|
|
48
|
+
}) => void): {
|
|
49
|
+
cleanup: () => void;
|
|
50
|
+
};
|
|
51
|
+
export declare function clearScreen(): void;
|
|
52
|
+
export declare function hideCursor(): void;
|
|
53
|
+
export declare function showCursor(): void;
|
|
54
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ink/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;CAiBlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;CAMlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAMF,eAAO,MAAM,cAAc,UAAqD,CAAC;AAEjF,wBAAgB,aAAa,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG;IAAE,KAAK,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,IAAI,CAAA;CAAE,CAkBxG;AAMD,wBAAgB,aAAa,CAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,KAAK,IAAI,GACnE;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA0BzB;AAMD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC;AAED,wBAAgB,UAAU,IAAI,IAAI,CAEjC"}
|