@cjhyy/code-shell 0.2.0 → 0.5.0-rc.1

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 (432) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/README.md +35 -2
  3. package/dist/cli.js +2 -0
  4. package/dist/index.d.ts +1 -67
  5. package/dist/index.js +1 -1
  6. package/package.json +25 -71
  7. package/dist/agent/coordinator.d.ts +0 -49
  8. package/dist/anthropic-OVRWAZRD.js +0 -1
  9. package/dist/arena/arena.d.ts +0 -43
  10. package/dist/arena/context/context-tools.d.ts +0 -16
  11. package/dist/arena/detect-mode.d.ts +0 -20
  12. package/dist/arena/digest-builder.d.ts +0 -25
  13. package/dist/arena/index.d.ts +0 -29
  14. package/dist/arena/index.js +0 -1
  15. package/dist/arena/iterate/convergence.d.ts +0 -25
  16. package/dist/arena/iterate/formats/index.d.ts +0 -22
  17. package/dist/arena/iterate/index.d.ts +0 -11
  18. package/dist/arena/iterate/iterative-arena.d.ts +0 -23
  19. package/dist/arena/iterate/parse.d.ts +0 -42
  20. package/dist/arena/iterate/phases/argue.d.ts +0 -22
  21. package/dist/arena/iterate/phases/revise.d.ts +0 -16
  22. package/dist/arena/iterate/phases/tournament.d.ts +0 -34
  23. package/dist/arena/iterate/tools/web-tools.d.ts +0 -13
  24. package/dist/arena/iterate/types.d.ts +0 -152
  25. package/dist/arena/ledger.d.ts +0 -47
  26. package/dist/arena/lenses/architecture.d.ts +0 -5
  27. package/dist/arena/lenses/engineering.d.ts +0 -5
  28. package/dist/arena/lenses/general.d.ts +0 -5
  29. package/dist/arena/lenses/index.d.ts +0 -16
  30. package/dist/arena/lenses/product.d.ts +0 -5
  31. package/dist/arena/model-presets.d.ts +0 -23
  32. package/dist/arena/phases/adjudication.d.ts +0 -24
  33. package/dist/arena/phases/build-consensus.d.ts +0 -29
  34. package/dist/arena/phases/claim-registry.d.ts +0 -26
  35. package/dist/arena/phases/cross-review.d.ts +0 -45
  36. package/dist/arena/phases/debate-rounds.d.ts +0 -27
  37. package/dist/arena/phases/participant-research.d.ts +0 -38
  38. package/dist/arena/phases/planning-detail-expansion.d.ts +0 -38
  39. package/dist/arena/planner.d.ts +0 -27
  40. package/dist/arena/providers/docs.d.ts +0 -6
  41. package/dist/arena/providers/git.d.ts +0 -8
  42. package/dist/arena/providers/index.d.ts +0 -32
  43. package/dist/arena/providers/none.d.ts +0 -7
  44. package/dist/arena/providers/repo.d.ts +0 -6
  45. package/dist/arena/render/session.d.ts +0 -17
  46. package/dist/arena/render/terminal.d.ts +0 -33
  47. package/dist/arena/strategies/discussion.d.ts +0 -25
  48. package/dist/arena/strategies/index.d.ts +0 -15
  49. package/dist/arena/strategies/language-wrapper.d.ts +0 -17
  50. package/dist/arena/strategies/lens-wrapper.d.ts +0 -16
  51. package/dist/arena/strategies/planning.d.ts +0 -30
  52. package/dist/arena/strategies/review.d.ts +0 -26
  53. package/dist/arena/strategies/utils.d.ts +0 -39
  54. package/dist/arena/tools/selector.d.ts +0 -17
  55. package/dist/arena/transitions.d.ts +0 -48
  56. package/dist/arena/types.d.ts +0 -508
  57. package/dist/arena-64T2EQD4.js +0 -3
  58. package/dist/bootstrap/setup.d.ts +0 -14
  59. package/dist/bootstrap/state.d.ts +0 -160
  60. package/dist/bwrap-PVZMLHZR.js +0 -2
  61. package/dist/chunk-2EUIMKJA.js +0 -1
  62. package/dist/chunk-2GJ7H5NC.js +0 -641
  63. package/dist/chunk-2OD6VR4N.js +0 -2
  64. package/dist/chunk-3QP5BQ3L.js +0 -1
  65. package/dist/chunk-A4M2Y42L.js +0 -2
  66. package/dist/chunk-DEYFK6FP.js +0 -1
  67. package/dist/chunk-DTPABBSV.js +0 -2
  68. package/dist/chunk-EU3J7TBP.js +0 -1
  69. package/dist/chunk-FU7AHZNN.js +0 -1
  70. package/dist/chunk-L7B2ORID.js +0 -4
  71. package/dist/chunk-M7VU4YVY.js +0 -49
  72. package/dist/chunk-MGP35GKD.js +0 -254
  73. package/dist/chunk-MLCTC53I.js +0 -1
  74. package/dist/chunk-O5HFCH2U.js +0 -1
  75. package/dist/chunk-P6JSTIFM.js +0 -1
  76. package/dist/chunk-Q3RSX66I.js +0 -1
  77. package/dist/chunk-QTWU7UNA.js +0 -5
  78. package/dist/chunk-RERBX75D.js +0 -251
  79. package/dist/chunk-SNFAPSLA.js +0 -1
  80. package/dist/chunk-T222K6IV.js +0 -18
  81. package/dist/chunk-TKJA6W36.js +0 -3
  82. package/dist/chunk-VKKU4LOM.js +0 -3
  83. package/dist/chunk-WI6FSWGU.js +0 -1
  84. package/dist/chunk-XXCZE2U2.js +0 -2
  85. package/dist/chunk-ZSAONDT6.js +0 -2
  86. package/dist/cli/commands/arena.d.ts +0 -29
  87. package/dist/cli/commands/builtin/advanced-commands.d.ts +0 -5
  88. package/dist/cli/commands/builtin/core-commands.d.ts +0 -5
  89. package/dist/cli/commands/builtin/export-md.d.ts +0 -19
  90. package/dist/cli/commands/builtin/extra-commands.d.ts +0 -6
  91. package/dist/cli/commands/builtin/git-commands.d.ts +0 -5
  92. package/dist/cli/commands/builtin/init/detect.d.ts +0 -25
  93. package/dist/cli/commands/builtin/init/index.d.ts +0 -19
  94. package/dist/cli/commands/builtin/more-commands.d.ts +0 -5
  95. package/dist/cli/commands/builtin/permissions-command.d.ts +0 -5
  96. package/dist/cli/commands/builtin/utility-commands.d.ts +0 -5
  97. package/dist/cli/commands/registry.d.ts +0 -72
  98. package/dist/cli/commands/repl.d.ts +0 -21
  99. package/dist/cli/commands/run.d.ts +0 -21
  100. package/dist/cli/commands/runs.d.ts +0 -14
  101. package/dist/cli/cost-tracker.d.ts +0 -63
  102. package/dist/cli/exit.d.ts +0 -12
  103. package/dist/cli/input/ndjson-reader.d.ts +0 -31
  104. package/dist/cli/input-compiler.d.ts +0 -5
  105. package/dist/cli/main.d.ts +0 -5
  106. package/dist/cli/main.js +0 -399
  107. package/dist/cli/migrate-models.d.ts +0 -45
  108. package/dist/cli/onboarding.d.ts +0 -189
  109. package/dist/cli/output/renderer.d.ts +0 -28
  110. package/dist/cli/output/terminal-ui.d.ts +0 -50
  111. package/dist/cli/updater.d.ts +0 -65
  112. package/dist/client-base-F5FCRSB3.js +0 -1
  113. package/dist/compaction-L3Y6NG4N.js +0 -1
  114. package/dist/context/compaction.d.ts +0 -116
  115. package/dist/context/manager.d.ts +0 -145
  116. package/dist/context/token-counter.d.ts +0 -27
  117. package/dist/context/tool-result-storage.d.ts +0 -96
  118. package/dist/cron/scheduler.d.ts +0 -34
  119. package/dist/data/openrouter-models.d.ts +0 -35
  120. package/dist/data/openrouter-sync.d.ts +0 -16
  121. package/dist/data/static-catalogs.d.ts +0 -25
  122. package/dist/devtools-SGDUOOM4.js +0 -1
  123. package/dist/engine/cost-store.d.ts +0 -22
  124. package/dist/engine/engine.d.ts +0 -207
  125. package/dist/engine/model-facade.d.ts +0 -24
  126. package/dist/engine/query.d.ts +0 -50
  127. package/dist/engine/streaming-tool-queue.d.ts +0 -34
  128. package/dist/engine/token-budget.d.ts +0 -22
  129. package/dist/engine/tool-summary.d.ts +0 -13
  130. package/dist/engine/turn-loop.d.ts +0 -97
  131. package/dist/engine/turn-state.d.ts +0 -20
  132. package/dist/exceptions.d.ts +0 -44
  133. package/dist/export-md-U72T7NW7.js +0 -22
  134. package/dist/file-history-7FQFEQOL.js +0 -1
  135. package/dist/git/utils.d.ts +0 -35
  136. package/dist/git/worktree.d.ts +0 -36
  137. package/dist/hooks/events.d.ts +0 -35
  138. package/dist/hooks/registry.d.ts +0 -15
  139. package/dist/llm/capabilities/index.d.ts +0 -20
  140. package/dist/llm/capabilities/rules.d.ts +0 -26
  141. package/dist/llm/capabilities/types.d.ts +0 -108
  142. package/dist/llm/client-base.d.ts +0 -29
  143. package/dist/llm/client-factory.d.ts +0 -10
  144. package/dist/llm/model-cache.d.ts +0 -21
  145. package/dist/llm/model-fetcher.d.ts +0 -29
  146. package/dist/llm/model-pool.d.ts +0 -84
  147. package/dist/llm/provider-catalog.d.ts +0 -32
  148. package/dist/llm/provider-kinds.d.ts +0 -21
  149. package/dist/llm/providers/anthropic.d.ts +0 -19
  150. package/dist/llm/providers/openai.d.ts +0 -41
  151. package/dist/llm/token-counter.d.ts +0 -17
  152. package/dist/llm/types.d.ts +0 -37
  153. package/dist/logging/logger.d.ts +0 -88
  154. package/dist/logging/session-recorder.d.ts +0 -90
  155. package/dist/lsp/client.d.ts +0 -41
  156. package/dist/lsp/manager.d.ts +0 -40
  157. package/dist/lsp/servers.d.ts +0 -16
  158. package/dist/manager-J6FXEUEK.js +0 -1
  159. package/dist/mcp-manager-27EVBKRT.js +0 -1
  160. package/dist/memory-BNI4WEWL.js +0 -1
  161. package/dist/model-cache-HEDXI7UJ.js +0 -1
  162. package/dist/model-fetcher-X5W5EASG.js +0 -1
  163. package/dist/native-ts/yoga-layout/enums.d.ts +0 -117
  164. package/dist/native-ts/yoga-layout/index.d.ts +0 -270
  165. package/dist/off-7SDVMMXW.js +0 -1
  166. package/dist/openai-3QEADSYL.js +0 -1
  167. package/dist/openrouter-models-GZVCRWD2.js +0 -1
  168. package/dist/openrouter-sync-WG4AG5NC.js +0 -1
  169. package/dist/plugins/loader.d.ts +0 -72
  170. package/dist/plugins/types.d.ts +0 -4
  171. package/dist/preset/index.d.ts +0 -60
  172. package/dist/product/define.d.ts +0 -60
  173. package/dist/product/index.d.ts +0 -5
  174. package/dist/product/index.js +0 -1
  175. package/dist/product/types.d.ts +0 -111
  176. package/dist/prompt/composer.d.ts +0 -42
  177. package/dist/prompt/instruction-scanner.d.ts +0 -54
  178. package/dist/prompt/section-cache.d.ts +0 -15
  179. package/dist/prompt/section-loader.d.ts +0 -26
  180. package/dist/protocol/client.d.ts +0 -64
  181. package/dist/protocol/index.d.ts +0 -4
  182. package/dist/protocol/server.d.ts +0 -51
  183. package/dist/protocol/transport.d.ts +0 -36
  184. package/dist/protocol/types.d.ts +0 -192
  185. package/dist/react-compiler-runtime-shim.d.ts +0 -1
  186. package/dist/remote/bridge.d.ts +0 -37
  187. package/dist/render/Ansi.d.ts +0 -10
  188. package/dist/render/bidi.d.ts +0 -15
  189. package/dist/render/clearTerminal.d.ts +0 -13
  190. package/dist/render/colorize.d.ts +0 -16
  191. package/dist/render/components/AlternateScreen.d.ts +0 -21
  192. package/dist/render/components/App.d.ts +0 -70
  193. package/dist/render/components/AppContext.d.ts +0 -11
  194. package/dist/render/components/Box.d.ts +0 -49
  195. package/dist/render/components/Button.d.ts +0 -36
  196. package/dist/render/components/ClockContext.d.ts +0 -9
  197. package/dist/render/components/CursorDeclarationContext.d.ts +0 -22
  198. package/dist/render/components/ErrorOverview.d.ts +0 -5
  199. package/dist/render/components/Link.d.ts +0 -7
  200. package/dist/render/components/Newline.d.ts +0 -12
  201. package/dist/render/components/NoSelect.d.ts +0 -19
  202. package/dist/render/components/RawAnsi.d.ts +0 -16
  203. package/dist/render/components/ScrollBox.d.ts +0 -78
  204. package/dist/render/components/Spacer.d.ts +0 -5
  205. package/dist/render/components/StdinContext.d.ts +0 -27
  206. package/dist/render/components/TerminalFocusContext.d.ts +0 -10
  207. package/dist/render/components/TerminalSizeContext.d.ts +0 -5
  208. package/dist/render/components/Text.d.ts +0 -55
  209. package/dist/render/constants.d.ts +0 -1
  210. package/dist/render/cursor.d.ts +0 -8
  211. package/dist/render/devtools.d.ts +0 -5
  212. package/dist/render/dom.d.ts +0 -76
  213. package/dist/render/events/click-event.d.ts +0 -31
  214. package/dist/render/events/dispatcher.d.ts +0 -40
  215. package/dist/render/events/emitter.d.ts +0 -5
  216. package/dist/render/events/event-handlers.d.ts +0 -46
  217. package/dist/render/events/event.d.ts +0 -5
  218. package/dist/render/events/focus-event.d.ts +0 -13
  219. package/dist/render/events/input-event.d.ts +0 -30
  220. package/dist/render/events/keyboard-event.d.ts +0 -19
  221. package/dist/render/events/paste-event.d.ts +0 -8
  222. package/dist/render/events/resize-event.d.ts +0 -9
  223. package/dist/render/events/terminal-event.d.ts +0 -54
  224. package/dist/render/events/terminal-focus-event.d.ts +0 -13
  225. package/dist/render/focus.d.ts +0 -43
  226. package/dist/render/frame.d.ts +0 -94
  227. package/dist/render/get-max-width.d.ts +0 -17
  228. package/dist/render/hit-test.d.ts +0 -33
  229. package/dist/render/hooks/use-animation-frame.d.ts +0 -26
  230. package/dist/render/hooks/use-app.d.ts +0 -5
  231. package/dist/render/hooks/use-declared-cursor.d.ts +0 -26
  232. package/dist/render/hooks/use-input.d.ts +0 -37
  233. package/dist/render/hooks/use-interval.d.ts +0 -18
  234. package/dist/render/hooks/use-search-highlight.d.ts +0 -30
  235. package/dist/render/hooks/use-selection.d.ts +0 -39
  236. package/dist/render/hooks/use-stdin.d.ts +0 -5
  237. package/dist/render/hooks/use-tab-status.d.ts +0 -13
  238. package/dist/render/hooks/use-terminal-focus.d.ts +0 -10
  239. package/dist/render/hooks/use-terminal-title.d.ts +0 -12
  240. package/dist/render/hooks/use-terminal-viewport.d.ts +0 -29
  241. package/dist/render/index.d.ts +0 -20
  242. package/dist/render/ink.d.ts +0 -369
  243. package/dist/render/instances.d.ts +0 -3
  244. package/dist/render/layout/engine.d.ts +0 -2
  245. package/dist/render/layout/geometry.d.ts +0 -30
  246. package/dist/render/layout/node.d.ts +0 -125
  247. package/dist/render/layout/yoga.d.ts +0 -56
  248. package/dist/render/line-width-cache.d.ts +0 -1
  249. package/dist/render/log-update.d.ts +0 -17
  250. package/dist/render/measure-element.d.ts +0 -16
  251. package/dist/render/measure-text.d.ts +0 -6
  252. package/dist/render/node-cache.d.ts +0 -20
  253. package/dist/render/optimizer.d.ts +0 -15
  254. package/dist/render/output.d.ts +0 -119
  255. package/dist/render/parse-keypress.d.ts +0 -111
  256. package/dist/render/reconciler.d.ts +0 -11
  257. package/dist/render/render-border.d.ts +0 -24
  258. package/dist/render/render-node-to-output.d.ts +0 -45
  259. package/dist/render/render-to-screen.d.ts +0 -46
  260. package/dist/render/renderer.d.ts +0 -14
  261. package/dist/render/root.d.ts +0 -74
  262. package/dist/render/screen.d.ts +0 -269
  263. package/dist/render/searchHighlight.d.ts +0 -20
  264. package/dist/render/selection.d.ts +0 -229
  265. package/dist/render/squash-text-nodes.d.ts +0 -22
  266. package/dist/render/stringWidth.d.ts +0 -1
  267. package/dist/render/styles.d.ts +0 -306
  268. package/dist/render/supports-hyperlinks.d.ts +0 -13
  269. package/dist/render/tabstops.d.ts +0 -1
  270. package/dist/render/terminal-focus-state.d.ts +0 -6
  271. package/dist/render/terminal-querier.d.ts +0 -129
  272. package/dist/render/terminal.d.ts +0 -46
  273. package/dist/render/termio/ansi.d.ts +0 -65
  274. package/dist/render/termio/csi.d.ts +0 -165
  275. package/dist/render/termio/dec.d.ts +0 -37
  276. package/dist/render/termio/esc.d.ts +0 -12
  277. package/dist/render/termio/osc.d.ts +0 -173
  278. package/dist/render/termio/parser.d.ts +0 -35
  279. package/dist/render/termio/sgr.d.ts +0 -8
  280. package/dist/render/termio/tokenize.d.ts +0 -45
  281. package/dist/render/termio/types.d.ts +0 -190
  282. package/dist/render/termio.d.ts +0 -24
  283. package/dist/render/useTerminalNotification.d.ts +0 -28
  284. package/dist/render/warn.d.ts +0 -1
  285. package/dist/render/widest-line.d.ts +0 -1
  286. package/dist/render/wrap-text.d.ts +0 -2
  287. package/dist/render/wrapAnsi.d.ts +0 -7
  288. package/dist/run/ArtifactTracker.d.ts +0 -38
  289. package/dist/run/CheckpointWriter.d.ts +0 -53
  290. package/dist/run/EngineRunner.d.ts +0 -72
  291. package/dist/run/Evaluator.d.ts +0 -56
  292. package/dist/run/FileRunStore.d.ts +0 -39
  293. package/dist/run/Heartbeat.d.ts +0 -54
  294. package/dist/run/RunApprovalBackend.d.ts +0 -53
  295. package/dist/run/RunLock.d.ts +0 -40
  296. package/dist/run/RunManager.d.ts +0 -82
  297. package/dist/run/RunQueue.d.ts +0 -27
  298. package/dist/run/RunStore.d.ts +0 -25
  299. package/dist/run/factory.d.ts +0 -63
  300. package/dist/run/index.d.ts +0 -17
  301. package/dist/run/index.js +0 -1
  302. package/dist/run/types.d.ts +0 -136
  303. package/dist/seatbelt-L54CNI2Y.js +0 -37
  304. package/dist/services/analytics.d.ts +0 -29
  305. package/dist/services/auto-dream.d.ts +0 -35
  306. package/dist/services/diagnostics.d.ts +0 -41
  307. package/dist/services/extract-memories.d.ts +0 -27
  308. package/dist/services/index.d.ts +0 -10
  309. package/dist/services/notifier.d.ts +0 -25
  310. package/dist/services/oauth.d.ts +0 -27
  311. package/dist/services/session-memory.d.ts +0 -37
  312. package/dist/session/file-history.d.ts +0 -41
  313. package/dist/session/memory.d.ts +0 -65
  314. package/dist/session/session-manager.d.ts +0 -28
  315. package/dist/session/transcript.d.ts +0 -39
  316. package/dist/session-manager-AGWS5SMJ.js +0 -1
  317. package/dist/settings/manager.d.ts +0 -36
  318. package/dist/settings/schema.d.ts +0 -1036
  319. package/dist/skills/index.d.ts +0 -7
  320. package/dist/skills/matcher.d.ts +0 -21
  321. package/dist/skills/scanner.d.ts +0 -30
  322. package/dist/tool-summary-V2B3MD5N.js +0 -2
  323. package/dist/tool-system/builtin/agent-registry.d.ts +0 -36
  324. package/dist/tool-system/builtin/agent.d.ts +0 -16
  325. package/dist/tool-system/builtin/apply-patch/applier.d.ts +0 -26
  326. package/dist/tool-system/builtin/apply-patch/index.d.ts +0 -19
  327. package/dist/tool-system/builtin/apply-patch/parser.d.ts +0 -17
  328. package/dist/tool-system/builtin/apply-patch/seek-sequence.d.ts +0 -18
  329. package/dist/tool-system/builtin/apply-patch/types.d.ts +0 -49
  330. package/dist/tool-system/builtin/arena.d.ts +0 -31
  331. package/dist/tool-system/builtin/ask-user.d.ts +0 -20
  332. package/dist/tool-system/builtin/bash.d.ts +0 -12
  333. package/dist/tool-system/builtin/brief.d.ts +0 -6
  334. package/dist/tool-system/builtin/config.d.ts +0 -6
  335. package/dist/tool-system/builtin/cron.d.ts +0 -10
  336. package/dist/tool-system/builtin/edit.d.ts +0 -6
  337. package/dist/tool-system/builtin/file-cache.d.ts +0 -11
  338. package/dist/tool-system/builtin/glob.d.ts +0 -6
  339. package/dist/tool-system/builtin/grep.d.ts +0 -6
  340. package/dist/tool-system/builtin/index.d.ts +0 -20
  341. package/dist/tool-system/builtin/lsp.d.ts +0 -6
  342. package/dist/tool-system/builtin/mcp-tools.d.ts +0 -10
  343. package/dist/tool-system/builtin/notebook-edit.d.ts +0 -6
  344. package/dist/tool-system/builtin/plan.d.ts +0 -18
  345. package/dist/tool-system/builtin/powershell.d.ts +0 -6
  346. package/dist/tool-system/builtin/read.d.ts +0 -6
  347. package/dist/tool-system/builtin/remote-trigger.d.ts +0 -6
  348. package/dist/tool-system/builtin/repl.d.ts +0 -6
  349. package/dist/tool-system/builtin/send-message.d.ts +0 -6
  350. package/dist/tool-system/builtin/skill.d.ts +0 -6
  351. package/dist/tool-system/builtin/sleep.d.ts +0 -6
  352. package/dist/tool-system/builtin/task.d.ts +0 -51
  353. package/dist/tool-system/builtin/tool-search.d.ts +0 -11
  354. package/dist/tool-system/builtin/web-fetch.d.ts +0 -6
  355. package/dist/tool-system/builtin/web-search.d.ts +0 -6
  356. package/dist/tool-system/builtin/worktree.d.ts +0 -10
  357. package/dist/tool-system/builtin/write.d.ts +0 -6
  358. package/dist/tool-system/context.d.ts +0 -110
  359. package/dist/tool-system/executor.d.ts +0 -49
  360. package/dist/tool-system/investigation-guard.d.ts +0 -46
  361. package/dist/tool-system/mcp-manager.d.ts +0 -50
  362. package/dist/tool-system/permission.d.ts +0 -104
  363. package/dist/tool-system/registry.d.ts +0 -32
  364. package/dist/tool-system/sandbox/bwrap.d.ts +0 -13
  365. package/dist/tool-system/sandbox/index.d.ts +0 -78
  366. package/dist/tool-system/sandbox/off.d.ts +0 -2
  367. package/dist/tool-system/sandbox/seatbelt.d.ts +0 -18
  368. package/dist/tool-system/task-guard.d.ts +0 -30
  369. package/dist/tool-system/validation.d.ts +0 -5
  370. package/dist/types.d.ts +0 -321
  371. package/dist/ui/App.d.ts +0 -14
  372. package/dist/ui/components/AgentBlock.d.ts +0 -32
  373. package/dist/ui/components/AskUserPrompt.d.ts +0 -14
  374. package/dist/ui/components/BabyHand.d.ts +0 -1
  375. package/dist/ui/components/Banner.d.ts +0 -8
  376. package/dist/ui/components/CodeBlock.d.ts +0 -7
  377. package/dist/ui/components/CommandInput.d.ts +0 -13
  378. package/dist/ui/components/ContextUsageBar.d.ts +0 -7
  379. package/dist/ui/components/DiffLine.d.ts +0 -33
  380. package/dist/ui/components/DiffView.d.ts +0 -6
  381. package/dist/ui/components/DogLogo.d.ts +0 -1
  382. package/dist/ui/components/FullscreenLayout.d.ts +0 -51
  383. package/dist/ui/components/KunHead.d.ts +0 -1
  384. package/dist/ui/components/KunLogo.d.ts +0 -1
  385. package/dist/ui/components/MessageContent.d.ts +0 -26
  386. package/dist/ui/components/ModelManager.d.ts +0 -68
  387. package/dist/ui/components/ModelSelector.d.ts +0 -10
  388. package/dist/ui/components/OnboardingPrompt.d.ts +0 -16
  389. package/dist/ui/components/PermissionDialog.d.ts +0 -8
  390. package/dist/ui/components/PermissionPrompt.d.ts +0 -11
  391. package/dist/ui/components/ProviderModelFlow.d.ts +0 -58
  392. package/dist/ui/components/ScrollView.d.ts +0 -34
  393. package/dist/ui/components/SessionPicker.d.ts +0 -16
  394. package/dist/ui/components/Spinner.d.ts +0 -8
  395. package/dist/ui/components/SpinnerWithVerb.d.ts +0 -18
  396. package/dist/ui/components/StatusLine.d.ts +0 -28
  397. package/dist/ui/components/StructuredDiff.d.ts +0 -8
  398. package/dist/ui/components/TaskList.d.ts +0 -6
  399. package/dist/ui/components/TextInput.d.ts +0 -9
  400. package/dist/ui/components/ThemedBox.d.ts +0 -19
  401. package/dist/ui/components/ThemedText.d.ts +0 -26
  402. package/dist/ui/components/ToolCall.d.ts +0 -28
  403. package/dist/ui/components/UpdateBanner.d.ts +0 -1
  404. package/dist/ui/components/VirtualMessageList.d.ts +0 -24
  405. package/dist/ui/components/WelcomeTips.d.ts +0 -5
  406. package/dist/ui/hooks/useCostSummary.d.ts +0 -1
  407. package/dist/ui/index.d.ts +0 -12
  408. package/dist/ui/input-history.d.ts +0 -61
  409. package/dist/ui/onboarding-runner.d.ts +0 -2
  410. package/dist/ui/store.d.ts +0 -83
  411. package/dist/ui/terminal-renderer.d.ts +0 -45
  412. package/dist/ui/theme.d.ts +0 -36
  413. package/dist/ui/vim-mode.d.ts +0 -25
  414. package/dist/updater-OCNU2K2Z.js +0 -1
  415. package/dist/utils/debug.d.ts +0 -41
  416. package/dist/utils/earlyInput.d.ts +0 -43
  417. package/dist/utils/env.d.ts +0 -24
  418. package/dist/utils/envUtils.d.ts +0 -51
  419. package/dist/utils/execFileNoThrow.d.ts +0 -39
  420. package/dist/utils/format.d.ts +0 -44
  421. package/dist/utils/fullscreen.d.ts +0 -47
  422. package/dist/utils/intl.d.ts +0 -22
  423. package/dist/utils/lockfile.d.ts +0 -15
  424. package/dist/utils/semver.d.ts +0 -6
  425. package/dist/utils/sliceAnsi.d.ts +0 -12
  426. package/dist/utils/systemTheme.d.ts +0 -40
  427. package/dist/utils/task-sanitizer.d.ts +0 -6
  428. package/dist/utils/theme.d.ts +0 -91
  429. package/dist/utils/toolDisplay.d.ts +0 -31
  430. package/dist/utils/truncate.d.ts +0 -40
  431. package/dist/voice/index.d.ts +0 -35
  432. package/skills-builtin/codeshell-help.md +0 -135
@@ -1,17 +0,0 @@
1
- /**
2
- * Run module — managed agent run lifecycle.
3
- */
4
- export type { RunStatus, RunSnapshot, RunEventType, RunEvent, RunCheckpoint, ApprovalStatus, ApprovalCategory, RunApproval, ArtifactKind, ArtifactRole, RunArtifactRef, SubmitRunInput, ResumeRunInput, ListRunsQuery, RunExecutionContext, RunExecutionResult, RunStreamEvent, RunStreamCallback, DetachFn, } from "./types.js";
5
- export { VALID_TRANSITIONS } from "./types.js";
6
- export type { RunStore } from "./RunStore.js";
7
- export { FileRunStore } from "./FileRunStore.js";
8
- export { RunQueue } from "./RunQueue.js";
9
- export { RunApprovalBackend, createRunAskUserFn, type RunLifecycleHooks, type PendingApproval, type PendingInput, } from "./RunApprovalBackend.js";
10
- export { CheckpointWriter, type CheckpointWriterConfig } from "./CheckpointWriter.js";
11
- export { ArtifactTracker, type ArtifactTrackerConfig } from "./ArtifactTracker.js";
12
- export { RunLock, type RunLockConfig } from "./RunLock.js";
13
- export { Heartbeat, type HeartbeatConfig, type HeartbeatData } from "./Heartbeat.js";
14
- export { NoopEvaluator, CompositeEvaluator, type Evaluator, type EvaluatorResult, type EvaluatorVerdict, type EvaluatorContext, } from "./Evaluator.js";
15
- export { EngineRunner, type EngineRunnerConfig, type RunExecutionHandle, type RunExecutor, type CustomToolEntry, } from "./EngineRunner.js";
16
- export { RunManager, type RunManagerConfig } from "./RunManager.js";
17
- export { createRunManager, type CreateRunManagerOptions } from "./factory.js";
package/dist/run/index.js DELETED
@@ -1 +0,0 @@
1
- export{a as createRunManager}from'../chunk-EU3J7TBP.js';export{$ as ArtifactTracker,_ as CheckpointWriter,da as CompositeEvaluator,ea as EngineRunner,W as FileRunStore,ba as Heartbeat,ca as NoopEvaluator,Y as RunApprovalBackend,aa as RunLock,fa as RunManager,X as RunQueue,V as VALID_TRANSITIONS,Z as createRunAskUserFn}from'../chunk-MGP35GKD.js';import'../chunk-MLCTC53I.js';import'../chunk-WI6FSWGU.js';import'../chunk-P6JSTIFM.js';import'../chunk-SNFAPSLA.js';import'../chunk-L7B2ORID.js';import'../chunk-M7VU4YVY.js';import'../chunk-T222K6IV.js';import'../chunk-QTWU7UNA.js';import'../chunk-DTPABBSV.js';import'../chunk-RERBX75D.js';import'../chunk-2GJ7H5NC.js';import'../chunk-A4M2Y42L.js';import'../chunk-FU7AHZNN.js';import'../chunk-ZSAONDT6.js';import'../chunk-3QP5BQ3L.js';
@@ -1,136 +0,0 @@
1
- /**
2
- * Run — managed lifecycle types for long-running agent tasks.
3
- *
4
- * A Run wraps one or more Engine executions with queue, state machine,
5
- * checkpoint, approval, and artifact tracking.
6
- */
7
- import type { AgentPresetName } from "../preset/index.js";
8
- export type RunStatus = "queued" | "running" | "waiting_input" | "waiting_approval" | "blocked" | "completed" | "failed" | "cancelled";
9
- export interface RunSnapshot {
10
- runId: string;
11
- objective: string;
12
- preset: AgentPresetName;
13
- cwd: string;
14
- status: RunStatus;
15
- createdAt: number;
16
- updatedAt: number;
17
- startedAt: number | null;
18
- finishedAt: number | null;
19
- parentRunId: string | null;
20
- sessionId: string | null;
21
- childSessionIds: string[];
22
- attemptCount: number;
23
- latestCheckpointId: string | null;
24
- latestApprovalId: string | null;
25
- summary: string | null;
26
- error: string | null;
27
- tags: string[];
28
- metadata: Record<string, unknown>;
29
- }
30
- export type RunEventType = "run_created" | "run_queued" | "run_started" | "session_linked" | "checkpoint_written" | "artifact_recorded" | "approval_requested" | "approval_resolved" | "run_blocked" | "run_resumed" | "run_completed" | "run_failed" | "run_cancelled";
31
- export interface RunEvent {
32
- eventId: string;
33
- runId: string;
34
- type: RunEventType;
35
- timestamp: number;
36
- data: Record<string, unknown>;
37
- }
38
- export interface RunCheckpoint {
39
- checkpointId: string;
40
- runId: string;
41
- createdAt: number;
42
- phase: string;
43
- objective: string;
44
- summary: string;
45
- nextAction: string | null;
46
- linkedSessionId: string | null;
47
- touchedTools: string[];
48
- touchedArtifacts: string[];
49
- waitingFor: null | {
50
- kind: "input";
51
- prompt: string;
52
- } | {
53
- kind: "approval";
54
- approvalId: string;
55
- };
56
- evaluator: null | {
57
- status: "pending" | "passed" | "failed";
58
- findings: string[];
59
- };
60
- metadata: Record<string, unknown>;
61
- }
62
- export type ApprovalStatus = "pending" | "approved" | "rejected";
63
- export type ApprovalCategory = "tool" | "artifact_publish" | "workflow_transition" | "custom";
64
- export interface RunApproval {
65
- approvalId: string;
66
- runId: string;
67
- createdAt: number;
68
- resolvedAt: number | null;
69
- status: ApprovalStatus;
70
- category: ApprovalCategory;
71
- title: string;
72
- description: string;
73
- payload: Record<string, unknown>;
74
- }
75
- export type ArtifactKind = "file" | "document" | "diagram" | "prototype" | "resource" | "custom";
76
- export type ArtifactRole = "input" | "output" | "checkpoint" | "supporting";
77
- export interface RunArtifactRef {
78
- artifactRefId: string;
79
- runId: string;
80
- kind: ArtifactKind;
81
- title: string;
82
- locator: string;
83
- role: ArtifactRole;
84
- version: string | null;
85
- metadata: Record<string, unknown>;
86
- }
87
- export interface SubmitRunInput {
88
- objective: string;
89
- preset?: AgentPresetName;
90
- cwd?: string;
91
- parentRunId?: string;
92
- tags?: string[];
93
- metadata?: Record<string, unknown>;
94
- }
95
- export interface ResumeRunInput {
96
- userInput?: string;
97
- approvalDecision?: {
98
- approvalId: string;
99
- approved: boolean;
100
- reason?: string;
101
- };
102
- }
103
- export interface ListRunsQuery {
104
- status?: RunStatus | RunStatus[];
105
- tag?: string;
106
- limit?: number;
107
- offset?: number;
108
- }
109
- export interface RunExecutionContext {
110
- onStream?: import("../types.js").StreamCallback;
111
- signal?: AbortSignal;
112
- engineConfigOverrides?: Record<string, unknown>;
113
- }
114
- export interface RunExecutionResult {
115
- text: string;
116
- reason: import("../types.js").TerminalReason;
117
- sessionId: string;
118
- turnCount: number;
119
- }
120
- export type RunStreamEvent = {
121
- type: "run_status_changed";
122
- run: RunSnapshot;
123
- } | {
124
- type: "run_event";
125
- event: RunEvent;
126
- } | {
127
- type: "engine_stream";
128
- event: import("../types.js").StreamEvent;
129
- };
130
- export type RunStreamCallback = (event: RunStreamEvent) => void | Promise<void>;
131
- export type DetachFn = () => void;
132
- /**
133
- * Valid state transitions for a Run.
134
- * Key = current status, Value = allowed next statuses.
135
- */
136
- export declare const VALID_TRANSITIONS: Record<RunStatus, RunStatus[]>;
@@ -1,37 +0,0 @@
1
- import {h,a}from'./chunk-3QP5BQ3L.js';import {mkdtempSync,writeFileSync,rmSync}from'fs';import {tmpdir}from'os';import {join}from'path';h();function y(e){return {name:"seatbelt",wrap(o,l){let n=b(e),t=mkdtempSync(join(tmpdir(),"codeshell-sandbox-")),a$1=join(t,"profile.sb");return writeFileSync(a$1,n,"utf-8"),{file:"/usr/bin/sandbox-exec",args:["-f",a$1,l.shell,"-c",o],cleanup:a(()=>{try{rmSync(t,{recursive:!0,force:!0});}catch{}},"cleanup")}},hintForBlockedOutput(o){if(/Operation not permitted|sandbox/.test(o))return `
2
- [sandbox:seatbelt] A syscall was blocked by the sandbox. If this path should be writable or this network call legitimate, ask the user to update sandbox.writableRoots / sandbox.network in settings.json.`}}}a(y,"createSeatbeltBackend");function b(e){let o=e.writableRoots.map(t=>` (subpath ${d(t)})`).join(`
3
- `),l=e.deniedReads.map(t=>` (subpath ${d(t)})`).join(`
4
- `),n=e.network==="deny"?"(deny network-outbound)":"(allow network*)";return `(version 1)
5
- (deny default)
6
-
7
- ;; Process control
8
- (allow process-fork)
9
- (allow process-exec)
10
- (allow signal (target self))
11
- (allow signal (target children))
12
-
13
- ;; Reads: broadly allowed, then explicit deny of sensitive paths
14
- (allow file-read*)
15
- ${l?`(deny file-read*
16
- ${l})`:""}
17
-
18
- ;; Writes: workspace + listed roots only
19
- (allow file-write*
20
- ${o})
21
- (allow file-write-data
22
- (literal "/dev/null")
23
- (literal "/dev/zero")
24
- (literal "/dev/random")
25
- (literal "/dev/urandom")
26
- (literal "/dev/dtracehelper"))
27
-
28
- ;; IPC & system services common tools need
29
- (allow mach-lookup)
30
- (allow ipc-posix-shm)
31
- (allow sysctl-read)
32
- (allow system-socket)
33
- (allow iokit-open)
34
-
35
- ;; Network
36
- ${n}
37
- `}a(b,"buildProfile");function d(e){return `"${e.replace(/"/g,'\\"')}"`}a(d,"quote");export{y as createSeatbeltBackend};
@@ -1,29 +0,0 @@
1
- /**
2
- * Analytics service — event tracking and telemetry.
3
- *
4
- * Provides a lightweight analytics pipeline that queues events
5
- * and flushes them to configured sinks (file, console, or remote).
6
- */
7
- export interface AnalyticsEvent {
8
- name: string;
9
- properties?: Record<string, unknown>;
10
- timestamp?: string;
11
- }
12
- type AnalyticsSink = (events: AnalyticsEvent[]) => void;
13
- declare class AnalyticsService {
14
- private queue;
15
- private sinks;
16
- private flushTimer;
17
- private initialized;
18
- /**
19
- * Initialize the analytics service with default file sink.
20
- */
21
- init(): void;
22
- addSink(sink: AnalyticsSink): void;
23
- track(name: string, properties?: Record<string, unknown>): void;
24
- flush(): void;
25
- shutdown(): void;
26
- }
27
- export declare const analytics: AnalyticsService;
28
- export declare function trackEvent(name: string, properties?: Record<string, unknown>): void;
29
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * AutoDream service — background memory consolidation.
3
- *
4
- * Periodically consolidates and organizes memories using the LLM,
5
- * similar to the /dream command but running automatically.
6
- */
7
- export interface AutoDreamConfig {
8
- /** Minimum sessions between dream runs */
9
- minSessionsBetween: number;
10
- /** Minimum time between dream runs (ms) */
11
- minTimeBetween: number;
12
- /** Whether auto-dream is enabled */
13
- enabled: boolean;
14
- }
15
- /**
16
- * Check if auto-dream should run.
17
- */
18
- export declare function shouldAutoDream(config?: AutoDreamConfig): boolean;
19
- /**
20
- * Record that a session was completed (increment counter).
21
- */
22
- export declare function recordSession(): void;
23
- /**
24
- * Record that a dream run completed.
25
- */
26
- export declare function recordDreamComplete(): void;
27
- /**
28
- * Build the consolidation prompt for auto-dream.
29
- */
30
- export declare function buildDreamPrompt(memories: Array<{
31
- name: string;
32
- type: string;
33
- description: string;
34
- content: string;
35
- }>): string;
@@ -1,41 +0,0 @@
1
- /**
2
- * Diagnostics service — error tracking and system health monitoring.
3
- *
4
- * Collects and reports diagnostic information for debugging.
5
- */
6
- export interface DiagnosticEntry {
7
- timestamp: string;
8
- level: "error" | "warn" | "info";
9
- category: string;
10
- message: string;
11
- metadata?: Record<string, unknown>;
12
- stack?: string;
13
- }
14
- declare class DiagnosticsTracker {
15
- private logDir;
16
- private entries;
17
- constructor();
18
- /**
19
- * Record a diagnostic event.
20
- */
21
- record(level: DiagnosticEntry["level"], category: string, message: string, metadata?: Record<string, unknown>): void;
22
- /**
23
- * Record an error with stack trace.
24
- */
25
- recordError(category: string, error: Error, metadata?: Record<string, unknown>): void;
26
- /**
27
- * Get recent diagnostic entries.
28
- */
29
- getRecent(count?: number): DiagnosticEntry[];
30
- /**
31
- * Get entries by category.
32
- */
33
- getByCategory(category: string): DiagnosticEntry[];
34
- /**
35
- * Generate a diagnostic report for troubleshooting.
36
- */
37
- generateReport(): string;
38
- private persist;
39
- }
40
- export declare const diagnostics: DiagnosticsTracker;
41
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * Extract Memories service — extract durable memories from session transcripts.
3
- *
4
- * Runs at the end of a query loop to identify important information
5
- * worth persisting across sessions.
6
- */
7
- export interface ExtractedMemory {
8
- type: "user" | "feedback" | "project" | "reference";
9
- name: string;
10
- description: string;
11
- content: string;
12
- }
13
- /**
14
- * Build the prompt for extracting memories from a conversation.
15
- */
16
- export declare function buildExtractionPrompt(transcript: Array<{
17
- role: string;
18
- content: string;
19
- }>, existingMemories: Array<{
20
- name: string;
21
- type: string;
22
- description: string;
23
- }>): string;
24
- /**
25
- * Parse extracted memories from LLM response.
26
- */
27
- export declare function parseExtractionResponse(response: string): ExtractedMemory[];
@@ -1,10 +0,0 @@
1
- /**
2
- * Services index — re-exports all service modules.
3
- */
4
- export { analytics, trackEvent } from "./analytics.js";
5
- export { authorize, refreshToken, type OAuthConfig, type OAuthTokens } from "./oauth.js";
6
- export { notify, notifyComplete, notifyError } from "./notifier.js";
7
- export { diagnostics } from "./diagnostics.js";
8
- export { buildExtractionPrompt, parseExtractionResponse, type ExtractedMemory, } from "./extract-memories.js";
9
- export { shouldAutoDream, recordSession, recordDreamComplete, buildDreamPrompt, } from "./auto-dream.js";
10
- export { saveSessionMemory, loadSessionMemory, listSessionMemories, searchSessionMemories, buildSessionMemoryPrompt, } from "./session-memory.js";
@@ -1,25 +0,0 @@
1
- /**
2
- * Notifier service — desktop/system notifications.
3
- *
4
- * Sends notifications when tasks complete, agents finish, or errors occur.
5
- * Falls back gracefully when no notification system is available.
6
- */
7
- export interface NotificationOptions {
8
- title: string;
9
- message: string;
10
- sound?: boolean;
11
- /** Urgency level: low, normal, critical */
12
- urgency?: "low" | "normal" | "critical";
13
- }
14
- /**
15
- * Send a desktop notification.
16
- */
17
- export declare function notify(options: NotificationOptions): void;
18
- /**
19
- * Send a notification that a task/agent has completed.
20
- */
21
- export declare function notifyComplete(taskName: string, duration?: number): void;
22
- /**
23
- * Send an error notification.
24
- */
25
- export declare function notifyError(context: string, error: string): void;
@@ -1,27 +0,0 @@
1
- /**
2
- * OAuth service — OAuth 2.0 authorization code flow with PKCE.
3
- *
4
- * Supports browser-based login flow for API authentication.
5
- */
6
- export interface OAuthConfig {
7
- clientId: string;
8
- authorizationEndpoint: string;
9
- tokenEndpoint: string;
10
- redirectUri?: string;
11
- scopes?: string[];
12
- }
13
- export interface OAuthTokens {
14
- accessToken: string;
15
- refreshToken?: string;
16
- expiresAt?: number;
17
- tokenType: string;
18
- }
19
- /**
20
- * Run the OAuth authorization code flow.
21
- * Opens a browser for user login and waits for the callback.
22
- */
23
- export declare function authorize(config: OAuthConfig): Promise<OAuthTokens>;
24
- /**
25
- * Refresh an access token using a refresh token.
26
- */
27
- export declare function refreshToken(config: OAuthConfig, refreshTokenValue: string): Promise<OAuthTokens>;
@@ -1,37 +0,0 @@
1
- /**
2
- * Session Memory service — automatic session memory maintenance.
3
- *
4
- * Extracts and maintains conversation context as persistent memory
5
- * entries that survive across sessions.
6
- */
7
- export interface SessionMemoryEntry {
8
- sessionId: string;
9
- summary: string;
10
- keyTopics: string[];
11
- decisions: string[];
12
- createdAt: string;
13
- tokenCount?: number;
14
- }
15
- /**
16
- * Save a session memory entry.
17
- */
18
- export declare function saveSessionMemory(entry: SessionMemoryEntry): void;
19
- /**
20
- * Load a session memory by session ID.
21
- */
22
- export declare function loadSessionMemory(sessionId: string): SessionMemoryEntry | null;
23
- /**
24
- * List all session memories, most recent first.
25
- */
26
- export declare function listSessionMemories(limit?: number): SessionMemoryEntry[];
27
- /**
28
- * Search session memories by keyword.
29
- */
30
- export declare function searchSessionMemories(query: string): SessionMemoryEntry[];
31
- /**
32
- * Build a prompt for extracting session memory from a conversation.
33
- */
34
- export declare function buildSessionMemoryPrompt(messages: Array<{
35
- role: string;
36
- content: string;
37
- }>): string;
@@ -1,41 +0,0 @@
1
- /**
2
- * File history — automatic backup of files before modifications.
3
- *
4
- * Stores snapshots in the session directory under file-history/.
5
- * Supports restoring files to a previous state.
6
- */
7
- export interface FileSnapshot {
8
- filePath: string;
9
- timestamp: number;
10
- backupPath: string;
11
- hash: string;
12
- size: number;
13
- }
14
- export declare class FileHistory {
15
- private readonly historyDir;
16
- private snapshots;
17
- constructor(sessionDir: string);
18
- /**
19
- * Save a snapshot of a file before it is modified.
20
- * Returns the snapshot record, or null if the file doesn't exist.
21
- */
22
- saveSnapshot(filePath: string): FileSnapshot | null;
23
- /**
24
- * Get all snapshots for a specific file.
25
- */
26
- getSnapshots(filePath: string): FileSnapshot[];
27
- /**
28
- * Restore a file to a specific snapshot.
29
- */
30
- restore(snapshot: FileSnapshot): boolean;
31
- /**
32
- * Restore a file to its most recent snapshot.
33
- */
34
- restoreLatest(filePath: string): boolean;
35
- /**
36
- * Get all tracked files.
37
- */
38
- getTrackedFiles(): string[];
39
- private saveIndex;
40
- static loadFromDir(sessionDir: string): FileHistory;
41
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * Memory system — persistent cross-session memory.
3
- *
4
- * Stores structured memory entries as individual markdown files under a base
5
- * directory. Resolution order for the base directory:
6
- * 1. explicit `baseDir` constructor arg
7
- * 2. CODE_SHELL_HOME env var
8
- * 3. ~/.code-shell
9
- *
10
- * MEMORY.md is the index file.
11
- */
12
- export interface MemoryEntry {
13
- name: string;
14
- description: string;
15
- type: "user" | "feedback" | "project" | "reference";
16
- content: string;
17
- fileName: string;
18
- }
19
- export interface MemoryManagerOptions {
20
- /** Project root path; when set, memories are scoped under projects/<hash>/memory. */
21
- projectDir?: string;
22
- /** Override the base directory (~/.code-shell by default). Takes precedence over env. */
23
- baseDir?: string;
24
- }
25
- export declare function resolveMemoryBaseDir(override?: string): string;
26
- export declare class MemoryManager {
27
- private readonly baseDir;
28
- private readonly memoryDir;
29
- private readonly indexPath;
30
- private indexCache;
31
- constructor(options?: MemoryManagerOptions | string);
32
- getMemoryDir(): string;
33
- /**
34
- * Save a memory entry. Creates the file and updates the index.
35
- */
36
- save(entry: Omit<MemoryEntry, "fileName">): string;
37
- /**
38
- * Load all memory entries.
39
- */
40
- loadAll(): MemoryEntry[];
41
- /**
42
- * Load a single memory file.
43
- */
44
- private loadFile;
45
- /**
46
- * Delete a memory by name or filename.
47
- */
48
- delete(nameOrFile: string): boolean;
49
- /**
50
- * Get the MEMORY.md index content for injection into prompts.
51
- */
52
- getIndex(): string;
53
- /**
54
- * Build a prompt-friendly summary of all memories.
55
- */
56
- buildMemoryContext(): string;
57
- /**
58
- * Lazy-build the in-memory index from disk on first use, then
59
- * keep it in sync incrementally via save/delete. Avoids the
60
- * O(N²) re-read of every memory file on every save.
61
- */
62
- private ensureIndexCache;
63
- private writeIndex;
64
- private slugify;
65
- }
@@ -1,28 +0,0 @@
1
- /**
2
- * Session lifecycle manager.
3
- */
4
- import type { SessionState } from "../types.js";
5
- import { Transcript } from "./transcript.js";
6
- export interface SessionBundle {
7
- state: SessionState;
8
- transcript: Transcript;
9
- }
10
- export declare class SessionManager {
11
- private readonly sessionsDir;
12
- constructor(storageDir?: string);
13
- create(cwd: string, model: string, provider: string): SessionBundle;
14
- resume(sessionId: string): SessionBundle;
15
- saveState(state: SessionState): void;
16
- /**
17
- * Fork a session from a specific point.
18
- * Creates a new session that shares events up to the given turn,
19
- * then diverges independently.
20
- */
21
- fork(sourceSessionId: string, forkAtTurn?: number): SessionBundle;
22
- list(limit?: number): SessionListEntry[];
23
- }
24
- export type SessionListEntry = SessionState & {
25
- preview?: string;
26
- /** Last activity time — transcript mtime, falling back to startedAt. */
27
- lastActiveAt: number;
28
- };
@@ -1,39 +0,0 @@
1
- /**
2
- * Transcript — JSONL event log (NOT chat history).
3
- * toMessages() derives Message[] from events for sending to LLM.
4
- */
5
- import type { TranscriptEvent, TranscriptEventType, Message, ContentBlock } from "../types.js";
6
- export declare class Transcript {
7
- private events;
8
- private filePath;
9
- private currentTurn;
10
- getFilePath(): string;
11
- constructor(filePath: string);
12
- append(type: TranscriptEventType, data: Record<string, unknown>): TranscriptEvent;
13
- appendMessage(role: string, content: string | ContentBlock[]): TranscriptEvent;
14
- appendToolUse(toolName: string, toolCallId: string, args: Record<string, unknown>): TranscriptEvent;
15
- appendToolResult(toolCallId: string, toolName: string, result?: string, error?: string): TranscriptEvent;
16
- appendTurnBoundary(): TranscriptEvent;
17
- appendSummary(summary: string, compactedRange: {
18
- fromTurn: number;
19
- toTurn: number;
20
- eventCount: number;
21
- }): TranscriptEvent;
22
- appendError(error: string, details?: Record<string, unknown>): TranscriptEvent;
23
- /**
24
- * Derive Message[] from transcript events for sending to the LLM.
25
- * This is the critical boundary: the LLM never sees the event log directly.
26
- */
27
- toMessages(): Message[];
28
- getEvents(type?: TranscriptEventType): TranscriptEvent[];
29
- get turnNumber(): number;
30
- get eventCount(): number;
31
- private flush;
32
- /**
33
- * Repair tool_result pairing issues:
34
- * - Orphaned tool_results (no matching tool_use) get removed
35
- * - Missing tool_results (tool_use with no result) get synthetic error results
36
- */
37
- repairToolResultPairs(): void;
38
- static loadFromFile(filePath: string): Transcript;
39
- }
@@ -1 +0,0 @@
1
- export{b as SessionManager}from'./chunk-QTWU7UNA.js';import'./chunk-FU7AHZNN.js';import'./chunk-3QP5BQ3L.js';
@@ -1,36 +0,0 @@
1
- /**
2
- * Settings manager — multi-source loading and merge.
3
- *
4
- * Priority: CLI flags > local > project > user > managed
5
- */
6
- import { type ValidatedSettings } from "./schema.js";
7
- export type SettingsSourceName = "managed" | "user" | "project" | "local" | "flag";
8
- export declare class SettingsManager {
9
- private readonly cwd;
10
- private sources;
11
- private merged;
12
- constructor(cwd?: string);
13
- /**
14
- * Load settings from all sources.
15
- */
16
- load(flagOverrides?: Record<string, unknown>): ValidatedSettings;
17
- /**
18
- * Get current effective settings.
19
- */
20
- get(): ValidatedSettings;
21
- /**
22
- * Invalidate cached merge.
23
- */
24
- invalidate(): void;
25
- /**
26
- * Persist a single setting (dotted key path) to the user-level config file
27
- * at ~/.code-shell/settings.json. Other sources (project / local /
28
- * managed) are intentionally untouched: writing back to project/local
29
- * would surprise version control, and managed is read-only.
30
- *
31
- * The merged cache is invalidated so the next get() picks up the change.
32
- */
33
- saveUserSetting(key: string, value: unknown): void;
34
- private loadJsonFile;
35
- private deepMerge;
36
- }