@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.
Files changed (281) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +8 -0
  3. package/dist/anthropic-P5VETAFI.cjs +10 -0
  4. package/dist/{anthropic-NENYS535.js → anthropic-W2GU3D76.js} +3 -2
  5. package/dist/arena/context/context-tools.d.ts +1 -1
  6. package/dist/arena/index.cjs +4 -4
  7. package/dist/arena/index.js +3 -3
  8. package/dist/arena/providers/index.d.ts +19 -3
  9. package/dist/arena/strategies/utils.d.ts +6 -1
  10. package/dist/arena/types.d.ts +10 -1
  11. package/dist/{arena-46QQ6BZQ.js → arena-ENHBHB2W.js} +5 -7
  12. package/dist/{arena-HZZZ2GJH.cjs → arena-HHDYYVHJ.cjs} +19 -21
  13. package/dist/{chunk-BE6IPRDM.js → chunk-2EUAE7AY.js} +1 -1
  14. package/dist/{chunk-WFQF3RT4.cjs → chunk-3CAZIWUA.cjs} +11 -8
  15. package/dist/{chunk-J5XW6UYL.js → chunk-5C5HIOML.js} +63 -4
  16. package/dist/chunk-75E4BBFC.js +224 -0
  17. package/dist/{chunk-ZJV3YSY3.cjs → chunk-BUJ5KYCI.cjs} +53 -11
  18. package/dist/{chunk-BMH65OVB.cjs → chunk-C7C7ZZY4.cjs} +8 -8
  19. package/dist/{chunk-KO2FPF7G.js → chunk-F5BS3GUC.js} +20 -2
  20. package/dist/chunk-FA5KD34T.js +54 -0
  21. package/dist/chunk-FV2ARONZ.cjs +224 -0
  22. package/dist/chunk-G76E5FOB.cjs +54 -0
  23. package/dist/{chunk-DICG4AB7.cjs → chunk-GZBD6QRS.cjs} +42 -3
  24. package/dist/{chunk-FVP7XJGS.cjs → chunk-HOXQLX5R.cjs} +406 -196
  25. package/dist/{chunk-4PKZPFCD.js → chunk-I57ZD5IQ.js} +47 -14
  26. package/dist/{chunk-7RMAR2Y3.js → chunk-ID6EJUHP.js} +1959 -473
  27. package/dist/chunk-JHNCK7JP.cjs +202 -0
  28. package/dist/{chunk-R32DJSJE.cjs → chunk-JHXNOB5G.cjs} +8 -5
  29. package/dist/{chunk-UK2SU23S.cjs → chunk-KOGV6PDQ.cjs} +20 -2
  30. package/dist/{chunk-VKGNCYRL.js → chunk-LMEKCQX4.js} +95 -13
  31. package/dist/{chunk-3EAEC566.cjs → chunk-M2QI5X3X.cjs} +51 -18
  32. package/dist/{chunk-YZ25SSWJ.js → chunk-M2SVOKC6.js} +46 -4
  33. package/dist/chunk-OMRGA6TI.js +4753 -0
  34. package/dist/{chunk-NG73UR3L.cjs → chunk-OP57WUWQ.cjs} +23 -1
  35. package/dist/{chunk-ZXYDDJEJ.js → chunk-OUC2DFA7.js} +2 -2
  36. package/dist/{chunk-6JOOLG6F.js → chunk-REFCCVDM.js} +5 -2
  37. package/dist/{chunk-O6F2EF2Z.js → chunk-SCDKLTN3.js} +41 -2
  38. package/dist/{chunk-BHGIJ2DJ.js → chunk-SW3L7HIM.js} +6 -3
  39. package/dist/chunk-TATCTZSB.cjs +4753 -0
  40. package/dist/{chunk-QHDYFC5U.cjs → chunk-VWFET3MG.cjs} +2132 -646
  41. package/dist/{chunk-3EUDE77E.cjs → chunk-X2DNIMPC.cjs} +19 -19
  42. package/dist/{chunk-SQZHPD3S.js → chunk-Y7TSCDF6.js} +297 -87
  43. package/dist/{chunk-WHRTARDJ.cjs → chunk-YAFCN7ZW.cjs} +112 -30
  44. package/dist/{chunk-LRAY5IYC.cjs → chunk-YD7XTI7T.cjs} +65 -6
  45. package/dist/{chunk-S74VVJBF.js → chunk-ZLPJJZUW.js} +23 -1
  46. package/dist/chunk-ZRVPCXI7.js +202 -0
  47. package/dist/cli/commands/builtin/advanced-commands.d.ts +1 -1
  48. package/dist/cli/commands/builtin/extra-commands.d.ts +2 -2
  49. package/dist/cli/commands/builtin/more-commands.d.ts +1 -3
  50. package/dist/cli/commands/registry.d.ts +8 -0
  51. package/dist/cli/cost-tracker.d.ts +6 -0
  52. package/dist/cli/main.cjs +3576 -2036
  53. package/dist/cli/main.js +3613 -2073
  54. package/dist/cli/onboarding.d.ts +67 -14
  55. package/dist/client-base-TOVE25FA.js +9 -0
  56. package/dist/client-base-VDDIADAC.cjs +9 -0
  57. package/dist/compaction-D3KV2NWY.cjs +31 -0
  58. package/dist/{compaction-CCHWA4G6.js → compaction-YNWCEF7B.js} +1 -2
  59. package/dist/context/manager.d.ts +9 -0
  60. package/dist/data/openrouter-models.d.ts +35 -0
  61. package/dist/data/openrouter-sync.d.ts +16 -0
  62. package/dist/{devtools-KIY3LWQJ.js → devtools-IRQQPIRY.js} +1 -1
  63. package/dist/{devtools-LRP47DDV.cjs → devtools-WTC3NFNE.cjs} +1 -1
  64. package/dist/engine/engine.d.ts +39 -4
  65. package/dist/engine/turn-loop.d.ts +13 -4
  66. package/dist/engine/turn-state.d.ts +6 -0
  67. package/dist/index.cjs +19 -28
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.js +28 -37
  70. package/dist/llm/client-base.d.ts +7 -0
  71. package/dist/llm/model-pool.d.ts +4 -0
  72. package/dist/logging/logger.d.ts +69 -8
  73. package/dist/manager-FWLOVEEK.cjs +7 -0
  74. package/dist/manager-GEXJLOIS.js +7 -0
  75. package/dist/{mcp-manager-OKXHHWYR.js → mcp-manager-37GQLFGX.js} +2 -2
  76. package/dist/mcp-manager-U77NEXBY.cjs +8 -0
  77. package/dist/memory-ADGOWADP.cjs +9 -0
  78. package/dist/memory-EPFDBPII.js +9 -0
  79. package/dist/native-ts/yoga-layout/index.d.ts +2 -2
  80. package/dist/{openai-5HQGBL4L.js → openai-RXU5URYI.js} +3 -2
  81. package/dist/openai-SQW4H2K4.cjs +10 -0
  82. package/dist/openrouter-models-OL725CL6.js +15 -0
  83. package/dist/openrouter-models-UM3AOGZ4.cjs +15 -0
  84. package/dist/openrouter-sync-CWD5VNW2.js +11 -0
  85. package/dist/openrouter-sync-HYZZC6RX.cjs +11 -0
  86. package/dist/product/index.cjs +12 -16
  87. package/dist/product/index.js +11 -15
  88. package/dist/product/types.d.ts +2 -7
  89. package/dist/protocol/types.d.ts +11 -3
  90. package/dist/{ink → render}/hooks/use-input.d.ts +1 -1
  91. package/dist/run/EngineRunner.d.ts +3 -1
  92. package/dist/run/RunManager.d.ts +6 -0
  93. package/dist/run/factory.d.ts +7 -1
  94. package/dist/run/index.cjs +12 -16
  95. package/dist/run/index.js +11 -15
  96. package/dist/session/memory.d.ts +23 -3
  97. package/dist/session/session-manager.d.ts +4 -1
  98. package/dist/{session-manager-UQKB564H.cjs → session-manager-HRSKENKB.cjs} +2 -2
  99. package/dist/{session-manager-JIIBCFTC.js → session-manager-NEKFEHF3.js} +1 -1
  100. package/dist/settings/manager.d.ts +9 -0
  101. package/dist/settings/schema.d.ts +48 -39
  102. package/dist/{tool-summary-J2ICNMWP.js → tool-summary-2RUFL5QK.js} +1 -1
  103. package/dist/{tool-summary-5P2GKRA4.cjs → tool-summary-RYNR4DDB.cjs} +2 -2
  104. package/dist/tool-system/builtin/agent-registry.d.ts +36 -0
  105. package/dist/tool-system/builtin/agent.d.ts +7 -26
  106. package/dist/tool-system/builtin/apply-patch/applier.d.ts +26 -0
  107. package/dist/tool-system/builtin/apply-patch/index.d.ts +19 -0
  108. package/dist/tool-system/builtin/apply-patch/parser.d.ts +17 -0
  109. package/dist/tool-system/builtin/apply-patch/seek-sequence.d.ts +18 -0
  110. package/dist/tool-system/builtin/apply-patch/types.d.ts +49 -0
  111. package/dist/tool-system/builtin/arena.d.ts +18 -5
  112. package/dist/tool-system/builtin/ask-user.d.ts +6 -6
  113. package/dist/tool-system/builtin/index.d.ts +11 -1
  114. package/dist/tool-system/builtin/tool-search.d.ts +2 -3
  115. package/dist/tool-system/context.d.ts +74 -0
  116. package/dist/tool-system/executor.d.ts +16 -0
  117. package/dist/tool-system/permission.d.ts +40 -5
  118. package/dist/tool-system/registry.d.ts +8 -0
  119. package/dist/types.d.ts +34 -1
  120. package/dist/ui/App.d.ts +1 -1
  121. package/dist/ui/components/AgentBlock.d.ts +1 -1
  122. package/dist/ui/components/AskUserPrompt.d.ts +7 -0
  123. package/dist/ui/components/MessageContent.d.ts +7 -3
  124. package/dist/ui/components/ModelManager.d.ts +35 -0
  125. package/dist/ui/components/ModelSelector.d.ts +10 -0
  126. package/dist/ui/components/OnboardingPrompt.d.ts +7 -0
  127. package/dist/ui/components/PermissionPrompt.d.ts +5 -2
  128. package/dist/ui/components/SessionPicker.d.ts +14 -0
  129. package/dist/ui/components/StatusLine.d.ts +4 -2
  130. package/dist/ui/components/ThemedBox.d.ts +1 -1
  131. package/dist/ui/components/ToolCall.d.ts +8 -1
  132. package/dist/ui/components/WelcomeTips.d.ts +5 -0
  133. package/dist/ui/onboarding-runner.d.ts +2 -0
  134. package/dist/ui/store.d.ts +1 -0
  135. package/dist/{updater-URVNPDPW.cjs → updater-M7L42ASZ.cjs} +4 -4
  136. package/dist/{updater-AVD4LKTQ.js → updater-ZRTONIR4.js} +4 -4
  137. package/dist/utils/debug.d.ts +17 -33
  138. package/package.json +4 -4
  139. package/dist/anthropic-XMTTVNSH.cjs +0 -9
  140. package/dist/bridge-4ZRXVWBN.js +0 -98
  141. package/dist/bridge-W476QDFH.cjs +0 -98
  142. package/dist/chunk-4RRUP4MM.js +0 -86
  143. package/dist/chunk-4SFPFHMG.js +0 -132
  144. package/dist/chunk-5LHVI777.cjs +0 -246
  145. package/dist/chunk-6ZIROYXX.js +0 -207
  146. package/dist/chunk-C7JBCO5V.js +0 -80
  147. package/dist/chunk-CSO5EOEP.cjs +0 -132
  148. package/dist/chunk-FGZGCFJX.cjs +0 -207
  149. package/dist/chunk-HD7MT5XU.cjs +0 -86
  150. package/dist/chunk-IMMTBZ33.cjs +0 -63
  151. package/dist/chunk-JT2WSQSR.cjs +0 -335
  152. package/dist/chunk-NZ4DQ72D.cjs +0 -664
  153. package/dist/chunk-OG4MIQJ6.js +0 -335
  154. package/dist/chunk-WRZJUQ5Z.js +0 -664
  155. package/dist/chunk-X4HAERTQ.js +0 -63
  156. package/dist/chunk-XHC2JMEC.cjs +0 -80
  157. package/dist/chunk-ZRSSGYA5.js +0 -246
  158. package/dist/compaction-44I55TLI.cjs +0 -32
  159. package/dist/coordinator-5HY7ALO2.js +0 -7
  160. package/dist/coordinator-INDLPVMF.cjs +0 -7
  161. package/dist/cost-tracker-IWYAUPXH.js +0 -9
  162. package/dist/cost-tracker-JXTJQQWE.cjs +0 -9
  163. package/dist/loader-DXFSUB4R.cjs +0 -91
  164. package/dist/loader-J5UID6CV.js +0 -91
  165. package/dist/manager-ETWDOCHN.cjs +0 -9
  166. package/dist/manager-HGMQNEJB.cjs +0 -11
  167. package/dist/manager-HUAQOORS.js +0 -9
  168. package/dist/manager-VJIZ2CQC.js +0 -11
  169. package/dist/mcp-manager-G4G2QASE.cjs +0 -8
  170. package/dist/memory-AP747G5H.js +0 -7
  171. package/dist/memory-BH3BYUN5.cjs +0 -7
  172. package/dist/onboarding-6WEPV7C2.js +0 -11
  173. package/dist/onboarding-QM5DY2TU.cjs +0 -11
  174. package/dist/openai-656VWUQW.cjs +0 -9
  175. package/dist/skills-63RBYQRX.js +0 -13
  176. package/dist/skills-V3BPLW3D.cjs +0 -13
  177. package/dist/token-counter-CHAXW5O7.cjs +0 -13
  178. package/dist/token-counter-DSOZGZ5Q.js +0 -13
  179. package/dist/utils/log.d.ts +0 -56
  180. package/dist/voice-KTZ7PAGO.js +0 -80
  181. package/dist/voice-KZE25GKB.cjs +0 -80
  182. /package/dist/{ink → render}/Ansi.d.ts +0 -0
  183. /package/dist/{ink → render}/bidi.d.ts +0 -0
  184. /package/dist/{ink → render}/clearTerminal.d.ts +0 -0
  185. /package/dist/{ink → render}/colorize.d.ts +0 -0
  186. /package/dist/{ink → render}/components/AlternateScreen.d.ts +0 -0
  187. /package/dist/{ink → render}/components/App.d.ts +0 -0
  188. /package/dist/{ink → render}/components/AppContext.d.ts +0 -0
  189. /package/dist/{ink → render}/components/Box.d.ts +0 -0
  190. /package/dist/{ink → render}/components/Button.d.ts +0 -0
  191. /package/dist/{ink → render}/components/ClockContext.d.ts +0 -0
  192. /package/dist/{ink → render}/components/CursorDeclarationContext.d.ts +0 -0
  193. /package/dist/{ink → render}/components/ErrorOverview.d.ts +0 -0
  194. /package/dist/{ink → render}/components/Link.d.ts +0 -0
  195. /package/dist/{ink → render}/components/Newline.d.ts +0 -0
  196. /package/dist/{ink → render}/components/NoSelect.d.ts +0 -0
  197. /package/dist/{ink → render}/components/RawAnsi.d.ts +0 -0
  198. /package/dist/{ink → render}/components/ScrollBox.d.ts +0 -0
  199. /package/dist/{ink → render}/components/Spacer.d.ts +0 -0
  200. /package/dist/{ink → render}/components/StdinContext.d.ts +0 -0
  201. /package/dist/{ink → render}/components/TerminalFocusContext.d.ts +0 -0
  202. /package/dist/{ink → render}/components/TerminalSizeContext.d.ts +0 -0
  203. /package/dist/{ink → render}/components/Text.d.ts +0 -0
  204. /package/dist/{ink → render}/constants.d.ts +0 -0
  205. /package/dist/{ink → render}/cursor.d.ts +0 -0
  206. /package/dist/{ink → render}/devtools.d.ts +0 -0
  207. /package/dist/{ink → render}/dom.d.ts +0 -0
  208. /package/dist/{ink → render}/events/click-event.d.ts +0 -0
  209. /package/dist/{ink → render}/events/dispatcher.d.ts +0 -0
  210. /package/dist/{ink → render}/events/emitter.d.ts +0 -0
  211. /package/dist/{ink → render}/events/event-handlers.d.ts +0 -0
  212. /package/dist/{ink → render}/events/event.d.ts +0 -0
  213. /package/dist/{ink → render}/events/focus-event.d.ts +0 -0
  214. /package/dist/{ink → render}/events/input-event.d.ts +0 -0
  215. /package/dist/{ink → render}/events/keyboard-event.d.ts +0 -0
  216. /package/dist/{ink → render}/events/paste-event.d.ts +0 -0
  217. /package/dist/{ink → render}/events/resize-event.d.ts +0 -0
  218. /package/dist/{ink → render}/events/terminal-event.d.ts +0 -0
  219. /package/dist/{ink → render}/events/terminal-focus-event.d.ts +0 -0
  220. /package/dist/{ink → render}/focus.d.ts +0 -0
  221. /package/dist/{ink → render}/frame.d.ts +0 -0
  222. /package/dist/{ink → render}/get-max-width.d.ts +0 -0
  223. /package/dist/{ink → render}/hit-test.d.ts +0 -0
  224. /package/dist/{ink → render}/hooks/use-animation-frame.d.ts +0 -0
  225. /package/dist/{ink → render}/hooks/use-app.d.ts +0 -0
  226. /package/dist/{ink → render}/hooks/use-declared-cursor.d.ts +0 -0
  227. /package/dist/{ink → render}/hooks/use-interval.d.ts +0 -0
  228. /package/dist/{ink → render}/hooks/use-search-highlight.d.ts +0 -0
  229. /package/dist/{ink → render}/hooks/use-selection.d.ts +0 -0
  230. /package/dist/{ink → render}/hooks/use-stdin.d.ts +0 -0
  231. /package/dist/{ink → render}/hooks/use-tab-status.d.ts +0 -0
  232. /package/dist/{ink → render}/hooks/use-terminal-focus.d.ts +0 -0
  233. /package/dist/{ink → render}/hooks/use-terminal-title.d.ts +0 -0
  234. /package/dist/{ink → render}/hooks/use-terminal-viewport.d.ts +0 -0
  235. /package/dist/{ink → render}/index.d.ts +0 -0
  236. /package/dist/{ink → render}/ink.d.ts +0 -0
  237. /package/dist/{ink → render}/instances.d.ts +0 -0
  238. /package/dist/{ink → render}/layout/engine.d.ts +0 -0
  239. /package/dist/{ink → render}/layout/geometry.d.ts +0 -0
  240. /package/dist/{ink → render}/layout/node.d.ts +0 -0
  241. /package/dist/{ink → render}/layout/yoga.d.ts +0 -0
  242. /package/dist/{ink → render}/line-width-cache.d.ts +0 -0
  243. /package/dist/{ink → render}/log-update.d.ts +0 -0
  244. /package/dist/{ink → render}/measure-element.d.ts +0 -0
  245. /package/dist/{ink → render}/measure-text.d.ts +0 -0
  246. /package/dist/{ink → render}/node-cache.d.ts +0 -0
  247. /package/dist/{ink → render}/optimizer.d.ts +0 -0
  248. /package/dist/{ink → render}/output.d.ts +0 -0
  249. /package/dist/{ink → render}/parse-keypress.d.ts +0 -0
  250. /package/dist/{ink → render}/reconciler.d.ts +0 -0
  251. /package/dist/{ink → render}/render-border.d.ts +0 -0
  252. /package/dist/{ink → render}/render-node-to-output.d.ts +0 -0
  253. /package/dist/{ink → render}/render-to-screen.d.ts +0 -0
  254. /package/dist/{ink → render}/renderer.d.ts +0 -0
  255. /package/dist/{ink → render}/root.d.ts +0 -0
  256. /package/dist/{ink → render}/screen.d.ts +0 -0
  257. /package/dist/{ink → render}/searchHighlight.d.ts +0 -0
  258. /package/dist/{ink → render}/selection.d.ts +0 -0
  259. /package/dist/{ink → render}/squash-text-nodes.d.ts +0 -0
  260. /package/dist/{ink → render}/stringWidth.d.ts +0 -0
  261. /package/dist/{ink → render}/styles.d.ts +0 -0
  262. /package/dist/{ink → render}/supports-hyperlinks.d.ts +0 -0
  263. /package/dist/{ink → render}/tabstops.d.ts +0 -0
  264. /package/dist/{ink → render}/terminal-focus-state.d.ts +0 -0
  265. /package/dist/{ink → render}/terminal-querier.d.ts +0 -0
  266. /package/dist/{ink → render}/terminal.d.ts +0 -0
  267. /package/dist/{ink → render}/termio/ansi.d.ts +0 -0
  268. /package/dist/{ink → render}/termio/csi.d.ts +0 -0
  269. /package/dist/{ink → render}/termio/dec.d.ts +0 -0
  270. /package/dist/{ink → render}/termio/esc.d.ts +0 -0
  271. /package/dist/{ink → render}/termio/osc.d.ts +0 -0
  272. /package/dist/{ink → render}/termio/parser.d.ts +0 -0
  273. /package/dist/{ink → render}/termio/sgr.d.ts +0 -0
  274. /package/dist/{ink → render}/termio/tokenize.d.ts +0 -0
  275. /package/dist/{ink → render}/termio/types.d.ts +0 -0
  276. /package/dist/{ink → render}/termio.d.ts +0 -0
  277. /package/dist/{ink → render}/useTerminalNotification.d.ts +0 -0
  278. /package/dist/{ink → render}/warn.d.ts +0 -0
  279. /package/dist/{ink → render}/widest-line.d.ts +0 -0
  280. /package/dist/{ink → render}/wrap-text.d.ts +0 -0
  281. /package/dist/{ink → render}/wrapAnsi.d.ts +0 -0
@@ -1,26 +1,79 @@
1
1
  /**
2
- * First-run onboardinginteractive API key setup with arrow-key navigation.
3
- *
4
- * Features:
5
- * - Arrow-key (↑/↓) selection for providers and models
6
- * - ESC to go back to previous step
7
- * - Multi-provider configuration for Arena
8
- * - API key validation before saving
2
+ * Onboarding data layer provider catalog, env detection, key validation,
3
+ * settings persistence. The interactive flow itself is rendered by Ink
4
+ * (see src/ui/components/OnboardingPrompt.tsx); this module only exposes
5
+ * pure(-ish) helpers it consumes, so there's a single input stack.
9
6
  */
10
- interface OnboardingResult {
7
+ export interface OnboardingResult {
11
8
  provider: string;
12
9
  model: string;
13
10
  apiKey: string;
14
11
  baseUrl: string;
15
12
  }
13
+ export interface ProviderDef {
14
+ id: string;
15
+ name: string;
16
+ envKey: string;
17
+ provider: string;
18
+ baseUrl: string;
19
+ defaultModel: string;
20
+ keyUrl: string;
21
+ keyPrefix: string;
22
+ models: string[];
23
+ /** When true, skip API key prompt (e.g. local providers like Ollama). */
24
+ noKey?: boolean;
25
+ }
26
+ export declare const PROVIDERS: ProviderDef[];
27
+ /**
28
+ * Resolve the model list a provider should expose right now. For
29
+ * OpenRouter this comes from the snapshot; for direct providers it
30
+ * stays hardcoded (snapshot doesn't carry their native IDs).
31
+ */
32
+ export declare function resolveProviderModels(provider: ProviderDef): string[];
33
+ export interface DetectedEnvKey {
34
+ provider: ProviderDef;
35
+ envKey: string;
36
+ apiKey: string;
37
+ }
38
+ /**
39
+ * Scan environment for known provider API keys.
40
+ * Returns one entry per provider that has its envKey set.
41
+ */
42
+ export declare function detectEnvKeys(): DetectedEnvKey[];
43
+ /** Mask a key for display: "sk-517f...b594" */
44
+ export declare function maskKey(key: string): string;
45
+ export declare function validateApiKey(baseUrl: string, apiKey: string): Promise<boolean>;
16
46
  export declare function hasApiKey(): boolean;
17
47
  /**
18
- * Run the full onboarding wizard. Supports ESC to go back at every step.
48
+ * Resolve a model's max-output-token budget. Lookup order:
49
+ * 1. KNOWN_MAX_OUTPUT (covers direct providers like Anthropic/DeepSeek
50
+ * whose IDs aren't in the OpenRouter snapshot)
51
+ * 2. OpenRouter snapshot (covers `vendor/model` style IDs)
52
+ * 3. undefined — caller falls back to its own default
53
+ *
54
+ * Returns undefined (not 0) when nothing is known, so callers can use
55
+ * `?? defaultValue` semantics.
56
+ */
57
+ export declare function resolveMaxOutput(model: string): number | undefined;
58
+ /**
59
+ * Derive a short key from a model path.
60
+ * "anthropic/claude-opus-4.7" → "claude-opus"
61
+ * "openai/gpt-5" → "gpt"
62
+ * "deepseek/deepseek-chat" → "deepseek"
19
63
  */
20
- export declare function runOnboarding(): Promise<OnboardingResult>;
64
+ export declare function modelKey(model: string): string;
21
65
  /**
22
- * Re-run onboarding from REPL (/login command).
23
- * Clears existing config first.
66
+ * Build model pool entries from a provider's model list.
24
67
  */
25
- export declare function reconfigure(): Promise<OnboardingResult>;
26
- export {};
68
+ export declare function buildModelPool(provider: ProviderDef, apiKey: string): Array<{
69
+ key: string;
70
+ label: string;
71
+ provider: string;
72
+ model: string;
73
+ baseUrl: string;
74
+ apiKey: string;
75
+ maxOutputTokens?: number;
76
+ }>;
77
+ export declare function modelDisplayName(model: string): string;
78
+ export declare function saveSettings(result: OnboardingResult, providerDef?: ProviderDef, poolModels?: string[]): void;
79
+ export declare function saveArenaSettingsByKeys(keys: string[]): void;
@@ -0,0 +1,9 @@
1
+ import {
2
+ LLMClientBase
3
+ } from "./chunk-SCDKLTN3.js";
4
+ import "./chunk-FUOKLKR2.js";
5
+ import "./chunk-ZRVPCXI7.js";
6
+ import "./chunk-DI7RDLOS.js";
7
+ export {
8
+ LLMClientBase
9
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkGZBD6QRScjs = require('./chunk-GZBD6QRS.cjs');
4
+ require('./chunk-EL2RL5DG.cjs');
5
+ require('./chunk-JHNCK7JP.cjs');
6
+ require('./chunk-IJSHQGMP.cjs');
7
+
8
+
9
+ exports.LLMClientBase = _chunkGZBD6QRScjs.LLMClientBase;
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+ var _chunkYD7XTI7Tcjs = require('./chunk-YD7XTI7T.cjs');
16
+ require('./chunk-IJSHQGMP.cjs');
17
+ _chunkYD7XTI7Tcjs.init_compaction.call(void 0, );
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+ exports.adjustIndexToPreserveAPIInvariants = _chunkYD7XTI7Tcjs.adjustIndexToPreserveAPIInvariants; exports.applySummaryCompaction = _chunkYD7XTI7Tcjs.applySummaryCompaction; exports.applyToolResultBudget = _chunkYD7XTI7Tcjs.applyToolResultBudget; exports.buildSummarizationPrompt = _chunkYD7XTI7Tcjs.buildSummarizationPrompt; exports.dropOldestRounds = _chunkYD7XTI7Tcjs.dropOldestRounds; exports.estimateTokens = _chunkYD7XTI7Tcjs.estimateTokens; exports.extractReferencedFilePaths = _chunkYD7XTI7Tcjs.extractReferencedFilePaths; exports.groupMessagesByApiRound = _chunkYD7XTI7Tcjs.groupMessagesByApiRound; exports.microcompact = _chunkYD7XTI7Tcjs.microcompact; exports.snipCompact = _chunkYD7XTI7Tcjs.snipCompact; exports.truncateToolResult = _chunkYD7XTI7Tcjs.truncateToolResult; exports.windowCompact = _chunkYD7XTI7Tcjs.windowCompact;
@@ -12,8 +12,7 @@ import {
12
12
  snipCompact,
13
13
  truncateToolResult,
14
14
  windowCompact
15
- } from "./chunk-J5XW6UYL.js";
16
- import "./chunk-4RRUP4MM.js";
15
+ } from "./chunk-5C5HIOML.js";
17
16
  import "./chunk-DI7RDLOS.js";
18
17
  init_compaction();
19
18
  export {
@@ -17,6 +17,12 @@ export interface ContextManagerConfig {
17
17
  * Injected by the Engine so the ContextManager doesn't depend on LLM directly.
18
18
  */
19
19
  export type SummarizeFn = (prompt: string) => Promise<string>;
20
+ export type CompactStrategy = "summary" | "window" | "snip" | "emergency";
21
+ export type OnCompactFn = (info: {
22
+ strategy: CompactStrategy;
23
+ before: number;
24
+ after: number;
25
+ }) => void;
20
26
  export declare class ContextManager {
21
27
  private config;
22
28
  private toolCallHashes;
@@ -29,7 +35,10 @@ export declare class ContextManager {
29
35
  private lastActualAtMessageCount;
30
36
  /** Path to session transcript — passed to summary compaction for on-demand access. */
31
37
  private transcriptPath;
38
+ /** Notified whenever a non-trivial compaction tier fires (skips microcompact). */
39
+ private onCompact;
32
40
  constructor(config?: Partial<ContextManagerConfig>);
41
+ setOnCompact(fn: OnCompactFn): void;
33
42
  /**
34
43
  * Record actual token usage from API response.
35
44
  * Used for hybrid estimation: actual + estimate for new messages.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Runtime accessor for the OpenRouter model snapshot.
3
+ *
4
+ * The snapshot is generated at build time by `scripts/sync-models.ts`
5
+ * from https://openrouter.ai/api/v1/models. Reading happens lazily on
6
+ * first call, so the JSON is parsed at most once per process.
7
+ *
8
+ * If the snapshot is missing or empty (e.g. first checkout before a
9
+ * build, or sync failure with no prior file), accessors return [] and
10
+ * callers should fall back to hardcoded defaults.
11
+ */
12
+ export interface OpenRouterModel {
13
+ id: string;
14
+ name: string;
15
+ created: number;
16
+ contextLength: number;
17
+ maxOutputTokens: number;
18
+ inputPricePerMillion: number;
19
+ outputPricePerMillion: number;
20
+ modalities: string[];
21
+ }
22
+ interface Snapshot {
23
+ fetchedAt: string;
24
+ source: string;
25
+ count: number;
26
+ models: OpenRouterModel[];
27
+ }
28
+ /** Replace the in-memory snapshot for the rest of this process. */
29
+ export declare function setOpenRouterSnapshot(next: Snapshot): void;
30
+ export declare function getOpenRouterSnapshot(): Snapshot;
31
+ export declare function getOpenRouterModels(): OpenRouterModel[];
32
+ export declare function findOpenRouterModel(id: string): OpenRouterModel | undefined;
33
+ /** Models filtered by vendor prefix, e.g. "anthropic", "openai", "deepseek". */
34
+ export declare function listOpenRouterModelsByVendor(vendor: string): OpenRouterModel[];
35
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Runtime sync of the OpenRouter model catalog.
3
+ *
4
+ * Fetches openrouter.ai/api/v1/models and replaces the bundled snapshot
5
+ * in memory for the rest of the process. Used by the /sync-models slash
6
+ * command. To persist a sync across restarts, re-run the build (which
7
+ * re-runs scripts/sync-models.ts).
8
+ */
9
+ import { getOpenRouterSnapshot } from "./openrouter-models.js";
10
+ export interface SyncResult {
11
+ ok: boolean;
12
+ count: number;
13
+ error?: string;
14
+ }
15
+ export declare function syncOpenRouterCatalog(timeoutMs?: number): Promise<SyncResult>;
16
+ export { getOpenRouterSnapshot };
@@ -2,5 +2,5 @@ import {
2
2
  init_esm_shims
3
3
  } from "./chunk-DI7RDLOS.js";
4
4
 
5
- // src/ink/devtools.ts
5
+ // src/render/devtools.ts
6
6
  init_esm_shims();
@@ -2,5 +2,5 @@
2
2
 
3
3
  var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
4
4
 
5
- // src/ink/devtools.ts
5
+ // src/render/devtools.ts
6
6
  _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
@@ -5,9 +5,11 @@ import type { LLMConfig, StreamCallback, TerminalReason, TokenUsage } from "../t
5
5
  import { ToolRegistry } from "../tool-system/registry.js";
6
6
  import { type ApprovalBackend } from "../tool-system/permission.js";
7
7
  import { HookRegistry } from "../hooks/registry.js";
8
+ import type { HookEventName } from "../hooks/events.js";
9
+ import type { HookHandler } from "../hooks/registry.js";
8
10
  import { SessionManager } from "../session/session-manager.js";
9
11
  import type { CostStateStore } from "./cost-store.js";
10
- import { type AskUserFn } from "../tool-system/builtin/ask-user.js";
12
+ import type { AskUserFn } from "../tool-system/builtin/ask-user.js";
11
13
  import { type AgentPresetName } from "../preset/index.js";
12
14
  import { ModelPool, type ModelEntry } from "../llm/model-pool.js";
13
15
  export interface EngineConfig {
@@ -24,6 +26,7 @@ export interface EngineConfig {
24
26
  sessionStorageDir?: string;
25
27
  maxContextTokens?: number;
26
28
  approvalBackend?: ApprovalBackend;
29
+ hooks?: EngineHookConfig[];
27
30
  askUser?: AskUserFn;
28
31
  mcpServers?: Record<string, import("../types.js").MCPServerConfig>;
29
32
  /**
@@ -34,6 +37,12 @@ export interface EngineConfig {
34
37
  */
35
38
  costStore?: CostStateStore;
36
39
  }
40
+ export interface EngineHookConfig {
41
+ event: HookEventName;
42
+ handler: HookHandler;
43
+ priority?: number;
44
+ name?: string;
45
+ }
37
46
  export interface EngineResult {
38
47
  text: string;
39
48
  reason: TerminalReason;
@@ -49,12 +58,25 @@ export declare class Engine {
49
58
  private sessionManager;
50
59
  private mcpManager;
51
60
  private modelPool;
61
+ private settingsManager;
62
+ private lastContextManager;
63
+ private lastMessages;
64
+ private lastSessionId;
65
+ private compactedMessagesBySession;
66
+ private activePermission;
67
+ private resolveMaxContextTokens;
52
68
  constructor(config: EngineConfig);
53
69
  /**
54
70
  * Register a custom tool (from product adapter) into the tool registry.
55
71
  * Must be called before run().
56
72
  */
57
73
  registerCustomTool(definition: import("../types.js").RegisteredTool, executor: (args: Record<string, unknown>) => Promise<string>): void;
74
+ /**
75
+ * Inject the askUser handler after construction. Used by AgentServer
76
+ * to wire its protocol-backed askUser into an Engine that was created
77
+ * before the server existed (chicken-and-egg: server takes engine in ctor).
78
+ */
79
+ setAskUser(fn: AskUserFn | undefined): void;
58
80
  /**
59
81
  * Run a task from start to finish.
60
82
  */
@@ -91,11 +113,24 @@ export declare class Engine {
91
113
  after: number;
92
114
  strategy: string;
93
115
  };
116
+ private stripUserContextMessage;
117
+ private getSettingsManager;
94
118
  /**
95
119
  * Update a config setting at runtime.
96
120
  */
97
121
  updateConfig(key: string, value: unknown): void;
98
- /** Track last context manager and messages for /compact support. */
99
- private lastContextManager;
100
- private lastMessages;
122
+ /**
123
+ * Read a settings value by dotted key (e.g. "arena.participants").
124
+ * Returns undefined if any segment is missing.
125
+ */
126
+ readSetting(key: string): unknown;
127
+ private buildPermissionConfig;
128
+ /**
129
+ * Switch permission mode at runtime. Takes effect immediately for any
130
+ * in-flight ToolExecutor (which holds a reference to the same classifier),
131
+ * and the new mode is used for any subsequent run() calls.
132
+ * Session-only — does not persist to settings.
133
+ */
134
+ setPermissionMode(mode: NonNullable<EngineConfig["permissionMode"]>): void;
135
+ getPermissionMode(): NonNullable<EngineConfig["permissionMode"]>;
101
136
  }
@@ -26,20 +26,29 @@ export interface TurnLoopDeps {
26
26
  systemPrompt: string;
27
27
  tools: import("../types.js").ToolDefinition[];
28
28
  }
29
+ export interface TurnLoopResult {
30
+ text: string;
31
+ reason: TerminalReason;
32
+ messages: Message[];
33
+ }
29
34
  export declare class TurnLoop {
30
35
  private readonly deps;
31
36
  private readonly config;
32
37
  private turnCount;
33
38
  /** Tool IDs already emitted as tool_use_start during streaming (to avoid duplicates). */
34
39
  private streamedToolIds;
40
+ /**
41
+ * Turn-scoped child logger set at the top of each loop iteration. Class
42
+ * methods invoked inside the iteration (callModelWithFallback,
43
+ * executeToolCall, ...) read it instead of using the root `logger`, so
44
+ * every line they write is tagged with the current turn/turnId.
45
+ */
46
+ private currentTurnLog;
35
47
  constructor(deps: TurnLoopDeps, config: TurnLoopConfig);
36
48
  /**
37
49
  * Run the multi-turn agent loop until completion.
38
50
  */
39
- run(initialMessages: Message[]): Promise<{
40
- text: string;
41
- reason: TerminalReason;
42
- }>;
51
+ run(initialMessages: Message[]): Promise<TurnLoopResult>;
43
52
  /**
44
53
  * Call model with streaming fallback.
45
54
  * If streaming fails, emit tombstone and retry non-streaming.
@@ -12,3 +12,9 @@ export interface TurnState {
12
12
  terminalReason?: TerminalReason;
13
13
  }
14
14
  export declare function initialTurnState(turnNumber: number): TurnState;
15
+ /**
16
+ * Short, human-readable turn correlation ID. Stamped on every log entry
17
+ * written for the duration of one turn so `jq 'select(.turnId == "abc123")'`
18
+ * pulls a single turn's whole timeline out of the daily log file.
19
+ */
20
+ export declare function newTurnId(): string;
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkWFQF3RT4cjs = require('./chunk-WFQF3RT4.cjs');
3
+ var _chunk3CAZIWUAcjs = require('./chunk-3CAZIWUA.cjs');
4
4
 
5
5
 
6
- var _chunkR32DJSJEcjs = require('./chunk-R32DJSJE.cjs');
6
+ var _chunkJHXNOB5Gcjs = require('./chunk-JHXNOB5G.cjs');
7
7
 
8
8
 
9
9
 
@@ -44,24 +44,18 @@ var _chunkR32DJSJEcjs = require('./chunk-R32DJSJE.cjs');
44
44
 
45
45
 
46
46
 
47
- var _chunkQHDYFC5Ucjs = require('./chunk-QHDYFC5U.cjs');
48
47
 
49
48
 
50
- var _chunk3QR52LL5cjs = require('./chunk-3QR52LL5.cjs');
51
-
52
-
53
- var _chunkUK2SU23Scjs = require('./chunk-UK2SU23S.cjs');
54
-
55
49
 
56
50
 
51
+ var _chunkVWFET3MGcjs = require('./chunk-VWFET3MG.cjs');
57
52
 
58
53
 
54
+ var _chunkKOGV6PDQcjs = require('./chunk-KOGV6PDQ.cjs');
59
55
 
60
- var _chunkFGZGCFJXcjs = require('./chunk-FGZGCFJX.cjs');
61
- require('./chunk-JT2WSQSR.cjs');
62
56
 
57
+ var _chunkC7C7ZZY4cjs = require('./chunk-C7C7ZZY4.cjs');
63
58
 
64
- var _chunkBMH65OVBcjs = require('./chunk-BMH65OVB.cjs');
65
59
 
66
60
 
67
61
 
@@ -69,22 +63,22 @@ var _chunkBMH65OVBcjs = require('./chunk-BMH65OVB.cjs');
69
63
 
70
64
 
71
65
 
66
+ var _chunkYD7XTI7Tcjs = require('./chunk-YD7XTI7T.cjs');
72
67
 
73
- var _chunkLRAY5IYCcjs = require('./chunk-LRAY5IYC.cjs');
74
- require('./chunk-HD7MT5XU.cjs');
75
68
 
69
+ var _chunkM2QI5X3Xcjs = require('./chunk-M2QI5X3X.cjs');
76
70
 
77
- var _chunk3EAEC566cjs = require('./chunk-3EAEC566.cjs');
78
71
 
79
72
 
73
+ var _chunkOP57WUWQcjs = require('./chunk-OP57WUWQ.cjs');
80
74
 
81
75
 
82
76
 
83
- var _chunkCSO5EOEPcjs = require('./chunk-CSO5EOEP.cjs');
84
77
 
78
+ var _chunkFV2ARONZcjs = require('./chunk-FV2ARONZ.cjs');
85
79
 
86
80
 
87
- var _chunkNG73UR3Lcjs = require('./chunk-NG73UR3L.cjs');
81
+ var _chunk3QR52LL5cjs = require('./chunk-3QR52LL5.cjs');
88
82
 
89
83
 
90
84
 
@@ -92,7 +86,7 @@ var _chunkNG73UR3Lcjs = require('./chunk-NG73UR3L.cjs');
92
86
 
93
87
 
94
88
 
95
- var _chunk3EUDE77Ecjs = require('./chunk-3EUDE77E.cjs');
89
+ var _chunkX2DNIMPCcjs = require('./chunk-X2DNIMPC.cjs');
96
90
 
97
91
 
98
92
 
@@ -120,19 +114,18 @@ var _chunk3EUDE77Ecjs = require('./chunk-3EUDE77E.cjs');
120
114
 
121
115
 
122
116
 
123
- var _chunkFVP7XJGScjs = require('./chunk-FVP7XJGS.cjs');
117
+ var _chunkHOXQLX5Rcjs = require('./chunk-HOXQLX5R.cjs');
124
118
 
125
119
 
126
- var _chunkIMMTBZ33cjs = require('./chunk-IMMTBZ33.cjs');
120
+ var _chunkBUJ5KYCIcjs = require('./chunk-BUJ5KYCI.cjs');
127
121
 
128
122
 
129
- var _chunkZJV3YSY3cjs = require('./chunk-ZJV3YSY3.cjs');
123
+ var _chunkYAFCN7ZWcjs = require('./chunk-YAFCN7ZW.cjs');
130
124
 
131
125
 
132
- var _chunkWHRTARDJcjs = require('./chunk-WHRTARDJ.cjs');
126
+ var _chunkGZBD6QRScjs = require('./chunk-GZBD6QRS.cjs');
133
127
 
134
128
 
135
- var _chunkDICG4AB7cjs = require('./chunk-DICG4AB7.cjs');
136
129
 
137
130
 
138
131
 
@@ -144,17 +137,17 @@ var _chunkDICG4AB7cjs = require('./chunk-DICG4AB7.cjs');
144
137
 
145
138
 
146
139
 
140
+ var _chunkEL2RL5DGcjs = require('./chunk-EL2RL5DG.cjs');
147
141
 
148
142
 
149
- var _chunkEL2RL5DGcjs = require('./chunk-EL2RL5DG.cjs');
150
- require('./chunk-XHC2JMEC.cjs');
143
+ var _chunkJHNCK7JPcjs = require('./chunk-JHNCK7JP.cjs');
151
144
 
152
145
 
153
146
  var _chunkIJSHQGMPcjs = require('./chunk-IJSHQGMP.cjs');
154
147
 
155
148
  // src/index.ts
156
149
  _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
157
- _chunkLRAY5IYCcjs.init_compaction.call(void 0, );
150
+ _chunkYD7XTI7Tcjs.init_compaction.call(void 0, );
158
151
 
159
152
  // src/arena/detect-mode.ts
160
153
  _chunkIJSHQGMPcjs.init_cjs_shims.call(void 0, );
@@ -219,8 +212,6 @@ function detectArenaMode(topic) {
219
212
  }
220
213
 
221
214
  // src/index.ts
222
- _chunkFGZGCFJXcjs.init_manager.call(void 0, );
223
- _chunkFGZGCFJXcjs.init_schema.call(void 0, );
224
215
  var VERSION = "0.1.0";
225
216
 
226
217
 
@@ -333,4 +324,4 @@ var VERSION = "0.1.0";
333
324
 
334
325
 
335
326
 
336
- exports.AnthropicClient = _chunkZJV3YSY3cjs.AnthropicClient; exports.Arena = _chunkFVP7XJGScjs.Arena; exports.ArenaLedger = _chunkFVP7XJGScjs.ArenaLedger; exports.ArtifactTracker = _chunkQHDYFC5Ucjs.ArtifactTracker; exports.AutoApprovalBackend = _chunkQHDYFC5Ucjs.AutoApprovalBackend; exports.BUILTIN_AGENT_PRESETS = _chunkQHDYFC5Ucjs.BUILTIN_AGENT_PRESETS; exports.BUILTIN_TOOLS = _chunkQHDYFC5Ucjs.BUILTIN_TOOLS; exports.CheckpointWriter = _chunkQHDYFC5Ucjs.CheckpointWriter; exports.CompositeEvaluator = _chunkQHDYFC5Ucjs.CompositeEvaluator; exports.ConfigError = _chunkEL2RL5DGcjs.ConfigError; exports.ContextLimitError = _chunkEL2RL5DGcjs.ContextLimitError; exports.ContextManager = _chunkQHDYFC5Ucjs.ContextManager; exports.DEFAULT_AGENT_PRESET = _chunkQHDYFC5Ucjs.DEFAULT_AGENT_PRESET; exports.DEFAULT_CLI_PRESET = _chunkQHDYFC5Ucjs.DEFAULT_CLI_PRESET; exports.DiscussionStrategy = _chunkFVP7XJGScjs.DiscussionStrategy; exports.Engine = _chunkQHDYFC5Ucjs.Engine; exports.EngineRunner = _chunkQHDYFC5Ucjs.EngineRunner; exports.FileHistory = _chunk3QR52LL5cjs.FileHistory; exports.FileRunStore = _chunkQHDYFC5Ucjs.FileRunStore; exports.FrameworkError = _chunkEL2RL5DGcjs.FrameworkError; exports.HeadlessApprovalBackend = _chunkQHDYFC5Ucjs.HeadlessApprovalBackend; exports.Heartbeat = _chunkQHDYFC5Ucjs.Heartbeat; exports.HookRegistry = _chunkQHDYFC5Ucjs.HookRegistry; exports.IterativeArena = _chunk3EUDE77Ecjs.IterativeArena; exports.LLMClientBase = _chunkDICG4AB7cjs.LLMClientBase; exports.LLMError = _chunkEL2RL5DGcjs.LLMError; exports.LLMRateLimitError = _chunkEL2RL5DGcjs.LLMRateLimitError; exports.MCPManager = _chunkBMH65OVBcjs.MCPManager; exports.MODEL_PRESETS = _chunkFVP7XJGScjs.MODEL_PRESETS; exports.MemoryManager = _chunk3EAEC566cjs.MemoryManager; exports.ModelPool = _chunkUK2SU23Scjs.ModelPool; exports.NoopEvaluator = _chunkQHDYFC5Ucjs.NoopEvaluator; exports.OpenAIClient = _chunkWHRTARDJcjs.OpenAIClient; exports.PermissionClassifier = _chunkQHDYFC5Ucjs.PermissionClassifier; exports.PermissionDeniedError = _chunkEL2RL5DGcjs.PermissionDeniedError; exports.PlanningStrategy = _chunkFVP7XJGScjs.PlanningStrategy; exports.PromptComposer = _chunkQHDYFC5Ucjs.PromptComposer; exports.ReviewStrategy = _chunkFVP7XJGScjs.ReviewStrategy; exports.RunApprovalBackend = _chunkQHDYFC5Ucjs.RunApprovalBackend; exports.RunLock = _chunkQHDYFC5Ucjs.RunLock; exports.RunManager = _chunkQHDYFC5Ucjs.RunManager; exports.RunQueue = _chunkQHDYFC5Ucjs.RunQueue; exports.SectionCache = _chunkQHDYFC5Ucjs.SectionCache; exports.SessionError = _chunkEL2RL5DGcjs.SessionError; exports.SessionManager = _chunkNG73UR3Lcjs.SessionManager; exports.SettingsManager = _chunkFGZGCFJXcjs.SettingsManager; exports.SettingsSchema = _chunkFGZGCFJXcjs.SettingsSchema; exports.ToolError = _chunkEL2RL5DGcjs.ToolError; exports.ToolExecutionError = _chunkEL2RL5DGcjs.ToolExecutionError; exports.ToolExecutor = _chunkQHDYFC5Ucjs.ToolExecutor; exports.ToolNotFoundError = _chunkEL2RL5DGcjs.ToolNotFoundError; exports.ToolRegistry = _chunkQHDYFC5Ucjs.ToolRegistry; exports.ToolTimeoutError = _chunkEL2RL5DGcjs.ToolTimeoutError; exports.Transcript = _chunkNG73UR3Lcjs.Transcript; exports.TranscriptError = _chunkEL2RL5DGcjs.TranscriptError; exports.VALID_TRANSITIONS = _chunkQHDYFC5Ucjs.VALID_TRANSITIONS; exports.VERSION = VERSION; exports.applyReviewResult = _chunkFVP7XJGScjs.applyReviewResult; exports.applySummaryCompaction = _chunkLRAY5IYCcjs.applySummaryCompaction; exports.availableSections = _chunkQHDYFC5Ucjs.availableSections; exports.buildDigest = _chunkFVP7XJGScjs.buildDigest; exports.buildPresetSystemPrompt = _chunkQHDYFC5Ucjs.buildPresetSystemPrompt; exports.buildSkillListing = _chunkCSO5EOEPcjs.buildSkillListing; exports.buildSummarizationPrompt = _chunkLRAY5IYCcjs.buildSummarizationPrompt; exports.collectEvidence = _chunkFVP7XJGScjs.collectEvidence; exports.combineInstructions = _chunkQHDYFC5Ucjs.combineInstructions; exports.createLLMClient = _chunkFVP7XJGScjs.createLLMClient; exports.createRunAskUserFn = _chunkQHDYFC5Ucjs.createRunAskUserFn; exports.createRunManager = _chunkR32DJSJEcjs.createRunManager; exports.defaultIterateConvergence = _chunk3EUDE77Ecjs.defaultConvergence; exports.defineProduct = _chunkWFQF3RT4cjs.defineProduct; exports.detectArenaMode = detectArenaMode; exports.estimateTokens = _chunkLRAY5IYCcjs.estimateTokens; exports.formatDigest = _chunkFVP7XJGScjs.formatDigest; exports.getIterateFormat = _chunk3EUDE77Ecjs.getFormat; exports.getMaxOutputTokens = _chunkFVP7XJGScjs.getMaxOutputTokens; exports.getStrategy = _chunkFVP7XJGScjs.getStrategy; exports.getStrategyForPlan = _chunkFVP7XJGScjs.getStrategyForPlan; exports.hasTools = _chunkFVP7XJGScjs.hasTools; exports.isTerminal = _chunkFVP7XJGScjs.isTerminal; exports.iterateCodeFormat = _chunk3EUDE77Ecjs.codeFormat; exports.iterateDiffRatio = _chunk3EUDE77Ecjs.diffRatio; exports.iterateDocumentFormat = _chunk3EUDE77Ecjs.documentFormat; exports.listPresetNames = _chunkQHDYFC5Ucjs.listPresetNames; exports.loadSection = _chunkQHDYFC5Ucjs.loadSection; exports.loadSections = _chunkQHDYFC5Ucjs.loadSections; exports.logger = _chunkIMMTBZ33cjs.logger; exports.markUnderReview = _chunkFVP7XJGScjs.markUnderReview; exports.markUnresolved = _chunkFVP7XJGScjs.markUnresolved; exports.matchSkillsByInput = _chunkCSO5EOEPcjs.matchSkillsByInput; exports.matchSkillsByTool = _chunkCSO5EOEPcjs.matchSkillsByTool; exports.microcompact = _chunkLRAY5IYCcjs.microcompact; exports.planArena = _chunkFVP7XJGScjs.planArena; exports.registerClaims = _chunkFVP7XJGScjs.registerClaims; exports.registerPreset = _chunkQHDYFC5Ucjs.registerPreset; exports.registerProvider = _chunkFVP7XJGScjs.registerProvider; exports.registerSection = _chunkQHDYFC5Ucjs.registerSection; exports.resolveAgentPreset = _chunkQHDYFC5Ucjs.resolveAgentPreset; exports.resolveBuiltinToolNames = _chunkQHDYFC5Ucjs.resolveBuiltinToolNames; exports.resolveClaimStatus = _chunkFVP7XJGScjs.resolveClaimStatus; exports.scanInstructions = _chunkQHDYFC5Ucjs.scanInstructions; exports.scanSkills = _chunkCSO5EOEPcjs.scanSkills; exports.selectClaimsForReview = _chunkFVP7XJGScjs.selectClaimsForReview; exports.selectTools = _chunkFVP7XJGScjs.selectTools; exports.taskManager = _chunkQHDYFC5Ucjs.taskManager; exports.transitionClaim = _chunkFVP7XJGScjs.transitionClaim; exports.truncateToolResult = _chunkLRAY5IYCcjs.truncateToolResult; exports.validTransitions = _chunkFVP7XJGScjs.validTransitions; exports.validateSettings = _chunkFGZGCFJXcjs.validateSettings; exports.windowCompact = _chunkLRAY5IYCcjs.windowCompact;
327
+ exports.AnthropicClient = _chunkBUJ5KYCIcjs.AnthropicClient; exports.Arena = _chunkHOXQLX5Rcjs.Arena; exports.ArenaLedger = _chunkHOXQLX5Rcjs.ArenaLedger; exports.ArtifactTracker = _chunkVWFET3MGcjs.ArtifactTracker; exports.AutoApprovalBackend = _chunkVWFET3MGcjs.AutoApprovalBackend; exports.BUILTIN_AGENT_PRESETS = _chunkVWFET3MGcjs.BUILTIN_AGENT_PRESETS; exports.BUILTIN_TOOLS = _chunkVWFET3MGcjs.BUILTIN_TOOLS; exports.CheckpointWriter = _chunkVWFET3MGcjs.CheckpointWriter; exports.CompositeEvaluator = _chunkVWFET3MGcjs.CompositeEvaluator; exports.ConfigError = _chunkEL2RL5DGcjs.ConfigError; exports.ContextLimitError = _chunkEL2RL5DGcjs.ContextLimitError; exports.ContextManager = _chunkVWFET3MGcjs.ContextManager; exports.DEFAULT_AGENT_PRESET = _chunkVWFET3MGcjs.DEFAULT_AGENT_PRESET; exports.DEFAULT_CLI_PRESET = _chunkVWFET3MGcjs.DEFAULT_CLI_PRESET; exports.DiscussionStrategy = _chunkHOXQLX5Rcjs.DiscussionStrategy; exports.Engine = _chunkVWFET3MGcjs.Engine; exports.EngineRunner = _chunkVWFET3MGcjs.EngineRunner; exports.FileHistory = _chunk3QR52LL5cjs.FileHistory; exports.FileRunStore = _chunkVWFET3MGcjs.FileRunStore; exports.FrameworkError = _chunkEL2RL5DGcjs.FrameworkError; exports.HeadlessApprovalBackend = _chunkVWFET3MGcjs.HeadlessApprovalBackend; exports.Heartbeat = _chunkVWFET3MGcjs.Heartbeat; exports.HookRegistry = _chunkVWFET3MGcjs.HookRegistry; exports.IterativeArena = _chunkX2DNIMPCcjs.IterativeArena; exports.LLMClientBase = _chunkGZBD6QRScjs.LLMClientBase; exports.LLMError = _chunkEL2RL5DGcjs.LLMError; exports.LLMRateLimitError = _chunkEL2RL5DGcjs.LLMRateLimitError; exports.MCPManager = _chunkC7C7ZZY4cjs.MCPManager; exports.MODEL_PRESETS = _chunkHOXQLX5Rcjs.MODEL_PRESETS; exports.MemoryManager = _chunkM2QI5X3Xcjs.MemoryManager; exports.ModelPool = _chunkKOGV6PDQcjs.ModelPool; exports.NoopEvaluator = _chunkVWFET3MGcjs.NoopEvaluator; exports.OpenAIClient = _chunkYAFCN7ZWcjs.OpenAIClient; exports.PermissionClassifier = _chunkVWFET3MGcjs.PermissionClassifier; exports.PermissionDeniedError = _chunkEL2RL5DGcjs.PermissionDeniedError; exports.PlanningStrategy = _chunkHOXQLX5Rcjs.PlanningStrategy; exports.PromptComposer = _chunkVWFET3MGcjs.PromptComposer; exports.ReviewStrategy = _chunkHOXQLX5Rcjs.ReviewStrategy; exports.RunApprovalBackend = _chunkVWFET3MGcjs.RunApprovalBackend; exports.RunLock = _chunkVWFET3MGcjs.RunLock; exports.RunManager = _chunkVWFET3MGcjs.RunManager; exports.RunQueue = _chunkVWFET3MGcjs.RunQueue; exports.SectionCache = _chunkVWFET3MGcjs.SectionCache; exports.SessionError = _chunkEL2RL5DGcjs.SessionError; exports.SessionManager = _chunkOP57WUWQcjs.SessionManager; exports.SettingsManager = _chunkFV2ARONZcjs.SettingsManager; exports.SettingsSchema = _chunkFV2ARONZcjs.SettingsSchema; exports.ToolError = _chunkEL2RL5DGcjs.ToolError; exports.ToolExecutionError = _chunkEL2RL5DGcjs.ToolExecutionError; exports.ToolExecutor = _chunkVWFET3MGcjs.ToolExecutor; exports.ToolNotFoundError = _chunkEL2RL5DGcjs.ToolNotFoundError; exports.ToolRegistry = _chunkVWFET3MGcjs.ToolRegistry; exports.ToolTimeoutError = _chunkEL2RL5DGcjs.ToolTimeoutError; exports.Transcript = _chunkOP57WUWQcjs.Transcript; exports.TranscriptError = _chunkEL2RL5DGcjs.TranscriptError; exports.VALID_TRANSITIONS = _chunkVWFET3MGcjs.VALID_TRANSITIONS; exports.VERSION = VERSION; exports.applyReviewResult = _chunkHOXQLX5Rcjs.applyReviewResult; exports.applySummaryCompaction = _chunkYD7XTI7Tcjs.applySummaryCompaction; exports.availableSections = _chunkVWFET3MGcjs.availableSections; exports.buildDigest = _chunkHOXQLX5Rcjs.buildDigest; exports.buildPresetSystemPrompt = _chunkVWFET3MGcjs.buildPresetSystemPrompt; exports.buildSkillListing = _chunkVWFET3MGcjs.buildSkillListing; exports.buildSummarizationPrompt = _chunkYD7XTI7Tcjs.buildSummarizationPrompt; exports.collectEvidence = _chunkHOXQLX5Rcjs.collectEvidence; exports.combineInstructions = _chunkVWFET3MGcjs.combineInstructions; exports.createLLMClient = _chunkHOXQLX5Rcjs.createLLMClient; exports.createRunAskUserFn = _chunkVWFET3MGcjs.createRunAskUserFn; exports.createRunManager = _chunkJHXNOB5Gcjs.createRunManager; exports.defaultIterateConvergence = _chunkX2DNIMPCcjs.defaultConvergence; exports.defineProduct = _chunk3CAZIWUAcjs.defineProduct; exports.detectArenaMode = detectArenaMode; exports.estimateTokens = _chunkYD7XTI7Tcjs.estimateTokens; exports.formatDigest = _chunkHOXQLX5Rcjs.formatDigest; exports.getIterateFormat = _chunkX2DNIMPCcjs.getFormat; exports.getMaxOutputTokens = _chunkHOXQLX5Rcjs.getMaxOutputTokens; exports.getStrategy = _chunkHOXQLX5Rcjs.getStrategy; exports.getStrategyForPlan = _chunkHOXQLX5Rcjs.getStrategyForPlan; exports.hasTools = _chunkHOXQLX5Rcjs.hasTools; exports.isTerminal = _chunkHOXQLX5Rcjs.isTerminal; exports.iterateCodeFormat = _chunkX2DNIMPCcjs.codeFormat; exports.iterateDiffRatio = _chunkX2DNIMPCcjs.diffRatio; exports.iterateDocumentFormat = _chunkX2DNIMPCcjs.documentFormat; exports.listPresetNames = _chunkVWFET3MGcjs.listPresetNames; exports.loadSection = _chunkVWFET3MGcjs.loadSection; exports.loadSections = _chunkVWFET3MGcjs.loadSections; exports.logger = _chunkJHNCK7JPcjs.logger; exports.markUnderReview = _chunkHOXQLX5Rcjs.markUnderReview; exports.markUnresolved = _chunkHOXQLX5Rcjs.markUnresolved; exports.matchSkillsByInput = _chunkVWFET3MGcjs.matchSkillsByInput; exports.matchSkillsByTool = _chunkVWFET3MGcjs.matchSkillsByTool; exports.microcompact = _chunkYD7XTI7Tcjs.microcompact; exports.planArena = _chunkHOXQLX5Rcjs.planArena; exports.registerClaims = _chunkHOXQLX5Rcjs.registerClaims; exports.registerPreset = _chunkVWFET3MGcjs.registerPreset; exports.registerProvider = _chunkHOXQLX5Rcjs.registerProvider; exports.registerSection = _chunkVWFET3MGcjs.registerSection; exports.resolveAgentPreset = _chunkVWFET3MGcjs.resolveAgentPreset; exports.resolveBuiltinToolNames = _chunkVWFET3MGcjs.resolveBuiltinToolNames; exports.resolveClaimStatus = _chunkHOXQLX5Rcjs.resolveClaimStatus; exports.scanInstructions = _chunkVWFET3MGcjs.scanInstructions; exports.scanSkills = _chunkVWFET3MGcjs.scanSkills; exports.selectClaimsForReview = _chunkHOXQLX5Rcjs.selectClaimsForReview; exports.selectTools = _chunkHOXQLX5Rcjs.selectTools; exports.taskManager = _chunkVWFET3MGcjs.taskManager; exports.transitionClaim = _chunkHOXQLX5Rcjs.transitionClaim; exports.truncateToolResult = _chunkYD7XTI7Tcjs.truncateToolResult; exports.validTransitions = _chunkHOXQLX5Rcjs.validTransitions; exports.validateSettings = _chunkFV2ARONZcjs.validateSettings; exports.windowCompact = _chunkYD7XTI7Tcjs.windowCompact;
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export declare const VERSION = "0.1.0";
7
7
  export type { Message, ContentBlock, ToolDefinition, ToolCall, ToolResult, RegisteredTool, TranscriptEvent, TranscriptEventType, SessionState, TokenUsage, CompiledInput, PermissionDecision, PermissionMode, PermissionRule, TurnPhase, TurnResult, TerminalReason, StreamEvent, StreamCallback, LLMConfig, LLMResponse, Settings, MCPServerConfig, } from "./types.js";
8
8
  export { FrameworkError, LLMError, LLMRateLimitError, ContextLimitError, ToolError, ToolNotFoundError, ToolExecutionError, ToolTimeoutError, PermissionDeniedError, SessionError, TranscriptError, ConfigError, } from "./exceptions.js";
9
9
  export { Engine } from "./engine/engine.js";
10
- export type { EngineConfig, EngineResult } from "./engine/engine.js";
10
+ export type { EngineConfig, EngineHookConfig, EngineResult } from "./engine/engine.js";
11
11
  export type { CostStateStore, CostStateSnapshot } from "./engine/cost-store.js";
12
12
  export { LLMClientBase } from "./llm/client-base.js";
13
13
  export { createLLMClient, registerProvider } from "./llm/client-factory.js";