@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and while the project is pre-1.0 we treat any 0.x → 0.(x+1) bump as potentially
|
|
7
|
+
breaking.
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **`IterativeArena` — multi-model authoring loop.** Pipeline: tournament v1
|
|
13
|
+
(every participant writes a draft, the author merges anonymized drafts into
|
|
14
|
+
v1) → critique-revise rounds (parallel critics produce anchored critiques
|
|
15
|
+
with severity/category, author rewrites). Two formats out of the box: `code`
|
|
16
|
+
and `document`. Configurable convergence (default: stop when no blockers
|
|
17
|
+
remain and either all critiques are minor/praise or the draft barely moved),
|
|
18
|
+
optional `humanCheckpoint` for interactive use, and `authorRotation` of
|
|
19
|
+
`fixed` / `round-robin` / `best-critic`. Public API exported from
|
|
20
|
+
`src/index.ts`. New types: `IterateConfig`, `IterateResult`, `Draft`,
|
|
21
|
+
`Critique`, `ConvergenceSignal`, `Round`, etc.
|
|
22
|
+
- Use `IterativeArena` to **produce** a draft from scratch (PRD, design doc,
|
|
23
|
+
code module). Use the existing `Arena` to **review** an existing artifact.
|
|
24
|
+
- `eslint.config.js` (ESLint v9 flat config) with typescript-eslint preset.
|
|
25
|
+
- `LICENSE` (MIT) and `CHANGELOG.md` at the repository root.
|
|
26
|
+
- `prepublishOnly` script to run typecheck + tests + build before publish.
|
|
27
|
+
- `node >= 20` engine constraint alongside the existing `bun >= 1.3` hint.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
- TypeScript compilation is now clean (was 50+ errors).
|
|
31
|
+
- Removed zombie `cli/transports/`, `cli/handlers/`, `cli/remoteIO.ts`,
|
|
32
|
+
`cli/structuredIO.ts`, `cli/ndjsonSafeStringify.ts` — these were copied
|
|
33
|
+
from the Claude Code source tree but depended on modules that were never
|
|
34
|
+
ported and had no active callers.
|
|
35
|
+
- `engine/model-facade.ts`: aligned field names with the real `TokenUsage`
|
|
36
|
+
interface (`promptTokens`/`completionTokens`/`cacheCreationTokens`) and
|
|
37
|
+
used `LLMClientBase.model` instead of the non-existent `modelName`.
|
|
38
|
+
- `utils/env.ts`, `ink/termio/osc.ts`, `utils/fullscreen.ts`: small type
|
|
39
|
+
drift fixes.
|
|
40
|
+
- Test suite is green (was 3 failing):
|
|
41
|
+
- Plan-mode tests were asserting an old `plan_file` parameter shape.
|
|
42
|
+
- `estimateTokens` test hard-coded an outdated char→token ratio.
|
|
43
|
+
- `SavePRD` and `LoadTemplate` custom tools in `examples/prd-agent` now reject
|
|
44
|
+
filenames that resolve outside the intended directory (path-traversal fix).
|
|
45
|
+
- `WebFetch` rejects non-HTTP(S) URLs and URLs whose literal hostname matches
|
|
46
|
+
loopback / link-local / RFC1918 / cloud-metadata (`169.254.169.254`) ranges,
|
|
47
|
+
and strips client-supplied `Authorization` / `Cookie` / `Host` headers.
|
|
48
|
+
Note: this does not defeat DNS rebinding or IPv4-decimal (e.g.
|
|
49
|
+
`http://2130706433/`) encoding — a defense-in-depth proxy is still
|
|
50
|
+
recommended for untrusted LLM input.
|
|
51
|
+
- Bash read-only classifier no longer auto-approves commands that contain
|
|
52
|
+
`;`, `&&`, `||`, backticks, `$(...)`, or redirections. Removed `node -e`,
|
|
53
|
+
`python -c`, and `sed -n` from the read-only prefix list — those can execute
|
|
54
|
+
arbitrary code.
|
|
55
|
+
- LSP client (`lsp/client.ts`) now `unref()`s the spawned process, clears its
|
|
56
|
+
per-request 30s timeout on resolve/reject, and fully removes listeners +
|
|
57
|
+
drains pending requests on `shutdown()`.
|
|
58
|
+
- `SessionManager.saveState` performs an atomic `.tmp` → rename instead of a
|
|
59
|
+
bare `writeFileSync`, so two processes writing the same session no longer
|
|
60
|
+
corrupt each other.
|
|
61
|
+
- MCP connect now times out after 15 s so a misbehaving server can't hang the
|
|
62
|
+
whole startup sequence.
|
|
63
|
+
- OpenAI/OpenRouter 401 "Provider returned error" now surfaces a clearer
|
|
64
|
+
message hinting the model may not support function calling on the current
|
|
65
|
+
provider, instead of the opaque SDK message.
|
|
66
|
+
- Context manager `recordActualUsage` is now actually invoked from the turn
|
|
67
|
+
loop after each model response, so the hybrid estimator has real API data
|
|
68
|
+
instead of always falling back to character-count heuristics.
|
|
69
|
+
- `examples/prd-agent/src/chat.ts` picks `openai/gpt-4.1-mini` as the default
|
|
70
|
+
model when using OpenRouter, because `openai/gpt-4o-mini` gets routed to an
|
|
71
|
+
Azure backend that rejects tool calls with 401.
|
|
72
|
+
|
|
73
|
+
### Removed
|
|
74
|
+
- `TodoWrite` tool. It was a 6-line wrapper around `TaskCreate` and its
|
|
75
|
+
presence confused models into using two equivalent interfaces. Use the
|
|
76
|
+
`Task*` family (`TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`, etc.).
|
|
77
|
+
|
|
78
|
+
### Changed
|
|
79
|
+
- Arena research-phase prompts no longer hard-cap output at "exactly 3 to 6
|
|
80
|
+
findings". The new instruction asks for "as many findings as the topic
|
|
81
|
+
warrants — typically 5-15", with each `summary` field expected to be 80+
|
|
82
|
+
words with concrete evidence. Debate-turn prompts likewise replaced
|
|
83
|
+
"Be concise" with a 150-300 word target. This addresses persistent reports
|
|
84
|
+
that Arena output was too thin for non-trivial topics.
|
|
85
|
+
- IterativeArena critics can now use web search via the `enableWebSearch`
|
|
86
|
+
config flag. When enabled (and a SERPER_API_KEY / TAVILY_API_KEY /
|
|
87
|
+
SEARXNG_URL is configured), each critic runs a tool-use loop and may call
|
|
88
|
+
`web_search` / `web_fetch` up to `maxArgueToolRounds` times before
|
|
89
|
+
emitting critiques. New `Critique.evidence` field carries the URLs they
|
|
90
|
+
consulted. New `fabrication` value in `CritiqueCategory`. Format prompts
|
|
91
|
+
(draft / merge / revise / argue, both `code` and `document`) now ban
|
|
92
|
+
invented numbers, citations, and URLs; unknowable specifics must be
|
|
93
|
+
marked `[需调研]` / `[TBD: ...]`.
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
- IterativeArena: `extractTag` now tolerates LLM responses where the
|
|
97
|
+
closing `</v1_content>` / `</v_next_content>` marker is missing (e.g. due
|
|
98
|
+
to max_tokens truncation). Previously the parser fell back to "use the
|
|
99
|
+
whole response as content", which left literal `<v1_content>` text at the
|
|
100
|
+
start of v1.md.
|
|
101
|
+
- IterativeArena: tournament draft / merge / single-author v1 / revise all
|
|
102
|
+
now request `maxTokens: 32000`. The previous 8k default truncated
|
|
103
|
+
long-form drafts mid-sentence and broke downstream parsing.
|
|
104
|
+
- IterativeArena: convergence no longer treats "zero critiques" as
|
|
105
|
+
"all_minor_or_praise". Zero is almost always a parsing or timeout
|
|
106
|
+
failure on the critic side, not a sign the draft is done. The loop now
|
|
107
|
+
continues to the next round (and naturally stops at `maxRounds`).
|
|
108
|
+
Convergence also requires at least 3 critiques before declaring success
|
|
109
|
+
on the "no blockers / no majors" branch.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 maki maki
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# CodeShell
|
|
2
|
+
|
|
3
|
+
CodeShell is a general-purpose AI agent orchestration framework for terminal and headless workflows.
|
|
4
|
+
|
|
5
|
+
It now ships with built-in presets:
|
|
6
|
+
|
|
7
|
+
- `general`: a domain-agnostic orchestrator for research, automation, operations, and long-running tasks
|
|
8
|
+
- `terminal-coding`: a coding-focused terminal assistant built on top of the same core engine
|
|
9
|
+
|
|
10
|
+
The important part is that the core is no longer tied to software engineering. The turn loop, context management, permissions, MCP integration, hooks, tasks, cron, and sub-agents stay generic; coding behavior is expressed as a preset.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
### Core engine
|
|
15
|
+
|
|
16
|
+
- Turn-based agent loop with streaming output
|
|
17
|
+
- Context compaction and session persistence
|
|
18
|
+
- Permission-gated tool execution
|
|
19
|
+
- Hook pipeline and MCP integration
|
|
20
|
+
- Task tracking, sub-agents, sleep, and cron tools for long-running workflows
|
|
21
|
+
|
|
22
|
+
### Presets
|
|
23
|
+
|
|
24
|
+
- `general` for orchestration-heavy work
|
|
25
|
+
- `terminal-coding` for terminal-native code editing and code navigation
|
|
26
|
+
- Configurable prompt and built-in tool selection through settings or the programmatic API
|
|
27
|
+
|
|
28
|
+
### Terminal UX
|
|
29
|
+
|
|
30
|
+
- Interactive REPL built with Ink
|
|
31
|
+
- Headless `run` mode for one-shot execution
|
|
32
|
+
- Session resume and cost tracking
|
|
33
|
+
|
|
34
|
+
## Quick start
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Default CLI preset: terminal coding assistant
|
|
38
|
+
npx @cjhyy/code-shell
|
|
39
|
+
|
|
40
|
+
# Run the same framework as a general orchestrator
|
|
41
|
+
npx @cjhyy/code-shell --preset general
|
|
42
|
+
|
|
43
|
+
# One-shot execution with the general preset
|
|
44
|
+
npx @cjhyy/code-shell run --preset general "Create a long-running research plan and track it with tasks"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Programmatic API
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { Engine } from "@cjhyy/code-shell";
|
|
51
|
+
|
|
52
|
+
const generalEngine = new Engine({
|
|
53
|
+
llm: {
|
|
54
|
+
provider: "openai",
|
|
55
|
+
model: "gpt-4.1",
|
|
56
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
57
|
+
},
|
|
58
|
+
preset: "general",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const codingEngine = new Engine({
|
|
62
|
+
llm: {
|
|
63
|
+
provider: "openai",
|
|
64
|
+
model: "gpt-4.1",
|
|
65
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
66
|
+
},
|
|
67
|
+
preset: "terminal-coding",
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Subpath imports
|
|
72
|
+
|
|
73
|
+
Pull only what you need:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { RunManager, FileRunStore } from "@cjhyy/code-shell/run";
|
|
77
|
+
import { Arena, IterativeArena } from "@cjhyy/code-shell/arena";
|
|
78
|
+
import { defineProduct } from "@cjhyy/code-shell/product";
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
CLI preset selection:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
npx @cjhyy/code-shell --preset general
|
|
87
|
+
npx @cjhyy/code-shell --preset terminal-coding
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Settings-based configuration:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"agent": {
|
|
95
|
+
"preset": "general",
|
|
96
|
+
"enabledBuiltinTools": ["LSP"],
|
|
97
|
+
"disabledBuiltinTools": ["WebSearch"],
|
|
98
|
+
"appendSystemPrompt": "Prefer long-horizon planning and keep task state updated."
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Supported `agent` settings:
|
|
104
|
+
|
|
105
|
+
- `preset`
|
|
106
|
+
- `enabledBuiltinTools`
|
|
107
|
+
- `disabledBuiltinTools`
|
|
108
|
+
- `customSystemPrompt`
|
|
109
|
+
- `appendSystemPrompt`
|
|
110
|
+
|
|
111
|
+
## Built-in presets
|
|
112
|
+
|
|
113
|
+
| Preset | Purpose | Extra tools |
|
|
114
|
+
|------|------|------|
|
|
115
|
+
| `general` | General orchestration, research, automation, long-running work | Core orchestration tools only |
|
|
116
|
+
| `terminal-coding` | Terminal coding assistant | `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`, `Brief` |
|
|
117
|
+
|
|
118
|
+
## Built-in tools
|
|
119
|
+
|
|
120
|
+
The framework keeps a broad orchestration toolbox available, including:
|
|
121
|
+
|
|
122
|
+
- File tools: `Read`, `Write`, `Edit`, `Glob`, `Grep`
|
|
123
|
+
- Execution tools: `Bash`, `PowerShell`, `REPL`
|
|
124
|
+
- Coordination tools: `TaskCreate`, `TaskUpdate`, `TaskList`, `TaskGet`, `TaskOutput`, `Agent`, `SendMessage`, `Sleep`
|
|
125
|
+
- Planning/runtime tools: `EnterPlanMode`, `ExitPlanMode`, `CronCreate`, `CronDelete`, `CronList`
|
|
126
|
+
- Discovery/integration tools: `ToolSearch`, `Skill`, `MCPTool`, `ListMcpResources`, `ReadMcpResource`
|
|
127
|
+
- Coding-only preset extras: `EnterWorktree`, `ExitWorktree`, `NotebookEdit`, `LSP`
|
|
128
|
+
|
|
129
|
+
## Architecture
|
|
130
|
+
|
|
131
|
+
```text
|
|
132
|
+
User / CLI / SDK
|
|
133
|
+
-> Engine
|
|
134
|
+
-> Preset resolution (prompt + default tools + default permission shortcuts)
|
|
135
|
+
-> TurnLoop
|
|
136
|
+
-> ModelFacade
|
|
137
|
+
-> ToolExecutor
|
|
138
|
+
-> ContextManager
|
|
139
|
+
-> Hooks / MCP / Tasks / Sessions
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Design principles:
|
|
143
|
+
|
|
144
|
+
- Core first: orchestration engine stays domain-agnostic
|
|
145
|
+
- Presets over hardcoding: coding behavior lives in configuration
|
|
146
|
+
- Secure by default: permission-gated actions and explicit approval flow
|
|
147
|
+
- Long-running ready: tasks, cron, sleep, and sub-agents are first-class
|
|
148
|
+
|
|
149
|
+
## Further Reading
|
|
150
|
+
|
|
151
|
+
- [CodeShell 当前架构与定位说明](docs/codeshell-repo-architecture.md)
|
|
152
|
+
|
|
153
|
+
## Project structure
|
|
154
|
+
|
|
155
|
+
```text
|
|
156
|
+
src/
|
|
157
|
+
├── cli/ # CLI entrypoints and terminal UI
|
|
158
|
+
├── context/ # Context compaction and window management
|
|
159
|
+
├── engine/ # Turn loop orchestration
|
|
160
|
+
├── hooks/ # Hook chain
|
|
161
|
+
├── llm/ # Model providers
|
|
162
|
+
├── preset/ # Built-in agent presets
|
|
163
|
+
├── prompt/ # Prompt composition
|
|
164
|
+
├── session/ # Session persistence and memory
|
|
165
|
+
├── tool/ # Tool registry, execution, permissions, MCP
|
|
166
|
+
└── index.ts # Public API exports
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Development
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
bun install
|
|
173
|
+
bun run build
|
|
174
|
+
bun run tsc --noEmit
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`bun run tsc --noEmit` currently reports many pre-existing repo-wide issues outside the preset/framework changes, so treat typecheck as a global health signal rather than a clean gate for just this slice.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent coordinator — agent registry + message bus for multi-agent communication.
|
|
3
|
+
*/
|
|
4
|
+
/** A registered named agent. */
|
|
5
|
+
export interface AgentInfo {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
status: "running" | "completed" | "failed";
|
|
9
|
+
description: string;
|
|
10
|
+
startedAt: number;
|
|
11
|
+
completedAt?: number;
|
|
12
|
+
result?: string;
|
|
13
|
+
}
|
|
14
|
+
/** A message between agents. */
|
|
15
|
+
export interface AgentMessage {
|
|
16
|
+
from: string;
|
|
17
|
+
to: string;
|
|
18
|
+
content: string;
|
|
19
|
+
timestamp: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Singleton agent registry and message bus.
|
|
23
|
+
*/
|
|
24
|
+
declare class AgentCoordinator {
|
|
25
|
+
private agents;
|
|
26
|
+
private inbox;
|
|
27
|
+
/** Register a named agent. */
|
|
28
|
+
register(id: string, name: string, description: string): void;
|
|
29
|
+
/** Mark an agent as completed. */
|
|
30
|
+
complete(name: string, result?: string): void;
|
|
31
|
+
/** Mark an agent as failed. */
|
|
32
|
+
fail(name: string): void;
|
|
33
|
+
/** Get agent info by name. */
|
|
34
|
+
get(name: string): AgentInfo | undefined;
|
|
35
|
+
/** List all agents. */
|
|
36
|
+
list(): AgentInfo[];
|
|
37
|
+
/** List active (running) agents. */
|
|
38
|
+
listActive(): AgentInfo[];
|
|
39
|
+
/** Send a message to a named agent. */
|
|
40
|
+
send(from: string, to: string, content: string): boolean;
|
|
41
|
+
/** Read messages for a named agent (drains the inbox). */
|
|
42
|
+
receive(name: string): AgentMessage[];
|
|
43
|
+
/** Peek at messages without draining. */
|
|
44
|
+
peek(name: string): AgentMessage[];
|
|
45
|
+
/** Reset all state. */
|
|
46
|
+
reset(): void;
|
|
47
|
+
}
|
|
48
|
+
export declare const agentCoordinator: AgentCoordinator;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkZJV3YSY3cjs = require('./chunk-ZJV3YSY3.cjs');
|
|
4
|
+
require('./chunk-DICG4AB7.cjs');
|
|
5
|
+
require('./chunk-EL2RL5DG.cjs');
|
|
6
|
+
require('./chunk-IJSHQGMP.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.AnthropicClient = _chunkZJV3YSY3cjs.AnthropicClient;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arena — multi-model collaborative analysis engine.
|
|
3
|
+
*
|
|
4
|
+
* Evidence-Driven Pipeline:
|
|
5
|
+
* 0. Planner → understand what the user wants (mode, lenses, sources)
|
|
6
|
+
* 1. EvidenceProviders → collect artifacts from selected sources
|
|
7
|
+
* 2. Strategy + Lens → compose prompts (mode flow + perspective)
|
|
8
|
+
* 3. ToolSelector → determine which tools participants can use
|
|
9
|
+
* 4. ParticipantResearch → each model investigates independently (parallel)
|
|
10
|
+
* 4b. ClaimRegistry → register findings as claims, populate ledger
|
|
11
|
+
* 5. VerificationReview → claim-aware cross-review with evidence digests
|
|
12
|
+
* 7. DebateRounds → contested claims enter structured debate
|
|
13
|
+
* 8. Adjudication → moderator rules on contested claims
|
|
14
|
+
* 6. ConsensusBuilder → claim-aware structured consensus
|
|
15
|
+
*/
|
|
16
|
+
import type { ArenaConfig, ArenaResultV2 } from "./types.js";
|
|
17
|
+
import type { PlannerFlags } from "./planner.js";
|
|
18
|
+
export declare class Arena {
|
|
19
|
+
private config;
|
|
20
|
+
private strategy;
|
|
21
|
+
private limits;
|
|
22
|
+
constructor(config: ArenaConfig);
|
|
23
|
+
/**
|
|
24
|
+
* Run a full arena session.
|
|
25
|
+
*
|
|
26
|
+
* @param topic - User's topic/request (natural language)
|
|
27
|
+
* @param flags - Optional explicit overrides (mode, base, head)
|
|
28
|
+
*/
|
|
29
|
+
run(topic: string, flags?: PlannerFlags): Promise<ArenaResultV2>;
|
|
30
|
+
/**
|
|
31
|
+
* Planning path: merge-oriented review → roadmap consensus → detail expansion.
|
|
32
|
+
*
|
|
33
|
+
* Planning mode does NOT enter heavy debate/adjudication. Contested findings
|
|
34
|
+
* are converted to open questions or dependency risks in the roadmap.
|
|
35
|
+
*/
|
|
36
|
+
private runPlanningPath;
|
|
37
|
+
/**
|
|
38
|
+
* Review/Discussion path: verification review → debate → adjudication → consensus.
|
|
39
|
+
*
|
|
40
|
+
* This is the heavy trust loop for claim verification.
|
|
41
|
+
*/
|
|
42
|
+
private runReviewDiscussionPath;
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context tools — read-only tools that arena participants can use
|
|
3
|
+
* to fetch additional source context during research.
|
|
4
|
+
*
|
|
5
|
+
* Security: All shell commands use execFileSync with argument arrays
|
|
6
|
+
* to prevent command injection. File paths are validated against the
|
|
7
|
+
* repository boundary to prevent path traversal.
|
|
8
|
+
*/
|
|
9
|
+
import type { ToolDefinition, ToolCall } from "../../types.js";
|
|
10
|
+
export declare const MAX_TOOL_RESULT = 15000;
|
|
11
|
+
export declare const MAX_TOOL_ROUNDS = 5;
|
|
12
|
+
export declare const CONTEXT_TOOLS: ToolDefinition[];
|
|
13
|
+
/**
|
|
14
|
+
* Execute a context tool call and return the result string.
|
|
15
|
+
*/
|
|
16
|
+
export declare function executeContextTool(tc: ToolCall): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arena mode auto-detection — infer review/discussion/planning from topic text.
|
|
3
|
+
*
|
|
4
|
+
* Heuristic-based: uses keyword matching with weighted scoring.
|
|
5
|
+
* Falls back to "review" (safest default) when confidence is low.
|
|
6
|
+
*/
|
|
7
|
+
import type { ArenaMode } from "./types.js";
|
|
8
|
+
/** Result of heuristic mode detection */
|
|
9
|
+
export interface ArenaModeDetection {
|
|
10
|
+
mode: ArenaMode;
|
|
11
|
+
confidence: "high" | "low";
|
|
12
|
+
reason: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Auto-detect arena mode from the topic string.
|
|
16
|
+
*
|
|
17
|
+
* Returns the detected mode, confidence level, and a human-readable reason.
|
|
18
|
+
* When confidence is low, falls back to "review" (the safest default).
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectArenaMode(topic: string): ArenaModeDetection;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DigestBuilder — constructs RoundResearchDigest from the shared ledger.
|
|
3
|
+
*
|
|
4
|
+
* The digest is a filtered view injected into prompts to avoid
|
|
5
|
+
* token explosion from the full ledger. Program-built, not model-built.
|
|
6
|
+
*/
|
|
7
|
+
import type { ArenaLedger } from "./ledger.js";
|
|
8
|
+
import type { RoundResearchDigest } from "./types.js";
|
|
9
|
+
interface DigestOptions {
|
|
10
|
+
/** Current round number */
|
|
11
|
+
round: number;
|
|
12
|
+
/** Claim IDs relevant to this round (e.g. contested claims in debate) */
|
|
13
|
+
relevantClaimIds: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Build a digest from the shared ledger for a specific round.
|
|
17
|
+
* Only includes data relevant to the specified claims.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildDigest(ledger: ArenaLedger, options: DigestOptions): RoundResearchDigest;
|
|
20
|
+
/**
|
|
21
|
+
* Format a digest into a text block suitable for prompt injection.
|
|
22
|
+
* All LLM-originated text is sanitized before inclusion.
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatDigest(digest: RoundResearchDigest): string;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunk3EUDE77Ecjs = require('../chunk-3EUDE77E.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var _chunkFVP7XJGScjs = require('../chunk-FVP7XJGS.cjs');
|
|
52
|
+
require('../chunk-IMMTBZ33.cjs');
|
|
53
|
+
require('../chunk-EL2RL5DG.cjs');
|
|
54
|
+
require('../chunk-IJSHQGMP.cjs');
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
exports.Arena = _chunkFVP7XJGScjs.Arena; exports.ArenaLedger = _chunkFVP7XJGScjs.ArenaLedger; exports.DiscussionStrategy = _chunkFVP7XJGScjs.DiscussionStrategy; exports.IterativeArena = _chunk3EUDE77Ecjs.IterativeArena; exports.LENS_NAMES = _chunkFVP7XJGScjs.LENS_NAMES; exports.MODEL_PRESETS = _chunkFVP7XJGScjs.MODEL_PRESETS; exports.PlanningStrategy = _chunkFVP7XJGScjs.PlanningStrategy; exports.ReviewStrategy = _chunkFVP7XJGScjs.ReviewStrategy; exports.applyReviewResult = _chunkFVP7XJGScjs.applyReviewResult; exports.buildConsensus = _chunkFVP7XJGScjs.buildConsensus; exports.buildDigest = _chunkFVP7XJGScjs.buildDigest; exports.buildLensPrompt = _chunkFVP7XJGScjs.buildLensPrompt; exports.collectEvidence = _chunkFVP7XJGScjs.collectEvidence; exports.createProgressRenderer = _chunkFVP7XJGScjs.createProgressRenderer; exports.defaultIterateConvergence = _chunk3EUDE77Ecjs.defaultConvergence; exports.formatArenaResult = _chunkFVP7XJGScjs.formatArenaResult; exports.formatArenaResultForSession = _chunkFVP7XJGScjs.formatArenaResultForSession; exports.formatDigest = _chunkFVP7XJGScjs.formatDigest; exports.getIterateFormat = _chunk3EUDE77Ecjs.getFormat; exports.getLens = _chunkFVP7XJGScjs.getLens; exports.getMaxOutputTokens = _chunkFVP7XJGScjs.getMaxOutputTokens; exports.getStrategy = _chunkFVP7XJGScjs.getStrategy; exports.getStrategyForPlan = _chunkFVP7XJGScjs.getStrategyForPlan; exports.hasTools = _chunkFVP7XJGScjs.hasTools; exports.isStrategyV2 = _chunkFVP7XJGScjs.isStrategyV2; exports.isTerminal = _chunkFVP7XJGScjs.isTerminal; exports.iterateCodeFormat = _chunk3EUDE77Ecjs.codeFormat; exports.iterateDiffRatio = _chunk3EUDE77Ecjs.diffRatio; exports.iterateDocumentFormat = _chunk3EUDE77Ecjs.documentFormat; exports.markUnderReview = _chunkFVP7XJGScjs.markUnderReview; exports.markUnresolved = _chunkFVP7XJGScjs.markUnresolved; exports.planArena = _chunkFVP7XJGScjs.planArena; exports.printArenaResult = _chunkFVP7XJGScjs.printArenaResult; exports.registerClaims = _chunkFVP7XJGScjs.registerClaims; exports.renderProgress = _chunkFVP7XJGScjs.renderProgress; exports.resolveClaimStatus = _chunkFVP7XJGScjs.resolveClaimStatus; exports.resolveLenses = _chunkFVP7XJGScjs.resolveLenses; exports.runAdjudication = _chunkFVP7XJGScjs.runAdjudication; exports.runCrossReview = _chunkFVP7XJGScjs.runCrossReview; exports.runDebateRounds = _chunkFVP7XJGScjs.runDebateRounds; exports.runParticipantResearch = _chunkFVP7XJGScjs.runParticipantResearch; exports.runParticipantResearchWithDossiers = _chunkFVP7XJGScjs.runParticipantResearchWithDossiers; exports.runVerificationReview = _chunkFVP7XJGScjs.runVerificationReview; exports.selectClaimsForReview = _chunkFVP7XJGScjs.selectClaimsForReview; exports.selectTools = _chunkFVP7XJGScjs.selectTools; exports.transitionClaim = _chunkFVP7XJGScjs.transitionClaim; exports.validTransitions = _chunkFVP7XJGScjs.validTransitions;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arena — multi-model collaborative analysis (Evidence-Driven).
|
|
3
|
+
*/
|
|
4
|
+
export { Arena } from "./arena.js";
|
|
5
|
+
export { MODEL_PRESETS, getMaxOutputTokens } from "./model-presets.js";
|
|
6
|
+
export type { ModelPreset } from "./model-presets.js";
|
|
7
|
+
export { getStrategy, getStrategyForPlan, ReviewStrategy, DiscussionStrategy, PlanningStrategy } from "./strategies/index.js";
|
|
8
|
+
export { planArena } from "./planner.js";
|
|
9
|
+
export { collectEvidence } from "./providers/index.js";
|
|
10
|
+
export { selectTools, hasTools } from "./tools/selector.js";
|
|
11
|
+
export { getLens, resolveLenses, buildLensPrompt, LENS_NAMES } from "./lenses/index.js";
|
|
12
|
+
export { runParticipantResearch, runParticipantResearchWithDossiers } from "./phases/participant-research.js";
|
|
13
|
+
export type { ResearchResult } from "./phases/participant-research.js";
|
|
14
|
+
export { runCrossReview, runVerificationReview } from "./phases/cross-review.js";
|
|
15
|
+
export { runDebateRounds } from "./phases/debate-rounds.js";
|
|
16
|
+
export { runAdjudication } from "./phases/adjudication.js";
|
|
17
|
+
export { buildConsensus } from "./phases/build-consensus.js";
|
|
18
|
+
export { registerClaims, selectClaimsForReview } from "./phases/claim-registry.js";
|
|
19
|
+
export { ArenaLedger } from "./ledger.js";
|
|
20
|
+
export { buildDigest, formatDigest } from "./digest-builder.js";
|
|
21
|
+
export { transitionClaim, resolveClaimStatus, markUnderReview, applyReviewResult, markUnresolved, isTerminal, validTransitions, } from "./transitions.js";
|
|
22
|
+
export { formatArenaResult, printArenaResult, renderProgress, createProgressRenderer } from "./render/terminal.js";
|
|
23
|
+
export type { OutputSink } from "./render/terminal.js";
|
|
24
|
+
export { formatArenaResultForSession } from "./render/session.js";
|
|
25
|
+
export type { ArenaConfig, ArenaResultV2, ArenaStrategy, ArenaStrategyV2, ClaimStatusSummary, ArenaParticipant, ArenaBaseContext, ArenaFinding, FindingReview, ParticipantReport, ArenaConsensus, ArenaConsensusItem, ArenaRoadmapPhase, ArenaProgressEvent, ArenaMode, FindingKind, PeerVerdict, ArenaPlan, ArenaLens, ArenaLensName, ArenaLensRef, ArenaSourceKind, ArenaSourceSpec, ArenaSubject, ArenaOutputShape, ArenaArtifact, ArenaToolPack, ArenaContextProvider, ArenaQuickFact, ToolTrace, EvidencePacket, FindingEvidenceLink, ResearchDossier, ClaimStatus, ClaimRecord, ClaimChallenge, ClaimAdjudication, RequestedCheck, DebateRound, DebateTurn, TargetedCheckTask, SharedResearchLedger, RoundResearchDigest, ArenaExecutionLimits, } from "./types.js";
|
|
26
|
+
export { isStrategyV2 } from "./types.js";
|
|
27
|
+
export { IterativeArena } from "./iterate/index.js";
|
|
28
|
+
export { defaultConvergence as defaultIterateConvergence, diffRatio as iterateDiffRatio, codeFormat as iterateCodeFormat, documentFormat as iterateDocumentFormat, getFormat as getIterateFormat, } from "./iterate/index.js";
|
|
29
|
+
export type { AuthorRotation, CheckpointAction, CheckpointContext, CheckpointFn, ConvergenceSignal, Critique, CritiqueCategory, CritiqueEvidence, CritiqueSeverity, Draft, DraftCandidate, IterateConfig, IterateFormat, IterateProgressEvent, IterateResult, IterateSubject, Round, StoppedReason, FormatPack as IterateFormatPack, } from "./iterate/index.js";
|