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
package/dist/ink/root.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
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.renderSync = void 0;
|
|
7
|
+
exports.createRoot = createRoot;
|
|
8
|
+
const debug_js_1 = require("src/utils/debug.js");
|
|
9
|
+
const stream_1 = require("stream");
|
|
10
|
+
const ink_js_1 = __importDefault(require("./ink.js"));
|
|
11
|
+
const instances_js_1 = __importDefault(require("./instances.js"));
|
|
12
|
+
/**
|
|
13
|
+
* Mount a component and render the output.
|
|
14
|
+
*/
|
|
15
|
+
const renderSync = (node, options) => {
|
|
16
|
+
const opts = getOptions(options);
|
|
17
|
+
const inkOptions = {
|
|
18
|
+
stdout: process.stdout,
|
|
19
|
+
stdin: process.stdin,
|
|
20
|
+
stderr: process.stderr,
|
|
21
|
+
exitOnCtrlC: true,
|
|
22
|
+
patchConsole: true,
|
|
23
|
+
...opts,
|
|
24
|
+
};
|
|
25
|
+
const instance = getInstance(inkOptions.stdout, () => new ink_js_1.default(inkOptions));
|
|
26
|
+
instance.render(node);
|
|
27
|
+
return {
|
|
28
|
+
rerender: instance.render,
|
|
29
|
+
unmount() {
|
|
30
|
+
instance.unmount();
|
|
31
|
+
},
|
|
32
|
+
waitUntilExit: instance.waitUntilExit,
|
|
33
|
+
cleanup: () => instances_js_1.default.delete(inkOptions.stdout),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
exports.renderSync = renderSync;
|
|
37
|
+
const wrappedRender = async (node, options) => {
|
|
38
|
+
// Preserve the microtask boundary that `await loadYoga()` used to provide.
|
|
39
|
+
// Without it, the first render fires synchronously before async startup work
|
|
40
|
+
// (e.g. useReplBridge notification state) settles, and the subsequent Static
|
|
41
|
+
// write overwrites scrollback instead of appending below the logo.
|
|
42
|
+
await Promise.resolve();
|
|
43
|
+
const instance = (0, exports.renderSync)(node, options);
|
|
44
|
+
(0, debug_js_1.logForDebugging)(`[render] first ink render: ${Math.round(process.uptime() * 1000)}ms since process start`);
|
|
45
|
+
return instance;
|
|
46
|
+
};
|
|
47
|
+
exports.default = wrappedRender;
|
|
48
|
+
/**
|
|
49
|
+
* Create an Ink root without rendering anything yet.
|
|
50
|
+
* Like react-dom's createRoot — call root.render() to mount a tree.
|
|
51
|
+
*/
|
|
52
|
+
async function createRoot({ stdout = process.stdout, stdin = process.stdin, stderr = process.stderr, exitOnCtrlC = true, patchConsole = true, onFrame, } = {}) {
|
|
53
|
+
// See wrappedRender — preserve microtask boundary from the old WASM await.
|
|
54
|
+
await Promise.resolve();
|
|
55
|
+
const instance = new ink_js_1.default({
|
|
56
|
+
stdout,
|
|
57
|
+
stdin,
|
|
58
|
+
stderr,
|
|
59
|
+
exitOnCtrlC,
|
|
60
|
+
patchConsole,
|
|
61
|
+
onFrame,
|
|
62
|
+
});
|
|
63
|
+
// Register in the instances map so that code that looks up the Ink
|
|
64
|
+
// instance by stdout (e.g. external editor pause/resume) can find it.
|
|
65
|
+
instances_js_1.default.set(stdout, instance);
|
|
66
|
+
return {
|
|
67
|
+
render: node => instance.render(node),
|
|
68
|
+
unmount: () => instance.unmount(),
|
|
69
|
+
waitUntilExit: () => instance.waitUntilExit(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const getOptions = (stdout = {}) => {
|
|
73
|
+
if (stdout instanceof stream_1.Stream) {
|
|
74
|
+
return {
|
|
75
|
+
stdout,
|
|
76
|
+
stdin: process.stdin,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return stdout;
|
|
80
|
+
};
|
|
81
|
+
const getInstance = (stdout, createInstance) => {
|
|
82
|
+
let instance = instances_js_1.default.get(stdout);
|
|
83
|
+
if (!instance) {
|
|
84
|
+
instance = createInstance();
|
|
85
|
+
instances_js_1.default.set(stdout, instance);
|
|
86
|
+
}
|
|
87
|
+
return instance;
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/ink/root.ts"],"names":[],"mappings":";;;;;;AAgIA,gCA4BC;AA3JD,iDAAoD;AACpD,mCAA+B;AAE/B,sDAA0D;AAC1D,kEAAsC;AAmEtC;;GAEG;AACI,MAAM,UAAU,GAAG,CACxB,IAAe,EACf,OAA4C,EAClC,EAAE;IACZ,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAChC,MAAM,UAAU,GAAe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, type Size } from './layout/geometry.js';
|
|
3
|
+
export declare class CharPool {
|
|
4
|
+
private strings;
|
|
5
|
+
private stringMap;
|
|
6
|
+
private ascii;
|
|
7
|
+
intern(char: string): number;
|
|
8
|
+
get(index: number): string;
|
|
9
|
+
}
|
|
10
|
+
export declare class HyperlinkPool {
|
|
11
|
+
private strings;
|
|
12
|
+
private stringMap;
|
|
13
|
+
intern(hyperlink: string | undefined): number;
|
|
14
|
+
get(id: number): string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare class StylePool {
|
|
17
|
+
private ids;
|
|
18
|
+
private styles;
|
|
19
|
+
private transitionCache;
|
|
20
|
+
readonly none: number;
|
|
21
|
+
constructor();
|
|
22
|
+
/**
|
|
23
|
+
* Intern a style and return its ID. Bit 0 of the ID encodes whether the
|
|
24
|
+
* style has a visible effect on space characters (background, inverse,
|
|
25
|
+
* underline, etc.). Foreground-only styles get even IDs; styles visible
|
|
26
|
+
* on spaces get odd IDs. This lets the renderer skip invisible spaces
|
|
27
|
+
* with a single bitmask check on the packed word.
|
|
28
|
+
*/
|
|
29
|
+
intern(styles: AnsiCode[]): number;
|
|
30
|
+
/** Recover styles from an encoded ID. Strips the bit-0 flag via >>> 1. */
|
|
31
|
+
get(id: number): AnsiCode[];
|
|
32
|
+
/**
|
|
33
|
+
* Returns the pre-serialized ANSI string to transition from one style to
|
|
34
|
+
* another. Cached by (fromId, toId) — zero allocations after first call
|
|
35
|
+
* for a given pair.
|
|
36
|
+
*/
|
|
37
|
+
transition(fromId: number, toId: number): string;
|
|
38
|
+
/**
|
|
39
|
+
* Intern a style that is `base + inverse`. Cached by base ID so
|
|
40
|
+
* repeated calls for the same underlying style don't re-scan the
|
|
41
|
+
* AnsiCode[] array. Used by the selection overlay.
|
|
42
|
+
*/
|
|
43
|
+
private inverseCache;
|
|
44
|
+
withInverse(baseId: number): number;
|
|
45
|
+
/** Inverse + bold + yellow-bg-via-fg-swap for the CURRENT search match.
|
|
46
|
+
* OTHER matches are plain inverse — bg inherits from the theme. Current
|
|
47
|
+
* gets a distinct yellow bg (via fg-then-inverse swap) plus bold weight
|
|
48
|
+
* so it stands out in a sea of inverse. Underline was too subtle. Zero
|
|
49
|
+
* reflow risk: all pure SGR overlays, per-cell, post-layout. The yellow
|
|
50
|
+
* overrides any existing fg (syntax highlighting) on those cells — fine,
|
|
51
|
+
* the "you are here" signal IS the point, syntax color can yield. */
|
|
52
|
+
private currentMatchCache;
|
|
53
|
+
withCurrentMatch(baseId: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* Selection overlay: REPLACE the cell's background with a solid color
|
|
56
|
+
* while preserving its foreground (color, bold, italic, dim, underline).
|
|
57
|
+
* Matches native terminal selection — a dedicated bg color, not SGR-7
|
|
58
|
+
* inverse. Inverse swaps fg/bg per-cell, which fragments visually over
|
|
59
|
+
* syntax-highlighted text (every fg color becomes a different bg stripe).
|
|
60
|
+
*
|
|
61
|
+
* Strips any existing bg (endCode 49m — REPLACES, so diff-added green
|
|
62
|
+
* etc. don't bleed through) and any existing inverse (endCode 27m —
|
|
63
|
+
* inverse on top of a solid bg would re-swap and look wrong).
|
|
64
|
+
*
|
|
65
|
+
* bg is set via setSelectionBg(); null → fallback to withInverse() so the
|
|
66
|
+
* overlay still works before theme wiring sets a color (tests, first frame).
|
|
67
|
+
* Cache is keyed by baseId only — setSelectionBg() clears it on change.
|
|
68
|
+
*/
|
|
69
|
+
private selectionBgCode;
|
|
70
|
+
private selectionBgCache;
|
|
71
|
+
setSelectionBg(bg: AnsiCode | null): void;
|
|
72
|
+
withSelectionBg(baseId: number): number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Cell width classification for handling double-wide characters (CJK, emoji,
|
|
76
|
+
* etc.)
|
|
77
|
+
*
|
|
78
|
+
* We use explicit spacer cells rather than inferring width at render time. This
|
|
79
|
+
* makes the data structure self-describing and simplifies cursor positioning
|
|
80
|
+
* logic.
|
|
81
|
+
*
|
|
82
|
+
* @see https://mitchellh.com/writing/grapheme-clusters-in-terminals
|
|
83
|
+
*/
|
|
84
|
+
export declare const enum CellWidth {
|
|
85
|
+
Narrow = 0,
|
|
86
|
+
Wide = 1,
|
|
87
|
+
SpacerTail = 2,
|
|
88
|
+
SpacerHead = 3
|
|
89
|
+
}
|
|
90
|
+
export type Hyperlink = string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Cell is a view type returned by cellAt(). Cells are stored as packed typed
|
|
93
|
+
* arrays internally to avoid GC pressure from allocating objects per cell.
|
|
94
|
+
*/
|
|
95
|
+
export type Cell = {
|
|
96
|
+
char: string;
|
|
97
|
+
styleId: number;
|
|
98
|
+
width: CellWidth;
|
|
99
|
+
hyperlink: Hyperlink;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Screen uses a packed Int32Array instead of Cell objects to eliminate GC
|
|
103
|
+
* pressure. For a 200x120 screen, this avoids allocating 24,000 objects.
|
|
104
|
+
*
|
|
105
|
+
* Cell data is stored as 2 Int32s per cell in a single contiguous array:
|
|
106
|
+
* word0: charId (full 32 bits — index into CharPool)
|
|
107
|
+
* word1: styleId[31:17] | hyperlinkId[16:2] | width[1:0]
|
|
108
|
+
*
|
|
109
|
+
* This layout halves memory accesses in diffEach (2 int loads vs 4) and
|
|
110
|
+
* enables future SIMD comparison via Bun.indexOfFirstDifference.
|
|
111
|
+
*/
|
|
112
|
+
export type Screen = Size & {
|
|
113
|
+
cells: Int32Array;
|
|
114
|
+
cells64: BigInt64Array;
|
|
115
|
+
charPool: CharPool;
|
|
116
|
+
hyperlinkPool: HyperlinkPool;
|
|
117
|
+
emptyStyleId: number;
|
|
118
|
+
/**
|
|
119
|
+
* Bounding box of cells that were written to (not blitted) during rendering.
|
|
120
|
+
* Used by diff() to limit iteration to only the region that could have changed.
|
|
121
|
+
*/
|
|
122
|
+
damage: Rectangle | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Per-cell noSelect bitmap — 1 byte per cell, 1 = exclude from text
|
|
125
|
+
* selection (copy + highlight). Used by <NoSelect> to mark gutters
|
|
126
|
+
* (line numbers, diff sigils) so click-drag over a diff yields clean
|
|
127
|
+
* copyable code. Fully reset each frame in resetScreen; blitRegion
|
|
128
|
+
* copies it alongside cells so the blit optimization preserves marks.
|
|
129
|
+
*/
|
|
130
|
+
noSelect: Uint8Array;
|
|
131
|
+
/**
|
|
132
|
+
* Per-ROW soft-wrap continuation marker. softWrap[r]=N>0 means row r
|
|
133
|
+
* is a word-wrap continuation of row r-1 (the `\n` before it was
|
|
134
|
+
* inserted by wrapAnsi, not in the source), and row r-1's written
|
|
135
|
+
* content ends at absolute column N (exclusive — cells [0..N) are the
|
|
136
|
+
* fragment, past N is unwritten padding). 0 means row r is NOT a
|
|
137
|
+
* continuation (hard newline or first row). Selection copy checks
|
|
138
|
+
* softWrap[r]>0 to join row r onto row r-1 without a newline, and
|
|
139
|
+
* reads softWrap[r+1] to know row r's content end when row r+1
|
|
140
|
+
* continues from it. The content-end column is needed because an
|
|
141
|
+
* unwritten cell and a written-unstyled-space are indistinguishable in
|
|
142
|
+
* the packed typed array (both all-zero) — without it we'd either drop
|
|
143
|
+
* the word-separator space (trim) or include trailing padding (no
|
|
144
|
+
* trim). This encoding (continuation-on-self, prev-content-end-here)
|
|
145
|
+
* is chosen so shiftRows preserves the is-continuation semantics: when
|
|
146
|
+
* row r scrolls off the top and row r+1 shifts to row r, sw[r] gets
|
|
147
|
+
* old sw[r+1] — which correctly says the new row r is a continuation
|
|
148
|
+
* of what's now in scrolledOffAbove. Reset each frame; copied by
|
|
149
|
+
* blitRegion/shiftRows.
|
|
150
|
+
*/
|
|
151
|
+
softWrap: Int32Array;
|
|
152
|
+
};
|
|
153
|
+
export declare function isEmptyCellAt(screen: Screen, x: number, y: number): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Check if a Cell (view object) represents an empty cell.
|
|
156
|
+
*/
|
|
157
|
+
export declare function isCellEmpty(screen: Screen, cell: Cell): boolean;
|
|
158
|
+
export declare function createScreen(width: number, height: number, styles: StylePool, charPool: CharPool, hyperlinkPool: HyperlinkPool): Screen;
|
|
159
|
+
/**
|
|
160
|
+
* Reset an existing screen for reuse, avoiding allocation of new typed arrays.
|
|
161
|
+
* Resizes if needed and clears all cells to empty/unwritten state.
|
|
162
|
+
*
|
|
163
|
+
* For double-buffering, this allows swapping between front and back buffers
|
|
164
|
+
* without allocating new Screen objects each frame.
|
|
165
|
+
*/
|
|
166
|
+
export declare function resetScreen(screen: Screen, width: number, height: number): void;
|
|
167
|
+
/**
|
|
168
|
+
* Re-intern a screen's char and hyperlink IDs into new pools.
|
|
169
|
+
* Used for generational pool reset — after migrating, the screen's
|
|
170
|
+
* typed arrays contain valid IDs for the new pools, and the old pools
|
|
171
|
+
* can be GC'd.
|
|
172
|
+
*
|
|
173
|
+
* O(width * height) but only called occasionally (e.g., between conversation turns).
|
|
174
|
+
*/
|
|
175
|
+
export declare function migrateScreenPools(screen: Screen, charPool: CharPool, hyperlinkPool: HyperlinkPool): void;
|
|
176
|
+
/**
|
|
177
|
+
* Get a Cell view at the given position. Returns a new object each call -
|
|
178
|
+
* this is intentional as cells are stored packed, not as objects.
|
|
179
|
+
*/
|
|
180
|
+
export declare function cellAt(screen: Screen, x: number, y: number): Cell | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* Get a Cell view by pre-computed array index. Skips bounds checks and
|
|
183
|
+
* index computation — caller must ensure index is valid.
|
|
184
|
+
*/
|
|
185
|
+
export declare function cellAtIndex(screen: Screen, index: number): Cell;
|
|
186
|
+
/**
|
|
187
|
+
* Get a Cell at the given index, or undefined if it has no visible content.
|
|
188
|
+
* Returns undefined for spacer cells (charId 1), empty unstyled spaces, and
|
|
189
|
+
* fg-only styled spaces that match lastRenderedStyleId (cursor-forward
|
|
190
|
+
* produces an identical visual result, avoiding a Cell allocation).
|
|
191
|
+
*
|
|
192
|
+
* @param lastRenderedStyleId - styleId of the last rendered cell on this
|
|
193
|
+
* line, or -1 if none yet.
|
|
194
|
+
*/
|
|
195
|
+
export declare function visibleCellAtIndex(cells: Int32Array, charPool: CharPool, hyperlinkPool: HyperlinkPool, index: number, lastRenderedStyleId: number): Cell | undefined;
|
|
196
|
+
export declare function charInCellAt(screen: Screen, x: number, y: number): string | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Set a cell, optionally creating a spacer for wide characters.
|
|
199
|
+
*
|
|
200
|
+
* Wide characters (CJK, emoji) occupy 2 cells in the buffer:
|
|
201
|
+
* 1. First cell: Contains the actual character with width = Wide
|
|
202
|
+
* 2. Second cell: Spacer cell with width = SpacerTail (empty, not rendered)
|
|
203
|
+
*
|
|
204
|
+
* If the cell has width = Wide, this function automatically creates the
|
|
205
|
+
* corresponding SpacerTail in the next column. This two-cell model keeps
|
|
206
|
+
* the buffer aligned to visual columns, making cursor positioning
|
|
207
|
+
* straightforward.
|
|
208
|
+
*
|
|
209
|
+
* TODO: When soft-wrapping is implemented, SpacerHead cells will be explicitly
|
|
210
|
+
* placed by the wrapping logic at line-end positions where wide characters
|
|
211
|
+
* wrap to the next line. This function doesn't need to handle SpacerHead
|
|
212
|
+
* automatically - it will be set directly by the wrapping code.
|
|
213
|
+
*/
|
|
214
|
+
export declare function setCellAt(screen: Screen, x: number, y: number, cell: Cell): void;
|
|
215
|
+
/**
|
|
216
|
+
* Replace the styleId of a cell in-place without disturbing char, width,
|
|
217
|
+
* or hyperlink. Preserves empty cells as-is (char stays ' '). Tracks damage
|
|
218
|
+
* for the cell so diffEach picks up the change.
|
|
219
|
+
*/
|
|
220
|
+
export declare function setCellStyleId(screen: Screen, x: number, y: number, styleId: number): void;
|
|
221
|
+
/**
|
|
222
|
+
* Bulk-copy a rectangular region from src to dst using TypedArray.set().
|
|
223
|
+
* Single cells.set() call per row (or one call for contiguous blocks).
|
|
224
|
+
* Damage is computed once for the whole region.
|
|
225
|
+
*
|
|
226
|
+
* Clamps negative regionX/regionY to 0 (matching clearRegion) — absolute-
|
|
227
|
+
* positioned overlays in tiny terminals can compute negative screen coords.
|
|
228
|
+
* maxX/maxY should already be clamped to both screen bounds by the caller.
|
|
229
|
+
*/
|
|
230
|
+
export declare function blitRegion(dst: Screen, src: Screen, regionX: number, regionY: number, maxX: number, maxY: number): void;
|
|
231
|
+
/**
|
|
232
|
+
* Bulk-clear a rectangular region of the screen.
|
|
233
|
+
* Uses BigInt64Array.fill() for fast row clears.
|
|
234
|
+
* Handles wide character boundary cleanup at region edges.
|
|
235
|
+
*/
|
|
236
|
+
export declare function clearRegion(screen: Screen, regionX: number, regionY: number, regionWidth: number, regionHeight: number): void;
|
|
237
|
+
/**
|
|
238
|
+
* Shift full-width rows within [top, bottom] (inclusive, 0-indexed) by n.
|
|
239
|
+
* n > 0 shifts UP (simulating CSI n S); n < 0 shifts DOWN (CSI n T).
|
|
240
|
+
* Vacated rows are cleared. Does NOT update damage. Both cells and the
|
|
241
|
+
* noSelect bitmap are shifted so text-selection markers stay aligned when
|
|
242
|
+
* this is applied to next.screen during scroll fast path.
|
|
243
|
+
*/
|
|
244
|
+
export declare function shiftRows(screen: Screen, top: number, bottom: number, n: number): void;
|
|
245
|
+
export declare const OSC8_PREFIX: string;
|
|
246
|
+
export declare function extractHyperlinkFromStyles(styles: AnsiCode[]): Hyperlink | null;
|
|
247
|
+
export declare function filterOutHyperlinkStyles(styles: AnsiCode[]): AnsiCode[];
|
|
248
|
+
/**
|
|
249
|
+
* Returns an array of all changes between two screens. Used by tests.
|
|
250
|
+
* Production code should use diffEach() to avoid allocations.
|
|
251
|
+
*/
|
|
252
|
+
export declare function diff(prev: Screen, next: Screen): [point: Point, removed: Cell | undefined, added: Cell | undefined][];
|
|
253
|
+
type DiffCallback = (x: number, y: number, removed: Cell | undefined, added: Cell | undefined) => boolean | void;
|
|
254
|
+
/**
|
|
255
|
+
* Like diff(), but calls a callback for each change instead of building an array.
|
|
256
|
+
* Reuses two Cell objects to avoid per-change allocations. The callback must not
|
|
257
|
+
* retain references to the Cell objects — their contents are overwritten each call.
|
|
258
|
+
*
|
|
259
|
+
* Returns true if the callback ever returned true (early exit signal).
|
|
260
|
+
*/
|
|
261
|
+
export declare function diffEach(prev: Screen, next: Screen, cb: DiffCallback): boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Mark a rectangular region as noSelect (exclude from text selection).
|
|
264
|
+
* Clamps to screen bounds. Called from output.ts when a <NoSelect> box
|
|
265
|
+
* renders. No damage tracking — noSelect doesn't affect terminal output,
|
|
266
|
+
* only getSelectedText/applySelectionOverlay which read it directly.
|
|
267
|
+
*/
|
|
268
|
+
export declare function markNoSelectRegion(screen: Screen, x: number, y: number, width: number, height: number): void;
|
|
269
|
+
export {};
|
|
270
|
+
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/ink/screen.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAGd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,IAAI,EAEV,MAAM,sBAAsB,CAAA;AAU7B,qBAAa,QAAQ;IACnB,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,SAAS,CAGf;IACF,OAAO,CAAC,KAAK,CAA8B;IAE3C,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAqB5B,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAG3B;AAID,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,SAAS,CAA4B;IAE7C,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM;IAW7C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGpC;AAqCD,qBAAa,SAAS;IACpB,OAAO,CAAC,GAAG,CAA4B;IACvC,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,eAAe,CAA4B;IACnD,QAAQ,CAAC,IAAI,EA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