@cjhyy/code-shell 0.1.0-alpha.0 → 0.1.0-alpha.2
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 +39 -0
- package/README.md +8 -0
- package/dist/anthropic-P5VETAFI.cjs +10 -0
- package/dist/{anthropic-NENYS535.js → anthropic-W2GU3D76.js} +3 -2
- package/dist/arena/context/context-tools.d.ts +1 -1
- package/dist/arena/index.cjs +4 -4
- package/dist/arena/index.js +3 -3
- package/dist/arena/providers/index.d.ts +19 -3
- package/dist/arena/strategies/utils.d.ts +6 -1
- package/dist/arena/types.d.ts +10 -1
- package/dist/{arena-46QQ6BZQ.js → arena-ENHBHB2W.js} +5 -7
- package/dist/{arena-HZZZ2GJH.cjs → arena-HHDYYVHJ.cjs} +19 -21
- package/dist/{chunk-BE6IPRDM.js → chunk-2EUAE7AY.js} +1 -1
- package/dist/{chunk-WFQF3RT4.cjs → chunk-3CAZIWUA.cjs} +11 -8
- package/dist/{chunk-J5XW6UYL.js → chunk-5C5HIOML.js} +63 -4
- package/dist/chunk-75E4BBFC.js +224 -0
- package/dist/{chunk-ZJV3YSY3.cjs → chunk-BUJ5KYCI.cjs} +53 -11
- package/dist/{chunk-BMH65OVB.cjs → chunk-C7C7ZZY4.cjs} +8 -8
- package/dist/{chunk-KO2FPF7G.js → chunk-F5BS3GUC.js} +20 -2
- package/dist/chunk-FA5KD34T.js +54 -0
- package/dist/chunk-FV2ARONZ.cjs +224 -0
- package/dist/chunk-G76E5FOB.cjs +54 -0
- package/dist/{chunk-DICG4AB7.cjs → chunk-GZBD6QRS.cjs} +42 -3
- package/dist/{chunk-FVP7XJGS.cjs → chunk-HOXQLX5R.cjs} +406 -196
- package/dist/{chunk-4PKZPFCD.js → chunk-I57ZD5IQ.js} +47 -14
- package/dist/{chunk-7RMAR2Y3.js → chunk-ID6EJUHP.js} +1959 -473
- package/dist/chunk-JHNCK7JP.cjs +202 -0
- package/dist/{chunk-R32DJSJE.cjs → chunk-JHXNOB5G.cjs} +8 -5
- package/dist/{chunk-UK2SU23S.cjs → chunk-KOGV6PDQ.cjs} +20 -2
- package/dist/{chunk-VKGNCYRL.js → chunk-LMEKCQX4.js} +95 -13
- package/dist/{chunk-3EAEC566.cjs → chunk-M2QI5X3X.cjs} +51 -18
- package/dist/{chunk-YZ25SSWJ.js → chunk-M2SVOKC6.js} +46 -4
- package/dist/chunk-OMRGA6TI.js +4753 -0
- package/dist/{chunk-NG73UR3L.cjs → chunk-OP57WUWQ.cjs} +23 -1
- package/dist/{chunk-ZXYDDJEJ.js → chunk-OUC2DFA7.js} +2 -2
- package/dist/{chunk-6JOOLG6F.js → chunk-REFCCVDM.js} +5 -2
- package/dist/{chunk-O6F2EF2Z.js → chunk-SCDKLTN3.js} +41 -2
- package/dist/{chunk-BHGIJ2DJ.js → chunk-SW3L7HIM.js} +6 -3
- package/dist/chunk-TATCTZSB.cjs +4753 -0
- package/dist/{chunk-QHDYFC5U.cjs → chunk-VWFET3MG.cjs} +2132 -646
- package/dist/{chunk-3EUDE77E.cjs → chunk-X2DNIMPC.cjs} +19 -19
- package/dist/{chunk-SQZHPD3S.js → chunk-Y7TSCDF6.js} +297 -87
- package/dist/{chunk-WHRTARDJ.cjs → chunk-YAFCN7ZW.cjs} +112 -30
- package/dist/{chunk-LRAY5IYC.cjs → chunk-YD7XTI7T.cjs} +65 -6
- package/dist/{chunk-S74VVJBF.js → chunk-ZLPJJZUW.js} +23 -1
- package/dist/chunk-ZRVPCXI7.js +202 -0
- package/dist/cli/commands/builtin/advanced-commands.d.ts +1 -1
- package/dist/cli/commands/builtin/extra-commands.d.ts +2 -2
- package/dist/cli/commands/builtin/more-commands.d.ts +1 -3
- package/dist/cli/commands/registry.d.ts +8 -0
- package/dist/cli/cost-tracker.d.ts +6 -0
- package/dist/cli/main.cjs +3576 -2036
- package/dist/cli/main.js +3613 -2073
- package/dist/cli/onboarding.d.ts +67 -14
- package/dist/client-base-TOVE25FA.js +9 -0
- package/dist/client-base-VDDIADAC.cjs +9 -0
- package/dist/compaction-D3KV2NWY.cjs +31 -0
- package/dist/{compaction-CCHWA4G6.js → compaction-YNWCEF7B.js} +1 -2
- package/dist/context/manager.d.ts +9 -0
- package/dist/data/openrouter-models.d.ts +35 -0
- package/dist/data/openrouter-sync.d.ts +16 -0
- package/dist/{devtools-KIY3LWQJ.js → devtools-IRQQPIRY.js} +1 -1
- package/dist/{devtools-LRP47DDV.cjs → devtools-WTC3NFNE.cjs} +1 -1
- package/dist/engine/engine.d.ts +39 -4
- package/dist/engine/turn-loop.d.ts +13 -4
- package/dist/engine/turn-state.d.ts +6 -0
- package/dist/index.cjs +19 -28
- package/dist/index.d.ts +1 -1
- package/dist/index.js +28 -37
- package/dist/llm/client-base.d.ts +7 -0
- package/dist/llm/model-pool.d.ts +4 -0
- package/dist/logging/logger.d.ts +69 -8
- package/dist/manager-FWLOVEEK.cjs +7 -0
- package/dist/manager-GEXJLOIS.js +7 -0
- package/dist/{mcp-manager-OKXHHWYR.js → mcp-manager-37GQLFGX.js} +2 -2
- package/dist/mcp-manager-U77NEXBY.cjs +8 -0
- package/dist/memory-ADGOWADP.cjs +9 -0
- package/dist/memory-EPFDBPII.js +9 -0
- package/dist/native-ts/yoga-layout/index.d.ts +2 -2
- package/dist/{openai-5HQGBL4L.js → openai-RXU5URYI.js} +3 -2
- package/dist/openai-SQW4H2K4.cjs +10 -0
- package/dist/openrouter-models-OL725CL6.js +15 -0
- package/dist/openrouter-models-UM3AOGZ4.cjs +15 -0
- package/dist/openrouter-sync-CWD5VNW2.js +11 -0
- package/dist/openrouter-sync-HYZZC6RX.cjs +11 -0
- package/dist/product/index.cjs +12 -16
- package/dist/product/index.js +11 -15
- package/dist/product/types.d.ts +2 -7
- package/dist/protocol/types.d.ts +11 -3
- package/dist/{ink → render}/hooks/use-input.d.ts +1 -1
- package/dist/run/EngineRunner.d.ts +3 -1
- package/dist/run/RunManager.d.ts +6 -0
- package/dist/run/factory.d.ts +7 -1
- package/dist/run/index.cjs +12 -16
- package/dist/run/index.js +11 -15
- package/dist/session/memory.d.ts +23 -3
- package/dist/session/session-manager.d.ts +4 -1
- package/dist/{session-manager-UQKB564H.cjs → session-manager-HRSKENKB.cjs} +2 -2
- package/dist/{session-manager-JIIBCFTC.js → session-manager-NEKFEHF3.js} +1 -1
- package/dist/settings/manager.d.ts +9 -0
- package/dist/settings/schema.d.ts +48 -39
- package/dist/{tool-summary-J2ICNMWP.js → tool-summary-2RUFL5QK.js} +1 -1
- package/dist/{tool-summary-5P2GKRA4.cjs → tool-summary-RYNR4DDB.cjs} +2 -2
- package/dist/tool-system/builtin/agent-registry.d.ts +36 -0
- package/dist/tool-system/builtin/agent.d.ts +7 -26
- package/dist/tool-system/builtin/apply-patch/applier.d.ts +26 -0
- package/dist/tool-system/builtin/apply-patch/index.d.ts +19 -0
- package/dist/tool-system/builtin/apply-patch/parser.d.ts +17 -0
- package/dist/tool-system/builtin/apply-patch/seek-sequence.d.ts +18 -0
- package/dist/tool-system/builtin/apply-patch/types.d.ts +49 -0
- package/dist/tool-system/builtin/arena.d.ts +18 -5
- package/dist/tool-system/builtin/ask-user.d.ts +6 -6
- package/dist/tool-system/builtin/index.d.ts +11 -1
- package/dist/tool-system/builtin/tool-search.d.ts +2 -3
- package/dist/tool-system/context.d.ts +74 -0
- package/dist/tool-system/executor.d.ts +16 -0
- package/dist/tool-system/permission.d.ts +40 -5
- package/dist/tool-system/registry.d.ts +8 -0
- package/dist/types.d.ts +34 -1
- package/dist/ui/App.d.ts +1 -1
- package/dist/ui/components/AgentBlock.d.ts +1 -1
- package/dist/ui/components/AskUserPrompt.d.ts +7 -0
- package/dist/ui/components/MessageContent.d.ts +7 -3
- package/dist/ui/components/ModelManager.d.ts +35 -0
- package/dist/ui/components/ModelSelector.d.ts +10 -0
- package/dist/ui/components/OnboardingPrompt.d.ts +7 -0
- package/dist/ui/components/PermissionPrompt.d.ts +5 -2
- package/dist/ui/components/SessionPicker.d.ts +14 -0
- package/dist/ui/components/StatusLine.d.ts +4 -2
- package/dist/ui/components/ThemedBox.d.ts +1 -1
- package/dist/ui/components/ToolCall.d.ts +8 -1
- package/dist/ui/components/WelcomeTips.d.ts +5 -0
- package/dist/ui/onboarding-runner.d.ts +2 -0
- package/dist/ui/store.d.ts +1 -0
- package/dist/{updater-URVNPDPW.cjs → updater-M7L42ASZ.cjs} +4 -4
- package/dist/{updater-AVD4LKTQ.js → updater-ZRTONIR4.js} +4 -4
- package/dist/utils/debug.d.ts +17 -33
- package/package.json +4 -4
- package/dist/anthropic-XMTTVNSH.cjs +0 -9
- package/dist/bridge-4ZRXVWBN.js +0 -98
- package/dist/bridge-W476QDFH.cjs +0 -98
- package/dist/chunk-4RRUP4MM.js +0 -86
- package/dist/chunk-4SFPFHMG.js +0 -132
- package/dist/chunk-5LHVI777.cjs +0 -246
- package/dist/chunk-6ZIROYXX.js +0 -207
- package/dist/chunk-C7JBCO5V.js +0 -80
- package/dist/chunk-CSO5EOEP.cjs +0 -132
- package/dist/chunk-FGZGCFJX.cjs +0 -207
- package/dist/chunk-HD7MT5XU.cjs +0 -86
- package/dist/chunk-IMMTBZ33.cjs +0 -63
- package/dist/chunk-JT2WSQSR.cjs +0 -335
- package/dist/chunk-NZ4DQ72D.cjs +0 -664
- package/dist/chunk-OG4MIQJ6.js +0 -335
- package/dist/chunk-WRZJUQ5Z.js +0 -664
- package/dist/chunk-X4HAERTQ.js +0 -63
- package/dist/chunk-XHC2JMEC.cjs +0 -80
- package/dist/chunk-ZRSSGYA5.js +0 -246
- package/dist/compaction-44I55TLI.cjs +0 -32
- package/dist/coordinator-5HY7ALO2.js +0 -7
- package/dist/coordinator-INDLPVMF.cjs +0 -7
- package/dist/cost-tracker-IWYAUPXH.js +0 -9
- package/dist/cost-tracker-JXTJQQWE.cjs +0 -9
- package/dist/loader-DXFSUB4R.cjs +0 -91
- package/dist/loader-J5UID6CV.js +0 -91
- package/dist/manager-ETWDOCHN.cjs +0 -9
- package/dist/manager-HGMQNEJB.cjs +0 -11
- package/dist/manager-HUAQOORS.js +0 -9
- package/dist/manager-VJIZ2CQC.js +0 -11
- package/dist/mcp-manager-G4G2QASE.cjs +0 -8
- package/dist/memory-AP747G5H.js +0 -7
- package/dist/memory-BH3BYUN5.cjs +0 -7
- package/dist/onboarding-6WEPV7C2.js +0 -11
- package/dist/onboarding-QM5DY2TU.cjs +0 -11
- package/dist/openai-656VWUQW.cjs +0 -9
- package/dist/skills-63RBYQRX.js +0 -13
- package/dist/skills-V3BPLW3D.cjs +0 -13
- package/dist/token-counter-CHAXW5O7.cjs +0 -13
- package/dist/token-counter-DSOZGZ5Q.js +0 -13
- package/dist/utils/log.d.ts +0 -56
- package/dist/voice-KTZ7PAGO.js +0 -80
- package/dist/voice-KZE25GKB.cjs +0 -80
- /package/dist/{ink → render}/Ansi.d.ts +0 -0
- /package/dist/{ink → render}/bidi.d.ts +0 -0
- /package/dist/{ink → render}/clearTerminal.d.ts +0 -0
- /package/dist/{ink → render}/colorize.d.ts +0 -0
- /package/dist/{ink → render}/components/AlternateScreen.d.ts +0 -0
- /package/dist/{ink → render}/components/App.d.ts +0 -0
- /package/dist/{ink → render}/components/AppContext.d.ts +0 -0
- /package/dist/{ink → render}/components/Box.d.ts +0 -0
- /package/dist/{ink → render}/components/Button.d.ts +0 -0
- /package/dist/{ink → render}/components/ClockContext.d.ts +0 -0
- /package/dist/{ink → render}/components/CursorDeclarationContext.d.ts +0 -0
- /package/dist/{ink → render}/components/ErrorOverview.d.ts +0 -0
- /package/dist/{ink → render}/components/Link.d.ts +0 -0
- /package/dist/{ink → render}/components/Newline.d.ts +0 -0
- /package/dist/{ink → render}/components/NoSelect.d.ts +0 -0
- /package/dist/{ink → render}/components/RawAnsi.d.ts +0 -0
- /package/dist/{ink → render}/components/ScrollBox.d.ts +0 -0
- /package/dist/{ink → render}/components/Spacer.d.ts +0 -0
- /package/dist/{ink → render}/components/StdinContext.d.ts +0 -0
- /package/dist/{ink → render}/components/TerminalFocusContext.d.ts +0 -0
- /package/dist/{ink → render}/components/TerminalSizeContext.d.ts +0 -0
- /package/dist/{ink → render}/components/Text.d.ts +0 -0
- /package/dist/{ink → render}/constants.d.ts +0 -0
- /package/dist/{ink → render}/cursor.d.ts +0 -0
- /package/dist/{ink → render}/devtools.d.ts +0 -0
- /package/dist/{ink → render}/dom.d.ts +0 -0
- /package/dist/{ink → render}/events/click-event.d.ts +0 -0
- /package/dist/{ink → render}/events/dispatcher.d.ts +0 -0
- /package/dist/{ink → render}/events/emitter.d.ts +0 -0
- /package/dist/{ink → render}/events/event-handlers.d.ts +0 -0
- /package/dist/{ink → render}/events/event.d.ts +0 -0
- /package/dist/{ink → render}/events/focus-event.d.ts +0 -0
- /package/dist/{ink → render}/events/input-event.d.ts +0 -0
- /package/dist/{ink → render}/events/keyboard-event.d.ts +0 -0
- /package/dist/{ink → render}/events/paste-event.d.ts +0 -0
- /package/dist/{ink → render}/events/resize-event.d.ts +0 -0
- /package/dist/{ink → render}/events/terminal-event.d.ts +0 -0
- /package/dist/{ink → render}/events/terminal-focus-event.d.ts +0 -0
- /package/dist/{ink → render}/focus.d.ts +0 -0
- /package/dist/{ink → render}/frame.d.ts +0 -0
- /package/dist/{ink → render}/get-max-width.d.ts +0 -0
- /package/dist/{ink → render}/hit-test.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-animation-frame.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-app.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-declared-cursor.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-interval.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-search-highlight.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-selection.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-stdin.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-tab-status.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-focus.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-title.d.ts +0 -0
- /package/dist/{ink → render}/hooks/use-terminal-viewport.d.ts +0 -0
- /package/dist/{ink → render}/index.d.ts +0 -0
- /package/dist/{ink → render}/ink.d.ts +0 -0
- /package/dist/{ink → render}/instances.d.ts +0 -0
- /package/dist/{ink → render}/layout/engine.d.ts +0 -0
- /package/dist/{ink → render}/layout/geometry.d.ts +0 -0
- /package/dist/{ink → render}/layout/node.d.ts +0 -0
- /package/dist/{ink → render}/layout/yoga.d.ts +0 -0
- /package/dist/{ink → render}/line-width-cache.d.ts +0 -0
- /package/dist/{ink → render}/log-update.d.ts +0 -0
- /package/dist/{ink → render}/measure-element.d.ts +0 -0
- /package/dist/{ink → render}/measure-text.d.ts +0 -0
- /package/dist/{ink → render}/node-cache.d.ts +0 -0
- /package/dist/{ink → render}/optimizer.d.ts +0 -0
- /package/dist/{ink → render}/output.d.ts +0 -0
- /package/dist/{ink → render}/parse-keypress.d.ts +0 -0
- /package/dist/{ink → render}/reconciler.d.ts +0 -0
- /package/dist/{ink → render}/render-border.d.ts +0 -0
- /package/dist/{ink → render}/render-node-to-output.d.ts +0 -0
- /package/dist/{ink → render}/render-to-screen.d.ts +0 -0
- /package/dist/{ink → render}/renderer.d.ts +0 -0
- /package/dist/{ink → render}/root.d.ts +0 -0
- /package/dist/{ink → render}/screen.d.ts +0 -0
- /package/dist/{ink → render}/searchHighlight.d.ts +0 -0
- /package/dist/{ink → render}/selection.d.ts +0 -0
- /package/dist/{ink → render}/squash-text-nodes.d.ts +0 -0
- /package/dist/{ink → render}/stringWidth.d.ts +0 -0
- /package/dist/{ink → render}/styles.d.ts +0 -0
- /package/dist/{ink → render}/supports-hyperlinks.d.ts +0 -0
- /package/dist/{ink → render}/tabstops.d.ts +0 -0
- /package/dist/{ink → render}/terminal-focus-state.d.ts +0 -0
- /package/dist/{ink → render}/terminal-querier.d.ts +0 -0
- /package/dist/{ink → render}/terminal.d.ts +0 -0
- /package/dist/{ink → render}/termio/ansi.d.ts +0 -0
- /package/dist/{ink → render}/termio/csi.d.ts +0 -0
- /package/dist/{ink → render}/termio/dec.d.ts +0 -0
- /package/dist/{ink → render}/termio/esc.d.ts +0 -0
- /package/dist/{ink → render}/termio/osc.d.ts +0 -0
- /package/dist/{ink → render}/termio/parser.d.ts +0 -0
- /package/dist/{ink → render}/termio/sgr.d.ts +0 -0
- /package/dist/{ink → render}/termio/tokenize.d.ts +0 -0
- /package/dist/{ink → render}/termio/types.d.ts +0 -0
- /package/dist/{ink → render}/termio.d.ts +0 -0
- /package/dist/{ink → render}/useTerminalNotification.d.ts +0 -0
- /package/dist/{ink → render}/warn.d.ts +0 -0
- /package/dist/{ink → render}/widest-line.d.ts +0 -0
- /package/dist/{ink → render}/wrap-text.d.ts +0 -0
- /package/dist/{ink → render}/wrapAnsi.d.ts +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V4A patch AST. A parsed patch is a list of Hunks; each Hunk targets one file.
|
|
3
|
+
*
|
|
4
|
+
* Three variants:
|
|
5
|
+
* - AddFile: create a new file with the given contents
|
|
6
|
+
* - DeleteFile: remove an existing file
|
|
7
|
+
* - UpdateFile: in-place edit (optionally with a rename via movePath),
|
|
8
|
+
* expressed as one or more UpdateFileChunks.
|
|
9
|
+
*/
|
|
10
|
+
export type Hunk = {
|
|
11
|
+
kind: "add";
|
|
12
|
+
path: string;
|
|
13
|
+
contents: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "delete";
|
|
16
|
+
path: string;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "update";
|
|
19
|
+
path: string;
|
|
20
|
+
movePath?: string;
|
|
21
|
+
chunks: UpdateFileChunk[];
|
|
22
|
+
};
|
|
23
|
+
export interface UpdateFileChunk {
|
|
24
|
+
/** Optional `@@ <context>` anchor that narrows where this chunk applies. */
|
|
25
|
+
changeContext?: string;
|
|
26
|
+
/** Lines that must match in the existing file (` ` and `-` markers). */
|
|
27
|
+
oldLines: string[];
|
|
28
|
+
/** Lines that should appear after the edit (` ` and `+` markers). */
|
|
29
|
+
newLines: string[];
|
|
30
|
+
/** True if this chunk ended with `*** End of File`; matches only at EOF. */
|
|
31
|
+
isEndOfFile: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare class PatchParseError extends Error {
|
|
34
|
+
readonly kind: "InvalidPatch" | "InvalidHunk";
|
|
35
|
+
readonly lineNumber?: number;
|
|
36
|
+
constructor(kind: "InvalidPatch" | "InvalidHunk", message: string, lineNumber?: number);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Result of staging (dry-run) a single file's planned change.
|
|
40
|
+
*
|
|
41
|
+
* A rename is represented as two PlannedFileChange entries: one for the
|
|
42
|
+
* source path with `newContent: null` (delete) and one for the destination
|
|
43
|
+
* path with the new content.
|
|
44
|
+
*/
|
|
45
|
+
export interface PlannedFileChange {
|
|
46
|
+
path: string;
|
|
47
|
+
/** null = delete; string = create-or-overwrite with this content. */
|
|
48
|
+
newContent: string | null;
|
|
49
|
+
}
|
|
@@ -8,11 +8,24 @@
|
|
|
8
8
|
* setArenaLLMConfig(), following the same pattern as setAskUserFn() and
|
|
9
9
|
* setSubAgentConfig().
|
|
10
10
|
*/
|
|
11
|
-
import type { ToolDefinition
|
|
11
|
+
import type { ToolDefinition } from "../../types.js";
|
|
12
|
+
import type { ToolContext } from "../context.js";
|
|
12
13
|
export declare const arenaToolDef: ToolDefinition;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* Snapshot of what Arena would do right now if invoked. Used by the
|
|
16
|
+
* `/arena` REPL command (via the protocol `arena_status` query) so
|
|
17
|
+
* users can see participants/endpoint before launching a run.
|
|
16
18
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
+
export interface ArenaStatus {
|
|
20
|
+
endpoint?: string;
|
|
21
|
+
defaultParticipants: Array<{
|
|
22
|
+
name: string;
|
|
23
|
+
model: string;
|
|
24
|
+
source: "pool" | "preset" | "raw";
|
|
25
|
+
compatible: boolean;
|
|
26
|
+
reason?: string;
|
|
27
|
+
}>;
|
|
28
|
+
poolSize: number;
|
|
29
|
+
}
|
|
30
|
+
export declare function getArenaStatus(): ArenaStatus;
|
|
31
|
+
export declare function arenaTool(args: Record<string, unknown>, ctx?: ToolContext): Promise<string>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Built-in AskUserQuestion tool — ask the user a question during execution.
|
|
3
|
+
*
|
|
4
|
+
* The actual prompt-the-user implementation is provided per-Engine via
|
|
5
|
+
* ToolContext.askUser. Headless mode (no UI wired up) leaves askUser
|
|
6
|
+
* undefined and the tool reports back asking the LLM to assume.
|
|
3
7
|
*/
|
|
4
8
|
import type { ToolDefinition } from "../../types.js";
|
|
9
|
+
import type { ToolContext } from "../context.js";
|
|
5
10
|
export declare const askUserToolDef: ToolDefinition;
|
|
6
|
-
/**
|
|
7
|
-
* Factory: the actual executor is injected at runtime by the Engine,
|
|
8
|
-
* because it depends on the CLI/UI layer to collect user input.
|
|
9
|
-
*/
|
|
10
11
|
export type AskUserFn = (question: string) => Promise<string>;
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function askUserTool(args: Record<string, unknown>): Promise<string>;
|
|
12
|
+
export declare function askUserTool(args: Record<string, unknown>, ctx?: ToolContext): Promise<string>;
|
|
@@ -2,7 +2,17 @@
|
|
|
2
2
|
* Built-in tool registration.
|
|
3
3
|
*/
|
|
4
4
|
import type { RegisteredTool } from "../../types.js";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Tool executor signature.
|
|
7
|
+
*
|
|
8
|
+
* Tools may inspect ctx for runtime services (askUser, llmConfig, modelPool,
|
|
9
|
+
* toolRegistry, subAgentSpawner). Tools that don't need any of these — Read,
|
|
10
|
+
* Write, Bash, Edit, Glob, Grep, etc. — may simply ignore the second arg.
|
|
11
|
+
*
|
|
12
|
+
* ctx is optional in the signature so legacy call sites (and tests) that
|
|
13
|
+
* pass only args still type-check; ToolRegistry always passes ctx at runtime.
|
|
14
|
+
*/
|
|
15
|
+
export type BuiltinToolFn = (args: Record<string, unknown>, ctx?: import("../context.js").ToolContext) => Promise<string>;
|
|
6
16
|
export interface BuiltinTool {
|
|
7
17
|
definition: RegisteredTool;
|
|
8
18
|
execute: BuiltinToolFn;
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* saving context by not loading all MCP tool schemas upfront.
|
|
7
7
|
*/
|
|
8
8
|
import type { ToolDefinition } from "../../types.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { ToolContext } from "../context.js";
|
|
10
10
|
export declare const toolSearchToolDef: ToolDefinition;
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function toolSearchTool(args: Record<string, unknown>): Promise<string>;
|
|
11
|
+
export declare function toolSearchTool(args: Record<string, unknown>, ctx?: ToolContext): Promise<string>;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolContext — runtime services injected into every tool execution.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the legacy module-level singletons (`setAskUserFn`,
|
|
5
|
+
* `setArenaLLMConfig`, `setSubAgentConfig`, `setToolSearchRegistry`).
|
|
6
|
+
*
|
|
7
|
+
* Each Engine instance builds its own ToolContext when run() starts and
|
|
8
|
+
* passes it through ToolExecutor → ToolRegistry → executor function.
|
|
9
|
+
* That makes concurrent Engine instances safe: tools never see another
|
|
10
|
+
* Engine's askUser handler or LLM credentials.
|
|
11
|
+
*
|
|
12
|
+
* Tools that don't need any context (Read/Write/Bash/...) just ignore
|
|
13
|
+
* the second argument; the type is purely additive.
|
|
14
|
+
*/
|
|
15
|
+
import type { LLMConfig, StreamCallback } from "../types.js";
|
|
16
|
+
import type { ModelPool } from "../llm/model-pool.js";
|
|
17
|
+
import type { ToolRegistry } from "./registry.js";
|
|
18
|
+
import type { AgentPresetName } from "../preset/index.js";
|
|
19
|
+
/** Function the host UI / server uses to ask the user a question. */
|
|
20
|
+
export type AskUserFn = (question: string) => Promise<string>;
|
|
21
|
+
/** Spawn a sub-agent. Returns the produced text or throws. */
|
|
22
|
+
export interface SubAgentSpawnRequest {
|
|
23
|
+
agentId: string;
|
|
24
|
+
description: string;
|
|
25
|
+
prompt: string;
|
|
26
|
+
maxTurns: number;
|
|
27
|
+
signal: AbortSignal;
|
|
28
|
+
}
|
|
29
|
+
export interface SubAgentSpawner {
|
|
30
|
+
/** Run a sub-agent synchronously and return its text output. */
|
|
31
|
+
spawn(req: SubAgentSpawnRequest): Promise<string>;
|
|
32
|
+
/** Stream callback to forward sub-agent events back to the parent UI. */
|
|
33
|
+
parentStream?: StreamCallback;
|
|
34
|
+
/** Static config used to describe what the spawned engine looks like. */
|
|
35
|
+
describe(): {
|
|
36
|
+
cwd: string;
|
|
37
|
+
preset?: AgentPresetName;
|
|
38
|
+
permissionMode: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The full context object handed to every tool invocation.
|
|
43
|
+
*
|
|
44
|
+
* Optional fields are filled in by Engine.run(); some headless paths may
|
|
45
|
+
* leave them undefined (e.g. running without UI → no askUser).
|
|
46
|
+
*/
|
|
47
|
+
export interface ToolContext {
|
|
48
|
+
/** Active working directory for this Engine. */
|
|
49
|
+
cwd: string;
|
|
50
|
+
/** LLM credentials/endpoint for tools that need to make their own calls. */
|
|
51
|
+
llmConfig: LLMConfig;
|
|
52
|
+
/** Active model pool (Arena reads this to pick participants). */
|
|
53
|
+
modelPool?: ModelPool;
|
|
54
|
+
/** Tool registry (ToolSearch reads this to enumerate available tools). */
|
|
55
|
+
toolRegistry: ToolRegistry;
|
|
56
|
+
/** UI-backed AskUserQuestion handler. Undefined → headless mode. */
|
|
57
|
+
askUser?: AskUserFn;
|
|
58
|
+
/** Sub-agent spawner (Agent tool). Undefined → Agent tool unavailable. */
|
|
59
|
+
subAgentSpawner?: SubAgentSpawner;
|
|
60
|
+
/** Optional cancellation signal for the whole turn. */
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Per-Engine container that produces a fresh ToolContext on demand.
|
|
65
|
+
* Engine creates one of these in run() and passes it to ToolExecutor.
|
|
66
|
+
*/
|
|
67
|
+
export declare class ServiceContainer {
|
|
68
|
+
private readonly base;
|
|
69
|
+
constructor(base: ToolContext);
|
|
70
|
+
/** Snapshot of the context at this moment. */
|
|
71
|
+
get(): ToolContext;
|
|
72
|
+
/** Create a derived context with overridden fields (e.g. per-call signal). */
|
|
73
|
+
withSignal(signal: AbortSignal): ToolContext;
|
|
74
|
+
}
|
|
@@ -5,14 +5,29 @@ import type { ToolCall, ToolResult, Message } from "../types.js";
|
|
|
5
5
|
import type { HookRegistry } from "../hooks/registry.js";
|
|
6
6
|
import { ToolRegistry } from "./registry.js";
|
|
7
7
|
import { PermissionClassifier } from "./permission.js";
|
|
8
|
+
import { logger as rootLogger } from "../logging/logger.js";
|
|
9
|
+
import type { ToolContext } from "./context.js";
|
|
10
|
+
type Logger = typeof rootLogger;
|
|
8
11
|
export declare class ToolExecutor {
|
|
9
12
|
private readonly registry;
|
|
10
13
|
private readonly permission;
|
|
11
14
|
private readonly hooks;
|
|
12
15
|
private signal?;
|
|
16
|
+
/** Per-Engine ToolContext injected for every tool call. */
|
|
17
|
+
private toolCtx?;
|
|
18
|
+
/**
|
|
19
|
+
* Turn-scoped logger set by TurnLoop at the top of each iteration.
|
|
20
|
+
* Falls back to the root logger so executor calls outside the turn loop
|
|
21
|
+
* (tests, ad-hoc tool runs) still write log lines, just without turn tags.
|
|
22
|
+
*/
|
|
23
|
+
private log;
|
|
13
24
|
constructor(registry: ToolRegistry, permission: PermissionClassifier, hooks: HookRegistry);
|
|
14
25
|
/** Set the abort signal for cascading cancellation. */
|
|
15
26
|
setSignal(signal?: AbortSignal): void;
|
|
27
|
+
/** Set the per-Engine ToolContext (askUser, llmConfig, modelPool, etc.). */
|
|
28
|
+
setContext(ctx: ToolContext | undefined): void;
|
|
29
|
+
/** Inject a turn-scoped logger so tool-execution lines carry turn/turnId. */
|
|
30
|
+
setLogger(log: Logger): void;
|
|
16
31
|
/** Check if a tool is safe for concurrent execution (read-only). */
|
|
17
32
|
isConcurrencySafe(toolName: string): boolean;
|
|
18
33
|
executeSingle(call: ToolCall): Promise<ToolResult>;
|
|
@@ -23,3 +38,4 @@ export declare class ToolExecutor {
|
|
|
23
38
|
*/
|
|
24
39
|
resultsToMessages(toolCalls: ToolCall[], results: ToolResult[]): Message[];
|
|
25
40
|
}
|
|
41
|
+
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Permission system — classifier + approval backend.
|
|
3
3
|
*/
|
|
4
4
|
import type { PermissionDecision, PermissionMode, PermissionRule, ApprovalRequest, ApprovalResult } from "../types.js";
|
|
5
|
+
import { logger as rootPermLogger } from "../logging/logger.js";
|
|
5
6
|
export interface ApprovalBackend {
|
|
6
7
|
requestApproval(request: ApprovalRequest): Promise<ApprovalResult>;
|
|
7
8
|
}
|
|
@@ -22,14 +23,33 @@ export declare class AutoApprovalBackend implements ApprovalBackend {
|
|
|
22
23
|
}
|
|
23
24
|
/**
|
|
24
25
|
* Interactive approval backend — prompts the user via a callback.
|
|
25
|
-
*
|
|
26
|
+
*
|
|
27
|
+
* Stores "always allow" decisions at two scopes:
|
|
28
|
+
* - session: in-memory map, lost when the process exits
|
|
29
|
+
* - project: persisted to <cwd>/.code-shell/settings.local.json so the
|
|
30
|
+
* same project remembers the rule across REPL restarts
|
|
31
|
+
*
|
|
32
|
+
* The classifier reads project rules from settings on session start (see
|
|
33
|
+
* Engine.buildPermissionConfig), so persisted rules become "auto-allow"
|
|
34
|
+
* the next time the user opens the project.
|
|
26
35
|
*/
|
|
27
36
|
export declare class InteractiveApprovalBackend implements ApprovalBackend {
|
|
28
37
|
private sessionRules;
|
|
29
38
|
private promptFn;
|
|
39
|
+
private cwd;
|
|
40
|
+
private savedProjectRules;
|
|
41
|
+
private onProjectRules;
|
|
30
42
|
setPromptFn(fn: (request: ApprovalRequest) => Promise<ApprovalResult>): void;
|
|
43
|
+
/** Inject the project root so persistence writes to the right settings file. */
|
|
44
|
+
setCwd(cwd: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Inject a callback fired when the user approves "for this project". The
|
|
47
|
+
* callback receives the *full* accumulated list of project rules saved in
|
|
48
|
+
* this session, so the classifier can be reconfigured without losing
|
|
49
|
+
* earlier approvals.
|
|
50
|
+
*/
|
|
51
|
+
setOnProjectRules(fn: (rules: PermissionRule[]) => void): void;
|
|
31
52
|
requestApproval(req: ApprovalRequest): Promise<ApprovalResult>;
|
|
32
|
-
private ruleKeyFromArgs;
|
|
33
53
|
}
|
|
34
54
|
export declare function getInteractiveApprovalBackend(): InteractiveApprovalBackend;
|
|
35
55
|
export declare function setInteractiveApprovalFn(fn: (request: ApprovalRequest) => Promise<ApprovalResult>): void;
|
|
@@ -52,11 +72,21 @@ export declare class DenialTracker {
|
|
|
52
72
|
export declare function setRuntimeBypass(enabled: boolean): void;
|
|
53
73
|
export declare function isRuntimeBypass(): boolean;
|
|
54
74
|
export declare class PermissionClassifier {
|
|
55
|
-
private
|
|
56
|
-
private
|
|
57
|
-
private
|
|
75
|
+
private rules;
|
|
76
|
+
private defaultMode;
|
|
77
|
+
private approvalBackend;
|
|
58
78
|
private denialTracker;
|
|
79
|
+
/**
|
|
80
|
+
* Turn-scoped logger so permission events (ask/decision/auto-deny) are
|
|
81
|
+
* tagged with the current turn/turnId. Falls back to the root logger so
|
|
82
|
+
* tests and ad-hoc usages still write log lines.
|
|
83
|
+
*/
|
|
84
|
+
private log;
|
|
59
85
|
constructor(rules: PermissionRule[], defaultMode?: PermissionMode, approvalBackend?: ApprovalBackend);
|
|
86
|
+
setLogger(log: typeof rootPermLogger): void;
|
|
87
|
+
/** Replace mode + backend in place so live tool execution sees the change. */
|
|
88
|
+
reconfigure(mode: PermissionMode, approvalBackend: ApprovalBackend, rules?: PermissionRule[]): void;
|
|
89
|
+
getMode(): PermissionMode;
|
|
60
90
|
classify(toolName: string, args: Record<string, unknown>): PermissionDecision;
|
|
61
91
|
handleAsk(toolName: string, args: Record<string, unknown>): Promise<boolean>;
|
|
62
92
|
/** Get denial warning message if the model keeps getting denied. */
|
|
@@ -64,6 +94,11 @@ export declare class PermissionClassifier {
|
|
|
64
94
|
private matchesRule;
|
|
65
95
|
private isDangerousCommand;
|
|
66
96
|
private assessRisk;
|
|
97
|
+
/**
|
|
98
|
+
* Short, human-friendly subtitle. The UI shows this under the tool title;
|
|
99
|
+
* full args (command bodies, diffs, etc.) come from the args field, so this
|
|
100
|
+
* stays compact — no truncation here, just a label.
|
|
101
|
+
*/
|
|
67
102
|
private describeToolCall;
|
|
68
103
|
}
|
|
69
104
|
export {};
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { RegisteredTool, ToolDefinition, ToolResult } from "../types.js";
|
|
5
5
|
import { type BuiltinToolFn } from "./builtin/index.js";
|
|
6
|
+
import type { ToolContext } from "./context.js";
|
|
7
|
+
/**
|
|
8
|
+
* Default execution timeout for any tool that does not declare its own
|
|
9
|
+
* timeoutMs at registration time. Tools that need to run longer (Agent,
|
|
10
|
+
* Arena, Bash, custom long-running tools) should set timeoutMs explicitly.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_TOOL_TIMEOUT_MS = 120000;
|
|
6
13
|
export interface ToolRegistryOptions {
|
|
7
14
|
builtinTools?: readonly string[];
|
|
8
15
|
}
|
|
@@ -18,6 +25,7 @@ export declare class ToolRegistry {
|
|
|
18
25
|
executeTool(name: string, args: Record<string, unknown>, options?: {
|
|
19
26
|
timeoutMs?: number;
|
|
20
27
|
signal?: AbortSignal;
|
|
28
|
+
ctx?: ToolContext;
|
|
21
29
|
}): Promise<ToolResult>;
|
|
22
30
|
listTools(): string[];
|
|
23
31
|
listToolsDetailed(): RegisteredTool[];
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Core type definitions for the code-shell orchestration framework.
|
|
3
3
|
*/
|
|
4
4
|
export interface ContentBlock {
|
|
5
|
-
type: "text" | "tool_use" | "tool_result" | "image";
|
|
5
|
+
type: "text" | "tool_use" | "tool_result" | "image" | "reasoning";
|
|
6
6
|
text?: string;
|
|
7
7
|
id?: string;
|
|
8
8
|
name?: string;
|
|
@@ -14,6 +14,7 @@ export interface ContentBlock {
|
|
|
14
14
|
media_type: string;
|
|
15
15
|
data: string;
|
|
16
16
|
};
|
|
17
|
+
reasoningContent?: string;
|
|
17
18
|
}
|
|
18
19
|
export interface Message {
|
|
19
20
|
role: "system" | "user" | "assistant" | "tool";
|
|
@@ -49,6 +50,12 @@ export interface RegisteredTool {
|
|
|
49
50
|
permissionDefault: PermissionDecision;
|
|
50
51
|
isConcurrencySafe?: boolean;
|
|
51
52
|
isReadOnly?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Override the default tool execution timeout (ms).
|
|
55
|
+
* Falls back to DEFAULT_TOOL_TIMEOUT_MS (120s) if unset.
|
|
56
|
+
* The caller of executeTool() can still override via options.timeoutMs.
|
|
57
|
+
*/
|
|
58
|
+
timeoutMs?: number;
|
|
52
59
|
}
|
|
53
60
|
export type TranscriptEventType = "message" | "tool_use" | "tool_result" | "summary" | "content_replace" | "file_history" | "plan_operation" | "session_meta" | "turn_boundary" | "error";
|
|
54
61
|
export interface TranscriptEvent {
|
|
@@ -118,14 +125,25 @@ export interface ApprovalRequest {
|
|
|
118
125
|
description: string;
|
|
119
126
|
riskLevel: "low" | "medium" | "high";
|
|
120
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Scope of an "always allow" decision.
|
|
130
|
+
* "once" — this single call only (default when always not set)
|
|
131
|
+
* "session" — remembered for the rest of the REPL session (in-memory)
|
|
132
|
+
* "project" — persisted to <cwd>/.code-shell/settings.local.json so it
|
|
133
|
+
* survives restart for the current project. Not committed.
|
|
134
|
+
*/
|
|
135
|
+
export type ApprovalScope = "once" | "session" | "project";
|
|
121
136
|
export type ApprovalResult = {
|
|
122
137
|
approved: true;
|
|
123
138
|
permanent?: boolean;
|
|
124
139
|
always?: boolean;
|
|
140
|
+
scope?: ApprovalScope;
|
|
141
|
+
/** Used by AskUserQuestion to carry the user's free-text answer. */ answer?: string;
|
|
125
142
|
} | {
|
|
126
143
|
approved: false;
|
|
127
144
|
reason?: string;
|
|
128
145
|
always?: boolean;
|
|
146
|
+
scope?: ApprovalScope;
|
|
129
147
|
};
|
|
130
148
|
export type TurnPhase = "pre_check" | "model_call" | "post_check" | "tool_exec" | "context_mgmt" | "hook_notify" | "complete" | "error";
|
|
131
149
|
export interface TurnResult {
|
|
@@ -142,6 +160,9 @@ export interface TaskInfo {
|
|
|
142
160
|
status: "pending" | "in_progress" | "completed" | "stopped";
|
|
143
161
|
}
|
|
144
162
|
export type StreamEvent = {
|
|
163
|
+
type: "session_started";
|
|
164
|
+
sessionId: string;
|
|
165
|
+
} | {
|
|
145
166
|
type: "stream_request_start";
|
|
146
167
|
turnNumber: number;
|
|
147
168
|
agentId?: string;
|
|
@@ -153,6 +174,11 @@ export type StreamEvent = {
|
|
|
153
174
|
type: "tool_use_start";
|
|
154
175
|
toolCall: ToolCall;
|
|
155
176
|
agentId?: string;
|
|
177
|
+
} | {
|
|
178
|
+
type: "tool_use_args_delta";
|
|
179
|
+
toolCallId: string;
|
|
180
|
+
args: Record<string, unknown>;
|
|
181
|
+
agentId?: string;
|
|
156
182
|
} | {
|
|
157
183
|
type: "tool_result";
|
|
158
184
|
result: ToolResult;
|
|
@@ -191,6 +217,12 @@ export type StreamEvent = {
|
|
|
191
217
|
} | {
|
|
192
218
|
type: "tool_summary";
|
|
193
219
|
summary: string;
|
|
220
|
+
} | {
|
|
221
|
+
type: "context_compact";
|
|
222
|
+
strategy: "summary" | "window" | "snip" | "emergency";
|
|
223
|
+
before: number;
|
|
224
|
+
after: number;
|
|
225
|
+
agentId?: string;
|
|
194
226
|
};
|
|
195
227
|
export type StreamCallback = (event: StreamEvent) => void | Promise<void>;
|
|
196
228
|
export interface LLMConfig {
|
|
@@ -210,6 +242,7 @@ export interface LLMResponse {
|
|
|
210
242
|
toolCalls: ToolCall[];
|
|
211
243
|
usage?: TokenUsage;
|
|
212
244
|
stopReason?: string;
|
|
245
|
+
reasoningContent?: string;
|
|
213
246
|
}
|
|
214
247
|
export interface LLMStreamChunk {
|
|
215
248
|
type: "text" | "tool_use_start" | "tool_use_delta" | "tool_use_end" | "stop";
|
package/dist/ui/App.d.ts
CHANGED
|
@@ -10,5 +10,5 @@ interface AppProps {
|
|
|
10
10
|
/** Pre-fill the input box without submitting (--prefill flag). */
|
|
11
11
|
prefill?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare function App({ client, model: initialModel, effort, maxTurns, cwd, maxContextTokens, sessionId: initialSessionId, prefill }: AppProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function App({ client, model: initialModel, effort, maxTurns, cwd, maxContextTokens, sessionId: initialSessionId, prefill, }: AppProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -25,7 +25,7 @@ export declare function AgentBlockEnd({ description, error, isLast }: AgentBlock
|
|
|
25
25
|
/**
|
|
26
26
|
* Tree line prefix for nested content under an agent.
|
|
27
27
|
*/
|
|
28
|
-
export declare function NestedPrefix({ children, isLast }: {
|
|
28
|
+
export declare function NestedPrefix({ children, isLast, }: {
|
|
29
29
|
children: React.ReactNode;
|
|
30
30
|
isLast?: boolean;
|
|
31
31
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
interface MessageContentProps {
|
|
2
2
|
text: string;
|
|
3
3
|
streaming?: boolean;
|
|
4
|
+
/** When rendered inside an agent block, suppress the leading message gap. */
|
|
5
|
+
nested?: boolean;
|
|
4
6
|
}
|
|
5
|
-
export declare function MessageContent({ text, streaming }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export declare function MessageContent({ text, streaming, nested }: MessageContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
8
|
interface UserMessageProps {
|
|
7
9
|
text: string;
|
|
8
10
|
}
|
|
9
11
|
export declare function UserMessage({ text }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
interface ErrorMessageProps {
|
|
11
13
|
error: string;
|
|
14
|
+
nested?: boolean;
|
|
12
15
|
}
|
|
13
|
-
export declare function ErrorMessage({ error }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function ErrorMessage({ error, nested }: ErrorMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
export declare function RateLimitMessage({ text }: {
|
|
15
18
|
text: string;
|
|
16
19
|
}): import("react/jsx-runtime").JSX.Element;
|
|
17
20
|
export declare function ContextLimitMessage(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export declare function ThinkingMessage({ content, collapsed }: {
|
|
21
|
+
export declare function ThinkingMessage({ content, collapsed, nested, }: {
|
|
19
22
|
content?: string;
|
|
20
23
|
collapsed?: boolean;
|
|
24
|
+
nested?: boolean;
|
|
21
25
|
}): import("react/jsx-runtime").JSX.Element;
|
|
22
26
|
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ProtocolModelEntry } from "../../protocol/types.js";
|
|
2
|
+
interface SnapshotInfo {
|
|
3
|
+
count: number;
|
|
4
|
+
fetchedAt: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Settings stores arena.participants as Array<string | object>. The panel
|
|
8
|
+
* surfaces strings (pool keys); object-form entries are shown read-only so
|
|
9
|
+
* we don't clobber a user's hand-edited config.
|
|
10
|
+
*/
|
|
11
|
+
export type ArenaParticipantEntry = {
|
|
12
|
+
kind: "key";
|
|
13
|
+
value: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: "object";
|
|
16
|
+
label: string;
|
|
17
|
+
};
|
|
18
|
+
interface ModelManagerProps {
|
|
19
|
+
entries: ProtocolModelEntry[];
|
|
20
|
+
snapshot: SnapshotInfo;
|
|
21
|
+
arenaParticipants: ArenaParticipantEntry[];
|
|
22
|
+
/** Activate a model. */
|
|
23
|
+
onSwitch: (key: string) => Promise<void>;
|
|
24
|
+
/** Trigger an OpenRouter snapshot refresh. */
|
|
25
|
+
onSync: () => Promise<{
|
|
26
|
+
ok: boolean;
|
|
27
|
+
count: number;
|
|
28
|
+
error?: string;
|
|
29
|
+
}>;
|
|
30
|
+
/** Persist updated participant list (string[]) to settings. */
|
|
31
|
+
onSaveArena: (participants: string[]) => Promise<void>;
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function ModelManager({ entries, snapshot, arenaParticipants, onSwitch, onSync, onSaveArena, onClose, }: ModelManagerProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProtocolModelEntry } from "../../protocol/types.js";
|
|
2
|
+
/** Re-export under the UI name for convenience. */
|
|
3
|
+
export type ModelEntry = ProtocolModelEntry;
|
|
4
|
+
interface ModelSelectorProps {
|
|
5
|
+
entries: ModelEntry[];
|
|
6
|
+
onSelect: (key: string) => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function ModelSelector({ entries, onSelect, onCancel }: ModelSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type OnboardingResult } from "../../cli/onboarding.js";
|
|
2
|
+
interface OnboardingPromptProps {
|
|
3
|
+
onComplete: (result: OnboardingResult) => void;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function OnboardingPrompt({ onComplete, onCancel }: OnboardingPromptProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import type { ApprovalScope } from "../../types.js";
|
|
1
2
|
interface PermissionPromptProps {
|
|
2
3
|
toolName: string;
|
|
3
4
|
description: string;
|
|
4
5
|
riskLevel: string;
|
|
5
|
-
|
|
6
|
+
args: Record<string, unknown>;
|
|
7
|
+
cwd: string;
|
|
8
|
+
onDecision: (approved: boolean, scope: ApprovalScope) => void;
|
|
6
9
|
}
|
|
7
|
-
export declare function PermissionPrompt({ toolName, description, riskLevel, onDecision }: PermissionPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function PermissionPrompt({ toolName, description, riskLevel, args, cwd, onDecision, }: PermissionPromptProps): import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface SessionPickerEntry {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
startedAt: number;
|
|
4
|
+
turnCount: number;
|
|
5
|
+
preview?: string;
|
|
6
|
+
cwd?: string;
|
|
7
|
+
}
|
|
8
|
+
interface SessionPickerProps {
|
|
9
|
+
entries: SessionPickerEntry[];
|
|
10
|
+
onSelect: (sessionId: string) => void;
|
|
11
|
+
onCancel: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function SessionPicker({ entries, onSelect, onCancel }: SessionPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -12,11 +12,13 @@ interface StatusLineProps {
|
|
|
12
12
|
tokens: number;
|
|
13
13
|
cost: number;
|
|
14
14
|
sessionId?: string;
|
|
15
|
-
|
|
15
|
+
/** Last known prompt tokens from completed turn. Live streaming is added on top. */
|
|
16
|
+
baseContextTokens?: number;
|
|
17
|
+
maxContextTokens?: number;
|
|
16
18
|
gitBranch?: string;
|
|
17
19
|
isRunning?: boolean;
|
|
18
20
|
streamingCharsRef?: MutableRefObject<number>;
|
|
19
21
|
runStartRef?: MutableRefObject<number>;
|
|
20
22
|
}
|
|
21
|
-
export declare function StatusLine({ model, effort, tokens, cost, sessionId,
|
|
23
|
+
export declare function StatusLine({ model, effort, tokens, cost, sessionId, baseContextTokens, maxContextTokens, gitBranch, isRunning, streamingCharsRef, runStartRef, }: StatusLineProps): import("react/jsx-runtime").JSX.Element;
|
|
22
24
|
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* version uses the lightweight ui/theme.ts context.
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
-
import { type BoxProps } from "../../
|
|
10
|
+
import { type BoxProps } from "../../render/index.js";
|
|
11
11
|
import type { Theme } from "../../utils/theme.js";
|
|
12
12
|
type ColorProp = keyof Theme | string;
|
|
13
13
|
export interface ThemedBoxProps extends Omit<BoxProps, "borderColor" | "backgroundColor"> {
|
|
@@ -16,6 +16,13 @@ interface ToolCallResultProps {
|
|
|
16
16
|
nested?: boolean;
|
|
17
17
|
/** When true, show full output instead of collapsed preview. */
|
|
18
18
|
expanded?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* When true, render as a single dim line — used for transient
|
|
21
|
+
* "this attempt failed and was retried" cases (e.g. Arena's
|
|
22
|
+
* fail-fast endpoint check) so the feed isn't swamped with scary
|
|
23
|
+
* red error cards for what was just a parameter fix-up.
|
|
24
|
+
*/
|
|
25
|
+
compact?: boolean;
|
|
19
26
|
}
|
|
20
|
-
export declare function ToolCallResult({ toolName, result, error, nested, expanded: forceExpand }: ToolCallResultProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function ToolCallResult({ toolName, result, error, nested, expanded: forceExpand, compact, }: ToolCallResultProps): import("react/jsx-runtime").JSX.Element;
|
|
21
28
|
export {};
|