@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,183 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
|
|
5
|
+
|
|
6
|
+
// package.json
|
|
7
|
+
var require_package = _chunkIJSHQGMPcjs.__commonJS.call(void 0, {
|
|
8
|
+
"package.json"(exports, module) {
|
|
9
|
+
module.exports = {
|
|
10
|
+
name: "@cjhyy/code-shell",
|
|
11
|
+
version: "0.1.0-alpha.0",
|
|
12
|
+
description: "Code Shell \u2014 general-purpose agent orchestration framework with a terminal coding preset",
|
|
13
|
+
type: "module",
|
|
14
|
+
main: "./dist/index.cjs",
|
|
15
|
+
module: "./dist/index.js",
|
|
16
|
+
types: "./dist/index.d.ts",
|
|
17
|
+
exports: {
|
|
18
|
+
".": {
|
|
19
|
+
types: "./dist/index.d.ts",
|
|
20
|
+
import: "./dist/index.js",
|
|
21
|
+
require: "./dist/index.cjs"
|
|
22
|
+
},
|
|
23
|
+
"./run": {
|
|
24
|
+
types: "./dist/run/index.d.ts",
|
|
25
|
+
import: "./dist/run/index.js",
|
|
26
|
+
require: "./dist/run/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./arena": {
|
|
29
|
+
types: "./dist/arena/index.d.ts",
|
|
30
|
+
import: "./dist/arena/index.js",
|
|
31
|
+
require: "./dist/arena/index.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./product": {
|
|
34
|
+
types: "./dist/product/index.d.ts",
|
|
35
|
+
import: "./dist/product/index.js",
|
|
36
|
+
require: "./dist/product/index.cjs"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
bin: {
|
|
41
|
+
"code-shell": "dist/cli/main.js"
|
|
42
|
+
},
|
|
43
|
+
repository: {
|
|
44
|
+
type: "git",
|
|
45
|
+
url: "git+https://github.com/cjhyy/codeshell.git"
|
|
46
|
+
},
|
|
47
|
+
homepage: "https://github.com/cjhyy/codeshell#readme",
|
|
48
|
+
bugs: {
|
|
49
|
+
url: "https://github.com/cjhyy/codeshell/issues"
|
|
50
|
+
},
|
|
51
|
+
publishConfig: {
|
|
52
|
+
access: "public"
|
|
53
|
+
},
|
|
54
|
+
scripts: {
|
|
55
|
+
build: "bun run tsup && bun run build:dts",
|
|
56
|
+
"build:dts": "tsc --emitDeclarationOnly --declaration --outDir dist || true",
|
|
57
|
+
dev: "bun run src/cli/main.ts",
|
|
58
|
+
test: "bun test",
|
|
59
|
+
"test:watch": "bun test --watch",
|
|
60
|
+
lint: "eslint src/",
|
|
61
|
+
format: "prettier --write 'src/**/*.ts'",
|
|
62
|
+
typecheck: "bun run tsc --noEmit",
|
|
63
|
+
prepublishOnly: "bun run build"
|
|
64
|
+
},
|
|
65
|
+
engines: {
|
|
66
|
+
node: ">=20"
|
|
67
|
+
},
|
|
68
|
+
files: [
|
|
69
|
+
"dist",
|
|
70
|
+
"README.md",
|
|
71
|
+
"LICENSE",
|
|
72
|
+
"CHANGELOG.md"
|
|
73
|
+
],
|
|
74
|
+
keywords: [
|
|
75
|
+
"ai",
|
|
76
|
+
"agent",
|
|
77
|
+
"orchestration",
|
|
78
|
+
"coding-assistant",
|
|
79
|
+
"cli",
|
|
80
|
+
"claude-code",
|
|
81
|
+
"mcp",
|
|
82
|
+
"llm"
|
|
83
|
+
],
|
|
84
|
+
author: "maki maki",
|
|
85
|
+
license: "MIT",
|
|
86
|
+
dependencies: {
|
|
87
|
+
"@alcalzone/ansi-tokenize": "^0.3.0",
|
|
88
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
89
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
90
|
+
asciichart: "^1.5.25",
|
|
91
|
+
"auto-bind": "^5.0.1",
|
|
92
|
+
"bidi-js": "^1.0.3",
|
|
93
|
+
chalk: "^5.4.1",
|
|
94
|
+
"cli-boxes": "^4.0.1",
|
|
95
|
+
"cli-highlight": "^2.1.11",
|
|
96
|
+
"code-excerpt": "^4.0.0",
|
|
97
|
+
commander: "^13.1.0",
|
|
98
|
+
diff: "^8.0.4",
|
|
99
|
+
"emoji-regex": "^10.6.0",
|
|
100
|
+
"get-east-asian-width": "^1.5.0",
|
|
101
|
+
glob: "^11.0.0",
|
|
102
|
+
"indent-string": "^5.0.0",
|
|
103
|
+
ink: "^6.8.0",
|
|
104
|
+
"lodash-es": "^4.17.23",
|
|
105
|
+
marked: "^17.0.5",
|
|
106
|
+
"marked-terminal": "^7.3.0",
|
|
107
|
+
nanoid: "^5.1.2",
|
|
108
|
+
openai: "^4.82.0",
|
|
109
|
+
ora: "^9.3.0",
|
|
110
|
+
"proper-lockfile": "^4.1.2",
|
|
111
|
+
react: "^19.2.4",
|
|
112
|
+
"react-reconciler": "^0.33.0",
|
|
113
|
+
semver: "^7.7.4",
|
|
114
|
+
"signal-exit": "^4.1.0",
|
|
115
|
+
"stack-utils": "^2.0.6",
|
|
116
|
+
"strip-ansi": "^7.2.0",
|
|
117
|
+
"supports-hyperlinks": "^4.4.0",
|
|
118
|
+
"type-fest": "^5.5.0",
|
|
119
|
+
"usehooks-ts": "^3.1.1",
|
|
120
|
+
"wrap-ansi": "^10.0.0",
|
|
121
|
+
yaml: "^2.7.0",
|
|
122
|
+
"yoga-layout": "^3.2.1",
|
|
123
|
+
zod: "^3.24.2"
|
|
124
|
+
},
|
|
125
|
+
devDependencies: {
|
|
126
|
+
"@eslint/js": "^10.0.1",
|
|
127
|
+
"@types/lodash": "^4.17.24",
|
|
128
|
+
"@types/lodash-es": "^4.17.12",
|
|
129
|
+
"@types/node": "^22.12.0",
|
|
130
|
+
"@types/react": "^19.2.14",
|
|
131
|
+
"@types/semver": "^7.7.1",
|
|
132
|
+
eslint: "^9.19.0",
|
|
133
|
+
prettier: "^3.4.2",
|
|
134
|
+
tsup: "^8.3.6",
|
|
135
|
+
typescript: "^5.7.3",
|
|
136
|
+
"typescript-eslint": "^8.59.0"
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
// src/cli/updater.ts
|
|
143
|
+
_chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
|
|
144
|
+
var _child_process = require('child_process');
|
|
145
|
+
var _updateAvailable;
|
|
146
|
+
function checkForUpdate(packageName = "code-shell") {
|
|
147
|
+
try {
|
|
148
|
+
const currentVersion = getCurrentVersion();
|
|
149
|
+
const latestVersion = _child_process.execSync.call(void 0, `npm view ${packageName} version 2>/dev/null`, {
|
|
150
|
+
encoding: "utf-8",
|
|
151
|
+
timeout: 5e3
|
|
152
|
+
}).trim();
|
|
153
|
+
if (latestVersion && latestVersion !== currentVersion && compareVersions(latestVersion, currentVersion) > 0) {
|
|
154
|
+
_updateAvailable = latestVersion;
|
|
155
|
+
}
|
|
156
|
+
} catch (e) {
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function getUpdateAvailable() {
|
|
160
|
+
return _updateAvailable;
|
|
161
|
+
}
|
|
162
|
+
function getCurrentVersion() {
|
|
163
|
+
try {
|
|
164
|
+
const pkg = require_package();
|
|
165
|
+
return _nullishCoalesce(pkg.version, () => ( "0.1.0"));
|
|
166
|
+
} catch (e2) {
|
|
167
|
+
return "0.1.0";
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function compareVersions(a, b) {
|
|
171
|
+
const pa = a.split(".").map(Number);
|
|
172
|
+
const pb = b.split(".").map(Number);
|
|
173
|
+
for (let i = 0; i < 3; i++) {
|
|
174
|
+
const diff = (_nullishCoalesce(pa[i], () => ( 0))) - (_nullishCoalesce(pb[i], () => ( 0)));
|
|
175
|
+
if (diff !== 0) return diff;
|
|
176
|
+
}
|
|
177
|
+
return 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
exports.checkForUpdate = checkForUpdate; exports.getCurrentVersion = getCurrentVersion; exports.getUpdateAvailable = getUpdateAvailable;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug logging — category-filtered, leveled output with file support.
|
|
3
|
+
*
|
|
4
|
+
* Activation:
|
|
5
|
+
* CODE_SHELL_DEBUG=1 — all debug output to stderr
|
|
6
|
+
* --debug — all debug output to file (~/.code-shell/debug/<session>.txt)
|
|
7
|
+
* --debug=api,hooks — filtered categories only
|
|
8
|
+
* --debug-file=/path/to/file — explicit output file
|
|
9
|
+
* --debug-to-stderr / -d2e — force stderr output
|
|
10
|
+
*
|
|
11
|
+
* Levels: verbose < debug < info < warn < error
|
|
12
|
+
* Set CODE_SHELL_DEBUG_LOG_LEVEL=verbose to include high-volume diagnostics.
|
|
13
|
+
*/
|
|
14
|
+
export type DebugLogLevel = "verbose" | "debug" | "info" | "warn" | "error";
|
|
15
|
+
type DebugFilter = {
|
|
16
|
+
categories: Set<string>;
|
|
17
|
+
};
|
|
18
|
+
export declare function setDebugSessionId(id: string): void;
|
|
19
|
+
export declare function getMinDebugLogLevel(): DebugLogLevel;
|
|
20
|
+
export declare function isDebugMode(): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Enable debug logging mid-session (e.g. via /debug command).
|
|
23
|
+
* Returns true if logging was already active.
|
|
24
|
+
*/
|
|
25
|
+
export declare function enableDebugLogging(): boolean;
|
|
26
|
+
export declare function isDebugToStdErr(): boolean;
|
|
27
|
+
export declare function getDebugFilter(): DebugFilter | null;
|
|
28
|
+
export declare function getDebugFilePath(): string | null;
|
|
29
|
+
/**
|
|
30
|
+
* Log a debug message with optional level.
|
|
31
|
+
* Output goes to stderr (--debug-to-stderr / CODE_SHELL_DEBUG=1)
|
|
32
|
+
* or to a file (~/.code-shell/debug/<session>.txt).
|
|
33
|
+
*/
|
|
34
|
+
export declare function logForDebugging(message: string, opts?: {
|
|
35
|
+
level?: DebugLogLevel | string;
|
|
36
|
+
}): void;
|
|
37
|
+
/**
|
|
38
|
+
* Category-scoped debug logger.
|
|
39
|
+
* Usage: const log = debugCategory("mcp"); log("connecting...");
|
|
40
|
+
*/
|
|
41
|
+
export declare function debugCategory(category: string): (msg: string) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Time a function and log the duration.
|
|
44
|
+
*/
|
|
45
|
+
export declare function debugTiming<T>(label: string, fn: () => T | Promise<T>): Promise<T>;
|
|
46
|
+
/**
|
|
47
|
+
* CC compatibility: log errors for Anthropic internal users.
|
|
48
|
+
* In Code Shell this is a debug-level error log.
|
|
49
|
+
*/
|
|
50
|
+
export declare function logAntError(msg: string, _err?: unknown): void;
|
|
51
|
+
/**
|
|
52
|
+
* CC compatibility exports.
|
|
53
|
+
*/
|
|
54
|
+
export declare function setHasFormattedOutput(_value: boolean): void;
|
|
55
|
+
export declare function getHasFormattedOutput(): boolean;
|
|
56
|
+
export declare function flushDebugLogs(): Promise<void>;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Early Input Capture
|
|
3
|
+
*
|
|
4
|
+
* This module captures terminal input that is typed before the REPL is fully
|
|
5
|
+
* initialized. Users often type `claude` and immediately start typing their
|
|
6
|
+
* prompt, but those early keystrokes would otherwise be lost during startup.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* 1. Call startCapturingEarlyInput() as early as possible in cli.tsx
|
|
10
|
+
* 2. When REPL is ready, call consumeEarlyInput() to get any buffered text
|
|
11
|
+
* 3. stopCapturingEarlyInput() is called automatically when input is consumed
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Start capturing stdin data early, before the REPL is initialized.
|
|
15
|
+
* Should be called as early as possible in the startup sequence.
|
|
16
|
+
*
|
|
17
|
+
* Only captures if stdin is a TTY (interactive terminal).
|
|
18
|
+
*/
|
|
19
|
+
export declare function startCapturingEarlyInput(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Stop capturing early input.
|
|
22
|
+
* Called automatically when input is consumed, or can be called manually.
|
|
23
|
+
*/
|
|
24
|
+
export declare function stopCapturingEarlyInput(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Consume any early input that was captured.
|
|
27
|
+
* Returns the captured input and clears the buffer.
|
|
28
|
+
* Automatically stops capturing when called.
|
|
29
|
+
*/
|
|
30
|
+
export declare function consumeEarlyInput(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Check if there is any early input available without consuming it.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hasEarlyInput(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Seed the early input buffer with text that will appear pre-filled
|
|
37
|
+
* in the prompt input when the REPL renders. Does not auto-submit.
|
|
38
|
+
*/
|
|
39
|
+
export declare function seedEarlyInput(text: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Check if early input capture is currently active.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isCapturingEarlyInput(): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment detection — platform, runtime, config paths, network.
|
|
3
|
+
*/
|
|
4
|
+
export declare const env: {
|
|
5
|
+
platform: "darwin" | "linux" | "win32";
|
|
6
|
+
terminal: string;
|
|
7
|
+
shell: string;
|
|
8
|
+
isCI: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function getHostPlatform(): "macos" | "linux" | "windows";
|
|
11
|
+
export declare function getHostPlatformForAnalytics(): string;
|
|
12
|
+
export declare function isWSL(): boolean;
|
|
13
|
+
/** ~/.claude/ directory (Claude Code compatible) */
|
|
14
|
+
export declare function getGlobalClaudeDir(): string;
|
|
15
|
+
/** ~/.code-shell/ directory */
|
|
16
|
+
export declare function getGlobalCodeShellDir(): string;
|
|
17
|
+
/** Resolve a file in ~/.claude/ or ~/.code-shell/ (claude takes precedence) */
|
|
18
|
+
export declare function getGlobalClaudeFile(filename: string): string | undefined;
|
|
19
|
+
export declare function getRuntime(): "bun" | "deno" | "node";
|
|
20
|
+
export declare function getPackageManager(cwd?: string): "bun" | "pnpm" | "yarn" | "npm";
|
|
21
|
+
export declare function hasInternetAccess(): Promise<boolean>;
|
|
22
|
+
export declare const JETBRAINS_IDES: readonly ["idea", "pycharm", "webstorm", "phpstorm", "rubymine", "clion", "goland", "rider", "datagrip", "fleet"];
|
|
23
|
+
export declare function isJetBrainsTerminal(): boolean;
|
|
24
|
+
export declare function isVSCodeTerminal(): boolean;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment variable helpers — ported from CC's utils/envUtils with full implementations.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Returns the Claude/Code Shell config home directory.
|
|
6
|
+
* Defaults to ~/.claude, overridable via CLAUDE_CONFIG_DIR env var.
|
|
7
|
+
* Memoized — keyed off CLAUDE_CONFIG_DIR so tests that change the env var get a fresh value.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getClaudeConfigHomeDir(): string;
|
|
10
|
+
export declare function getTeamsDir(): string;
|
|
11
|
+
export declare function isEnvTruthy(val: string | boolean | undefined): boolean;
|
|
12
|
+
export declare function isEnvDefinedFalsy(envVar: string | boolean | undefined): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check if NODE_OPTIONS contains a specific flag.
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasNodeOption(flag: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* --bare / CLAUDE_CODE_SIMPLE — skip hooks, LSP, plugin sync, skill dir-walk,
|
|
19
|
+
* attribution, background prefetches, and ALL keychain/credential reads.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isBareMode(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Parses an array of environment variable strings into a key-value object.
|
|
24
|
+
* @param rawEnvArgs Array of strings in KEY=VALUE format
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseEnvVars(rawEnvArgs: string[] | undefined): Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Get the AWS region with fallback to default.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAWSRegion(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the default Vertex AI region.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getDefaultVertexRegion(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Check if bash commands should maintain project working directory.
|
|
37
|
+
*/
|
|
38
|
+
export declare function shouldMaintainProjectWorkingDir(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Check if running on Homespace (ant-internal cloud environment).
|
|
41
|
+
*/
|
|
42
|
+
export declare function isRunningOnHomespace(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Get the Vertex AI region for a specific model.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getVertexRegionForModel(model: string | undefined): string | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Stub: Check if running inside a protected namespace.
|
|
49
|
+
* Always returns false in Code Shell (Anthropic-internal feature).
|
|
50
|
+
*/
|
|
51
|
+
export declare function isInProtectedNamespace(): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execute a child process without throwing on non-zero exit.
|
|
3
|
+
*
|
|
4
|
+
* Distinguishes between:
|
|
5
|
+
* - Spawn failure (file not found, permission denied) → code = null
|
|
6
|
+
* - Non-zero exit (process ran but returned error) → code = exit code
|
|
7
|
+
* - Success → code = 0
|
|
8
|
+
*/
|
|
9
|
+
export interface ExecFileNoThrowResult {
|
|
10
|
+
/** Process exit code (0 = success, null = spawn failed). */
|
|
11
|
+
code: number | null;
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ExecFileNoThrowOptions {
|
|
16
|
+
/** stdin input to pipe to the process. */
|
|
17
|
+
input?: string;
|
|
18
|
+
/** Working directory. */
|
|
19
|
+
cwd?: string;
|
|
20
|
+
/** Timeout in ms (default 10_000). */
|
|
21
|
+
timeout?: number;
|
|
22
|
+
/** Environment variables to merge. */
|
|
23
|
+
env?: Record<string, string | undefined>;
|
|
24
|
+
/** Shell to run in (if true, uses platform default). */
|
|
25
|
+
shell?: boolean | string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Run a command and return exit code + stdout/stderr.
|
|
29
|
+
* Never throws — spawn failures return code=null.
|
|
30
|
+
*/
|
|
31
|
+
export declare function execFileNoThrow(file: string, args: string[], options?: ExecFileNoThrowOptions): Promise<ExecFileNoThrowResult>;
|
|
32
|
+
/**
|
|
33
|
+
* execFileNoThrow with explicit cwd (convenience wrapper).
|
|
34
|
+
*/
|
|
35
|
+
export declare function execFileNoThrowWithCwd(cwd: string, file: string, args: string[], options?: Omit<ExecFileNoThrowOptions, "cwd">): Promise<ExecFileNoThrowResult>;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Use execFileNoThrow directly.
|
|
38
|
+
*/
|
|
39
|
+
export declare function execSyncWithDefaults_DEPRECATED(..._args: any[]): any;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a byte count to a human-readable string (KB, MB, GB).
|
|
3
|
+
* @example formatFileSize(1536) → "1.5KB"
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatFileSize(sizeInBytes: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* Formats milliseconds as seconds with 1 decimal place (e.g. `1234` → `"1.2s"`).
|
|
8
|
+
* Unlike formatDuration, always keeps the decimal — use for sub-minute timings
|
|
9
|
+
* where the fractional second is meaningful (TTFT, hook durations, etc.).
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatSecondsShort(ms: number): string;
|
|
12
|
+
export declare function formatDuration(ms: number, options?: {
|
|
13
|
+
hideTrailingZeros?: boolean;
|
|
14
|
+
mostSignificantOnly?: boolean;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function formatNumber(number: number): string;
|
|
17
|
+
export declare function formatTokens(count: number): string;
|
|
18
|
+
type RelativeTimeStyle = 'long' | 'short' | 'narrow';
|
|
19
|
+
type RelativeTimeOptions = {
|
|
20
|
+
style?: RelativeTimeStyle;
|
|
21
|
+
numeric?: 'always' | 'auto';
|
|
22
|
+
};
|
|
23
|
+
export declare function formatRelativeTime(date: Date, options?: RelativeTimeOptions & {
|
|
24
|
+
now?: Date;
|
|
25
|
+
}): string;
|
|
26
|
+
export declare function formatRelativeTimeAgo(date: Date, options?: RelativeTimeOptions & {
|
|
27
|
+
now?: Date;
|
|
28
|
+
}): string;
|
|
29
|
+
/**
|
|
30
|
+
* Formats log metadata for display (time, size or message count, branch, tag, PR)
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatLogMetadata(log: {
|
|
33
|
+
modified: Date;
|
|
34
|
+
messageCount: number;
|
|
35
|
+
fileSize?: number;
|
|
36
|
+
gitBranch?: string;
|
|
37
|
+
tag?: string;
|
|
38
|
+
agentSetting?: string;
|
|
39
|
+
prNumber?: number;
|
|
40
|
+
prRepository?: string;
|
|
41
|
+
}): string;
|
|
42
|
+
export declare function formatResetTime(timestampInSeconds: number | undefined, showTimezone?: boolean, showTime?: boolean): string | undefined;
|
|
43
|
+
export declare function formatResetText(resetsAt: string, showTimezone?: boolean, showTime?: boolean): string;
|
|
44
|
+
export { truncate, truncatePathMiddle, truncateStartToWidth, truncateToWidth, truncateToWidthNoEllipsis, wrapText, } from './truncate.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when running under `tmux -CC` (iTerm2 integration mode).
|
|
3
|
+
*
|
|
4
|
+
* The alt-screen / mouse-tracking path in fullscreen mode is unrecoverable
|
|
5
|
+
* in -CC mode (double-click corrupts terminal state; mouse wheel is dead),
|
|
6
|
+
* so callers auto-disable fullscreen.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isTmuxControlMode(): boolean;
|
|
9
|
+
export declare function _resetTmuxControlModeProbeForTesting(): void;
|
|
10
|
+
/**
|
|
11
|
+
* Runtime env-var check only. Ants default to on (CLAUDE_CODE_NO_FLICKER=0
|
|
12
|
+
* to opt out); external users default to off (CLAUDE_CODE_NO_FLICKER=1 to
|
|
13
|
+
* opt in).
|
|
14
|
+
*/
|
|
15
|
+
export declare function isFullscreenEnvEnabled(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether fullscreen mode should enable SGR mouse tracking (DEC 1000/1002/1006).
|
|
18
|
+
* Set CLAUDE_CODE_DISABLE_MOUSE=1 to keep alt-screen + virtualized scroll
|
|
19
|
+
* but skip mouse capture, so tmux/kitty/terminal-native copy-on-select keeps working.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isMouseTrackingEnabled(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether mouse click handling is disabled (clicks/drags ignored, wheel still
|
|
24
|
+
* works). Set CLAUDE_CODE_DISABLE_MOUSE_CLICKS=1 to prevent accidental clicks
|
|
25
|
+
* from triggering cursor positioning, text selection, or message expansion.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isMouseClicksDisabled(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* True when the fullscreen alt-screen layout is actually rendering —
|
|
30
|
+
* requires an interactive REPL session AND the env var not explicitly
|
|
31
|
+
* set falsy.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isFullscreenActive(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* One-time hint for tmux users in fullscreen with `mouse off`.
|
|
36
|
+
*
|
|
37
|
+
* Fire-and-forget from REPL startup. Returns the hint text once per
|
|
38
|
+
* session if TMUX is set, fullscreen is active, and tmux's current
|
|
39
|
+
* `mouse` option is off; null otherwise.
|
|
40
|
+
*/
|
|
41
|
+
export declare function maybeGetTmuxMouseHint(): Promise<string | null>;
|
|
42
|
+
/** Test-only: reset module-level once-per-session flags. */
|
|
43
|
+
export declare function _resetForTesting(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Whether fullscreen mode is available (alias for isFullscreenActive).
|
|
46
|
+
*/
|
|
47
|
+
export declare function isFullscreen(): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Intl object instances with lazy initialization.
|
|
3
|
+
*
|
|
4
|
+
* Intl constructors are expensive (~0.05-0.1ms each), so we cache instances
|
|
5
|
+
* for reuse across the codebase instead of creating new ones each time.
|
|
6
|
+
* Lazy initialization ensures we only pay the cost when actually needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getGraphemeSegmenter(): Intl.Segmenter;
|
|
9
|
+
/**
|
|
10
|
+
* Extract the first grapheme cluster from a string.
|
|
11
|
+
* Returns '' for empty strings.
|
|
12
|
+
*/
|
|
13
|
+
export declare function firstGrapheme(text: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Extract the last grapheme cluster from a string.
|
|
16
|
+
* Returns '' for empty strings.
|
|
17
|
+
*/
|
|
18
|
+
export declare function lastGrapheme(text: string): string;
|
|
19
|
+
export declare function getWordSegmenter(): Intl.Segmenter;
|
|
20
|
+
export declare function getRelativeTimeFormat(style: 'long' | 'short' | 'narrow', numeric: 'always' | 'auto'): Intl.RelativeTimeFormat;
|
|
21
|
+
export declare function getTimeZone(): string;
|
|
22
|
+
export declare function getSystemLocaleLanguage(): string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy accessor for proper-lockfile.
|
|
3
|
+
*
|
|
4
|
+
* proper-lockfile depends on graceful-fs, which monkey-patches every fs
|
|
5
|
+
* method on first require (~8ms). Static imports of proper-lockfile pull this
|
|
6
|
+
* cost into the startup path even when no locking happens (e.g. `--help`).
|
|
7
|
+
*
|
|
8
|
+
* Import this module instead of `proper-lockfile` directly. The underlying
|
|
9
|
+
* package is only loaded the first time a lock function is actually called.
|
|
10
|
+
*/
|
|
11
|
+
import type { CheckOptions, LockOptions, UnlockOptions } from 'proper-lockfile';
|
|
12
|
+
export declare function lock(file: string, options?: LockOptions): Promise<() => Promise<void>>;
|
|
13
|
+
export declare function lockSync(file: string, options?: LockOptions): () => void;
|
|
14
|
+
export declare function unlock(file: string, options?: UnlockOptions): Promise<void>;
|
|
15
|
+
export declare function check(file: string, options?: CheckOptions): Promise<boolean>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent logging — writes to ~/.code-shell/logs/ with daily rotation.
|
|
3
|
+
*
|
|
4
|
+
* Also provides an in-memory error log (last 100 errors) for bug reports,
|
|
5
|
+
* and a pluggable ErrorLogSink architecture for decoupled error routing.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get recent in-memory errors for inclusion in bug reports.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getInMemoryErrors(): Array<{
|
|
11
|
+
error: string;
|
|
12
|
+
timestamp: string;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Sink interface for pluggable error logging backends.
|
|
16
|
+
*/
|
|
17
|
+
export type ErrorLogSink = {
|
|
18
|
+
logError: (error: Error) => void;
|
|
19
|
+
logMCPError: (serverName: string, error: unknown) => void;
|
|
20
|
+
logMCPDebug: (serverName: string, message: string) => void;
|
|
21
|
+
getErrorsPath: () => string;
|
|
22
|
+
getMCPLogsPath: (serverName: string) => string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Attach a sink to receive all error events.
|
|
26
|
+
* Queued events are drained immediately. Idempotent.
|
|
27
|
+
*/
|
|
28
|
+
export declare function attachErrorLogSink(newSink: ErrorLogSink): void;
|
|
29
|
+
/**
|
|
30
|
+
* Log an error to multiple destinations:
|
|
31
|
+
* - In-memory error log (for bug reports)
|
|
32
|
+
* - Persistent log file
|
|
33
|
+
* - ErrorLogSink (if attached)
|
|
34
|
+
*/
|
|
35
|
+
export declare function logError(msgOrError: string | Error | unknown, err?: unknown): void;
|
|
36
|
+
export declare function logInfo(msg: string): void;
|
|
37
|
+
export declare function logWarn(msg: string): void;
|
|
38
|
+
export declare function logMCPDebug(serverNameOrMsg: string, message?: string): void;
|
|
39
|
+
export declare function logMCPError(serverNameOrMsg: string, err?: unknown): void;
|
|
40
|
+
/**
|
|
41
|
+
* Read the most recent N lines from today's log.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getRecentLogs(n?: number): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Clean up old log files (keep last MAX_LOG_FILES days).
|
|
46
|
+
*/
|
|
47
|
+
export declare function rotateLogs(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get the logs directory path.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getLogsDir(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Reset error log state for testing purposes only.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
export declare function _resetErrorLogForTesting(): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shim for CC's utils/sliceAnsi — slices an ANSI-styled string by display
|
|
3
|
+
* column position while preserving escape sequences.
|
|
4
|
+
*
|
|
5
|
+
* This is a lightweight implementation. For full fidelity with wide characters
|
|
6
|
+
* and complex ANSI sequences, consider installing `slice-ansi`.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Slice a string that may contain ANSI escape codes by *visible* character
|
|
10
|
+
* positions (start inclusive, end exclusive).
|
|
11
|
+
*/
|
|
12
|
+
export default function sliceAnsi(text: string, start: number, end?: number): string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal dark/light mode detection for the 'auto' theme setting.
|
|
3
|
+
*
|
|
4
|
+
* Detection is based on the terminal's actual background color (queried via
|
|
5
|
+
* OSC 11 by systemThemeWatcher.ts) rather than the OS appearance setting —
|
|
6
|
+
* a dark terminal on a light-mode OS should still resolve to 'dark'.
|
|
7
|
+
*
|
|
8
|
+
* The detected theme is cached module-level so callers can resolve 'auto'
|
|
9
|
+
* without awaiting the async OSC round-trip. The cache is seeded from
|
|
10
|
+
* $COLORFGBG (synchronous, set by some terminals at launch) and then
|
|
11
|
+
* updated by the watcher once the OSC 11 response arrives.
|
|
12
|
+
*/
|
|
13
|
+
import type { ThemeName, ThemeSetting } from './theme.js';
|
|
14
|
+
export type SystemTheme = 'dark' | 'light';
|
|
15
|
+
/**
|
|
16
|
+
* Get the current terminal theme. Cached after first detection; the watcher
|
|
17
|
+
* updates the cache on live changes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSystemThemeName(): SystemTheme;
|
|
20
|
+
/**
|
|
21
|
+
* Update the cached terminal theme. Called by the watcher when the OSC 11
|
|
22
|
+
* query returns so non-React call sites stay in sync.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setCachedSystemTheme(theme: SystemTheme): void;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve a ThemeSetting (which may be 'auto') to a concrete ThemeName.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveThemeSetting(setting: ThemeSetting): ThemeName;
|
|
29
|
+
/**
|
|
30
|
+
* Parse an OSC color response data string into a theme.
|
|
31
|
+
*
|
|
32
|
+
* Accepts XParseColor formats returned by OSC 10/11 queries:
|
|
33
|
+
* - `rgb:R/G/B` where each component is 1–4 hex digits (each scaled to
|
|
34
|
+
* [0, 16^n - 1] for n digits). This is what xterm, iTerm2, Terminal.app,
|
|
35
|
+
* Ghostty, kitty, Alacritty, etc. return.
|
|
36
|
+
* - `#RRGGBB` / `#RRRRGGGGBBBB` (rare, but cheap to accept).
|
|
37
|
+
*
|
|
38
|
+
* Returns undefined for unrecognized formats so callers can fall back.
|
|
39
|
+
*/
|
|
40
|
+
export declare function themeFromOscColor(data: string): SystemTheme | undefined;
|