@cjhyy/code-shell 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +109 -0
- package/LICENSE +21 -0
- package/README.md +177 -0
- package/dist/agent/coordinator.d.ts +49 -0
- package/dist/anthropic-NENYS535.js +9 -0
- package/dist/anthropic-XMTTVNSH.cjs +9 -0
- package/dist/arena/arena.d.ts +43 -0
- package/dist/arena/context/context-tools.d.ts +16 -0
- package/dist/arena/detect-mode.d.ts +20 -0
- package/dist/arena/digest-builder.d.ts +25 -0
- package/dist/arena/index.cjs +103 -0
- package/dist/arena/index.d.ts +29 -0
- package/dist/arena/index.js +103 -0
- package/dist/arena/iterate/convergence.d.ts +25 -0
- package/dist/arena/iterate/formats/index.d.ts +22 -0
- package/dist/arena/iterate/index.d.ts +11 -0
- package/dist/arena/iterate/iterative-arena.d.ts +23 -0
- package/dist/arena/iterate/parse.d.ts +42 -0
- package/dist/arena/iterate/phases/argue.d.ts +22 -0
- package/dist/arena/iterate/phases/revise.d.ts +16 -0
- package/dist/arena/iterate/phases/tournament.d.ts +34 -0
- package/dist/arena/iterate/tools/web-tools.d.ts +13 -0
- package/dist/arena/iterate/types.d.ts +152 -0
- package/dist/arena/ledger.d.ts +47 -0
- package/dist/arena/lenses/architecture.d.ts +5 -0
- package/dist/arena/lenses/engineering.d.ts +5 -0
- package/dist/arena/lenses/general.d.ts +5 -0
- package/dist/arena/lenses/index.d.ts +16 -0
- package/dist/arena/lenses/product.d.ts +5 -0
- package/dist/arena/model-presets.d.ts +14 -0
- package/dist/arena/phases/adjudication.d.ts +24 -0
- package/dist/arena/phases/build-consensus.d.ts +29 -0
- package/dist/arena/phases/claim-registry.d.ts +26 -0
- package/dist/arena/phases/cross-review.d.ts +45 -0
- package/dist/arena/phases/debate-rounds.d.ts +27 -0
- package/dist/arena/phases/participant-research.d.ts +38 -0
- package/dist/arena/phases/planning-detail-expansion.d.ts +38 -0
- package/dist/arena/planner.d.ts +27 -0
- package/dist/arena/providers/docs.d.ts +6 -0
- package/dist/arena/providers/git.d.ts +8 -0
- package/dist/arena/providers/index.d.ts +16 -0
- package/dist/arena/providers/none.d.ts +7 -0
- package/dist/arena/providers/repo.d.ts +6 -0
- package/dist/arena/render/session.d.ts +17 -0
- package/dist/arena/render/terminal.d.ts +33 -0
- package/dist/arena/strategies/discussion.d.ts +25 -0
- package/dist/arena/strategies/index.d.ts +15 -0
- package/dist/arena/strategies/language-wrapper.d.ts +17 -0
- package/dist/arena/strategies/lens-wrapper.d.ts +16 -0
- package/dist/arena/strategies/planning.d.ts +30 -0
- package/dist/arena/strategies/review.d.ts +26 -0
- package/dist/arena/strategies/utils.d.ts +34 -0
- package/dist/arena/tools/selector.d.ts +17 -0
- package/dist/arena/transitions.d.ts +48 -0
- package/dist/arena/types.d.ts +499 -0
- package/dist/arena-46QQ6BZQ.js +261 -0
- package/dist/arena-HZZZ2GJH.cjs +261 -0
- package/dist/bootstrap/setup.d.ts +14 -0
- package/dist/bootstrap/state.d.ts +160 -0
- package/dist/bridge-4ZRXVWBN.js +98 -0
- package/dist/bridge-W476QDFH.cjs +98 -0
- package/dist/chunk-3EAEC566.cjs +136 -0
- package/dist/chunk-3EUDE77E.cjs +1252 -0
- package/dist/chunk-3QR52LL5.cjs +105 -0
- package/dist/chunk-4PKZPFCD.js +136 -0
- package/dist/chunk-4RRUP4MM.js +86 -0
- package/dist/chunk-4SFPFHMG.js +132 -0
- package/dist/chunk-5LHVI777.cjs +246 -0
- package/dist/chunk-6JOOLG6F.js +104 -0
- package/dist/chunk-6ZIROYXX.js +207 -0
- package/dist/chunk-7RMAR2Y3.js +6511 -0
- package/dist/chunk-BE6IPRDM.js +224 -0
- package/dist/chunk-BHGIJ2DJ.js +41 -0
- package/dist/chunk-BMH65OVB.cjs +224 -0
- package/dist/chunk-C7JBCO5V.js +80 -0
- package/dist/chunk-CSO5EOEP.cjs +132 -0
- package/dist/chunk-DI7RDLOS.js +47 -0
- package/dist/chunk-DICG4AB7.cjs +73 -0
- package/dist/chunk-EL2RL5DG.cjs +101 -0
- package/dist/chunk-FGZGCFJX.cjs +207 -0
- package/dist/chunk-FUOKLKR2.js +101 -0
- package/dist/chunk-FVP7XJGS.cjs +4577 -0
- package/dist/chunk-HD7MT5XU.cjs +86 -0
- package/dist/chunk-IJSHQGMP.cjs +45 -0
- package/dist/chunk-IMMTBZ33.cjs +63 -0
- package/dist/chunk-J5XW6UYL.js +291 -0
- package/dist/chunk-JT2WSQSR.cjs +335 -0
- package/dist/chunk-KO2FPF7G.js +93 -0
- package/dist/chunk-LRAY5IYC.cjs +291 -0
- package/dist/chunk-NG73UR3L.cjs +285 -0
- package/dist/chunk-NZ4DQ72D.cjs +664 -0
- package/dist/chunk-O6F2EF2Z.js +73 -0
- package/dist/chunk-OG4MIQJ6.js +335 -0
- package/dist/chunk-QHDYFC5U.cjs +6511 -0
- package/dist/chunk-R32DJSJE.cjs +41 -0
- package/dist/chunk-S74VVJBF.js +285 -0
- package/dist/chunk-SK62UVS6.js +105 -0
- package/dist/chunk-SQZHPD3S.js +4577 -0
- package/dist/chunk-UK2SU23S.cjs +93 -0
- package/dist/chunk-VKGNCYRL.js +258 -0
- package/dist/chunk-WFQF3RT4.cjs +104 -0
- package/dist/chunk-WHRTARDJ.cjs +258 -0
- package/dist/chunk-WRZJUQ5Z.js +664 -0
- package/dist/chunk-X4HAERTQ.js +63 -0
- package/dist/chunk-XHC2JMEC.cjs +80 -0
- package/dist/chunk-YZ25SSWJ.js +222 -0
- package/dist/chunk-ZJV3YSY3.cjs +222 -0
- package/dist/chunk-ZRSSGYA5.js +246 -0
- package/dist/chunk-ZXYDDJEJ.js +1252 -0
- package/dist/cli/commands/arena.d.ts +29 -0
- package/dist/cli/commands/builtin/advanced-commands.d.ts +5 -0
- package/dist/cli/commands/builtin/core-commands.d.ts +5 -0
- package/dist/cli/commands/builtin/extra-commands.d.ts +6 -0
- package/dist/cli/commands/builtin/git-commands.d.ts +5 -0
- package/dist/cli/commands/builtin/more-commands.d.ts +7 -0
- package/dist/cli/commands/builtin/permissions-command.d.ts +5 -0
- package/dist/cli/commands/builtin/utility-commands.d.ts +5 -0
- package/dist/cli/commands/registry.d.ts +64 -0
- package/dist/cli/commands/repl.d.ts +21 -0
- package/dist/cli/commands/run.d.ts +21 -0
- package/dist/cli/commands/runs.d.ts +14 -0
- package/dist/cli/cost-tracker.d.ts +57 -0
- package/dist/cli/exit.d.ts +12 -0
- package/dist/cli/input/ndjson-reader.d.ts +31 -0
- package/dist/cli/input-compiler.d.ts +5 -0
- package/dist/cli/main.cjs +19674 -0
- package/dist/cli/main.d.ts +5 -0
- package/dist/cli/main.js +19674 -0
- package/dist/cli/onboarding.d.ts +26 -0
- package/dist/cli/output/renderer.d.ts +28 -0
- package/dist/cli/output/terminal-ui.d.ts +50 -0
- package/dist/cli/updater.d.ts +10 -0
- package/dist/compaction-44I55TLI.cjs +32 -0
- package/dist/compaction-CCHWA4G6.js +32 -0
- package/dist/context/compaction.d.ts +83 -0
- package/dist/context/manager.d.ts +99 -0
- package/dist/context/token-counter.d.ts +27 -0
- package/dist/coordinator-5HY7ALO2.js +7 -0
- package/dist/coordinator-INDLPVMF.cjs +7 -0
- package/dist/cost-tracker-IWYAUPXH.js +9 -0
- package/dist/cost-tracker-JXTJQQWE.cjs +9 -0
- package/dist/cron/scheduler.d.ts +34 -0
- package/dist/devtools-KIY3LWQJ.js +6 -0
- package/dist/devtools-LRP47DDV.cjs +6 -0
- package/dist/engine/cost-store.d.ts +22 -0
- package/dist/engine/engine.d.ts +101 -0
- package/dist/engine/model-facade.d.ts +24 -0
- package/dist/engine/query.d.ts +50 -0
- package/dist/engine/streaming-tool-queue.d.ts +34 -0
- package/dist/engine/token-budget.d.ts +22 -0
- package/dist/engine/tool-summary.d.ts +13 -0
- package/dist/engine/turn-loop.d.ts +62 -0
- package/dist/engine/turn-state.d.ts +14 -0
- package/dist/exceptions.d.ts +44 -0
- package/dist/file-history-HZWO2WQ5.js +7 -0
- package/dist/file-history-UQQILIY7.cjs +7 -0
- package/dist/git/utils.d.ts +35 -0
- package/dist/git/worktree.d.ts +36 -0
- package/dist/hooks/events.d.ts +35 -0
- package/dist/hooks/registry.d.ts +15 -0
- package/dist/index.cjs +336 -0
- package/dist/index.d.ts +64 -0
- package/dist/index.js +336 -0
- package/dist/ink/Ansi.d.ts +10 -0
- package/dist/ink/bidi.d.ts +15 -0
- package/dist/ink/clearTerminal.d.ts +13 -0
- package/dist/ink/colorize.d.ts +16 -0
- package/dist/ink/components/AlternateScreen.d.ts +21 -0
- package/dist/ink/components/App.d.ts +70 -0
- package/dist/ink/components/AppContext.d.ts +11 -0
- package/dist/ink/components/Box.d.ts +49 -0
- package/dist/ink/components/Button.d.ts +36 -0
- package/dist/ink/components/ClockContext.d.ts +9 -0
- package/dist/ink/components/CursorDeclarationContext.d.ts +22 -0
- package/dist/ink/components/ErrorOverview.d.ts +5 -0
- package/dist/ink/components/Link.d.ts +7 -0
- package/dist/ink/components/Newline.d.ts +12 -0
- package/dist/ink/components/NoSelect.d.ts +19 -0
- package/dist/ink/components/RawAnsi.d.ts +16 -0
- package/dist/ink/components/ScrollBox.d.ts +78 -0
- package/dist/ink/components/Spacer.d.ts +5 -0
- package/dist/ink/components/StdinContext.d.ts +27 -0
- package/dist/ink/components/TerminalFocusContext.d.ts +10 -0
- package/dist/ink/components/TerminalSizeContext.d.ts +5 -0
- package/dist/ink/components/Text.d.ts +55 -0
- package/dist/ink/constants.d.ts +1 -0
- package/dist/ink/cursor.d.ts +8 -0
- package/dist/ink/devtools.d.ts +5 -0
- package/dist/ink/dom.d.ts +76 -0
- package/dist/ink/events/click-event.d.ts +31 -0
- package/dist/ink/events/dispatcher.d.ts +40 -0
- package/dist/ink/events/emitter.d.ts +5 -0
- package/dist/ink/events/event-handlers.d.ts +46 -0
- package/dist/ink/events/event.d.ts +5 -0
- package/dist/ink/events/focus-event.d.ts +13 -0
- package/dist/ink/events/input-event.d.ts +30 -0
- package/dist/ink/events/keyboard-event.d.ts +19 -0
- package/dist/ink/events/paste-event.d.ts +8 -0
- package/dist/ink/events/resize-event.d.ts +9 -0
- package/dist/ink/events/terminal-event.d.ts +54 -0
- package/dist/ink/events/terminal-focus-event.d.ts +13 -0
- package/dist/ink/focus.d.ts +43 -0
- package/dist/ink/frame.d.ts +94 -0
- package/dist/ink/get-max-width.d.ts +17 -0
- package/dist/ink/hit-test.d.ts +33 -0
- package/dist/ink/hooks/use-animation-frame.d.ts +26 -0
- package/dist/ink/hooks/use-app.d.ts +5 -0
- package/dist/ink/hooks/use-declared-cursor.d.ts +26 -0
- package/dist/ink/hooks/use-input.d.ts +37 -0
- package/dist/ink/hooks/use-interval.d.ts +18 -0
- package/dist/ink/hooks/use-search-highlight.d.ts +30 -0
- package/dist/ink/hooks/use-selection.d.ts +39 -0
- package/dist/ink/hooks/use-stdin.d.ts +5 -0
- package/dist/ink/hooks/use-tab-status.d.ts +13 -0
- package/dist/ink/hooks/use-terminal-focus.d.ts +10 -0
- package/dist/ink/hooks/use-terminal-title.d.ts +12 -0
- package/dist/ink/hooks/use-terminal-viewport.d.ts +29 -0
- package/dist/ink/index.d.ts +20 -0
- package/dist/ink/ink.d.ts +369 -0
- package/dist/ink/instances.d.ts +3 -0
- package/dist/ink/layout/engine.d.ts +2 -0
- package/dist/ink/layout/geometry.d.ts +30 -0
- package/dist/ink/layout/node.d.ts +125 -0
- package/dist/ink/layout/yoga.d.ts +56 -0
- package/dist/ink/line-width-cache.d.ts +1 -0
- package/dist/ink/log-update.d.ts +17 -0
- package/dist/ink/measure-element.d.ts +16 -0
- package/dist/ink/measure-text.d.ts +6 -0
- package/dist/ink/node-cache.d.ts +20 -0
- package/dist/ink/optimizer.d.ts +15 -0
- package/dist/ink/output.d.ts +119 -0
- package/dist/ink/parse-keypress.d.ts +111 -0
- package/dist/ink/reconciler.d.ts +11 -0
- package/dist/ink/render-border.d.ts +24 -0
- package/dist/ink/render-node-to-output.d.ts +45 -0
- package/dist/ink/render-to-screen.d.ts +46 -0
- package/dist/ink/renderer.d.ts +14 -0
- package/dist/ink/root.d.ts +74 -0
- package/dist/ink/screen.d.ts +269 -0
- package/dist/ink/searchHighlight.d.ts +20 -0
- package/dist/ink/selection.d.ts +229 -0
- package/dist/ink/squash-text-nodes.d.ts +22 -0
- package/dist/ink/stringWidth.d.ts +1 -0
- package/dist/ink/styles.d.ts +306 -0
- package/dist/ink/supports-hyperlinks.d.ts +13 -0
- package/dist/ink/tabstops.d.ts +1 -0
- package/dist/ink/terminal-focus-state.d.ts +6 -0
- package/dist/ink/terminal-querier.d.ts +129 -0
- package/dist/ink/terminal.d.ts +46 -0
- package/dist/ink/termio/ansi.d.ts +65 -0
- package/dist/ink/termio/csi.d.ts +165 -0
- package/dist/ink/termio/dec.d.ts +37 -0
- package/dist/ink/termio/esc.d.ts +12 -0
- package/dist/ink/termio/osc.d.ts +173 -0
- package/dist/ink/termio/parser.d.ts +35 -0
- package/dist/ink/termio/sgr.d.ts +8 -0
- package/dist/ink/termio/tokenize.d.ts +45 -0
- package/dist/ink/termio/types.d.ts +190 -0
- package/dist/ink/termio.d.ts +24 -0
- package/dist/ink/useTerminalNotification.d.ts +28 -0
- package/dist/ink/warn.d.ts +1 -0
- package/dist/ink/widest-line.d.ts +1 -0
- package/dist/ink/wrap-text.d.ts +2 -0
- package/dist/ink/wrapAnsi.d.ts +7 -0
- package/dist/llm/client-base.d.ts +22 -0
- package/dist/llm/client-factory.d.ts +10 -0
- package/dist/llm/model-pool.d.ts +60 -0
- package/dist/llm/providers/anthropic.d.ts +19 -0
- package/dist/llm/providers/openai.d.ts +19 -0
- package/dist/llm/types.d.ts +21 -0
- package/dist/loader-DXFSUB4R.cjs +91 -0
- package/dist/loader-J5UID6CV.js +91 -0
- package/dist/logging/logger.d.ts +19 -0
- package/dist/lsp/client.d.ts +41 -0
- package/dist/lsp/manager.d.ts +40 -0
- package/dist/lsp/servers.d.ts +16 -0
- package/dist/manager-ETWDOCHN.cjs +9 -0
- package/dist/manager-HGMQNEJB.cjs +11 -0
- package/dist/manager-HUAQOORS.js +9 -0
- package/dist/manager-VJIZ2CQC.js +11 -0
- package/dist/mcp-manager-G4G2QASE.cjs +8 -0
- package/dist/mcp-manager-OKXHHWYR.js +8 -0
- package/dist/memory-AP747G5H.js +7 -0
- package/dist/memory-BH3BYUN5.cjs +7 -0
- package/dist/native-ts/yoga-layout/enums.d.ts +117 -0
- package/dist/native-ts/yoga-layout/index.d.ts +270 -0
- package/dist/onboarding-6WEPV7C2.js +11 -0
- package/dist/onboarding-QM5DY2TU.cjs +11 -0
- package/dist/openai-5HQGBL4L.js +9 -0
- package/dist/openai-656VWUQW.cjs +9 -0
- package/dist/plugins/loader.d.ts +72 -0
- package/dist/plugins/types.d.ts +4 -0
- package/dist/preset/index.d.ts +60 -0
- package/dist/product/define.d.ts +60 -0
- package/dist/product/index.cjs +23 -0
- package/dist/product/index.d.ts +5 -0
- package/dist/product/index.js +23 -0
- package/dist/product/types.d.ts +116 -0
- package/dist/prompt/composer.d.ts +42 -0
- package/dist/prompt/instruction-scanner.d.ts +54 -0
- package/dist/prompt/section-cache.d.ts +15 -0
- package/dist/prompt/section-loader.d.ts +26 -0
- package/dist/protocol/client.d.ts +64 -0
- package/dist/protocol/index.d.ts +4 -0
- package/dist/protocol/server.d.ts +49 -0
- package/dist/protocol/transport.d.ts +36 -0
- package/dist/protocol/types.d.ts +150 -0
- package/dist/react-compiler-runtime-shim.d.ts +1 -0
- package/dist/remote/bridge.d.ts +37 -0
- package/dist/run/ArtifactTracker.d.ts +38 -0
- package/dist/run/CheckpointWriter.d.ts +53 -0
- package/dist/run/EngineRunner.d.ts +70 -0
- package/dist/run/Evaluator.d.ts +56 -0
- package/dist/run/FileRunStore.d.ts +39 -0
- package/dist/run/Heartbeat.d.ts +54 -0
- package/dist/run/RunApprovalBackend.d.ts +53 -0
- package/dist/run/RunLock.d.ts +40 -0
- package/dist/run/RunManager.d.ts +76 -0
- package/dist/run/RunQueue.d.ts +27 -0
- package/dist/run/RunStore.d.ts +25 -0
- package/dist/run/factory.d.ts +57 -0
- package/dist/run/index.cjs +50 -0
- package/dist/run/index.d.ts +17 -0
- package/dist/run/index.js +50 -0
- package/dist/run/types.d.ts +136 -0
- package/dist/services/analytics.d.ts +29 -0
- package/dist/services/auto-dream.d.ts +35 -0
- package/dist/services/compact.d.ts +56 -0
- package/dist/services/diagnostics.d.ts +41 -0
- package/dist/services/extract-memories.d.ts +27 -0
- package/dist/services/index.d.ts +11 -0
- package/dist/services/notifier.d.ts +25 -0
- package/dist/services/oauth.d.ts +27 -0
- package/dist/services/session-memory.d.ts +37 -0
- package/dist/session/file-history.d.ts +41 -0
- package/dist/session/memory.d.ts +45 -0
- package/dist/session/session-manager.d.ts +23 -0
- package/dist/session/transcript.d.ts +39 -0
- package/dist/session-manager-JIIBCFTC.js +8 -0
- package/dist/session-manager-UQKB564H.cjs +8 -0
- package/dist/settings/manager.d.ts +27 -0
- package/dist/settings/schema.d.ts +676 -0
- package/dist/skills/index.d.ts +7 -0
- package/dist/skills/matcher.d.ts +21 -0
- package/dist/skills/scanner.d.ts +30 -0
- package/dist/skills-63RBYQRX.js +13 -0
- package/dist/skills-V3BPLW3D.cjs +13 -0
- package/dist/token-counter-CHAXW5O7.cjs +13 -0
- package/dist/token-counter-DSOZGZ5Q.js +13 -0
- package/dist/tool-summary-5P2GKRA4.cjs +31 -0
- package/dist/tool-summary-J2ICNMWP.js +31 -0
- package/dist/tool-system/builtin/agent.d.ts +35 -0
- package/dist/tool-system/builtin/arena.d.ts +18 -0
- package/dist/tool-system/builtin/ask-user.d.ts +12 -0
- package/dist/tool-system/builtin/bash.d.ts +6 -0
- package/dist/tool-system/builtin/brief.d.ts +6 -0
- package/dist/tool-system/builtin/config.d.ts +6 -0
- package/dist/tool-system/builtin/cron.d.ts +10 -0
- package/dist/tool-system/builtin/edit.d.ts +6 -0
- package/dist/tool-system/builtin/file-cache.d.ts +11 -0
- package/dist/tool-system/builtin/glob.d.ts +6 -0
- package/dist/tool-system/builtin/grep.d.ts +6 -0
- package/dist/tool-system/builtin/index.d.ts +10 -0
- package/dist/tool-system/builtin/lsp.d.ts +6 -0
- package/dist/tool-system/builtin/mcp-tools.d.ts +10 -0
- package/dist/tool-system/builtin/notebook-edit.d.ts +6 -0
- package/dist/tool-system/builtin/plan.d.ts +18 -0
- package/dist/tool-system/builtin/powershell.d.ts +6 -0
- package/dist/tool-system/builtin/read.d.ts +6 -0
- package/dist/tool-system/builtin/remote-trigger.d.ts +6 -0
- package/dist/tool-system/builtin/repl.d.ts +6 -0
- package/dist/tool-system/builtin/send-message.d.ts +6 -0
- package/dist/tool-system/builtin/skill.d.ts +6 -0
- package/dist/tool-system/builtin/sleep.d.ts +6 -0
- package/dist/tool-system/builtin/task.d.ts +51 -0
- package/dist/tool-system/builtin/tool-search.d.ts +12 -0
- package/dist/tool-system/builtin/web-fetch.d.ts +6 -0
- package/dist/tool-system/builtin/web-search.d.ts +6 -0
- package/dist/tool-system/builtin/worktree.d.ts +10 -0
- package/dist/tool-system/builtin/write.d.ts +6 -0
- package/dist/tool-system/executor.d.ts +25 -0
- package/dist/tool-system/mcp-manager.d.ts +50 -0
- package/dist/tool-system/permission.d.ts +69 -0
- package/dist/tool-system/registry.d.ts +24 -0
- package/dist/tool-system/validation.d.ts +5 -0
- package/dist/types.d.ts +260 -0
- package/dist/ui/App.d.ts +14 -0
- package/dist/ui/components/AgentBlock.d.ts +32 -0
- package/dist/ui/components/BabyHand.d.ts +1 -0
- package/dist/ui/components/Banner.d.ts +8 -0
- package/dist/ui/components/CodeBlock.d.ts +7 -0
- package/dist/ui/components/CommandInput.d.ts +13 -0
- package/dist/ui/components/ContextUsageBar.d.ts +7 -0
- package/dist/ui/components/DiffView.d.ts +6 -0
- package/dist/ui/components/DogLogo.d.ts +1 -0
- package/dist/ui/components/FullscreenLayout.d.ts +51 -0
- package/dist/ui/components/KunHead.d.ts +1 -0
- package/dist/ui/components/KunLogo.d.ts +1 -0
- package/dist/ui/components/MessageContent.d.ts +22 -0
- package/dist/ui/components/PermissionDialog.d.ts +8 -0
- package/dist/ui/components/PermissionPrompt.d.ts +8 -0
- package/dist/ui/components/ScrollView.d.ts +34 -0
- package/dist/ui/components/Spinner.d.ts +8 -0
- package/dist/ui/components/SpinnerWithVerb.d.ts +13 -0
- package/dist/ui/components/StatusLine.d.ts +22 -0
- package/dist/ui/components/StructuredDiff.d.ts +8 -0
- package/dist/ui/components/TaskList.d.ts +6 -0
- package/dist/ui/components/TextInput.d.ts +9 -0
- package/dist/ui/components/ThemedBox.d.ts +19 -0
- package/dist/ui/components/ThemedText.d.ts +26 -0
- package/dist/ui/components/ToolCall.d.ts +21 -0
- package/dist/ui/components/VirtualMessageList.d.ts +24 -0
- package/dist/ui/hooks/useCostSummary.d.ts +1 -0
- package/dist/ui/index.d.ts +12 -0
- package/dist/ui/input-history.d.ts +61 -0
- package/dist/ui/store.d.ts +82 -0
- package/dist/ui/terminal-renderer.d.ts +45 -0
- package/dist/ui/theme.d.ts +36 -0
- package/dist/ui/vim-mode.d.ts +25 -0
- package/dist/updater-AVD4LKTQ.js +183 -0
- package/dist/updater-URVNPDPW.cjs +183 -0
- package/dist/utils/debug.d.ts +57 -0
- package/dist/utils/earlyInput.d.ts +43 -0
- package/dist/utils/env.d.ts +24 -0
- package/dist/utils/envUtils.d.ts +51 -0
- package/dist/utils/execFileNoThrow.d.ts +39 -0
- package/dist/utils/format.d.ts +44 -0
- package/dist/utils/fullscreen.d.ts +47 -0
- package/dist/utils/intl.d.ts +22 -0
- package/dist/utils/lockfile.d.ts +15 -0
- package/dist/utils/log.d.ts +56 -0
- package/dist/utils/semver.d.ts +5 -0
- package/dist/utils/sliceAnsi.d.ts +12 -0
- package/dist/utils/systemTheme.d.ts +40 -0
- package/dist/utils/theme.d.ts +91 -0
- package/dist/utils/toolDisplay.d.ts +31 -0
- package/dist/utils/truncate.d.ts +40 -0
- package/dist/voice/index.d.ts +35 -0
- package/dist/voice-KTZ7PAGO.js +80 -0
- package/dist/voice-KZE25GKB.cjs +80 -0
- package/package.json +130 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSI (Control Sequence Introducer) Types
|
|
3
|
+
*
|
|
4
|
+
* Enums and types for CSI command parameters.
|
|
5
|
+
*/
|
|
6
|
+
export declare const CSI_PREFIX: string;
|
|
7
|
+
/**
|
|
8
|
+
* CSI parameter byte ranges
|
|
9
|
+
*/
|
|
10
|
+
export declare const CSI_RANGE: {
|
|
11
|
+
readonly PARAM_START: 48;
|
|
12
|
+
readonly PARAM_END: 63;
|
|
13
|
+
readonly INTERMEDIATE_START: 32;
|
|
14
|
+
readonly INTERMEDIATE_END: 47;
|
|
15
|
+
readonly FINAL_START: 64;
|
|
16
|
+
readonly FINAL_END: 126;
|
|
17
|
+
};
|
|
18
|
+
/** Check if a byte is a CSI parameter byte */
|
|
19
|
+
export declare function isCSIParam(byte: number): boolean;
|
|
20
|
+
/** Check if a byte is a CSI intermediate byte */
|
|
21
|
+
export declare function isCSIIntermediate(byte: number): boolean;
|
|
22
|
+
/** Check if a byte is a CSI final byte (@ through ~) */
|
|
23
|
+
export declare function isCSIFinal(byte: number): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a CSI sequence: ESC [ p1;p2;...;pN final
|
|
26
|
+
* Single arg: treated as raw body
|
|
27
|
+
* Multiple args: last is final byte, rest are params joined by ;
|
|
28
|
+
*/
|
|
29
|
+
export declare function csi(...args: (string | number)[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* CSI final bytes - the command identifier
|
|
32
|
+
*/
|
|
33
|
+
export declare const CSI: {
|
|
34
|
+
readonly CUU: 65;
|
|
35
|
+
readonly CUD: 66;
|
|
36
|
+
readonly CUF: 67;
|
|
37
|
+
readonly CUB: 68;
|
|
38
|
+
readonly CNL: 69;
|
|
39
|
+
readonly CPL: 70;
|
|
40
|
+
readonly CHA: 71;
|
|
41
|
+
readonly CUP: 72;
|
|
42
|
+
readonly CHT: 73;
|
|
43
|
+
readonly VPA: 100;
|
|
44
|
+
readonly HVP: 102;
|
|
45
|
+
readonly ED: 74;
|
|
46
|
+
readonly EL: 75;
|
|
47
|
+
readonly ECH: 88;
|
|
48
|
+
readonly IL: 76;
|
|
49
|
+
readonly DL: 77;
|
|
50
|
+
readonly ICH: 64;
|
|
51
|
+
readonly DCH: 80;
|
|
52
|
+
readonly SU: 83;
|
|
53
|
+
readonly SD: 84;
|
|
54
|
+
readonly SM: 104;
|
|
55
|
+
readonly RM: 108;
|
|
56
|
+
readonly SGR: 109;
|
|
57
|
+
readonly DSR: 110;
|
|
58
|
+
readonly DECSCUSR: 113;
|
|
59
|
+
readonly DECSTBM: 114;
|
|
60
|
+
readonly SCOSC: 115;
|
|
61
|
+
readonly SCORC: 117;
|
|
62
|
+
readonly CBT: 90;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Erase in Display regions (ED command parameter)
|
|
66
|
+
*/
|
|
67
|
+
export declare const ERASE_DISPLAY: readonly ["toEnd", "toStart", "all", "scrollback"];
|
|
68
|
+
/**
|
|
69
|
+
* Erase in Line regions (EL command parameter)
|
|
70
|
+
*/
|
|
71
|
+
export declare const ERASE_LINE_REGION: readonly ["toEnd", "toStart", "all"];
|
|
72
|
+
/**
|
|
73
|
+
* Cursor styles (DECSCUSR)
|
|
74
|
+
*/
|
|
75
|
+
export type CursorStyle = 'block' | 'underline' | 'bar';
|
|
76
|
+
export declare const CURSOR_STYLES: Array<{
|
|
77
|
+
style: CursorStyle;
|
|
78
|
+
blinking: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
/** Move cursor up n lines (CSI n A) */
|
|
81
|
+
export declare function cursorUp(n?: number): string;
|
|
82
|
+
/** Move cursor down n lines (CSI n B) */
|
|
83
|
+
export declare function cursorDown(n?: number): string;
|
|
84
|
+
/** Move cursor forward n columns (CSI n C) */
|
|
85
|
+
export declare function cursorForward(n?: number): string;
|
|
86
|
+
/** Move cursor back n columns (CSI n D) */
|
|
87
|
+
export declare function cursorBack(n?: number): string;
|
|
88
|
+
/** Move cursor to column n (1-indexed) (CSI n G) */
|
|
89
|
+
export declare function cursorTo(col: number): string;
|
|
90
|
+
/** Move cursor to column 1 (CSI G) */
|
|
91
|
+
export declare const CURSOR_LEFT: string;
|
|
92
|
+
/** Move cursor to row, col (1-indexed) (CSI row ; col H) */
|
|
93
|
+
export declare function cursorPosition(row: number, col: number): string;
|
|
94
|
+
/** Move cursor to home position (CSI H) */
|
|
95
|
+
export declare const CURSOR_HOME: string;
|
|
96
|
+
/**
|
|
97
|
+
* Move cursor relative to current position
|
|
98
|
+
* Positive x = right, negative x = left
|
|
99
|
+
* Positive y = down, negative y = up
|
|
100
|
+
*/
|
|
101
|
+
export declare function cursorMove(x: number, y: number): string;
|
|
102
|
+
/** Save cursor position (CSI s) */
|
|
103
|
+
export declare const CURSOR_SAVE: string;
|
|
104
|
+
/** Restore cursor position (CSI u) */
|
|
105
|
+
export declare const CURSOR_RESTORE: string;
|
|
106
|
+
/** Erase from cursor to end of line (CSI K) */
|
|
107
|
+
export declare function eraseToEndOfLine(): string;
|
|
108
|
+
/** Erase from cursor to start of line (CSI 1 K) */
|
|
109
|
+
export declare function eraseToStartOfLine(): string;
|
|
110
|
+
/** Erase entire line (CSI 2 K) */
|
|
111
|
+
export declare function eraseLine(): string;
|
|
112
|
+
/** Erase entire line - constant form */
|
|
113
|
+
export declare const ERASE_LINE: string;
|
|
114
|
+
/** Erase from cursor to end of screen (CSI J) */
|
|
115
|
+
export declare function eraseToEndOfScreen(): string;
|
|
116
|
+
/** Erase from cursor to start of screen (CSI 1 J) */
|
|
117
|
+
export declare function eraseToStartOfScreen(): string;
|
|
118
|
+
/** Erase entire screen (CSI 2 J) */
|
|
119
|
+
export declare function eraseScreen(): string;
|
|
120
|
+
/** Erase entire screen - constant form */
|
|
121
|
+
export declare const ERASE_SCREEN: string;
|
|
122
|
+
/** Erase scrollback buffer (CSI 3 J) */
|
|
123
|
+
export declare const ERASE_SCROLLBACK: string;
|
|
124
|
+
/**
|
|
125
|
+
* Erase n lines starting from cursor line, moving cursor up
|
|
126
|
+
* This erases each line and moves up, ending at column 1
|
|
127
|
+
*/
|
|
128
|
+
export declare function eraseLines(n: number): string;
|
|
129
|
+
/** Scroll up n lines (CSI n S) */
|
|
130
|
+
export declare function scrollUp(n?: number): string;
|
|
131
|
+
/** Scroll down n lines (CSI n T) */
|
|
132
|
+
export declare function scrollDown(n?: number): string;
|
|
133
|
+
/** Set scroll region (DECSTBM, CSI top;bottom r). 1-indexed, inclusive. */
|
|
134
|
+
export declare function setScrollRegion(top: number, bottom: number): string;
|
|
135
|
+
/** Reset scroll region to full screen (DECSTBM, CSI r). Homes the cursor. */
|
|
136
|
+
export declare const RESET_SCROLL_REGION: string;
|
|
137
|
+
/** Sent by terminal before pasted content (CSI 200 ~) */
|
|
138
|
+
export declare const PASTE_START: string;
|
|
139
|
+
/** Sent by terminal after pasted content (CSI 201 ~) */
|
|
140
|
+
export declare const PASTE_END: string;
|
|
141
|
+
/** Sent by terminal when it gains focus (CSI I) */
|
|
142
|
+
export declare const FOCUS_IN: string;
|
|
143
|
+
/** Sent by terminal when it loses focus (CSI O) */
|
|
144
|
+
export declare const FOCUS_OUT: string;
|
|
145
|
+
/**
|
|
146
|
+
* Enable Kitty keyboard protocol with basic modifier reporting
|
|
147
|
+
* CSI > 1 u - pushes mode with flags=1 (disambiguate escape codes)
|
|
148
|
+
* This makes Shift+Enter send CSI 13;2 u instead of just CR
|
|
149
|
+
*/
|
|
150
|
+
export declare const ENABLE_KITTY_KEYBOARD: string;
|
|
151
|
+
/**
|
|
152
|
+
* Disable Kitty keyboard protocol
|
|
153
|
+
* CSI < u - pops the keyboard mode stack
|
|
154
|
+
*/
|
|
155
|
+
export declare const DISABLE_KITTY_KEYBOARD: string;
|
|
156
|
+
/**
|
|
157
|
+
* Enable xterm modifyOtherKeys level 2.
|
|
158
|
+
* tmux accepts this (not the kitty stack) to enable extended keys — when
|
|
159
|
+
* extended-keys-format is csi-u, tmux then emits keys in kitty format.
|
|
160
|
+
*/
|
|
161
|
+
export declare const ENABLE_MODIFY_OTHER_KEYS: string;
|
|
162
|
+
/**
|
|
163
|
+
* Disable xterm modifyOtherKeys (reset to default).
|
|
164
|
+
*/
|
|
165
|
+
export declare const DISABLE_MODIFY_OTHER_KEYS: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DEC (Digital Equipment Corporation) Private Mode Sequences
|
|
3
|
+
*
|
|
4
|
+
* DEC private modes use CSI ? N h (set) and CSI ? N l (reset) format.
|
|
5
|
+
* These are terminal-specific extensions to the ANSI standard.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* DEC private mode numbers
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEC: {
|
|
11
|
+
readonly CURSOR_VISIBLE: 25;
|
|
12
|
+
readonly ALT_SCREEN: 47;
|
|
13
|
+
readonly ALT_SCREEN_CLEAR: 1049;
|
|
14
|
+
readonly MOUSE_NORMAL: 1000;
|
|
15
|
+
readonly MOUSE_BUTTON: 1002;
|
|
16
|
+
readonly MOUSE_ANY: 1003;
|
|
17
|
+
readonly MOUSE_SGR: 1006;
|
|
18
|
+
readonly FOCUS_EVENTS: 1004;
|
|
19
|
+
readonly BRACKETED_PASTE: 2004;
|
|
20
|
+
readonly SYNCHRONIZED_UPDATE: 2026;
|
|
21
|
+
};
|
|
22
|
+
/** Generate CSI ? N h sequence (set mode) */
|
|
23
|
+
export declare function decset(mode: number): string;
|
|
24
|
+
/** Generate CSI ? N l sequence (reset mode) */
|
|
25
|
+
export declare function decreset(mode: number): string;
|
|
26
|
+
export declare const BSU: string;
|
|
27
|
+
export declare const ESU: string;
|
|
28
|
+
export declare const EBP: string;
|
|
29
|
+
export declare const DBP: string;
|
|
30
|
+
export declare const EFE: string;
|
|
31
|
+
export declare const DFE: string;
|
|
32
|
+
export declare const SHOW_CURSOR: string;
|
|
33
|
+
export declare const HIDE_CURSOR: string;
|
|
34
|
+
export declare const ENTER_ALT_SCREEN: string;
|
|
35
|
+
export declare const EXIT_ALT_SCREEN: string;
|
|
36
|
+
export declare const ENABLE_MOUSE_TRACKING: string;
|
|
37
|
+
export declare const DISABLE_MOUSE_TRACKING: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESC Sequence Parser
|
|
3
|
+
*
|
|
4
|
+
* Handles simple escape sequences: ESC + one or two characters
|
|
5
|
+
*/
|
|
6
|
+
import type { Action } from './types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Parse a simple ESC sequence
|
|
9
|
+
*
|
|
10
|
+
* @param chars - Characters after ESC (not including ESC itself)
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseEsc(chars: string): Action | null;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSC (Operating System Command) Types and Parser
|
|
3
|
+
*/
|
|
4
|
+
import type { Action, Color, TabStatusAction } from './types.js';
|
|
5
|
+
export declare const OSC_PREFIX: string;
|
|
6
|
+
/** String Terminator (ESC \) - alternative to BEL for terminating OSC */
|
|
7
|
+
export declare const ST: string;
|
|
8
|
+
/** Generate an OSC sequence: ESC ] p1;p2;...;pN <terminator>
|
|
9
|
+
* Uses ST terminator for Kitty (avoids beeps), BEL for others */
|
|
10
|
+
export declare function osc(...parts: (string | number)[]): string;
|
|
11
|
+
/**
|
|
12
|
+
* Wrap an escape sequence for terminal multiplexer passthrough.
|
|
13
|
+
* tmux and GNU screen intercept escape sequences; DCS passthrough
|
|
14
|
+
* tunnels them to the outer terminal unmodified.
|
|
15
|
+
*
|
|
16
|
+
* tmux 3.3+ gates this behind `allow-passthrough` (default off). When off,
|
|
17
|
+
* tmux silently drops the whole DCS — no junk, no worse than unwrapped OSC.
|
|
18
|
+
* Users who want passthrough set it in their .tmux.conf; we don't mutate it.
|
|
19
|
+
*
|
|
20
|
+
* Do NOT wrap BEL: raw \x07 triggers tmux's bell-action (window flag);
|
|
21
|
+
* wrapped \x07 is opaque DCS payload and tmux never sees the bell.
|
|
22
|
+
*/
|
|
23
|
+
export declare function wrapForMultiplexer(sequence: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Which path setClipboard() will take, based on env state. Synchronous so
|
|
26
|
+
* callers can show an honest toast without awaiting the copy itself.
|
|
27
|
+
*
|
|
28
|
+
* - 'native': pbcopy (or equivalent) will run — high-confidence system
|
|
29
|
+
* clipboard write. tmux buffer may also be loaded as a bonus.
|
|
30
|
+
* - 'tmux-buffer': tmux load-buffer will run, but no native tool — paste
|
|
31
|
+
* with prefix+] works. System clipboard depends on tmux's set-clipboard
|
|
32
|
+
* option + outer terminal OSC 52 support; can't know from here.
|
|
33
|
+
* - 'osc52': only the raw OSC 52 sequence will be written to stdout.
|
|
34
|
+
* Best-effort; iTerm2 disables OSC 52 by default.
|
|
35
|
+
*
|
|
36
|
+
* pbcopy gating uses SSH_CONNECTION specifically, not SSH_TTY — tmux panes
|
|
37
|
+
* inherit SSH_TTY forever even after local reattach, but SSH_CONNECTION is
|
|
38
|
+
* in tmux's default update-environment set and gets cleared.
|
|
39
|
+
*/
|
|
40
|
+
export type ClipboardPath = 'native' | 'tmux-buffer' | 'osc52';
|
|
41
|
+
export declare function getClipboardPath(): ClipboardPath;
|
|
42
|
+
/**
|
|
43
|
+
* Load text into tmux's paste buffer via `tmux load-buffer`.
|
|
44
|
+
* -w (tmux 3.2+) propagates to the outer terminal's clipboard via tmux's
|
|
45
|
+
* own OSC 52 emission. -w is dropped for iTerm2: tmux's OSC 52 emission
|
|
46
|
+
* crashes the iTerm2 session over SSH.
|
|
47
|
+
*
|
|
48
|
+
* Returns true if the buffer was loaded successfully.
|
|
49
|
+
*/
|
|
50
|
+
export declare function tmuxLoadBuffer(text: string): Promise<boolean>;
|
|
51
|
+
/**
|
|
52
|
+
* OSC 52 clipboard write: ESC ] 52 ; c ; <base64> BEL/ST
|
|
53
|
+
* 'c' selects the clipboard (vs 'p' for primary selection on X11).
|
|
54
|
+
*
|
|
55
|
+
* When inside tmux ($TMUX set), `tmux load-buffer -w -` is the primary
|
|
56
|
+
* path. tmux's buffer is always reachable — works over SSH, survives
|
|
57
|
+
* detach/reattach, immune to stale env vars. The -w flag (tmux 3.2+) tells
|
|
58
|
+
* tmux to also propagate to the outer terminal via its own OSC 52 path,
|
|
59
|
+
* which tmux wraps correctly for the attached client. On older tmux, -w is
|
|
60
|
+
* ignored and the buffer is still loaded. -w is dropped for iTerm2 (#22432)
|
|
61
|
+
* because tmux's own OSC 52 emission (empty selection param: ESC]52;;b64)
|
|
62
|
+
* crashes iTerm2 over SSH.
|
|
63
|
+
*
|
|
64
|
+
* After load-buffer succeeds, we ALSO return a DCS-passthrough-wrapped
|
|
65
|
+
* OSC 52 for the caller to write to stdout. Our sequence uses explicit `c`
|
|
66
|
+
* (not tmux's crashy empty-param variant), so it sidesteps the #22432 path.
|
|
67
|
+
* With `allow-passthrough on` + an OSC-52-capable outer terminal, selection
|
|
68
|
+
* reaches the system clipboard; with either off, tmux silently drops the
|
|
69
|
+
* DCS and prefix+] still works. See Greg Smith's "free pony" in
|
|
70
|
+
* https://anthropic.slack.com/archives/C07VBSHV7EV/p1773177228548119.
|
|
71
|
+
*
|
|
72
|
+
* If load-buffer fails entirely, fall through to raw OSC 52.
|
|
73
|
+
*
|
|
74
|
+
* Outside tmux, write raw OSC 52 to stdout (caller handles the write).
|
|
75
|
+
*
|
|
76
|
+
* Local (no SSH_CONNECTION): also shell out to a native clipboard utility.
|
|
77
|
+
* OSC 52 and tmux -w both depend on terminal settings — iTerm2 disables
|
|
78
|
+
* OSC 52 by default, VS Code shows a permission prompt on first use. Native
|
|
79
|
+
* utilities (pbcopy/wl-copy/xclip/xsel/clip.exe) always work locally. Over
|
|
80
|
+
* SSH these would write to the remote clipboard — OSC 52 is the right path there.
|
|
81
|
+
*
|
|
82
|
+
* Returns the sequence for the caller to write to stdout (raw OSC 52
|
|
83
|
+
* outside tmux, DCS-wrapped inside).
|
|
84
|
+
*/
|
|
85
|
+
export declare function setClipboard(text: string): Promise<string>;
|
|
86
|
+
/** @internal test-only */
|
|
87
|
+
export declare function _resetLinuxCopyCache(): void;
|
|
88
|
+
/**
|
|
89
|
+
* OSC command numbers
|
|
90
|
+
*/
|
|
91
|
+
export declare const OSC: {
|
|
92
|
+
readonly SET_TITLE_AND_ICON: 0;
|
|
93
|
+
readonly SET_ICON: 1;
|
|
94
|
+
readonly SET_TITLE: 2;
|
|
95
|
+
readonly SET_COLOR: 4;
|
|
96
|
+
readonly SET_CWD: 7;
|
|
97
|
+
readonly HYPERLINK: 8;
|
|
98
|
+
readonly ITERM2: 9;
|
|
99
|
+
readonly SET_FG_COLOR: 10;
|
|
100
|
+
readonly SET_BG_COLOR: 11;
|
|
101
|
+
readonly SET_CURSOR_COLOR: 12;
|
|
102
|
+
readonly CLIPBOARD: 52;
|
|
103
|
+
readonly KITTY: 99;
|
|
104
|
+
readonly RESET_COLOR: 104;
|
|
105
|
+
readonly RESET_FG_COLOR: 110;
|
|
106
|
+
readonly RESET_BG_COLOR: 111;
|
|
107
|
+
readonly RESET_CURSOR_COLOR: 112;
|
|
108
|
+
readonly SEMANTIC_PROMPT: 133;
|
|
109
|
+
readonly GHOSTTY: 777;
|
|
110
|
+
readonly TAB_STATUS: 21337;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Parse an OSC sequence into an action
|
|
114
|
+
*
|
|
115
|
+
* @param content - The sequence content (without ESC ] and terminator)
|
|
116
|
+
*/
|
|
117
|
+
export declare function parseOSC(content: string): Action | null;
|
|
118
|
+
/**
|
|
119
|
+
* Parse an XParseColor-style color spec into an RGB Color.
|
|
120
|
+
* Accepts `#RRGGBB` and `rgb:R/G/B` (1–4 hex digits per component, scaled
|
|
121
|
+
* to 8-bit). Returns null on parse failure.
|
|
122
|
+
*/
|
|
123
|
+
export declare function parseOscColor(spec: string): Color | null;
|
|
124
|
+
/** Start a hyperlink (OSC 8). Auto-assigns an id= param derived from the URL
|
|
125
|
+
* so terminals group wrapped lines of the same link together (the spec says
|
|
126
|
+
* cells with matching URI *and* nonempty id are joined; without an id each
|
|
127
|
+
* wrapped line is a separate link — inconsistent hover, partial tooltips).
|
|
128
|
+
* Empty url = close sequence (empty params per spec). */
|
|
129
|
+
export declare function link(url: string, params?: Record<string, string>): string;
|
|
130
|
+
/** End a hyperlink (OSC 8) */
|
|
131
|
+
export declare const LINK_END: string;
|
|
132
|
+
/** iTerm2 OSC 9 subcommand numbers */
|
|
133
|
+
export declare const ITERM2: {
|
|
134
|
+
readonly NOTIFY: 0;
|
|
135
|
+
readonly BADGE: 2;
|
|
136
|
+
readonly PROGRESS: 4;
|
|
137
|
+
};
|
|
138
|
+
/** Progress operation codes (for use with ITERM2.PROGRESS) */
|
|
139
|
+
export declare const PROGRESS: {
|
|
140
|
+
readonly CLEAR: 0;
|
|
141
|
+
readonly SET: 1;
|
|
142
|
+
readonly ERROR: 2;
|
|
143
|
+
readonly INDETERMINATE: 3;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Clear iTerm2 progress bar sequence (OSC 9;4;0;BEL)
|
|
147
|
+
* Uses BEL terminator since this is for cleanup (not runtime notification)
|
|
148
|
+
* and we want to ensure it's always sent regardless of terminal type.
|
|
149
|
+
*/
|
|
150
|
+
export declare const CLEAR_ITERM2_PROGRESS: string;
|
|
151
|
+
/**
|
|
152
|
+
* Clear terminal title sequence (OSC 0 with empty string + BEL).
|
|
153
|
+
* Uses BEL terminator for cleanup — safe on all terminals.
|
|
154
|
+
*/
|
|
155
|
+
export declare const CLEAR_TERMINAL_TITLE: string;
|
|
156
|
+
/** Clear all three OSC 21337 tab-status fields. Used on exit. */
|
|
157
|
+
export declare const CLEAR_TAB_STATUS: string;
|
|
158
|
+
/**
|
|
159
|
+
* Gate for emitting OSC 21337 (tab-status indicator). Ant-only while the
|
|
160
|
+
* spec is unstable. Terminals that don't recognize it discard silently, so
|
|
161
|
+
* emission is safe unconditionally — we don't gate on terminal detection
|
|
162
|
+
* since support is expected across several terminals.
|
|
163
|
+
*
|
|
164
|
+
* Callers must wrap output with wrapForMultiplexer() so tmux/screen
|
|
165
|
+
* DCS-passthrough carries the sequence to the outer terminal.
|
|
166
|
+
*/
|
|
167
|
+
export declare function supportsTabStatus(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Emit an OSC 21337 tab-status sequence. Omitted fields are left unchanged
|
|
170
|
+
* by the receiving terminal; `null` sends an empty value to clear.
|
|
171
|
+
* `;` and `\` in status text are escaped per the spec.
|
|
172
|
+
*/
|
|
173
|
+
export declare function tabStatus(fields: TabStatusAction): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI Parser - Semantic Action Generator
|
|
3
|
+
*
|
|
4
|
+
* A streaming parser for ANSI escape sequences that produces semantic actions.
|
|
5
|
+
* Uses the tokenizer for escape sequence boundary detection, then interprets
|
|
6
|
+
* each sequence to produce structured actions.
|
|
7
|
+
*
|
|
8
|
+
* Key design decisions:
|
|
9
|
+
* - Streaming: can process input incrementally
|
|
10
|
+
* - Semantic output: produces structured actions, not string tokens
|
|
11
|
+
* - Style tracking: maintains current text style state
|
|
12
|
+
*/
|
|
13
|
+
import type { Action, TextStyle } from './types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Parser class - maintains state for streaming/incremental parsing
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const parser = new Parser()
|
|
20
|
+
* const actions1 = parser.feed('partial\x1b[')
|
|
21
|
+
* const actions2 = parser.feed('31mred') // state maintained internally
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare class Parser {
|
|
25
|
+
private tokenizer;
|
|
26
|
+
style: TextStyle;
|
|
27
|
+
inLink: boolean;
|
|
28
|
+
linkUrl: string | undefined;
|
|
29
|
+
reset(): void;
|
|
30
|
+
/** Feed input and get resulting actions */
|
|
31
|
+
feed(input: string): Action[];
|
|
32
|
+
private processToken;
|
|
33
|
+
private processText;
|
|
34
|
+
private processSequence;
|
|
35
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SGR (Select Graphic Rendition) Parser
|
|
3
|
+
*
|
|
4
|
+
* Parses SGR parameters and applies them to a TextStyle.
|
|
5
|
+
* Handles both semicolon (;) and colon (:) separated parameters.
|
|
6
|
+
*/
|
|
7
|
+
import type { TextStyle } from './types.js';
|
|
8
|
+
export declare function applySGR(paramStr: string, style: TextStyle): TextStyle;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input Tokenizer - Escape sequence boundary detection
|
|
3
|
+
*
|
|
4
|
+
* Splits terminal input into tokens: text chunks and raw escape sequences.
|
|
5
|
+
* Unlike the Parser which interprets sequences semantically, this just
|
|
6
|
+
* identifies boundaries for use by keyboard input parsing.
|
|
7
|
+
*/
|
|
8
|
+
export type Token = {
|
|
9
|
+
type: 'text';
|
|
10
|
+
value: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'sequence';
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
export type Tokenizer = {
|
|
16
|
+
/** Feed input and get resulting tokens */
|
|
17
|
+
feed(input: string): Token[];
|
|
18
|
+
/** Flush any buffered incomplete sequences */
|
|
19
|
+
flush(): Token[];
|
|
20
|
+
/** Reset tokenizer state */
|
|
21
|
+
reset(): void;
|
|
22
|
+
/** Get any buffered incomplete sequence */
|
|
23
|
+
buffer(): string;
|
|
24
|
+
};
|
|
25
|
+
type TokenizerOptions = {
|
|
26
|
+
/**
|
|
27
|
+
* Treat `CSI M` as an X10 mouse event prefix and consume 3 payload bytes.
|
|
28
|
+
* Only enable for stdin input — `\x1b[M` is also CSI DL (Delete Lines) in
|
|
29
|
+
* output streams, and enabling this there swallows display text. Default false.
|
|
30
|
+
*/
|
|
31
|
+
x10Mouse?: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Create a streaming tokenizer for terminal input.
|
|
35
|
+
*
|
|
36
|
+
* Usage:
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const tokenizer = createTokenizer()
|
|
39
|
+
* const tokens1 = tokenizer.feed('hello\x1b[')
|
|
40
|
+
* const tokens2 = tokenizer.feed('A') // completes the escape sequence
|
|
41
|
+
* const remaining = tokenizer.flush() // force output incomplete sequences
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function createTokenizer(options?: TokenizerOptions): Tokenizer;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI Parser - Semantic Types
|
|
3
|
+
*
|
|
4
|
+
* These types represent the semantic meaning of ANSI escape sequences,
|
|
5
|
+
* not their string representation. Inspired by ghostty's action-based design.
|
|
6
|
+
*/
|
|
7
|
+
/** Named colors from the 16-color palette */
|
|
8
|
+
export type NamedColor = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'brightBlack' | 'brightRed' | 'brightGreen' | 'brightYellow' | 'brightBlue' | 'brightMagenta' | 'brightCyan' | 'brightWhite';
|
|
9
|
+
/** Color specification - can be named, indexed (256), or RGB */
|
|
10
|
+
export type Color = {
|
|
11
|
+
type: 'named';
|
|
12
|
+
name: NamedColor;
|
|
13
|
+
} | {
|
|
14
|
+
type: 'indexed';
|
|
15
|
+
index: number;
|
|
16
|
+
} | {
|
|
17
|
+
type: 'rgb';
|
|
18
|
+
r: number;
|
|
19
|
+
g: number;
|
|
20
|
+
b: number;
|
|
21
|
+
} | {
|
|
22
|
+
type: 'default';
|
|
23
|
+
};
|
|
24
|
+
/** Underline style variants */
|
|
25
|
+
export type UnderlineStyle = 'none' | 'single' | 'double' | 'curly' | 'dotted' | 'dashed';
|
|
26
|
+
/** Text style attributes - represents current styling state */
|
|
27
|
+
export type TextStyle = {
|
|
28
|
+
bold: boolean;
|
|
29
|
+
dim: boolean;
|
|
30
|
+
italic: boolean;
|
|
31
|
+
underline: UnderlineStyle;
|
|
32
|
+
blink: boolean;
|
|
33
|
+
inverse: boolean;
|
|
34
|
+
hidden: boolean;
|
|
35
|
+
strikethrough: boolean;
|
|
36
|
+
overline: boolean;
|
|
37
|
+
fg: Color;
|
|
38
|
+
bg: Color;
|
|
39
|
+
underlineColor: Color;
|
|
40
|
+
};
|
|
41
|
+
/** Create a default (reset) text style */
|
|
42
|
+
export declare function defaultStyle(): TextStyle;
|
|
43
|
+
/** Check if two styles are equal */
|
|
44
|
+
export declare function stylesEqual(a: TextStyle, b: TextStyle): boolean;
|
|
45
|
+
/** Check if two colors are equal */
|
|
46
|
+
export declare function colorsEqual(a: Color, b: Color): boolean;
|
|
47
|
+
export type CursorDirection = 'up' | 'down' | 'forward' | 'back';
|
|
48
|
+
export type CursorAction = {
|
|
49
|
+
type: 'move';
|
|
50
|
+
direction: CursorDirection;
|
|
51
|
+
count: number;
|
|
52
|
+
} | {
|
|
53
|
+
type: 'position';
|
|
54
|
+
row: number;
|
|
55
|
+
col: number;
|
|
56
|
+
} | {
|
|
57
|
+
type: 'column';
|
|
58
|
+
col: number;
|
|
59
|
+
} | {
|
|
60
|
+
type: 'row';
|
|
61
|
+
row: number;
|
|
62
|
+
} | {
|
|
63
|
+
type: 'save';
|
|
64
|
+
} | {
|
|
65
|
+
type: 'restore';
|
|
66
|
+
} | {
|
|
67
|
+
type: 'show';
|
|
68
|
+
} | {
|
|
69
|
+
type: 'hide';
|
|
70
|
+
} | {
|
|
71
|
+
type: 'style';
|
|
72
|
+
style: 'block' | 'underline' | 'bar';
|
|
73
|
+
blinking: boolean;
|
|
74
|
+
} | {
|
|
75
|
+
type: 'nextLine';
|
|
76
|
+
count: number;
|
|
77
|
+
} | {
|
|
78
|
+
type: 'prevLine';
|
|
79
|
+
count: number;
|
|
80
|
+
};
|
|
81
|
+
export type EraseAction = {
|
|
82
|
+
type: 'display';
|
|
83
|
+
region: 'toEnd' | 'toStart' | 'all' | 'scrollback';
|
|
84
|
+
} | {
|
|
85
|
+
type: 'line';
|
|
86
|
+
region: 'toEnd' | 'toStart' | 'all';
|
|
87
|
+
} | {
|
|
88
|
+
type: 'chars';
|
|
89
|
+
count: number;
|
|
90
|
+
};
|
|
91
|
+
export type ScrollAction = {
|
|
92
|
+
type: 'up';
|
|
93
|
+
count: number;
|
|
94
|
+
} | {
|
|
95
|
+
type: 'down';
|
|
96
|
+
count: number;
|
|
97
|
+
} | {
|
|
98
|
+
type: 'setRegion';
|
|
99
|
+
top: number;
|
|
100
|
+
bottom: number;
|
|
101
|
+
};
|
|
102
|
+
export type ModeAction = {
|
|
103
|
+
type: 'alternateScreen';
|
|
104
|
+
enabled: boolean;
|
|
105
|
+
} | {
|
|
106
|
+
type: 'bracketedPaste';
|
|
107
|
+
enabled: boolean;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'mouseTracking';
|
|
110
|
+
mode: 'off' | 'normal' | 'button' | 'any';
|
|
111
|
+
} | {
|
|
112
|
+
type: 'focusEvents';
|
|
113
|
+
enabled: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type LinkAction = {
|
|
116
|
+
type: 'start';
|
|
117
|
+
url: string;
|
|
118
|
+
params?: Record<string, string>;
|
|
119
|
+
} | {
|
|
120
|
+
type: 'end';
|
|
121
|
+
};
|
|
122
|
+
export type TitleAction = {
|
|
123
|
+
type: 'windowTitle';
|
|
124
|
+
title: string;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'iconName';
|
|
127
|
+
name: string;
|
|
128
|
+
} | {
|
|
129
|
+
type: 'both';
|
|
130
|
+
title: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Per-tab chrome metadata. Tristate for each field:
|
|
134
|
+
* - property absent → not mentioned in sequence, no change
|
|
135
|
+
* - null → explicitly cleared (bare key or key= with empty value)
|
|
136
|
+
* - value → set to this
|
|
137
|
+
*/
|
|
138
|
+
export type TabStatusAction = {
|
|
139
|
+
indicator?: Color | null;
|
|
140
|
+
status?: string | null;
|
|
141
|
+
statusColor?: Color | null;
|
|
142
|
+
};
|
|
143
|
+
/** A segment of styled text */
|
|
144
|
+
export type TextSegment = {
|
|
145
|
+
type: 'text';
|
|
146
|
+
text: string;
|
|
147
|
+
style: TextStyle;
|
|
148
|
+
};
|
|
149
|
+
/** A grapheme (visual character unit) with width info */
|
|
150
|
+
export type Grapheme = {
|
|
151
|
+
value: string;
|
|
152
|
+
width: 1 | 2;
|
|
153
|
+
};
|
|
154
|
+
/** All possible parsed actions */
|
|
155
|
+
export type Action = {
|
|
156
|
+
type: 'text';
|
|
157
|
+
graphemes: Grapheme[];
|
|
158
|
+
style: TextStyle;
|
|
159
|
+
} | {
|
|
160
|
+
type: 'cursor';
|
|
161
|
+
action: CursorAction;
|
|
162
|
+
} | {
|
|
163
|
+
type: 'erase';
|
|
164
|
+
action: EraseAction;
|
|
165
|
+
} | {
|
|
166
|
+
type: 'scroll';
|
|
167
|
+
action: ScrollAction;
|
|
168
|
+
} | {
|
|
169
|
+
type: 'mode';
|
|
170
|
+
action: ModeAction;
|
|
171
|
+
} | {
|
|
172
|
+
type: 'link';
|
|
173
|
+
action: LinkAction;
|
|
174
|
+
} | {
|
|
175
|
+
type: 'title';
|
|
176
|
+
action: TitleAction;
|
|
177
|
+
} | {
|
|
178
|
+
type: 'tabStatus';
|
|
179
|
+
action: TabStatusAction;
|
|
180
|
+
} | {
|
|
181
|
+
type: 'sgr';
|
|
182
|
+
params: string;
|
|
183
|
+
} | {
|
|
184
|
+
type: 'bell';
|
|
185
|
+
} | {
|
|
186
|
+
type: 'reset';
|
|
187
|
+
} | {
|
|
188
|
+
type: 'unknown';
|
|
189
|
+
sequence: string;
|
|
190
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI Parser Module
|
|
3
|
+
*
|
|
4
|
+
* A semantic ANSI escape sequence parser inspired by ghostty, tmux, and iTerm2.
|
|
5
|
+
*
|
|
6
|
+
* Key features:
|
|
7
|
+
* - Semantic output: produces structured actions, not string tokens
|
|
8
|
+
* - Streaming: can parse input incrementally via Parser class
|
|
9
|
+
* - Style tracking: maintains text style state across parse calls
|
|
10
|
+
* - Comprehensive: supports SGR, CSI, OSC, ESC sequences
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
*
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { Parser } from './termio.js'
|
|
16
|
+
*
|
|
17
|
+
* const parser = new Parser()
|
|
18
|
+
* const actions = parser.feed('\x1b[31mred\x1b[0m')
|
|
19
|
+
* // => [{ type: 'text', graphemes: [...], style: { fg: { type: 'named', name: 'red' }, ... } }]
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export { Parser } from './termio/parser.js';
|
|
23
|
+
export type { Action, Color, CursorAction, CursorDirection, EraseAction, Grapheme, LinkAction, ModeAction, NamedColor, ScrollAction, TextSegment, TextStyle, TitleAction, UnderlineStyle, } from './termio/types.js';
|
|
24
|
+
export { colorsEqual, defaultStyle, stylesEqual } from './termio/types.js';
|