@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,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run — managed lifecycle types for long-running agent tasks.
|
|
3
|
+
*
|
|
4
|
+
* A Run wraps one or more Engine executions with queue, state machine,
|
|
5
|
+
* checkpoint, approval, and artifact tracking.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentPresetName } from "../preset/index.js";
|
|
8
|
+
export type RunStatus = "queued" | "running" | "waiting_input" | "waiting_approval" | "blocked" | "completed" | "failed" | "cancelled";
|
|
9
|
+
export interface RunSnapshot {
|
|
10
|
+
runId: string;
|
|
11
|
+
objective: string;
|
|
12
|
+
preset: AgentPresetName;
|
|
13
|
+
cwd: string;
|
|
14
|
+
status: RunStatus;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
updatedAt: number;
|
|
17
|
+
startedAt: number | null;
|
|
18
|
+
finishedAt: number | null;
|
|
19
|
+
parentRunId: string | null;
|
|
20
|
+
sessionId: string | null;
|
|
21
|
+
childSessionIds: string[];
|
|
22
|
+
attemptCount: number;
|
|
23
|
+
latestCheckpointId: string | null;
|
|
24
|
+
latestApprovalId: string | null;
|
|
25
|
+
summary: string | null;
|
|
26
|
+
error: string | null;
|
|
27
|
+
tags: string[];
|
|
28
|
+
metadata: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export type RunEventType = "run_created" | "run_queued" | "run_started" | "session_linked" | "checkpoint_written" | "artifact_recorded" | "approval_requested" | "approval_resolved" | "run_blocked" | "run_resumed" | "run_completed" | "run_failed" | "run_cancelled";
|
|
31
|
+
export interface RunEvent {
|
|
32
|
+
eventId: string;
|
|
33
|
+
runId: string;
|
|
34
|
+
type: RunEventType;
|
|
35
|
+
timestamp: number;
|
|
36
|
+
data: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
export interface RunCheckpoint {
|
|
39
|
+
checkpointId: string;
|
|
40
|
+
runId: string;
|
|
41
|
+
createdAt: number;
|
|
42
|
+
phase: string;
|
|
43
|
+
objective: string;
|
|
44
|
+
summary: string;
|
|
45
|
+
nextAction: string | null;
|
|
46
|
+
linkedSessionId: string | null;
|
|
47
|
+
touchedTools: string[];
|
|
48
|
+
touchedArtifacts: string[];
|
|
49
|
+
waitingFor: null | {
|
|
50
|
+
kind: "input";
|
|
51
|
+
prompt: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: "approval";
|
|
54
|
+
approvalId: string;
|
|
55
|
+
};
|
|
56
|
+
evaluator: null | {
|
|
57
|
+
status: "pending" | "passed" | "failed";
|
|
58
|
+
findings: string[];
|
|
59
|
+
};
|
|
60
|
+
metadata: Record<string, unknown>;
|
|
61
|
+
}
|
|
62
|
+
export type ApprovalStatus = "pending" | "approved" | "rejected";
|
|
63
|
+
export type ApprovalCategory = "tool" | "artifact_publish" | "workflow_transition" | "custom";
|
|
64
|
+
export interface RunApproval {
|
|
65
|
+
approvalId: string;
|
|
66
|
+
runId: string;
|
|
67
|
+
createdAt: number;
|
|
68
|
+
resolvedAt: number | null;
|
|
69
|
+
status: ApprovalStatus;
|
|
70
|
+
category: ApprovalCategory;
|
|
71
|
+
title: string;
|
|
72
|
+
description: string;
|
|
73
|
+
payload: Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
export type ArtifactKind = "file" | "document" | "diagram" | "prototype" | "resource" | "custom";
|
|
76
|
+
export type ArtifactRole = "input" | "output" | "checkpoint" | "supporting";
|
|
77
|
+
export interface RunArtifactRef {
|
|
78
|
+
artifactRefId: string;
|
|
79
|
+
runId: string;
|
|
80
|
+
kind: ArtifactKind;
|
|
81
|
+
title: string;
|
|
82
|
+
locator: string;
|
|
83
|
+
role: ArtifactRole;
|
|
84
|
+
version: string | null;
|
|
85
|
+
metadata: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
export interface SubmitRunInput {
|
|
88
|
+
objective: string;
|
|
89
|
+
preset?: AgentPresetName;
|
|
90
|
+
cwd?: string;
|
|
91
|
+
parentRunId?: string;
|
|
92
|
+
tags?: string[];
|
|
93
|
+
metadata?: Record<string, unknown>;
|
|
94
|
+
}
|
|
95
|
+
export interface ResumeRunInput {
|
|
96
|
+
userInput?: string;
|
|
97
|
+
approvalDecision?: {
|
|
98
|
+
approvalId: string;
|
|
99
|
+
approved: boolean;
|
|
100
|
+
reason?: string;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export interface ListRunsQuery {
|
|
104
|
+
status?: RunStatus | RunStatus[];
|
|
105
|
+
tag?: string;
|
|
106
|
+
limit?: number;
|
|
107
|
+
offset?: number;
|
|
108
|
+
}
|
|
109
|
+
export interface RunExecutionContext {
|
|
110
|
+
onStream?: import("../types.js").StreamCallback;
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
engineConfigOverrides?: Record<string, unknown>;
|
|
113
|
+
}
|
|
114
|
+
export interface RunExecutionResult {
|
|
115
|
+
text: string;
|
|
116
|
+
reason: import("../types.js").TerminalReason;
|
|
117
|
+
sessionId: string;
|
|
118
|
+
turnCount: number;
|
|
119
|
+
}
|
|
120
|
+
export type RunStreamEvent = {
|
|
121
|
+
type: "run_status_changed";
|
|
122
|
+
run: RunSnapshot;
|
|
123
|
+
} | {
|
|
124
|
+
type: "run_event";
|
|
125
|
+
event: RunEvent;
|
|
126
|
+
} | {
|
|
127
|
+
type: "engine_stream";
|
|
128
|
+
event: import("../types.js").StreamEvent;
|
|
129
|
+
};
|
|
130
|
+
export type RunStreamCallback = (event: RunStreamEvent) => void | Promise<void>;
|
|
131
|
+
export type DetachFn = () => void;
|
|
132
|
+
/**
|
|
133
|
+
* Valid state transitions for a Run.
|
|
134
|
+
* Key = current status, Value = allowed next statuses.
|
|
135
|
+
*/
|
|
136
|
+
export declare const VALID_TRANSITIONS: Record<RunStatus, RunStatus[]>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Analytics service — event tracking and telemetry.
|
|
3
|
+
*
|
|
4
|
+
* Provides a lightweight analytics pipeline that queues events
|
|
5
|
+
* and flushes them to configured sinks (file, console, or remote).
|
|
6
|
+
*/
|
|
7
|
+
export interface AnalyticsEvent {
|
|
8
|
+
name: string;
|
|
9
|
+
properties?: Record<string, unknown>;
|
|
10
|
+
timestamp?: string;
|
|
11
|
+
}
|
|
12
|
+
type AnalyticsSink = (events: AnalyticsEvent[]) => void;
|
|
13
|
+
declare class AnalyticsService {
|
|
14
|
+
private queue;
|
|
15
|
+
private sinks;
|
|
16
|
+
private flushTimer;
|
|
17
|
+
private initialized;
|
|
18
|
+
/**
|
|
19
|
+
* Initialize the analytics service with default file sink.
|
|
20
|
+
*/
|
|
21
|
+
init(): void;
|
|
22
|
+
addSink(sink: AnalyticsSink): void;
|
|
23
|
+
track(name: string, properties?: Record<string, unknown>): void;
|
|
24
|
+
flush(): void;
|
|
25
|
+
shutdown(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare const analytics: AnalyticsService;
|
|
28
|
+
export declare function trackEvent(name: string, properties?: Record<string, unknown>): void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AutoDream service — background memory consolidation.
|
|
3
|
+
*
|
|
4
|
+
* Periodically consolidates and organizes memories using the LLM,
|
|
5
|
+
* similar to the /dream command but running automatically.
|
|
6
|
+
*/
|
|
7
|
+
export interface AutoDreamConfig {
|
|
8
|
+
/** Minimum sessions between dream runs */
|
|
9
|
+
minSessionsBetween: number;
|
|
10
|
+
/** Minimum time between dream runs (ms) */
|
|
11
|
+
minTimeBetween: number;
|
|
12
|
+
/** Whether auto-dream is enabled */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Check if auto-dream should run.
|
|
17
|
+
*/
|
|
18
|
+
export declare function shouldAutoDream(config?: AutoDreamConfig): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Record that a session was completed (increment counter).
|
|
21
|
+
*/
|
|
22
|
+
export declare function recordSession(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Record that a dream run completed.
|
|
25
|
+
*/
|
|
26
|
+
export declare function recordDreamComplete(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Build the consolidation prompt for auto-dream.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildDreamPrompt(memories: Array<{
|
|
31
|
+
name: string;
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
content: string;
|
|
35
|
+
}>): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compaction service — context window management and auto-compaction.
|
|
3
|
+
*
|
|
4
|
+
* Provides microcompact (inline trimming), autocompact (threshold-based),
|
|
5
|
+
* and full compaction (LLM-based summarization) strategies.
|
|
6
|
+
*/
|
|
7
|
+
export interface CompactionConfig {
|
|
8
|
+
/** Max context tokens before triggering auto-compaction */
|
|
9
|
+
autoCompactThreshold: number;
|
|
10
|
+
/** Percentage of context to retain after compaction (0-1) */
|
|
11
|
+
retentionRatio: number;
|
|
12
|
+
/** Whether to preserve system messages during compaction */
|
|
13
|
+
preserveSystemMessages: boolean;
|
|
14
|
+
/** Whether auto-compaction is enabled */
|
|
15
|
+
autoCompactEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CompactionResult {
|
|
18
|
+
/** Summary text that replaces the compacted content */
|
|
19
|
+
summary: string;
|
|
20
|
+
/** Number of messages removed */
|
|
21
|
+
messagesRemoved: number;
|
|
22
|
+
/** Tokens freed */
|
|
23
|
+
tokensFreed: number;
|
|
24
|
+
/** Strategy used */
|
|
25
|
+
strategy: "micro" | "auto" | "full";
|
|
26
|
+
}
|
|
27
|
+
export interface Message {
|
|
28
|
+
role: string;
|
|
29
|
+
content: string | unknown[];
|
|
30
|
+
tokenEstimate?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Micro-compaction: trim tool results and long messages inline.
|
|
34
|
+
*/
|
|
35
|
+
export declare function microCompact(messages: Message[], maxTokensPerMessage?: number): Message[];
|
|
36
|
+
/**
|
|
37
|
+
* Check if auto-compaction should be triggered.
|
|
38
|
+
*/
|
|
39
|
+
export declare function shouldAutoCompact(currentTokens: number, config?: CompactionConfig): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Build a compaction prompt for LLM-based summarization.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildCompactionPrompt(messages: Message[], customInstructions?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Apply compaction by removing old messages and inserting a summary.
|
|
46
|
+
*/
|
|
47
|
+
export declare function applyCompaction(messages: Message[], summary: string, config?: CompactionConfig): {
|
|
48
|
+
messages: Message[];
|
|
49
|
+
result: CompactionResult;
|
|
50
|
+
};
|
|
51
|
+
export declare const compactionService: {
|
|
52
|
+
microCompact: typeof microCompact;
|
|
53
|
+
shouldAutoCompact: typeof shouldAutoCompact;
|
|
54
|
+
buildCompactionPrompt: typeof buildCompactionPrompt;
|
|
55
|
+
applyCompaction: typeof applyCompaction;
|
|
56
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Diagnostics service — error tracking and system health monitoring.
|
|
3
|
+
*
|
|
4
|
+
* Collects and reports diagnostic information for debugging.
|
|
5
|
+
*/
|
|
6
|
+
export interface DiagnosticEntry {
|
|
7
|
+
timestamp: string;
|
|
8
|
+
level: "error" | "warn" | "info";
|
|
9
|
+
category: string;
|
|
10
|
+
message: string;
|
|
11
|
+
metadata?: Record<string, unknown>;
|
|
12
|
+
stack?: string;
|
|
13
|
+
}
|
|
14
|
+
declare class DiagnosticsTracker {
|
|
15
|
+
private logDir;
|
|
16
|
+
private entries;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Record a diagnostic event.
|
|
20
|
+
*/
|
|
21
|
+
record(level: DiagnosticEntry["level"], category: string, message: string, metadata?: Record<string, unknown>): void;
|
|
22
|
+
/**
|
|
23
|
+
* Record an error with stack trace.
|
|
24
|
+
*/
|
|
25
|
+
recordError(category: string, error: Error, metadata?: Record<string, unknown>): void;
|
|
26
|
+
/**
|
|
27
|
+
* Get recent diagnostic entries.
|
|
28
|
+
*/
|
|
29
|
+
getRecent(count?: number): DiagnosticEntry[];
|
|
30
|
+
/**
|
|
31
|
+
* Get entries by category.
|
|
32
|
+
*/
|
|
33
|
+
getByCategory(category: string): DiagnosticEntry[];
|
|
34
|
+
/**
|
|
35
|
+
* Generate a diagnostic report for troubleshooting.
|
|
36
|
+
*/
|
|
37
|
+
generateReport(): string;
|
|
38
|
+
private persist;
|
|
39
|
+
}
|
|
40
|
+
export declare const diagnostics: DiagnosticsTracker;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract Memories service — extract durable memories from session transcripts.
|
|
3
|
+
*
|
|
4
|
+
* Runs at the end of a query loop to identify important information
|
|
5
|
+
* worth persisting across sessions.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExtractedMemory {
|
|
8
|
+
type: "user" | "feedback" | "project" | "reference";
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
content: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Build the prompt for extracting memories from a conversation.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildExtractionPrompt(transcript: Array<{
|
|
17
|
+
role: string;
|
|
18
|
+
content: string;
|
|
19
|
+
}>, existingMemories: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Parse extracted memories from LLM response.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseExtractionResponse(response: string): ExtractedMemory[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Services index — re-exports all service modules.
|
|
3
|
+
*/
|
|
4
|
+
export { analytics, trackEvent } from "./analytics.js";
|
|
5
|
+
export { compactionService, microCompact, shouldAutoCompact, buildCompactionPrompt, applyCompaction, type CompactionConfig, type CompactionResult, } from "./compact.js";
|
|
6
|
+
export { authorize, refreshToken, type OAuthConfig, type OAuthTokens } from "./oauth.js";
|
|
7
|
+
export { notify, notifyComplete, notifyError } from "./notifier.js";
|
|
8
|
+
export { diagnostics } from "./diagnostics.js";
|
|
9
|
+
export { buildExtractionPrompt, parseExtractionResponse, type ExtractedMemory, } from "./extract-memories.js";
|
|
10
|
+
export { shouldAutoDream, recordSession, recordDreamComplete, buildDreamPrompt, } from "./auto-dream.js";
|
|
11
|
+
export { saveSessionMemory, loadSessionMemory, listSessionMemories, searchSessionMemories, buildSessionMemoryPrompt, } from "./session-memory.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notifier service — desktop/system notifications.
|
|
3
|
+
*
|
|
4
|
+
* Sends notifications when tasks complete, agents finish, or errors occur.
|
|
5
|
+
* Falls back gracefully when no notification system is available.
|
|
6
|
+
*/
|
|
7
|
+
export interface NotificationOptions {
|
|
8
|
+
title: string;
|
|
9
|
+
message: string;
|
|
10
|
+
sound?: boolean;
|
|
11
|
+
/** Urgency level: low, normal, critical */
|
|
12
|
+
urgency?: "low" | "normal" | "critical";
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Send a desktop notification.
|
|
16
|
+
*/
|
|
17
|
+
export declare function notify(options: NotificationOptions): void;
|
|
18
|
+
/**
|
|
19
|
+
* Send a notification that a task/agent has completed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function notifyComplete(taskName: string, duration?: number): void;
|
|
22
|
+
/**
|
|
23
|
+
* Send an error notification.
|
|
24
|
+
*/
|
|
25
|
+
export declare function notifyError(context: string, error: string): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth service — OAuth 2.0 authorization code flow with PKCE.
|
|
3
|
+
*
|
|
4
|
+
* Supports browser-based login flow for API authentication.
|
|
5
|
+
*/
|
|
6
|
+
export interface OAuthConfig {
|
|
7
|
+
clientId: string;
|
|
8
|
+
authorizationEndpoint: string;
|
|
9
|
+
tokenEndpoint: string;
|
|
10
|
+
redirectUri?: string;
|
|
11
|
+
scopes?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface OAuthTokens {
|
|
14
|
+
accessToken: string;
|
|
15
|
+
refreshToken?: string;
|
|
16
|
+
expiresAt?: number;
|
|
17
|
+
tokenType: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Run the OAuth authorization code flow.
|
|
21
|
+
* Opens a browser for user login and waits for the callback.
|
|
22
|
+
*/
|
|
23
|
+
export declare function authorize(config: OAuthConfig): Promise<OAuthTokens>;
|
|
24
|
+
/**
|
|
25
|
+
* Refresh an access token using a refresh token.
|
|
26
|
+
*/
|
|
27
|
+
export declare function refreshToken(config: OAuthConfig, refreshTokenValue: string): Promise<OAuthTokens>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Memory service — automatic session memory maintenance.
|
|
3
|
+
*
|
|
4
|
+
* Extracts and maintains conversation context as persistent memory
|
|
5
|
+
* entries that survive across sessions.
|
|
6
|
+
*/
|
|
7
|
+
export interface SessionMemoryEntry {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
summary: string;
|
|
10
|
+
keyTopics: string[];
|
|
11
|
+
decisions: string[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
tokenCount?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Save a session memory entry.
|
|
17
|
+
*/
|
|
18
|
+
export declare function saveSessionMemory(entry: SessionMemoryEntry): void;
|
|
19
|
+
/**
|
|
20
|
+
* Load a session memory by session ID.
|
|
21
|
+
*/
|
|
22
|
+
export declare function loadSessionMemory(sessionId: string): SessionMemoryEntry | null;
|
|
23
|
+
/**
|
|
24
|
+
* List all session memories, most recent first.
|
|
25
|
+
*/
|
|
26
|
+
export declare function listSessionMemories(limit?: number): SessionMemoryEntry[];
|
|
27
|
+
/**
|
|
28
|
+
* Search session memories by keyword.
|
|
29
|
+
*/
|
|
30
|
+
export declare function searchSessionMemories(query: string): SessionMemoryEntry[];
|
|
31
|
+
/**
|
|
32
|
+
* Build a prompt for extracting session memory from a conversation.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildSessionMemoryPrompt(messages: Array<{
|
|
35
|
+
role: string;
|
|
36
|
+
content: string;
|
|
37
|
+
}>): string;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File history — automatic backup of files before modifications.
|
|
3
|
+
*
|
|
4
|
+
* Stores snapshots in the session directory under file-history/.
|
|
5
|
+
* Supports restoring files to a previous state.
|
|
6
|
+
*/
|
|
7
|
+
export interface FileSnapshot {
|
|
8
|
+
filePath: string;
|
|
9
|
+
timestamp: number;
|
|
10
|
+
backupPath: string;
|
|
11
|
+
hash: string;
|
|
12
|
+
size: number;
|
|
13
|
+
}
|
|
14
|
+
export declare class FileHistory {
|
|
15
|
+
private readonly historyDir;
|
|
16
|
+
private snapshots;
|
|
17
|
+
constructor(sessionDir: string);
|
|
18
|
+
/**
|
|
19
|
+
* Save a snapshot of a file before it is modified.
|
|
20
|
+
* Returns the snapshot record, or null if the file doesn't exist.
|
|
21
|
+
*/
|
|
22
|
+
saveSnapshot(filePath: string): FileSnapshot | null;
|
|
23
|
+
/**
|
|
24
|
+
* Get all snapshots for a specific file.
|
|
25
|
+
*/
|
|
26
|
+
getSnapshots(filePath: string): FileSnapshot[];
|
|
27
|
+
/**
|
|
28
|
+
* Restore a file to a specific snapshot.
|
|
29
|
+
*/
|
|
30
|
+
restore(snapshot: FileSnapshot): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Restore a file to its most recent snapshot.
|
|
33
|
+
*/
|
|
34
|
+
restoreLatest(filePath: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Get all tracked files.
|
|
37
|
+
*/
|
|
38
|
+
getTrackedFiles(): string[];
|
|
39
|
+
private saveIndex;
|
|
40
|
+
static loadFromDir(sessionDir: string): FileHistory;
|
|
41
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory system — persistent cross-session memory.
|
|
3
|
+
*
|
|
4
|
+
* Stores structured memory entries in ~/.code-shell/memory/ as individual markdown files.
|
|
5
|
+
* MEMORY.md is the index file.
|
|
6
|
+
*/
|
|
7
|
+
export interface MemoryEntry {
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
type: "user" | "feedback" | "project" | "reference";
|
|
11
|
+
content: string;
|
|
12
|
+
fileName: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class MemoryManager {
|
|
15
|
+
private readonly memoryDir;
|
|
16
|
+
private readonly indexPath;
|
|
17
|
+
constructor(projectDir?: string);
|
|
18
|
+
getMemoryDir(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Save a memory entry. Creates the file and updates the index.
|
|
21
|
+
*/
|
|
22
|
+
save(entry: Omit<MemoryEntry, "fileName">): string;
|
|
23
|
+
/**
|
|
24
|
+
* Load all memory entries.
|
|
25
|
+
*/
|
|
26
|
+
loadAll(): MemoryEntry[];
|
|
27
|
+
/**
|
|
28
|
+
* Load a single memory file.
|
|
29
|
+
*/
|
|
30
|
+
private loadFile;
|
|
31
|
+
/**
|
|
32
|
+
* Delete a memory by name or filename.
|
|
33
|
+
*/
|
|
34
|
+
delete(nameOrFile: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Get the MEMORY.md index content for injection into prompts.
|
|
37
|
+
*/
|
|
38
|
+
getIndex(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Build a prompt-friendly summary of all memories.
|
|
41
|
+
*/
|
|
42
|
+
buildMemoryContext(): string;
|
|
43
|
+
private updateIndex;
|
|
44
|
+
private slugify;
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session lifecycle manager.
|
|
3
|
+
*/
|
|
4
|
+
import type { SessionState } from "../types.js";
|
|
5
|
+
import { Transcript } from "./transcript.js";
|
|
6
|
+
export interface SessionBundle {
|
|
7
|
+
state: SessionState;
|
|
8
|
+
transcript: Transcript;
|
|
9
|
+
}
|
|
10
|
+
export declare class SessionManager {
|
|
11
|
+
private readonly sessionsDir;
|
|
12
|
+
constructor(storageDir?: string);
|
|
13
|
+
create(cwd: string, model: string, provider: string): SessionBundle;
|
|
14
|
+
resume(sessionId: string): SessionBundle;
|
|
15
|
+
saveState(state: SessionState): void;
|
|
16
|
+
/**
|
|
17
|
+
* Fork a session from a specific point.
|
|
18
|
+
* Creates a new session that shares events up to the given turn,
|
|
19
|
+
* then diverges independently.
|
|
20
|
+
*/
|
|
21
|
+
fork(sourceSessionId: string, forkAtTurn?: number): SessionBundle;
|
|
22
|
+
list(limit?: number): SessionState[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transcript — JSONL event log (NOT chat history).
|
|
3
|
+
* toMessages() derives Message[] from events for sending to LLM.
|
|
4
|
+
*/
|
|
5
|
+
import type { TranscriptEvent, TranscriptEventType, Message, ContentBlock } from "../types.js";
|
|
6
|
+
export declare class Transcript {
|
|
7
|
+
private events;
|
|
8
|
+
private filePath;
|
|
9
|
+
private currentTurn;
|
|
10
|
+
getFilePath(): string;
|
|
11
|
+
constructor(filePath: string);
|
|
12
|
+
append(type: TranscriptEventType, data: Record<string, unknown>): TranscriptEvent;
|
|
13
|
+
appendMessage(role: string, content: string | ContentBlock[]): TranscriptEvent;
|
|
14
|
+
appendToolUse(toolName: string, toolCallId: string, args: Record<string, unknown>): TranscriptEvent;
|
|
15
|
+
appendToolResult(toolCallId: string, toolName: string, result?: string, error?: string): TranscriptEvent;
|
|
16
|
+
appendTurnBoundary(): TranscriptEvent;
|
|
17
|
+
appendSummary(summary: string, compactedRange: {
|
|
18
|
+
fromTurn: number;
|
|
19
|
+
toTurn: number;
|
|
20
|
+
eventCount: number;
|
|
21
|
+
}): TranscriptEvent;
|
|
22
|
+
appendError(error: string, details?: Record<string, unknown>): TranscriptEvent;
|
|
23
|
+
/**
|
|
24
|
+
* Derive Message[] from transcript events for sending to the LLM.
|
|
25
|
+
* This is the critical boundary: the LLM never sees the event log directly.
|
|
26
|
+
*/
|
|
27
|
+
toMessages(): Message[];
|
|
28
|
+
getEvents(type?: TranscriptEventType): TranscriptEvent[];
|
|
29
|
+
get turnNumber(): number;
|
|
30
|
+
get eventCount(): number;
|
|
31
|
+
private flush;
|
|
32
|
+
/**
|
|
33
|
+
* Repair tool_result pairing issues:
|
|
34
|
+
* - Orphaned tool_results (no matching tool_use) get removed
|
|
35
|
+
* - Missing tool_results (tool_use with no result) get synthetic error results
|
|
36
|
+
*/
|
|
37
|
+
repairToolResultPairs(): void;
|
|
38
|
+
static loadFromFile(filePath: string): Transcript;
|
|
39
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkNG73UR3Lcjs = require('./chunk-NG73UR3L.cjs');
|
|
4
|
+
require('./chunk-EL2RL5DG.cjs');
|
|
5
|
+
require('./chunk-IJSHQGMP.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.SessionManager = _chunkNG73UR3Lcjs.SessionManager;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings manager — multi-source loading and merge.
|
|
3
|
+
*
|
|
4
|
+
* Priority: CLI flags > local > project > user > managed
|
|
5
|
+
*/
|
|
6
|
+
import { type ValidatedSettings } from "./schema.js";
|
|
7
|
+
export type SettingsSourceName = "managed" | "user" | "project" | "local" | "flag";
|
|
8
|
+
export declare class SettingsManager {
|
|
9
|
+
private readonly cwd;
|
|
10
|
+
private sources;
|
|
11
|
+
private merged;
|
|
12
|
+
constructor(cwd?: string);
|
|
13
|
+
/**
|
|
14
|
+
* Load settings from all sources.
|
|
15
|
+
*/
|
|
16
|
+
load(flagOverrides?: Record<string, unknown>): ValidatedSettings;
|
|
17
|
+
/**
|
|
18
|
+
* Get current effective settings.
|
|
19
|
+
*/
|
|
20
|
+
get(): ValidatedSettings;
|
|
21
|
+
/**
|
|
22
|
+
* Invalidate cached merge.
|
|
23
|
+
*/
|
|
24
|
+
invalidate(): void;
|
|
25
|
+
private loadJsonFile;
|
|
26
|
+
private deepMerge;
|
|
27
|
+
}
|