indusagi-coding-agent 0.1.59 → 0.1.61

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 (1162) hide show
  1. package/CHANGELOG.md +60 -48
  2. package/CREDITS.md +19 -0
  3. package/NOTICE +7 -0
  4. package/README.md +65 -63
  5. package/dist/entry.js +19251 -0
  6. package/dist/types/addons/addons.test.d.ts +21 -0
  7. package/dist/types/addons/contract.d.ts +640 -0
  8. package/dist/types/addons/dispatch/event-dispatcher.d.ts +140 -0
  9. package/dist/types/addons/dispatch/index.d.ts +23 -0
  10. package/dist/types/addons/dispatch/tool-interceptor.d.ts +128 -0
  11. package/dist/types/addons/host.d.ts +246 -0
  12. package/dist/types/addons/index.d.ts +51 -0
  13. package/dist/types/addons/manifest.d.ts +56 -0
  14. package/dist/types/addons/sandbox.d.ts +103 -0
  15. package/dist/types/addons/surface.d.ts +42 -0
  16. package/dist/types/boot/auth-vault.d.ts +29 -0
  17. package/dist/types/boot/boot.d.ts +26 -0
  18. package/dist/types/boot/boot.test.d.ts +15 -0
  19. package/dist/types/boot/contract.d.ts +234 -0
  20. package/dist/types/boot/index.d.ts +20 -0
  21. package/dist/types/boot/invocation.d.ts +40 -0
  22. package/dist/types/boot/invocation.test.d.ts +8 -0
  23. package/dist/types/boot/runners/index.d.ts +11 -0
  24. package/dist/types/boot/runners/link-runner.d.ts +20 -0
  25. package/dist/types/boot/runners/oneshot-runner.d.ts +19 -0
  26. package/dist/types/boot/runners/registry.d.ts +30 -0
  27. package/dist/types/boot/runners/repl-runner.d.ts +19 -0
  28. package/dist/types/boot/runners/session-persist.test.d.ts +10 -0
  29. package/dist/types/boot/runners/session.d.ts +45 -0
  30. package/dist/types/boot/stages.d.ts +92 -0
  31. package/dist/types/boot/upgrade/apply.d.ts +45 -0
  32. package/dist/types/boot/upgrade/index.d.ts +13 -0
  33. package/dist/types/boot/upgrade/upgrades.d.ts +126 -0
  34. package/dist/types/briefing/briefing.test.d.ts +15 -0
  35. package/dist/types/briefing/compose.d.ts +37 -0
  36. package/dist/types/briefing/contract.d.ts +686 -0
  37. package/dist/types/briefing/index.d.ts +27 -0
  38. package/dist/types/briefing/macros.d.ts +206 -0
  39. package/dist/types/briefing/skills.d.ts +67 -0
  40. package/dist/types/capability-deck/bridge-ledger/index.d.ts +25 -0
  41. package/dist/types/capability-deck/bridge-ledger/key.d.ts +65 -0
  42. package/dist/types/capability-deck/bridge-ledger/ledger.d.ts +129 -0
  43. package/dist/types/capability-deck/bridge-ledger/network.d.ts +115 -0
  44. package/dist/types/capability-deck/builtin-bridge.d.ts +114 -0
  45. package/dist/types/capability-deck/capability-deck.test.d.ts +18 -0
  46. package/dist/types/capability-deck/cards/bg-process-card.d.ts +99 -0
  47. package/dist/types/capability-deck/cards/index.d.ts +30 -0
  48. package/dist/types/capability-deck/cards/memory-card.d.ts +69 -0
  49. package/dist/types/capability-deck/cards/saas-card.d.ts +78 -0
  50. package/dist/types/capability-deck/cards/task-card.d.ts +82 -0
  51. package/dist/types/capability-deck/cards/todo-card.d.ts +78 -0
  52. package/dist/types/capability-deck/contract.d.ts +317 -0
  53. package/dist/types/capability-deck/index.d.ts +46 -0
  54. package/dist/types/capability-deck/manifest.d.ts +60 -0
  55. package/dist/types/capability-deck/provision.d.ts +76 -0
  56. package/dist/types/channels/channels.test.d.ts +15 -0
  57. package/dist/types/channels/contract.d.ts +489 -0
  58. package/dist/types/channels/framer.d.ts +49 -0
  59. package/dist/types/channels/index.d.ts +24 -0
  60. package/dist/types/channels/link/dialog.d.ts +138 -0
  61. package/dist/types/channels/link/driver.d.ts +81 -0
  62. package/dist/types/channels/link/index.d.ts +13 -0
  63. package/dist/types/channels/link/server.d.ts +70 -0
  64. package/dist/types/channels/oneshot.d.ts +37 -0
  65. package/dist/types/channels/ops.d.ts +89 -0
  66. package/dist/types/channels/session-ops.d.ts +80 -0
  67. package/dist/types/conductor/catalog/catalog.d.ts +87 -0
  68. package/dist/types/conductor/catalog/index.d.ts +14 -0
  69. package/dist/types/conductor/catalog/matcher.d.ts +47 -0
  70. package/dist/types/conductor/conductor.d.ts +157 -0
  71. package/dist/types/conductor/conductor.test.d.ts +10 -0
  72. package/dist/types/conductor/contract.d.ts +547 -0
  73. package/dist/types/conductor/index.d.ts +23 -0
  74. package/dist/types/conductor/signal-hub/hub.d.ts +83 -0
  75. package/dist/types/conductor/signal-hub/index.d.ts +19 -0
  76. package/dist/types/conductor/signal-hub/translate.d.ts +74 -0
  77. package/dist/types/conductor/skill-parse/index.d.ts +10 -0
  78. package/dist/types/conductor/skill-parse/parse.d.ts +67 -0
  79. package/dist/types/conductor/submit.test.d.ts +28 -0
  80. package/dist/types/conductor/transcript-store/index.d.ts +16 -0
  81. package/dist/types/conductor/transcript-store/serialize.d.ts +106 -0
  82. package/dist/types/conductor/transcript-store/store.d.ts +170 -0
  83. package/dist/types/console/components/Banner.d.ts +54 -0
  84. package/dist/types/console/components/Composer.d.ts +37 -0
  85. package/dist/types/console/components/StatusBar.d.ts +31 -0
  86. package/dist/types/console/components/TerminalConsole.d.ts +32 -0
  87. package/dist/types/console/console.test.d.ts +19 -0
  88. package/dist/types/console/contract.d.ts +562 -0
  89. package/dist/types/console/index.d.ts +31 -0
  90. package/dist/types/console/input/complete.d.ts +120 -0
  91. package/dist/types/console/input/dir-reader.d.ts +28 -0
  92. package/dist/types/console/input/index.d.ts +24 -0
  93. package/dist/types/console/input/input.test.d.ts +14 -0
  94. package/dist/types/console/input/keymap.d.ts +184 -0
  95. package/dist/types/console/input/paste.d.ts +131 -0
  96. package/dist/types/console/mount.d.ts +53 -0
  97. package/dist/types/console/overlays/auth.d.ts +31 -0
  98. package/dist/types/console/overlays/host.d.ts +44 -0
  99. package/dist/types/console/overlays/index.d.ts +13 -0
  100. package/dist/types/console/overlays/pickers.d.ts +37 -0
  101. package/dist/types/console/overlays/sessions.d.ts +29 -0
  102. package/dist/types/console/reducer.d.ts +51 -0
  103. package/dist/types/console/slash/builtins.d.ts +33 -0
  104. package/dist/types/console/slash/commands/dynamic.d.ts +57 -0
  105. package/dist/types/console/slash/commands/dynamic.test.d.ts +9 -0
  106. package/dist/types/console/slash/commands/integrations.d.ts +28 -0
  107. package/dist/types/console/slash/commands/integrations.test.d.ts +18 -0
  108. package/dist/types/console/slash/commands/shared.d.ts +72 -0
  109. package/dist/types/console/slash/commands/transcript.d.ts +24 -0
  110. package/dist/types/console/slash/commands/transcript.test.d.ts +10 -0
  111. package/dist/types/console/slash/commands/workbench.d.ts +21 -0
  112. package/dist/types/console/slash/commands/workbench.test.d.ts +10 -0
  113. package/dist/types/console/slash/index.d.ts +34 -0
  114. package/dist/types/console/slash/registry.d.ts +90 -0
  115. package/dist/types/console/slash/resolve.d.ts +109 -0
  116. package/dist/types/console/slash/slash.test.d.ts +18 -0
  117. package/dist/types/console/startup.d.ts +119 -0
  118. package/dist/types/console/theme/adapter.d.ts +60 -0
  119. package/dist/types/console/theme/index.d.ts +18 -0
  120. package/dist/types/console/theme/palette.d.ts +42 -0
  121. package/dist/types/console/theme/resolve.d.ts +45 -0
  122. package/dist/types/console/theme/theme.test.d.ts +16 -0
  123. package/dist/types/console/theme/tokens.d.ts +40 -0
  124. package/dist/types/entry.d.ts +17 -0
  125. package/dist/types/index.d.ts +24 -0
  126. package/dist/types/insight/channel.d.ts +45 -0
  127. package/dist/types/insight/contract.d.ts +411 -0
  128. package/dist/types/insight/index.d.ts +26 -0
  129. package/dist/types/insight/insight.test.d.ts +17 -0
  130. package/dist/types/insight/recorder.d.ts +63 -0
  131. package/dist/types/insight/redaction.d.ts +44 -0
  132. package/dist/types/insight/replay.d.ts +77 -0
  133. package/dist/types/insight/sampling.d.ts +84 -0
  134. package/dist/types/insight/serialize.d.ts +54 -0
  135. package/dist/types/insight/sinks/console.d.ts +36 -0
  136. package/dist/types/insight/sinks/file.d.ts +37 -0
  137. package/dist/types/insight/sinks/index.d.ts +16 -0
  138. package/dist/types/insight/sinks/stream.d.ts +53 -0
  139. package/dist/types/kit/clipboard-image.d.ts +40 -0
  140. package/dist/types/kit/external-editor.d.ts +35 -0
  141. package/dist/types/kit/image.d.ts +102 -0
  142. package/dist/types/kit/index.d.ts +29 -0
  143. package/dist/types/kit/kit.test.d.ts +13 -0
  144. package/dist/types/kit/shell.d.ts +50 -0
  145. package/dist/types/kit/tool-fetch.d.ts +165 -0
  146. package/dist/types/launch/catalog.d.ts +51 -0
  147. package/dist/types/launch/contract.d.ts +385 -0
  148. package/dist/types/launch/credentials.d.ts +112 -0
  149. package/dist/types/launch/index.d.ts +28 -0
  150. package/dist/types/launch/invocation/attachments.d.ts +72 -0
  151. package/dist/types/launch/invocation/flags.d.ts +59 -0
  152. package/dist/types/launch/invocation/index.d.ts +23 -0
  153. package/dist/types/launch/invocation/read.d.ts +52 -0
  154. package/dist/types/launch/invocation/usage.d.ts +25 -0
  155. package/dist/types/launch/launch.test.d.ts +20 -0
  156. package/dist/types/launch/oauth.d.ts +88 -0
  157. package/dist/types/launch/packages.d.ts +75 -0
  158. package/dist/types/launch/packages.test.d.ts +15 -0
  159. package/dist/types/launch/pickers.d.ts +97 -0
  160. package/dist/types/runtime-bridge/bridges/_drive.d.ts +74 -0
  161. package/dist/types/runtime-bridge/bridges/builtins.d.ts +77 -0
  162. package/dist/types/runtime-bridge/bridges/claude-cli.d.ts +37 -0
  163. package/dist/types/runtime-bridge/bridges/codex-cli.d.ts +27 -0
  164. package/dist/types/runtime-bridge/bridges/index.d.ts +15 -0
  165. package/dist/types/runtime-bridge/bridges/indusagi-cli.d.ts +36 -0
  166. package/dist/types/runtime-bridge/broker.d.ts +182 -0
  167. package/dist/types/runtime-bridge/contract.d.ts +436 -0
  168. package/dist/types/runtime-bridge/index.d.ts +21 -0
  169. package/dist/types/runtime-bridge/runtime-bridge.test.d.ts +17 -0
  170. package/dist/types/runtime-bridge/sink.d.ts +59 -0
  171. package/dist/types/sessions/contract.d.ts +79 -0
  172. package/dist/types/sessions/index.d.ts +11 -0
  173. package/dist/types/sessions/library.d.ts +95 -0
  174. package/dist/types/sessions/sessions.test.d.ts +11 -0
  175. package/dist/types/settings/contract.d.ts +116 -0
  176. package/dist/types/settings/index.d.ts +13 -0
  177. package/dist/types/settings/manager.d.ts +109 -0
  178. package/dist/types/settings/settings.test.d.ts +16 -0
  179. package/dist/types/transcript-export/index.d.ts +20 -0
  180. package/dist/types/transcript-export/publish.d.ts +81 -0
  181. package/dist/types/transcript-export/sgr.d.ts +90 -0
  182. package/dist/types/transcript-export/template.d.ts +64 -0
  183. package/dist/types/transcript-export/theme-bridge.d.ts +99 -0
  184. package/dist/types/transcript-export/transcript-export.test.d.ts +16 -0
  185. package/dist/types/window-budget/budget/estimate.d.ts +47 -0
  186. package/dist/types/window-budget/budget/gate.d.ts +37 -0
  187. package/dist/types/window-budget/budget/index.d.ts +14 -0
  188. package/dist/types/window-budget/budget/slice.d.ts +38 -0
  189. package/dist/types/window-budget/condenser.d.ts +59 -0
  190. package/dist/types/window-budget/contract.d.ts +182 -0
  191. package/dist/types/window-budget/index.d.ts +15 -0
  192. package/dist/types/window-budget/summarize/condense.d.ts +70 -0
  193. package/dist/types/window-budget/summarize/index.d.ts +12 -0
  194. package/dist/types/window-budget/summarize/prompt.d.ts +56 -0
  195. package/dist/types/window-budget/window-budget.test.d.ts +18 -0
  196. package/dist/types/workspace/brand.d.ts +20 -0
  197. package/dist/types/workspace/index.d.ts +11 -0
  198. package/dist/types/workspace/locator.d.ts +50 -0
  199. package/dist/types/workspace/runtime-detect.d.ts +56 -0
  200. package/package.json +43 -62
  201. package/LICENSE +0 -8
  202. package/LICENSE-THIRD-PARTY.txt +0 -30
  203. package/demos/README.md +0 -12
  204. package/dist/cli.d.ts +0 -3
  205. package/dist/cli.d.ts.map +0 -1
  206. package/dist/cli.js +0 -30
  207. package/dist/cli.js.map +0 -1
  208. package/dist/command-line/args.d.ts +0 -59
  209. package/dist/command-line/args.d.ts.map +0 -1
  210. package/dist/command-line/args.js +0 -332
  211. package/dist/command-line/args.js.map +0 -1
  212. package/dist/command-line/config-selector.d.ts +0 -17
  213. package/dist/command-line/config-selector.d.ts.map +0 -1
  214. package/dist/command-line/config-selector.js +0 -34
  215. package/dist/command-line/config-selector.js.map +0 -1
  216. package/dist/command-line/file-processor.d.ts +0 -15
  217. package/dist/command-line/file-processor.d.ts.map +0 -1
  218. package/dist/command-line/file-processor.js +0 -73
  219. package/dist/command-line/file-processor.js.map +0 -1
  220. package/dist/command-line/list-models.d.ts +0 -9
  221. package/dist/command-line/list-models.d.ts.map +0 -1
  222. package/dist/command-line/list-models.js +0 -74
  223. package/dist/command-line/list-models.js.map +0 -1
  224. package/dist/command-line/login-handler.d.ts +0 -94
  225. package/dist/command-line/login-handler.d.ts.map +0 -1
  226. package/dist/command-line/login-handler.js +0 -794
  227. package/dist/command-line/login-handler.js.map +0 -1
  228. package/dist/command-line/session-picker.d.ts +0 -10
  229. package/dist/command-line/session-picker.d.ts.map +0 -1
  230. package/dist/command-line/session-picker.js +0 -60
  231. package/dist/command-line/session-picker.js.map +0 -1
  232. package/dist/config.d.ts +0 -31
  233. package/dist/config.d.ts.map +0 -1
  234. package/dist/config.js +0 -143
  235. package/dist/config.js.map +0 -1
  236. package/dist/dev/observe-deep.d.ts +0 -2
  237. package/dist/dev/observe-deep.d.ts.map +0 -1
  238. package/dist/dev/observe-deep.js +0 -333
  239. package/dist/dev/observe-deep.js.map +0 -1
  240. package/dist/dev/observe-smoke.d.ts +0 -2
  241. package/dist/dev/observe-smoke.d.ts.map +0 -1
  242. package/dist/dev/observe-smoke.js +0 -264
  243. package/dist/dev/observe-smoke.js.map +0 -1
  244. package/dist/helpers/array.d.ts +0 -438
  245. package/dist/helpers/array.d.ts.map +0 -1
  246. package/dist/helpers/array.js +0 -692
  247. package/dist/helpers/array.js.map +0 -1
  248. package/dist/helpers/changelog.d.ts +0 -20
  249. package/dist/helpers/changelog.d.ts.map +0 -1
  250. package/dist/helpers/changelog.js +0 -79
  251. package/dist/helpers/changelog.js.map +0 -1
  252. package/dist/helpers/clipboard-image.d.ts +0 -11
  253. package/dist/helpers/clipboard-image.d.ts.map +0 -1
  254. package/dist/helpers/clipboard-image.js +0 -111
  255. package/dist/helpers/clipboard-image.js.map +0 -1
  256. package/dist/helpers/clipboard.d.ts +0 -2
  257. package/dist/helpers/clipboard.d.ts.map +0 -1
  258. package/dist/helpers/clipboard.js +0 -72
  259. package/dist/helpers/clipboard.js.map +0 -1
  260. package/dist/helpers/color-formatter.d.ts +0 -318
  261. package/dist/helpers/color-formatter.d.ts.map +0 -1
  262. package/dist/helpers/color-formatter.js +0 -469
  263. package/dist/helpers/color-formatter.js.map +0 -1
  264. package/dist/helpers/data-transformer.d.ts +0 -391
  265. package/dist/helpers/data-transformer.d.ts.map +0 -1
  266. package/dist/helpers/data-transformer.js +0 -604
  267. package/dist/helpers/data-transformer.js.map +0 -1
  268. package/dist/helpers/date-formatter.d.ts +0 -316
  269. package/dist/helpers/date-formatter.d.ts.map +0 -1
  270. package/dist/helpers/date-formatter.js +0 -553
  271. package/dist/helpers/date-formatter.js.map +0 -1
  272. package/dist/helpers/error-handler.d.ts +0 -541
  273. package/dist/helpers/error-handler.d.ts.map +0 -1
  274. package/dist/helpers/error-handler.js +0 -726
  275. package/dist/helpers/error-handler.js.map +0 -1
  276. package/dist/helpers/file-operations.d.ts +0 -324
  277. package/dist/helpers/file-operations.d.ts.map +0 -1
  278. package/dist/helpers/file-operations.js +0 -543
  279. package/dist/helpers/file-operations.js.map +0 -1
  280. package/dist/helpers/frontmatter.d.ts +0 -273
  281. package/dist/helpers/frontmatter.d.ts.map +0 -1
  282. package/dist/helpers/frontmatter.js +0 -580
  283. package/dist/helpers/frontmatter.js.map +0 -1
  284. package/dist/helpers/git.d.ts +0 -2
  285. package/dist/helpers/git.d.ts.map +0 -1
  286. package/dist/helpers/git.js +0 -6
  287. package/dist/helpers/git.js.map +0 -1
  288. package/dist/helpers/image-convert.d.ts +0 -9
  289. package/dist/helpers/image-convert.d.ts.map +0 -1
  290. package/dist/helpers/image-convert.js +0 -41
  291. package/dist/helpers/image-convert.js.map +0 -1
  292. package/dist/helpers/image-resize.d.ts +0 -19
  293. package/dist/helpers/image-resize.d.ts.map +0 -1
  294. package/dist/helpers/image-resize.js +0 -143
  295. package/dist/helpers/image-resize.js.map +0 -1
  296. package/dist/helpers/json-formatter.d.ts +0 -267
  297. package/dist/helpers/json-formatter.d.ts.map +0 -1
  298. package/dist/helpers/json-formatter.js +0 -533
  299. package/dist/helpers/json-formatter.js.map +0 -1
  300. package/dist/helpers/logger.d.ts +0 -176
  301. package/dist/helpers/logger.d.ts.map +0 -1
  302. package/dist/helpers/logger.js +0 -346
  303. package/dist/helpers/logger.js.map +0 -1
  304. package/dist/helpers/markdown-formatter.d.ts +0 -235
  305. package/dist/helpers/markdown-formatter.d.ts.map +0 -1
  306. package/dist/helpers/markdown-formatter.js +0 -633
  307. package/dist/helpers/markdown-formatter.js.map +0 -1
  308. package/dist/helpers/mime.d.ts +0 -3
  309. package/dist/helpers/mime.d.ts.map +0 -1
  310. package/dist/helpers/mime.js +0 -46
  311. package/dist/helpers/mime.js.map +0 -1
  312. package/dist/helpers/open-auth-url.d.ts +0 -2
  313. package/dist/helpers/open-auth-url.d.ts.map +0 -1
  314. package/dist/helpers/open-auth-url.js +0 -59
  315. package/dist/helpers/open-auth-url.js.map +0 -1
  316. package/dist/helpers/path-validator.d.ts +0 -603
  317. package/dist/helpers/path-validator.d.ts.map +0 -1
  318. package/dist/helpers/path-validator.js +0 -895
  319. package/dist/helpers/path-validator.js.map +0 -1
  320. package/dist/helpers/photon.d.ts +0 -10
  321. package/dist/helpers/photon.d.ts.map +0 -1
  322. package/dist/helpers/photon.js +0 -132
  323. package/dist/helpers/photon.js.map +0 -1
  324. package/dist/helpers/shell.d.ts +0 -10
  325. package/dist/helpers/shell.d.ts.map +0 -1
  326. package/dist/helpers/shell.js +0 -142
  327. package/dist/helpers/shell.js.map +0 -1
  328. package/dist/helpers/sleep.d.ts +0 -5
  329. package/dist/helpers/sleep.d.ts.map +0 -1
  330. package/dist/helpers/sleep.js +0 -41
  331. package/dist/helpers/sleep.js.map +0 -1
  332. package/dist/helpers/string-formatter.d.ts +0 -609
  333. package/dist/helpers/string-formatter.d.ts.map +0 -1
  334. package/dist/helpers/string-formatter.js +0 -807
  335. package/dist/helpers/string-formatter.js.map +0 -1
  336. package/dist/helpers/tools-manager.d.ts +0 -5
  337. package/dist/helpers/tools-manager.d.ts.map +0 -1
  338. package/dist/helpers/tools-manager.js +0 -161
  339. package/dist/helpers/tools-manager.js.map +0 -1
  340. package/dist/helpers/type-guards.d.ts +0 -634
  341. package/dist/helpers/type-guards.d.ts.map +0 -1
  342. package/dist/helpers/type-guards.js +0 -671
  343. package/dist/helpers/type-guards.js.map +0 -1
  344. package/dist/index.d.ts +0 -41
  345. package/dist/index.d.ts.map +0 -1
  346. package/dist/index.js +0 -40
  347. package/dist/index.js.map +0 -1
  348. package/dist/interfaces/index.d.ts +0 -16
  349. package/dist/interfaces/index.d.ts.map +0 -1
  350. package/dist/interfaces/index.js +0 -14
  351. package/dist/interfaces/index.js.map +0 -1
  352. package/dist/interfaces/print-mode.d.ts +0 -561
  353. package/dist/interfaces/print-mode.d.ts.map +0 -1
  354. package/dist/interfaces/print-mode.js +0 -633
  355. package/dist/interfaces/print-mode.js.map +0 -1
  356. package/dist/interfaces/react-ink/adapters/command-router.d.ts +0 -19
  357. package/dist/interfaces/react-ink/adapters/command-router.d.ts.map +0 -1
  358. package/dist/interfaces/react-ink/adapters/command-router.js +0 -674
  359. package/dist/interfaces/react-ink/adapters/command-router.js.map +0 -1
  360. package/dist/interfaces/react-ink/adapters/session-events.d.ts +0 -5
  361. package/dist/interfaces/react-ink/adapters/session-events.d.ts.map +0 -1
  362. package/dist/interfaces/react-ink/adapters/session-events.js +0 -255
  363. package/dist/interfaces/react-ink/adapters/session-events.js.map +0 -1
  364. package/dist/interfaces/react-ink/adapters/session-history.d.ts +0 -14
  365. package/dist/interfaces/react-ink/adapters/session-history.d.ts.map +0 -1
  366. package/dist/interfaces/react-ink/adapters/session-history.js +0 -83
  367. package/dist/interfaces/react-ink/adapters/session-history.js.map +0 -1
  368. package/dist/interfaces/react-ink/adapters/tool-state.d.ts +0 -4
  369. package/dist/interfaces/react-ink/adapters/tool-state.d.ts.map +0 -1
  370. package/dist/interfaces/react-ink/adapters/tool-state.js +0 -67
  371. package/dist/interfaces/react-ink/adapters/tool-state.js.map +0 -1
  372. package/dist/interfaces/react-ink/components/AppShell.d.ts +0 -17
  373. package/dist/interfaces/react-ink/components/AppShell.d.ts.map +0 -1
  374. package/dist/interfaces/react-ink/components/AppShell.js +0 -1535
  375. package/dist/interfaces/react-ink/components/AppShell.js.map +0 -1
  376. package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts +0 -9
  377. package/dist/interfaces/react-ink/components/ChangelogBlock.d.ts.map +0 -1
  378. package/dist/interfaces/react-ink/components/ChangelogBlock.js +0 -58
  379. package/dist/interfaces/react-ink/components/ChangelogBlock.js.map +0 -1
  380. package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts +0 -9
  381. package/dist/interfaces/react-ink/components/DisplayBlockView.d.ts.map +0 -1
  382. package/dist/interfaces/react-ink/components/DisplayBlockView.js +0 -11
  383. package/dist/interfaces/react-ink/components/DisplayBlockView.js.map +0 -1
  384. package/dist/interfaces/react-ink/components/Footer.d.ts +0 -12
  385. package/dist/interfaces/react-ink/components/Footer.d.ts.map +0 -1
  386. package/dist/interfaces/react-ink/components/Footer.js +0 -88
  387. package/dist/interfaces/react-ink/components/Footer.js.map +0 -1
  388. package/dist/interfaces/react-ink/components/Header.d.ts +0 -14
  389. package/dist/interfaces/react-ink/components/Header.d.ts.map +0 -1
  390. package/dist/interfaces/react-ink/components/Header.js +0 -24
  391. package/dist/interfaces/react-ink/components/Header.js.map +0 -1
  392. package/dist/interfaces/react-ink/components/MessageList.d.ts +0 -14
  393. package/dist/interfaces/react-ink/components/MessageList.d.ts.map +0 -1
  394. package/dist/interfaces/react-ink/components/MessageList.js +0 -43
  395. package/dist/interfaces/react-ink/components/MessageList.js.map +0 -1
  396. package/dist/interfaces/react-ink/components/MessageRow.d.ts +0 -13
  397. package/dist/interfaces/react-ink/components/MessageRow.d.ts.map +0 -1
  398. package/dist/interfaces/react-ink/components/MessageRow.js +0 -35
  399. package/dist/interfaces/react-ink/components/MessageRow.js.map +0 -1
  400. package/dist/interfaces/react-ink/components/PromptInput.d.ts +0 -35
  401. package/dist/interfaces/react-ink/components/PromptInput.d.ts.map +0 -1
  402. package/dist/interfaces/react-ink/components/PromptInput.js +0 -458
  403. package/dist/interfaces/react-ink/components/PromptInput.js.map +0 -1
  404. package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts +0 -9
  405. package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.d.ts.map +0 -1
  406. package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js +0 -14
  407. package/dist/interfaces/react-ink/components/StartupDiagnosticsBlock.js.map +0 -1
  408. package/dist/interfaces/react-ink/components/StatusLine.d.ts +0 -10
  409. package/dist/interfaces/react-ink/components/StatusLine.d.ts.map +0 -1
  410. package/dist/interfaces/react-ink/components/StatusLine.js +0 -39
  411. package/dist/interfaces/react-ink/components/StatusLine.js.map +0 -1
  412. package/dist/interfaces/react-ink/components/TaskPanel.d.ts +0 -10
  413. package/dist/interfaces/react-ink/components/TaskPanel.d.ts.map +0 -1
  414. package/dist/interfaces/react-ink/components/TaskPanel.js +0 -23
  415. package/dist/interfaces/react-ink/components/TaskPanel.js.map +0 -1
  416. package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts +0 -18
  417. package/dist/interfaces/react-ink/components/ToolEventBlock.d.ts.map +0 -1
  418. package/dist/interfaces/react-ink/components/ToolEventBlock.js +0 -61
  419. package/dist/interfaces/react-ink/components/ToolEventBlock.js.map +0 -1
  420. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts +0 -9
  421. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.d.ts.map +0 -1
  422. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js +0 -6
  423. package/dist/interfaces/react-ink/components/dialogs/DialogFrame.js.map +0 -1
  424. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts +0 -15
  425. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.d.ts.map +0 -1
  426. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js +0 -10
  427. package/dist/interfaces/react-ink/components/dialogs/LoginDialog.js.map +0 -1
  428. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts +0 -10
  429. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.d.ts.map +0 -1
  430. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js +0 -64
  431. package/dist/interfaces/react-ink/components/dialogs/ModelDialog.js.map +0 -1
  432. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts +0 -10
  433. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.d.ts.map +0 -1
  434. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js +0 -24
  435. package/dist/interfaces/react-ink/components/dialogs/OAuthDialog.js.map +0 -1
  436. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts +0 -10
  437. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.d.ts.map +0 -1
  438. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js +0 -95
  439. package/dist/interfaces/react-ink/components/dialogs/ScopedModelsDialog.js.map +0 -1
  440. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts +0 -17
  441. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.d.ts.map +0 -1
  442. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js +0 -66
  443. package/dist/interfaces/react-ink/components/dialogs/SelectableDialog.js.map +0 -1
  444. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts +0 -11
  445. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.d.ts.map +0 -1
  446. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js +0 -10
  447. package/dist/interfaces/react-ink/components/dialogs/SessionDialog.js.map +0 -1
  448. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts +0 -15
  449. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.d.ts.map +0 -1
  450. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js +0 -79
  451. package/dist/interfaces/react-ink/components/dialogs/SettingsDialog.js.map +0 -1
  452. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts +0 -10
  453. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.d.ts.map +0 -1
  454. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js +0 -99
  455. package/dist/interfaces/react-ink/components/dialogs/StartupSessionPicker.js.map +0 -1
  456. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts +0 -8
  457. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.d.ts.map +0 -1
  458. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js +0 -7
  459. package/dist/interfaces/react-ink/components/dialogs/ThemeDialog.js.map +0 -1
  460. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts +0 -9
  461. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.d.ts.map +0 -1
  462. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js +0 -7
  463. package/dist/interfaces/react-ink/components/dialogs/TreeDialog.js.map +0 -1
  464. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts +0 -9
  465. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.d.ts.map +0 -1
  466. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js +0 -7
  467. package/dist/interfaces/react-ink/components/dialogs/UserMessageDialog.js.map +0 -1
  468. package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts +0 -30
  469. package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.d.ts.map +0 -1
  470. package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js +0 -106
  471. package/dist/interfaces/react-ink/components/extensions/ExtensionComponentHost.js.map +0 -1
  472. package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts +0 -20
  473. package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.d.ts.map +0 -1
  474. package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js +0 -145
  475. package/dist/interfaces/react-ink/components/extensions/ExtensionDialogs.js.map +0 -1
  476. package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts +0 -12
  477. package/dist/interfaces/react-ink/components/messages/AssistantMessage.d.ts.map +0 -1
  478. package/dist/interfaces/react-ink/components/messages/AssistantMessage.js +0 -20
  479. package/dist/interfaces/react-ink/components/messages/AssistantMessage.js.map +0 -1
  480. package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts +0 -9
  481. package/dist/interfaces/react-ink/components/messages/BashMessage.d.ts.map +0 -1
  482. package/dist/interfaces/react-ink/components/messages/BashMessage.js +0 -11
  483. package/dist/interfaces/react-ink/components/messages/BashMessage.js.map +0 -1
  484. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts +0 -9
  485. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.d.ts.map +0 -1
  486. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js +0 -6
  487. package/dist/interfaces/react-ink/components/messages/BranchSummaryMessage.js.map +0 -1
  488. package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts +0 -9
  489. package/dist/interfaces/react-ink/components/messages/CompactionMessage.d.ts.map +0 -1
  490. package/dist/interfaces/react-ink/components/messages/CompactionMessage.js +0 -6
  491. package/dist/interfaces/react-ink/components/messages/CompactionMessage.js.map +0 -1
  492. package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts +0 -10
  493. package/dist/interfaces/react-ink/components/messages/CustomMessage.d.ts.map +0 -1
  494. package/dist/interfaces/react-ink/components/messages/CustomMessage.js +0 -9
  495. package/dist/interfaces/react-ink/components/messages/CustomMessage.js.map +0 -1
  496. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts +0 -8
  497. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.d.ts.map +0 -1
  498. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js +0 -10
  499. package/dist/interfaces/react-ink/components/messages/SkillInvocationMessage.js.map +0 -1
  500. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts +0 -9
  501. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.d.ts.map +0 -1
  502. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js +0 -8
  503. package/dist/interfaces/react-ink/components/messages/ToolCallMessage.js.map +0 -1
  504. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts +0 -12
  505. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.d.ts.map +0 -1
  506. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js +0 -8
  507. package/dist/interfaces/react-ink/components/messages/ToolResultBlock.js.map +0 -1
  508. package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts +0 -10
  509. package/dist/interfaces/react-ink/components/messages/UserMessage.d.ts.map +0 -1
  510. package/dist/interfaces/react-ink/components/messages/UserMessage.js +0 -7
  511. package/dist/interfaces/react-ink/components/messages/UserMessage.js.map +0 -1
  512. package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts +0 -8
  513. package/dist/interfaces/react-ink/hooks/use-agent-session.d.ts.map +0 -1
  514. package/dist/interfaces/react-ink/hooks/use-agent-session.js +0 -34
  515. package/dist/interfaces/react-ink/hooks/use-agent-session.js.map +0 -1
  516. package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts +0 -12
  517. package/dist/interfaces/react-ink/hooks/use-app-keybindings.d.ts.map +0 -1
  518. package/dist/interfaces/react-ink/hooks/use-app-keybindings.js +0 -17
  519. package/dist/interfaces/react-ink/hooks/use-app-keybindings.js.map +0 -1
  520. package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts +0 -7
  521. package/dist/interfaces/react-ink/hooks/use-footer-data.d.ts.map +0 -1
  522. package/dist/interfaces/react-ink/hooks/use-footer-data.js +0 -17
  523. package/dist/interfaces/react-ink/hooks/use-footer-data.js.map +0 -1
  524. package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts +0 -17
  525. package/dist/interfaces/react-ink/hooks/use-prompt-submit.d.ts.map +0 -1
  526. package/dist/interfaces/react-ink/hooks/use-prompt-submit.js +0 -66
  527. package/dist/interfaces/react-ink/hooks/use-prompt-submit.js.map +0 -1
  528. package/dist/interfaces/react-ink/hooks/use-session-history.d.ts +0 -8
  529. package/dist/interfaces/react-ink/hooks/use-session-history.d.ts.map +0 -1
  530. package/dist/interfaces/react-ink/hooks/use-session-history.js +0 -8
  531. package/dist/interfaces/react-ink/hooks/use-session-history.js.map +0 -1
  532. package/dist/interfaces/react-ink/index.d.ts +0 -8
  533. package/dist/interfaces/react-ink/index.d.ts.map +0 -1
  534. package/dist/interfaces/react-ink/index.js +0 -8
  535. package/dist/interfaces/react-ink/index.js.map +0 -1
  536. package/dist/interfaces/react-ink/interactive-mode.d.ts +0 -24
  537. package/dist/interfaces/react-ink/interactive-mode.d.ts.map +0 -1
  538. package/dist/interfaces/react-ink/interactive-mode.js +0 -57
  539. package/dist/interfaces/react-ink/interactive-mode.js.map +0 -1
  540. package/dist/interfaces/react-ink/render-root.d.ts +0 -19
  541. package/dist/interfaces/react-ink/render-root.d.ts.map +0 -1
  542. package/dist/interfaces/react-ink/render-root.js +0 -6
  543. package/dist/interfaces/react-ink/render-root.js.map +0 -1
  544. package/dist/interfaces/react-ink/state/reducer.d.ts +0 -51
  545. package/dist/interfaces/react-ink/state/reducer.d.ts.map +0 -1
  546. package/dist/interfaces/react-ink/state/reducer.js +0 -122
  547. package/dist/interfaces/react-ink/state/reducer.js.map +0 -1
  548. package/dist/interfaces/react-ink/state/store.d.ts +0 -4
  549. package/dist/interfaces/react-ink/state/store.d.ts.map +0 -1
  550. package/dist/interfaces/react-ink/state/store.js +0 -5
  551. package/dist/interfaces/react-ink/state/store.js.map +0 -1
  552. package/dist/interfaces/react-ink/state/ui-state.d.ts +0 -5
  553. package/dist/interfaces/react-ink/state/ui-state.d.ts.map +0 -1
  554. package/dist/interfaces/react-ink/state/ui-state.js +0 -20
  555. package/dist/interfaces/react-ink/state/ui-state.js.map +0 -1
  556. package/dist/interfaces/react-ink/theme-adapter.d.ts +0 -4
  557. package/dist/interfaces/react-ink/theme-adapter.d.ts.map +0 -1
  558. package/dist/interfaces/react-ink/theme-adapter.js +0 -15
  559. package/dist/interfaces/react-ink/theme-adapter.js.map +0 -1
  560. package/dist/interfaces/react-ink/types.d.ts +0 -51
  561. package/dist/interfaces/react-ink/types.d.ts.map +0 -1
  562. package/dist/interfaces/react-ink/types.js +0 -2
  563. package/dist/interfaces/react-ink/types.js.map +0 -1
  564. package/dist/interfaces/react-ink/utils/changelog.d.ts +0 -7
  565. package/dist/interfaces/react-ink/utils/changelog.d.ts.map +0 -1
  566. package/dist/interfaces/react-ink/utils/changelog.js +0 -40
  567. package/dist/interfaces/react-ink/utils/changelog.js.map +0 -1
  568. package/dist/interfaces/react-ink/utils/key-data.d.ts +0 -22
  569. package/dist/interfaces/react-ink/utils/key-data.d.ts.map +0 -1
  570. package/dist/interfaces/react-ink/utils/key-data.js +0 -123
  571. package/dist/interfaces/react-ink/utils/key-data.js.map +0 -1
  572. package/dist/interfaces/react-ink/utils/message-groups.d.ts +0 -26
  573. package/dist/interfaces/react-ink/utils/message-groups.d.ts.map +0 -1
  574. package/dist/interfaces/react-ink/utils/message-groups.js +0 -230
  575. package/dist/interfaces/react-ink/utils/message-groups.js.map +0 -1
  576. package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts +0 -20
  577. package/dist/interfaces/react-ink/utils/prompt-autocomplete.d.ts.map +0 -1
  578. package/dist/interfaces/react-ink/utils/prompt-autocomplete.js +0 -46
  579. package/dist/interfaces/react-ink/utils/prompt-autocomplete.js.map +0 -1
  580. package/dist/interfaces/react-ink/utils/selection-dialog.d.ts +0 -3
  581. package/dist/interfaces/react-ink/utils/selection-dialog.d.ts.map +0 -1
  582. package/dist/interfaces/react-ink/utils/selection-dialog.js +0 -18
  583. package/dist/interfaces/react-ink/utils/selection-dialog.js.map +0 -1
  584. package/dist/interfaces/react-ink/utils/session-actions.d.ts +0 -10
  585. package/dist/interfaces/react-ink/utils/session-actions.d.ts.map +0 -1
  586. package/dist/interfaces/react-ink/utils/session-actions.js +0 -66
  587. package/dist/interfaces/react-ink/utils/session-actions.js.map +0 -1
  588. package/dist/interfaces/react-ink/utils/slash-commands.d.ts +0 -10
  589. package/dist/interfaces/react-ink/utils/slash-commands.d.ts.map +0 -1
  590. package/dist/interfaces/react-ink/utils/slash-commands.js +0 -111
  591. package/dist/interfaces/react-ink/utils/slash-commands.js.map +0 -1
  592. package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts +0 -7
  593. package/dist/interfaces/react-ink/utils/startup-diagnostics.d.ts.map +0 -1
  594. package/dist/interfaces/react-ink/utils/startup-diagnostics.js +0 -111
  595. package/dist/interfaces/react-ink/utils/startup-diagnostics.js.map +0 -1
  596. package/dist/interfaces/react-ink/utils/tool-display.d.ts +0 -22
  597. package/dist/interfaces/react-ink/utils/tool-display.d.ts.map +0 -1
  598. package/dist/interfaces/react-ink/utils/tool-display.js +0 -349
  599. package/dist/interfaces/react-ink/utils/tool-display.js.map +0 -1
  600. package/dist/interfaces/service-api/rpc-client.d.ts +0 -1129
  601. package/dist/interfaces/service-api/rpc-client.d.ts.map +0 -1
  602. package/dist/interfaces/service-api/rpc-client.js +0 -1333
  603. package/dist/interfaces/service-api/rpc-client.js.map +0 -1
  604. package/dist/interfaces/service-api/rpc-mode.d.ts +0 -813
  605. package/dist/interfaces/service-api/rpc-mode.d.ts.map +0 -1
  606. package/dist/interfaces/service-api/rpc-mode.js +0 -1229
  607. package/dist/interfaces/service-api/rpc-mode.js.map +0 -1
  608. package/dist/interfaces/service-api/rpc-types.d.ts +0 -392
  609. package/dist/interfaces/service-api/rpc-types.d.ts.map +0 -1
  610. package/dist/interfaces/service-api/rpc-types.js +0 -22
  611. package/dist/interfaces/service-api/rpc-types.js.map +0 -1
  612. package/dist/interfaces/shared.d.ts +0 -386
  613. package/dist/interfaces/shared.d.ts.map +0 -1
  614. package/dist/interfaces/shared.js +0 -543
  615. package/dist/interfaces/shared.js.map +0 -1
  616. package/dist/interfaces/theme/dark.json +0 -91
  617. package/dist/interfaces/theme/light.json +0 -90
  618. package/dist/interfaces/theme/theme-schema.json +0 -339
  619. package/dist/interfaces/theme/theme.d.ts +0 -500
  620. package/dist/interfaces/theme/theme.d.ts.map +0 -1
  621. package/dist/interfaces/theme/theme.js +0 -1511
  622. package/dist/interfaces/theme/theme.js.map +0 -1
  623. package/dist/main.d.ts +0 -8
  624. package/dist/main.d.ts.map +0 -1
  625. package/dist/main.js +0 -750
  626. package/dist/main.js.map +0 -1
  627. package/dist/migrations.d.ts +0 -8
  628. package/dist/migrations.d.ts.map +0 -1
  629. package/dist/migrations.js +0 -206
  630. package/dist/migrations.js.map +0 -1
  631. package/dist/observe.d.ts +0 -2
  632. package/dist/observe.d.ts.map +0 -1
  633. package/dist/observe.js +0 -2
  634. package/dist/observe.js.map +0 -1
  635. package/dist/runtime/agent-session.d.ts +0 -988
  636. package/dist/runtime/agent-session.d.ts.map +0 -1
  637. package/dist/runtime/agent-session.js +0 -3114
  638. package/dist/runtime/agent-session.js.map +0 -1
  639. package/dist/runtime/auth-storage.d.ts +0 -53
  640. package/dist/runtime/auth-storage.d.ts.map +0 -1
  641. package/dist/runtime/auth-storage.js +0 -378
  642. package/dist/runtime/auth-storage.js.map +0 -1
  643. package/dist/runtime/bash-executor.d.ts +0 -16
  644. package/dist/runtime/bash-executor.d.ts.map +0 -1
  645. package/dist/runtime/bash-executor.js +0 -270
  646. package/dist/runtime/bash-executor.js.map +0 -1
  647. package/dist/runtime/context-compression/branch-summarization.d.ts +0 -86
  648. package/dist/runtime/context-compression/branch-summarization.d.ts.map +0 -1
  649. package/dist/runtime/context-compression/branch-summarization.js +0 -242
  650. package/dist/runtime/context-compression/branch-summarization.js.map +0 -1
  651. package/dist/runtime/context-compression/compaction.d.ts +0 -121
  652. package/dist/runtime/context-compression/compaction.d.ts.map +0 -1
  653. package/dist/runtime/context-compression/compaction.js +0 -607
  654. package/dist/runtime/context-compression/compaction.js.map +0 -1
  655. package/dist/runtime/context-compression/index.d.ts +0 -35
  656. package/dist/runtime/context-compression/index.d.ts.map +0 -1
  657. package/dist/runtime/context-compression/index.js +0 -33
  658. package/dist/runtime/context-compression/index.js.map +0 -1
  659. package/dist/runtime/context-compression/utils.d.ts +0 -17
  660. package/dist/runtime/context-compression/utils.d.ts.map +0 -1
  661. package/dist/runtime/context-compression/utils.js +0 -117
  662. package/dist/runtime/context-compression/utils.js.map +0 -1
  663. package/dist/runtime/diagnostics.d.ts +0 -206
  664. package/dist/runtime/diagnostics.d.ts.map +0 -1
  665. package/dist/runtime/diagnostics.js +0 -144
  666. package/dist/runtime/diagnostics.js.map +0 -1
  667. package/dist/runtime/discover-packages.d.ts +0 -2
  668. package/dist/runtime/discover-packages.d.ts.map +0 -1
  669. package/dist/runtime/discover-packages.js +0 -59
  670. package/dist/runtime/discover-packages.js.map +0 -1
  671. package/dist/runtime/event-bus.d.ts +0 -9
  672. package/dist/runtime/event-bus.d.ts.map +0 -1
  673. package/dist/runtime/event-bus.js +0 -29
  674. package/dist/runtime/event-bus.js.map +0 -1
  675. package/dist/runtime/exec.d.ts +0 -13
  676. package/dist/runtime/exec.d.ts.map +0 -1
  677. package/dist/runtime/exec.js +0 -62
  678. package/dist/runtime/exec.js.map +0 -1
  679. package/dist/runtime/footer-data-provider.d.ts +0 -19
  680. package/dist/runtime/footer-data-provider.d.ts.map +0 -1
  681. package/dist/runtime/footer-data-provider.js +0 -122
  682. package/dist/runtime/footer-data-provider.js.map +0 -1
  683. package/dist/runtime/html-export/ansi-to-html.d.ts +0 -26
  684. package/dist/runtime/html-export/ansi-to-html.d.ts.map +0 -1
  685. package/dist/runtime/html-export/ansi-to-html.js +0 -253
  686. package/dist/runtime/html-export/ansi-to-html.js.map +0 -1
  687. package/dist/runtime/html-export/ansi-to-html.ts +0 -262
  688. package/dist/runtime/html-export/index.d.ts +0 -162
  689. package/dist/runtime/html-export/index.d.ts.map +0 -1
  690. package/dist/runtime/html-export/index.js +0 -350
  691. package/dist/runtime/html-export/index.js.map +0 -1
  692. package/dist/runtime/html-export/index.ts +0 -432
  693. package/dist/runtime/html-export/template.css +0 -905
  694. package/dist/runtime/html-export/template.html +0 -76
  695. package/dist/runtime/html-export/template.js +0 -1549
  696. package/dist/runtime/html-export/tool-renderer.d.ts +0 -18
  697. package/dist/runtime/html-export/tool-renderer.d.ts.map +0 -1
  698. package/dist/runtime/html-export/tool-renderer.js +0 -45
  699. package/dist/runtime/html-export/tool-renderer.js.map +0 -1
  700. package/dist/runtime/html-export/tool-renderer.ts +0 -80
  701. package/dist/runtime/html-export/vendor/highlight.min.js +0 -1244
  702. package/dist/runtime/html-export/vendor/marked.min.js +0 -74
  703. package/dist/runtime/index.d.ts +0 -35
  704. package/dist/runtime/index.d.ts.map +0 -1
  705. package/dist/runtime/index.js +0 -35
  706. package/dist/runtime/index.js.map +0 -1
  707. package/dist/runtime/keybindings.d.ts +0 -20
  708. package/dist/runtime/keybindings.d.ts.map +0 -1
  709. package/dist/runtime/keybindings.js +0 -109
  710. package/dist/runtime/keybindings.js.map +0 -1
  711. package/dist/runtime/lifecycle/index.d.ts +0 -4
  712. package/dist/runtime/lifecycle/index.d.ts.map +0 -1
  713. package/dist/runtime/lifecycle/index.js +0 -3
  714. package/dist/runtime/lifecycle/index.js.map +0 -1
  715. package/dist/runtime/lifecycle/loader.d.ts +0 -6
  716. package/dist/runtime/lifecycle/loader.d.ts.map +0 -1
  717. package/dist/runtime/lifecycle/loader.js +0 -179
  718. package/dist/runtime/lifecycle/loader.js.map +0 -1
  719. package/dist/runtime/lifecycle/runner.d.ts +0 -14
  720. package/dist/runtime/lifecycle/runner.d.ts.map +0 -1
  721. package/dist/runtime/lifecycle/runner.js +0 -58
  722. package/dist/runtime/lifecycle/runner.js.map +0 -1
  723. package/dist/runtime/lifecycle/types.d.ts +0 -139
  724. package/dist/runtime/lifecycle/types.d.ts.map +0 -1
  725. package/dist/runtime/lifecycle/types.js +0 -2
  726. package/dist/runtime/lifecycle/types.js.map +0 -1
  727. package/dist/runtime/messages.d.ts +0 -2
  728. package/dist/runtime/messages.d.ts.map +0 -1
  729. package/dist/runtime/messages.js +0 -2
  730. package/dist/runtime/messages.js.map +0 -1
  731. package/dist/runtime/model-registry.d.ts +0 -62
  732. package/dist/runtime/model-registry.d.ts.map +0 -1
  733. package/dist/runtime/model-registry.js +0 -446
  734. package/dist/runtime/model-registry.js.map +0 -1
  735. package/dist/runtime/model-resolver.d.ts +0 -35
  736. package/dist/runtime/model-resolver.d.ts.map +0 -1
  737. package/dist/runtime/model-resolver.js +0 -232
  738. package/dist/runtime/model-resolver.js.map +0 -1
  739. package/dist/runtime/observe.d.ts +0 -50
  740. package/dist/runtime/observe.d.ts.map +0 -1
  741. package/dist/runtime/observe.js +0 -233
  742. package/dist/runtime/observe.js.map +0 -1
  743. package/dist/runtime/package-manager.d.ts +0 -103
  744. package/dist/runtime/package-manager.d.ts.map +0 -1
  745. package/dist/runtime/package-manager.js +0 -583
  746. package/dist/runtime/package-manager.js.map +0 -1
  747. package/dist/runtime/plugins/index.d.ts +0 -13
  748. package/dist/runtime/plugins/index.d.ts.map +0 -1
  749. package/dist/runtime/plugins/index.js +0 -23
  750. package/dist/runtime/plugins/index.js.map +0 -1
  751. package/dist/runtime/plugins/loader.d.ts +0 -19
  752. package/dist/runtime/plugins/loader.d.ts.map +0 -1
  753. package/dist/runtime/plugins/loader.js +0 -415
  754. package/dist/runtime/plugins/loader.js.map +0 -1
  755. package/dist/runtime/plugins/runner.d.ts +0 -107
  756. package/dist/runtime/plugins/runner.d.ts.map +0 -1
  757. package/dist/runtime/plugins/runner.js +0 -468
  758. package/dist/runtime/plugins/runner.js.map +0 -1
  759. package/dist/runtime/plugins/types.d.ts +0 -862
  760. package/dist/runtime/plugins/types.d.ts.map +0 -1
  761. package/dist/runtime/plugins/types.js +0 -32
  762. package/dist/runtime/plugins/types.js.map +0 -1
  763. package/dist/runtime/plugins/wrapper.d.ts +0 -29
  764. package/dist/runtime/plugins/wrapper.d.ts.map +0 -1
  765. package/dist/runtime/plugins/wrapper.js +0 -129
  766. package/dist/runtime/plugins/wrapper.js.map +0 -1
  767. package/dist/runtime/prompt-templates.d.ts +0 -18
  768. package/dist/runtime/prompt-templates.d.ts.map +0 -1
  769. package/dist/runtime/prompt-templates.js +0 -203
  770. package/dist/runtime/prompt-templates.js.map +0 -1
  771. package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts +0 -19
  772. package/dist/runtime/providers/adapters/claude-cli-adapter.d.ts.map +0 -1
  773. package/dist/runtime/providers/adapters/claude-cli-adapter.js +0 -242
  774. package/dist/runtime/providers/adapters/claude-cli-adapter.js.map +0 -1
  775. package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts +0 -18
  776. package/dist/runtime/providers/adapters/codex-cli-adapter.d.ts.map +0 -1
  777. package/dist/runtime/providers/adapters/codex-cli-adapter.js +0 -177
  778. package/dist/runtime/providers/adapters/codex-cli-adapter.js.map +0 -1
  779. package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts +0 -21
  780. package/dist/runtime/providers/adapters/indusagi-cli-adapter.d.ts.map +0 -1
  781. package/dist/runtime/providers/adapters/indusagi-cli-adapter.js +0 -162
  782. package/dist/runtime/providers/adapters/indusagi-cli-adapter.js.map +0 -1
  783. package/dist/runtime/providers/adapters/utils.d.ts +0 -12
  784. package/dist/runtime/providers/adapters/utils.d.ts.map +0 -1
  785. package/dist/runtime/providers/adapters/utils.js +0 -122
  786. package/dist/runtime/providers/adapters/utils.js.map +0 -1
  787. package/dist/runtime/providers/builtins.d.ts +0 -3
  788. package/dist/runtime/providers/builtins.d.ts.map +0 -1
  789. package/dist/runtime/providers/builtins.js +0 -88
  790. package/dist/runtime/providers/builtins.js.map +0 -1
  791. package/dist/runtime/providers/provider-adapter-registry.d.ts +0 -11
  792. package/dist/runtime/providers/provider-adapter-registry.d.ts.map +0 -1
  793. package/dist/runtime/providers/provider-adapter-registry.js +0 -36
  794. package/dist/runtime/providers/provider-adapter-registry.js.map +0 -1
  795. package/dist/runtime/providers/provider-adapter.d.ts +0 -33
  796. package/dist/runtime/providers/provider-adapter.d.ts.map +0 -1
  797. package/dist/runtime/providers/provider-adapter.js +0 -2
  798. package/dist/runtime/providers/provider-adapter.js.map +0 -1
  799. package/dist/runtime/providers/provider-service.d.ts +0 -33
  800. package/dist/runtime/providers/provider-service.d.ts.map +0 -1
  801. package/dist/runtime/providers/provider-service.js +0 -157
  802. package/dist/runtime/providers/provider-service.js.map +0 -1
  803. package/dist/runtime/providers/types.d.ts +0 -29
  804. package/dist/runtime/providers/types.d.ts.map +0 -1
  805. package/dist/runtime/providers/types.js +0 -9
  806. package/dist/runtime/providers/types.js.map +0 -1
  807. package/dist/runtime/resource-loader.d.ts +0 -180
  808. package/dist/runtime/resource-loader.d.ts.map +0 -1
  809. package/dist/runtime/resource-loader.js +0 -530
  810. package/dist/runtime/resource-loader.js.map +0 -1
  811. package/dist/runtime/sdk.d.ts +0 -65
  812. package/dist/runtime/sdk.d.ts.map +0 -1
  813. package/dist/runtime/sdk.js +0 -402
  814. package/dist/runtime/sdk.js.map +0 -1
  815. package/dist/runtime/session-manager.d.ts +0 -448
  816. package/dist/runtime/session-manager.d.ts.map +0 -1
  817. package/dist/runtime/session-manager.js +0 -1177
  818. package/dist/runtime/session-manager.js.map +0 -1
  819. package/dist/runtime/settings-manager.d.ts +0 -234
  820. package/dist/runtime/settings-manager.d.ts.map +0 -1
  821. package/dist/runtime/settings-manager.js +0 -298
  822. package/dist/runtime/settings-manager.js.map +0 -1
  823. package/dist/runtime/skills.d.ts +0 -33
  824. package/dist/runtime/skills.d.ts.map +0 -1
  825. package/dist/runtime/skills.js +0 -277
  826. package/dist/runtime/skills.js.map +0 -1
  827. package/dist/runtime/subagents.d.ts +0 -29
  828. package/dist/runtime/subagents.d.ts.map +0 -1
  829. package/dist/runtime/subagents.js +0 -163
  830. package/dist/runtime/subagents.js.map +0 -1
  831. package/dist/runtime/system-prompt.d.ts +0 -16
  832. package/dist/runtime/system-prompt.d.ts.map +0 -1
  833. package/dist/runtime/system-prompt.js +0 -275
  834. package/dist/runtime/system-prompt.js.map +0 -1
  835. package/dist/runtime/task-session-manager.d.ts +0 -55
  836. package/dist/runtime/task-session-manager.d.ts.map +0 -1
  837. package/dist/runtime/task-session-manager.js +0 -410
  838. package/dist/runtime/task-session-manager.js.map +0 -1
  839. package/dist/runtime/timings.d.ts +0 -4
  840. package/dist/runtime/timings.d.ts.map +0 -1
  841. package/dist/runtime/timings.js +0 -41
  842. package/dist/runtime/timings.js.map +0 -1
  843. package/dist/runtime/todo-store.d.ts +0 -20
  844. package/dist/runtime/todo-store.d.ts.map +0 -1
  845. package/dist/runtime/todo-store.js +0 -60
  846. package/dist/runtime/todo-store.js.map +0 -1
  847. package/dist/runtime/tooling/bash.d.ts +0 -2
  848. package/dist/runtime/tooling/bash.d.ts.map +0 -1
  849. package/dist/runtime/tooling/bash.js +0 -2
  850. package/dist/runtime/tooling/bash.js.map +0 -1
  851. package/dist/runtime/tooling/bg-process.d.ts +0 -44
  852. package/dist/runtime/tooling/bg-process.d.ts.map +0 -1
  853. package/dist/runtime/tooling/bg-process.js +0 -55
  854. package/dist/runtime/tooling/bg-process.js.map +0 -1
  855. package/dist/runtime/tooling/composio-compat.d.ts +0 -169
  856. package/dist/runtime/tooling/composio-compat.d.ts.map +0 -1
  857. package/dist/runtime/tooling/composio-compat.js +0 -163
  858. package/dist/runtime/tooling/composio-compat.js.map +0 -1
  859. package/dist/runtime/tooling/edit-diff.d.ts +0 -9
  860. package/dist/runtime/tooling/edit-diff.d.ts.map +0 -1
  861. package/dist/runtime/tooling/edit-diff.js +0 -2
  862. package/dist/runtime/tooling/edit-diff.js.map +0 -1
  863. package/dist/runtime/tooling/edit.d.ts +0 -2
  864. package/dist/runtime/tooling/edit.d.ts.map +0 -1
  865. package/dist/runtime/tooling/edit.js +0 -2
  866. package/dist/runtime/tooling/edit.js.map +0 -1
  867. package/dist/runtime/tooling/find.d.ts +0 -2
  868. package/dist/runtime/tooling/find.d.ts.map +0 -1
  869. package/dist/runtime/tooling/find.js +0 -2
  870. package/dist/runtime/tooling/find.js.map +0 -1
  871. package/dist/runtime/tooling/grep.d.ts +0 -2
  872. package/dist/runtime/tooling/grep.d.ts.map +0 -1
  873. package/dist/runtime/tooling/grep.js +0 -2
  874. package/dist/runtime/tooling/grep.js.map +0 -1
  875. package/dist/runtime/tooling/index.d.ts +0 -248
  876. package/dist/runtime/tooling/index.d.ts.map +0 -1
  877. package/dist/runtime/tooling/index.js +0 -325
  878. package/dist/runtime/tooling/index.js.map +0 -1
  879. package/dist/runtime/tooling/ls.d.ts +0 -2
  880. package/dist/runtime/tooling/ls.d.ts.map +0 -1
  881. package/dist/runtime/tooling/ls.js +0 -2
  882. package/dist/runtime/tooling/ls.js.map +0 -1
  883. package/dist/runtime/tooling/memory.d.ts +0 -132
  884. package/dist/runtime/tooling/memory.d.ts.map +0 -1
  885. package/dist/runtime/tooling/memory.js +0 -171
  886. package/dist/runtime/tooling/memory.js.map +0 -1
  887. package/dist/runtime/tooling/path-utils.d.ts +0 -2
  888. package/dist/runtime/tooling/path-utils.d.ts.map +0 -1
  889. package/dist/runtime/tooling/path-utils.js +0 -2
  890. package/dist/runtime/tooling/path-utils.js.map +0 -1
  891. package/dist/runtime/tooling/read.d.ts +0 -2
  892. package/dist/runtime/tooling/read.d.ts.map +0 -1
  893. package/dist/runtime/tooling/read.js +0 -2
  894. package/dist/runtime/tooling/read.js.map +0 -1
  895. package/dist/runtime/tooling/registry.d.ts +0 -18
  896. package/dist/runtime/tooling/registry.d.ts.map +0 -1
  897. package/dist/runtime/tooling/registry.js +0 -166
  898. package/dist/runtime/tooling/registry.js.map +0 -1
  899. package/dist/runtime/tooling/task.d.ts +0 -37
  900. package/dist/runtime/tooling/task.d.ts.map +0 -1
  901. package/dist/runtime/tooling/task.js +0 -65
  902. package/dist/runtime/tooling/task.js.map +0 -1
  903. package/dist/runtime/tooling/todo.d.ts +0 -34
  904. package/dist/runtime/tooling/todo.d.ts.map +0 -1
  905. package/dist/runtime/tooling/todo.js +0 -96
  906. package/dist/runtime/tooling/todo.js.map +0 -1
  907. package/dist/runtime/tooling/truncate.d.ts +0 -2
  908. package/dist/runtime/tooling/truncate.d.ts.map +0 -1
  909. package/dist/runtime/tooling/truncate.js +0 -2
  910. package/dist/runtime/tooling/truncate.js.map +0 -1
  911. package/dist/runtime/tooling/webfetch.d.ts +0 -2
  912. package/dist/runtime/tooling/webfetch.d.ts.map +0 -1
  913. package/dist/runtime/tooling/webfetch.js +0 -2
  914. package/dist/runtime/tooling/webfetch.js.map +0 -1
  915. package/dist/runtime/tooling/websearch.d.ts +0 -2
  916. package/dist/runtime/tooling/websearch.d.ts.map +0 -1
  917. package/dist/runtime/tooling/websearch.js +0 -2
  918. package/dist/runtime/tooling/websearch.js.map +0 -1
  919. package/dist/runtime/tooling/write.d.ts +0 -2
  920. package/dist/runtime/tooling/write.d.ts.map +0 -1
  921. package/dist/runtime/tooling/write.js +0 -2
  922. package/dist/runtime/tooling/write.js.map +0 -1
  923. package/dist/telemetry/core/config.d.ts +0 -28
  924. package/dist/telemetry/core/config.d.ts.map +0 -1
  925. package/dist/telemetry/core/config.js +0 -150
  926. package/dist/telemetry/core/config.js.map +0 -1
  927. package/dist/telemetry/core/event-bus.d.ts +0 -15
  928. package/dist/telemetry/core/event-bus.d.ts.map +0 -1
  929. package/dist/telemetry/core/event-bus.js +0 -37
  930. package/dist/telemetry/core/event-bus.js.map +0 -1
  931. package/dist/telemetry/core/index.d.ts +0 -12
  932. package/dist/telemetry/core/index.d.ts.map +0 -1
  933. package/dist/telemetry/core/index.js +0 -14
  934. package/dist/telemetry/core/index.js.map +0 -1
  935. package/dist/telemetry/core/observability.d.ts +0 -63
  936. package/dist/telemetry/core/observability.d.ts.map +0 -1
  937. package/dist/telemetry/core/observability.js +0 -127
  938. package/dist/telemetry/core/observability.js.map +0 -1
  939. package/dist/telemetry/core/span.d.ts +0 -37
  940. package/dist/telemetry/core/span.d.ts.map +0 -1
  941. package/dist/telemetry/core/span.js +0 -90
  942. package/dist/telemetry/core/span.js.map +0 -1
  943. package/dist/telemetry/core/tracer.d.ts +0 -22
  944. package/dist/telemetry/core/tracer.d.ts.map +0 -1
  945. package/dist/telemetry/core/tracer.js +0 -79
  946. package/dist/telemetry/core/tracer.js.map +0 -1
  947. package/dist/telemetry/core/types.d.ts +0 -155
  948. package/dist/telemetry/core/types.d.ts.map +0 -1
  949. package/dist/telemetry/core/types.js +0 -38
  950. package/dist/telemetry/core/types.js.map +0 -1
  951. package/dist/telemetry/exporters/base-exporter.d.ts +0 -16
  952. package/dist/telemetry/exporters/base-exporter.d.ts.map +0 -1
  953. package/dist/telemetry/exporters/base-exporter.js +0 -26
  954. package/dist/telemetry/exporters/base-exporter.js.map +0 -1
  955. package/dist/telemetry/exporters/console-exporter.d.ts +0 -22
  956. package/dist/telemetry/exporters/console-exporter.d.ts.map +0 -1
  957. package/dist/telemetry/exporters/console-exporter.js +0 -80
  958. package/dist/telemetry/exporters/console-exporter.js.map +0 -1
  959. package/dist/telemetry/exporters/file-exporter.d.ts +0 -31
  960. package/dist/telemetry/exporters/file-exporter.d.ts.map +0 -1
  961. package/dist/telemetry/exporters/file-exporter.js +0 -120
  962. package/dist/telemetry/exporters/file-exporter.js.map +0 -1
  963. package/dist/telemetry/exporters/index.d.ts +0 -12
  964. package/dist/telemetry/exporters/index.d.ts.map +0 -1
  965. package/dist/telemetry/exporters/index.js +0 -11
  966. package/dist/telemetry/exporters/index.js.map +0 -1
  967. package/dist/telemetry/exporters/langfuse-exporter.d.ts +0 -27
  968. package/dist/telemetry/exporters/langfuse-exporter.d.ts.map +0 -1
  969. package/dist/telemetry/exporters/langfuse-exporter.js +0 -146
  970. package/dist/telemetry/exporters/langfuse-exporter.js.map +0 -1
  971. package/dist/telemetry/exporters/sentry-exporter.d.ts +0 -22
  972. package/dist/telemetry/exporters/sentry-exporter.d.ts.map +0 -1
  973. package/dist/telemetry/exporters/sentry-exporter.js +0 -121
  974. package/dist/telemetry/exporters/sentry-exporter.js.map +0 -1
  975. package/dist/telemetry/index.d.ts +0 -3
  976. package/dist/telemetry/index.d.ts.map +0 -1
  977. package/dist/telemetry/index.js +0 -3
  978. package/dist/telemetry/index.js.map +0 -1
  979. package/dist/vendor/observe/adapters/agent-event-adapter.d.ts +0 -28
  980. package/dist/vendor/observe/adapters/agent-event-adapter.d.ts.map +0 -1
  981. package/dist/vendor/observe/adapters/agent-event-adapter.js +0 -136
  982. package/dist/vendor/observe/adapters/agent-event-adapter.js.map +0 -1
  983. package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts +0 -24
  984. package/dist/vendor/observe/adapters/ai-stream-adapter.d.ts.map +0 -1
  985. package/dist/vendor/observe/adapters/ai-stream-adapter.js +0 -118
  986. package/dist/vendor/observe/adapters/ai-stream-adapter.js.map +0 -1
  987. package/dist/vendor/observe/artifacts/content-store.d.ts +0 -12
  988. package/dist/vendor/observe/artifacts/content-store.d.ts.map +0 -1
  989. package/dist/vendor/observe/artifacts/content-store.js +0 -2
  990. package/dist/vendor/observe/artifacts/content-store.js.map +0 -1
  991. package/dist/vendor/observe/artifacts/file-content-store.d.ts +0 -16
  992. package/dist/vendor/observe/artifacts/file-content-store.d.ts.map +0 -1
  993. package/dist/vendor/observe/artifacts/file-content-store.js +0 -43
  994. package/dist/vendor/observe/artifacts/file-content-store.js.map +0 -1
  995. package/dist/vendor/observe/batcher.d.ts +0 -27
  996. package/dist/vendor/observe/batcher.d.ts.map +0 -1
  997. package/dist/vendor/observe/batcher.js +0 -66
  998. package/dist/vendor/observe/batcher.js.map +0 -1
  999. package/dist/vendor/observe/client/artifacts-manager.d.ts +0 -29
  1000. package/dist/vendor/observe/client/artifacts-manager.d.ts.map +0 -1
  1001. package/dist/vendor/observe/client/artifacts-manager.js +0 -120
  1002. package/dist/vendor/observe/client/artifacts-manager.js.map +0 -1
  1003. package/dist/vendor/observe/client/datasets-manager.d.ts +0 -16
  1004. package/dist/vendor/observe/client/datasets-manager.d.ts.map +0 -1
  1005. package/dist/vendor/observe/client/datasets-manager.js +0 -27
  1006. package/dist/vendor/observe/client/datasets-manager.js.map +0 -1
  1007. package/dist/vendor/observe/client/experiments-manager.d.ts +0 -61
  1008. package/dist/vendor/observe/client/experiments-manager.d.ts.map +0 -1
  1009. package/dist/vendor/observe/client/experiments-manager.js +0 -132
  1010. package/dist/vendor/observe/client/experiments-manager.js.map +0 -1
  1011. package/dist/vendor/observe/client/index.d.ts +0 -9
  1012. package/dist/vendor/observe/client/index.d.ts.map +0 -1
  1013. package/dist/vendor/observe/client/index.js +0 -9
  1014. package/dist/vendor/observe/client/index.js.map +0 -1
  1015. package/dist/vendor/observe/client/observe-client.d.ts +0 -30
  1016. package/dist/vendor/observe/client/observe-client.d.ts.map +0 -1
  1017. package/dist/vendor/observe/client/observe-client.js +0 -22
  1018. package/dist/vendor/observe/client/observe-client.js.map +0 -1
  1019. package/dist/vendor/observe/client/prompts-manager.d.ts +0 -17
  1020. package/dist/vendor/observe/client/prompts-manager.d.ts.map +0 -1
  1021. package/dist/vendor/observe/client/prompts-manager.js +0 -38
  1022. package/dist/vendor/observe/client/prompts-manager.js.map +0 -1
  1023. package/dist/vendor/observe/client/scores-manager.d.ts +0 -10
  1024. package/dist/vendor/observe/client/scores-manager.d.ts.map +0 -1
  1025. package/dist/vendor/observe/client/scores-manager.js +0 -15
  1026. package/dist/vendor/observe/client/scores-manager.js.map +0 -1
  1027. package/dist/vendor/observe/client/sessions-manager.d.ts +0 -15
  1028. package/dist/vendor/observe/client/sessions-manager.d.ts.map +0 -1
  1029. package/dist/vendor/observe/client/sessions-manager.js +0 -24
  1030. package/dist/vendor/observe/client/sessions-manager.js.map +0 -1
  1031. package/dist/vendor/observe/client/traces-manager.d.ts +0 -23
  1032. package/dist/vendor/observe/client/traces-manager.d.ts.map +0 -1
  1033. package/dist/vendor/observe/client/traces-manager.js +0 -39
  1034. package/dist/vendor/observe/client/traces-manager.js.map +0 -1
  1035. package/dist/vendor/observe/console-exporter.d.ts +0 -11
  1036. package/dist/vendor/observe/console-exporter.d.ts.map +0 -1
  1037. package/dist/vendor/observe/console-exporter.js +0 -18
  1038. package/dist/vendor/observe/console-exporter.js.map +0 -1
  1039. package/dist/vendor/observe/context.d.ts +0 -4
  1040. package/dist/vendor/observe/context.d.ts.map +0 -1
  1041. package/dist/vendor/observe/context.js +0 -9
  1042. package/dist/vendor/observe/context.js.map +0 -1
  1043. package/dist/vendor/observe/entities/artifacts.d.ts +0 -46
  1044. package/dist/vendor/observe/entities/artifacts.d.ts.map +0 -1
  1045. package/dist/vendor/observe/entities/artifacts.js +0 -2
  1046. package/dist/vendor/observe/entities/artifacts.js.map +0 -1
  1047. package/dist/vendor/observe/entities/datasets.d.ts +0 -37
  1048. package/dist/vendor/observe/entities/datasets.d.ts.map +0 -1
  1049. package/dist/vendor/observe/entities/datasets.js +0 -2
  1050. package/dist/vendor/observe/entities/datasets.js.map +0 -1
  1051. package/dist/vendor/observe/entities/experiments.d.ts +0 -66
  1052. package/dist/vendor/observe/entities/experiments.d.ts.map +0 -1
  1053. package/dist/vendor/observe/entities/experiments.js +0 -2
  1054. package/dist/vendor/observe/entities/experiments.js.map +0 -1
  1055. package/dist/vendor/observe/entities/index.d.ts +0 -9
  1056. package/dist/vendor/observe/entities/index.d.ts.map +0 -1
  1057. package/dist/vendor/observe/entities/index.js +0 -9
  1058. package/dist/vendor/observe/entities/index.js.map +0 -1
  1059. package/dist/vendor/observe/entities/prompts.d.ts +0 -25
  1060. package/dist/vendor/observe/entities/prompts.d.ts.map +0 -1
  1061. package/dist/vendor/observe/entities/prompts.js +0 -2
  1062. package/dist/vendor/observe/entities/prompts.js.map +0 -1
  1063. package/dist/vendor/observe/entities/scores.d.ts +0 -28
  1064. package/dist/vendor/observe/entities/scores.d.ts.map +0 -1
  1065. package/dist/vendor/observe/entities/scores.js +0 -2
  1066. package/dist/vendor/observe/entities/scores.js.map +0 -1
  1067. package/dist/vendor/observe/entities/sessions.d.ts +0 -36
  1068. package/dist/vendor/observe/entities/sessions.d.ts.map +0 -1
  1069. package/dist/vendor/observe/entities/sessions.js +0 -2
  1070. package/dist/vendor/observe/entities/sessions.js.map +0 -1
  1071. package/dist/vendor/observe/entities/shared.d.ts +0 -26
  1072. package/dist/vendor/observe/entities/shared.d.ts.map +0 -1
  1073. package/dist/vendor/observe/entities/shared.js +0 -2
  1074. package/dist/vendor/observe/entities/shared.js.map +0 -1
  1075. package/dist/vendor/observe/entities/traces.d.ts +0 -59
  1076. package/dist/vendor/observe/entities/traces.d.ts.map +0 -1
  1077. package/dist/vendor/observe/entities/traces.js +0 -2
  1078. package/dist/vendor/observe/entities/traces.js.map +0 -1
  1079. package/dist/vendor/observe/exporter.d.ts +0 -2
  1080. package/dist/vendor/observe/exporter.d.ts.map +0 -1
  1081. package/dist/vendor/observe/exporter.js +0 -2
  1082. package/dist/vendor/observe/exporter.js.map +0 -1
  1083. package/dist/vendor/observe/file-exporter.d.ts +0 -16
  1084. package/dist/vendor/observe/file-exporter.d.ts.map +0 -1
  1085. package/dist/vendor/observe/file-exporter.js +0 -39
  1086. package/dist/vendor/observe/file-exporter.js.map +0 -1
  1087. package/dist/vendor/observe/global.d.ts +0 -6
  1088. package/dist/vendor/observe/global.d.ts.map +0 -1
  1089. package/dist/vendor/observe/global.js +0 -17
  1090. package/dist/vendor/observe/global.js.map +0 -1
  1091. package/dist/vendor/observe/index.d.ts +0 -24
  1092. package/dist/vendor/observe/index.d.ts.map +0 -1
  1093. package/dist/vendor/observe/index.js +0 -24
  1094. package/dist/vendor/observe/index.js.map +0 -1
  1095. package/dist/vendor/observe/noop.d.ts +0 -17
  1096. package/dist/vendor/observe/noop.d.ts.map +0 -1
  1097. package/dist/vendor/observe/noop.js +0 -80
  1098. package/dist/vendor/observe/noop.js.map +0 -1
  1099. package/dist/vendor/observe/privacy.d.ts +0 -18
  1100. package/dist/vendor/observe/privacy.d.ts.map +0 -1
  1101. package/dist/vendor/observe/privacy.js +0 -160
  1102. package/dist/vendor/observe/privacy.js.map +0 -1
  1103. package/dist/vendor/observe/query/simple-query-client.d.ts +0 -11
  1104. package/dist/vendor/observe/query/simple-query-client.d.ts.map +0 -1
  1105. package/dist/vendor/observe/query/simple-query-client.js +0 -31
  1106. package/dist/vendor/observe/query/simple-query-client.js.map +0 -1
  1107. package/dist/vendor/observe/replay/session-replay.d.ts +0 -20
  1108. package/dist/vendor/observe/replay/session-replay.d.ts.map +0 -1
  1109. package/dist/vendor/observe/replay/session-replay.js +0 -180
  1110. package/dist/vendor/observe/replay/session-replay.js.map +0 -1
  1111. package/dist/vendor/observe/runtime.d.ts +0 -27
  1112. package/dist/vendor/observe/runtime.d.ts.map +0 -1
  1113. package/dist/vendor/observe/runtime.js +0 -177
  1114. package/dist/vendor/observe/runtime.js.map +0 -1
  1115. package/dist/vendor/observe/server/dashboard-html.d.ts +0 -6
  1116. package/dist/vendor/observe/server/dashboard-html.d.ts.map +0 -1
  1117. package/dist/vendor/observe/server/dashboard-html.js +0 -305
  1118. package/dist/vendor/observe/server/dashboard-html.js.map +0 -1
  1119. package/dist/vendor/observe/server/http-observe-server.d.ts +0 -62
  1120. package/dist/vendor/observe/server/http-observe-server.d.ts.map +0 -1
  1121. package/dist/vendor/observe/server/http-observe-server.js +0 -418
  1122. package/dist/vendor/observe/server/http-observe-server.js.map +0 -1
  1123. package/dist/vendor/observe/server/in-memory-observe-server.d.ts +0 -20
  1124. package/dist/vendor/observe/server/in-memory-observe-server.d.ts.map +0 -1
  1125. package/dist/vendor/observe/server/in-memory-observe-server.js +0 -76
  1126. package/dist/vendor/observe/server/in-memory-observe-server.js.map +0 -1
  1127. package/dist/vendor/observe/span.d.ts +0 -45
  1128. package/dist/vendor/observe/span.d.ts.map +0 -1
  1129. package/dist/vendor/observe/span.js +0 -110
  1130. package/dist/vendor/observe/span.js.map +0 -1
  1131. package/dist/vendor/observe/store/contracts.d.ts +0 -59
  1132. package/dist/vendor/observe/store/contracts.d.ts.map +0 -1
  1133. package/dist/vendor/observe/store/contracts.js +0 -2
  1134. package/dist/vendor/observe/store/contracts.js.map +0 -1
  1135. package/dist/vendor/observe/store/file-control-plane-store.d.ts +0 -33
  1136. package/dist/vendor/observe/store/file-control-plane-store.d.ts.map +0 -1
  1137. package/dist/vendor/observe/store/file-control-plane-store.js +0 -146
  1138. package/dist/vendor/observe/store/file-control-plane-store.js.map +0 -1
  1139. package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts +0 -84
  1140. package/dist/vendor/observe/store/in-memory-control-plane-store.d.ts.map +0 -1
  1141. package/dist/vendor/observe/store/in-memory-control-plane-store.js +0 -447
  1142. package/dist/vendor/observe/store/in-memory-control-plane-store.js.map +0 -1
  1143. package/dist/vendor/observe/store/index.d.ts +0 -4
  1144. package/dist/vendor/observe/store/index.d.ts.map +0 -1
  1145. package/dist/vendor/observe/store/index.js +0 -4
  1146. package/dist/vendor/observe/store/index.js.map +0 -1
  1147. package/dist/vendor/observe/types.d.ts +0 -246
  1148. package/dist/vendor/observe/types.d.ts.map +0 -1
  1149. package/dist/vendor/observe/types.js +0 -152
  1150. package/dist/vendor/observe/types.js.map +0 -1
  1151. package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts +0 -25
  1152. package/dist/vendor/observe/worker/in-memory-observe-worker.d.ts.map +0 -1
  1153. package/dist/vendor/observe/worker/in-memory-observe-worker.js +0 -82
  1154. package/dist/vendor/observe/worker/in-memory-observe-worker.js.map +0 -1
  1155. package/guides/CLAUDE_CODEX_CLI_INTEGRATION_PLAN.md +0 -321
  1156. package/guides/INDUSAGI_MONO_MIT_REMOVAL_GUIDE.md +0 -2132
  1157. package/guides/INDUSVX_OBSERVE_FULL_INTEGRATION_REPORT.md +0 -543
  1158. package/guides/OBSERVE_DEEP_VALIDATION.md +0 -252
  1159. package/guides/OBSERVE_LOCAL_TESTING.md +0 -183
  1160. package/guides/OPTION3_PROVIDER_ADAPTER_RUNTIME_PLAN.md +0 -370
  1161. package/guides/SAME_TO_SAME_PARITY_REPORT.md +0 -312
  1162. package/tasks/patch-indusagi-react-host.mjs +0 -247
@@ -1,1177 +0,0 @@
1
- /**
2
- * Session Manager - Persistent session storage and retrieval
3
- *
4
- * Purpose:
5
- * Manages agent session persistence using JSONL (JSON Lines) format for append-only,
6
- * transaction-safe storage. Handles session loading, saving, branching, and compaction.
7
- *
8
- * Based on conversation persistence patterns from Anthropic's Claude API
9
- * and JSONL formats from common chat applications (ChatGPT, Claude.ai).
10
- * Refactored for agent session branching and compaction.
11
- *
12
- * Architecture:
13
- * - Session File Format: JSONL (one JSON object per line)
14
- * - Storage Location: ~/.indusagi/sessions/ (or INDUSAGI_DIR/sessions/)
15
- * - Entry Types: Messages, model changes, thinking level changes, compaction markers
16
- * - Concurrency: Append-only prevents write conflicts
17
- * - Recovery: Can rebuild state from session entry log
18
- *
19
- * Key Features:
20
- * - Append-only session files for safe concurrent access
21
- * - Session branching (fork a session at any point)
22
- * - Entry types for different session events
23
- * - Compaction metadata tracking
24
- * - Custom entry support for extensions
25
- * - Session validation and recovery
26
- * - Efficient file operations (streaming read for large sessions)
27
- *
28
- * Session File Format:
29
- * ```
30
- * {"type":"session","version":3,"id":"abc123","timestamp":"2025-02-21T...","cwd":"/path","parentSession":"parent-id"}
31
- * {"type":"message","id":"msg1","parentId":null,"timestamp":"2025-02-21T...","message":{...}}
32
- * {"type":"message","id":"msg2","parentId":"msg1","timestamp":"2025-02-21T...","message":{...}}
33
- * {"type":"model_change","id":"mc1","parentId":"msg2","timestamp":"2025-02-21T...","provider":"openai","modelId":"gpt-4"}
34
- * {"type":"thinking_level_change","id":"tlc1","parentId":"mc1","timestamp":"2025-02-21T...","thinkingLevel":"high"}
35
- * {"type":"compaction","id":"comp1","parentId":"tlc1","timestamp":"2025-02-21T...","summary":"...","firstKeptEntryId":"msg2","tokensBefore":5000}
36
- * ```
37
- *
38
- * Entry Types:
39
- * - "message" - Agent or user message
40
- * - "model_change" - Model was switched
41
- * - "thinking_level_change" - Thinking level was adjusted
42
- * - "compaction" - Session was compacted with summary
43
- * - "branch_summary" - Branch point summary
44
- * - "custom" - Extension-specific data
45
- *
46
- * Session State Reconstruction:
47
- * 1. Load session header (first line)
48
- * 2. Read all entries sequentially
49
- * 3. Build message list from "message" entries
50
- * 4. Track latest "model_change" for current model
51
- * 5. Track latest "thinking_level_change" for current level
52
- * 6. Use "compaction" markers to know what was summarized
53
- * 7. Ignore "branch_summary" and "custom" entries from context
54
- *
55
- * Session Branching:
56
- * ```typescript
57
- * // Load existing session
58
- * const session = await loadSession("original-id");
59
- *
60
- * // Create branch at current point
61
- * const branchId = randomUUID();
62
- * const newSession = createNewSession(branchId, { parentSession: "original-id" });
63
- *
64
- * // Messages after branch are separate from original
65
- * ```
66
- *
67
- * Compaction Process:
68
- * - Summarize old messages into summary text
69
- * - Write CompactionEntry with summary and metadata
70
- * - Keep all entries for recovery
71
- * - LLM context uses summary instead of original messages
72
- *
73
- * Large File Handling:
74
- * - Sessions can be > 1GB
75
- * - Use streaming/chunked reads for file access
76
- * - Append operations are efficient (seek to EOF + write)
77
- * - Supports pagination for large message lists
78
- *
79
- * Error Handling:
80
- * - Malformed entries: Logged and skipped
81
- * - Incomplete files: Recovery via last valid entry
82
- * - Missing sessions: Returns undefined
83
- * - File permission errors: Throws with context
84
- *
85
- * Usage Examples:
86
- * ```typescript
87
- * // Create new session
88
- * const sessionId = randomUUID();
89
- * const header = createSessionHeader(sessionId, process.cwd());
90
- * await saveSessionEntry(sessionId, header);
91
- *
92
- * // Add messages
93
- * const message: AgentMessage = { role: "user", content: "..." };
94
- * await saveSessionEntry(sessionId, {
95
- * type: "message",
96
- * id: randomUUID(),
97
- * parentId: null,
98
- * timestamp: new Date().toISOString(),
99
- * message
100
- * });
101
- *
102
- * // Load session
103
- * const loaded = await loadSession(sessionId);
104
- * console.log(loaded.messages.length);
105
- *
106
- * // List all sessions
107
- * const all = await listSessions();
108
- * ```
109
- *
110
- * File Locations:
111
- * - Session directory: ~/.indusagi/sessions/
112
- * - Session file: ~/.indusagi/sessions/{sessionId}.jsonl
113
- * - Can override with INDUSAGI_DIR environment variable
114
- *
115
- * Thread Safety:
116
- * - JSONL format allows append-only writes
117
- * - No explicit locking needed
118
- * - Multiple processes can append safely
119
- * - Reads may see partial entries (handle gracefully)
120
- *
121
- * Based on session manager from indusagi-agent
122
- * Original: https://github.com/varunisrani/indusagi-ts/vendor/indusagi-agent/src/session-manager.ts
123
- */
124
- import { randomUUID } from "crypto";
125
- import { appendFileSync, closeSync, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, statSync, writeFileSync, } from "fs";
126
- import { readdir, readFile, stat } from "fs/promises";
127
- import { join, resolve } from "path";
128
- import { getAgentDir as getDefaultAgentDir, getSessionsDir } from "../config.js";
129
- import { createBranchSummaryMessage, createCompactionSummaryMessage, createCustomMessage, } from "./messages.js";
130
- export const CURRENT_SESSION_VERSION = 3;
131
- /** Generate a unique short ID (8 hex chars, collision-checked) */
132
- function generateId(byId) {
133
- for (let i = 0; i < 100; i++) {
134
- const id = randomUUID().slice(0, 8);
135
- if (!byId.has(id))
136
- return id;
137
- }
138
- // Fallback to full UUID if somehow we have collisions
139
- return randomUUID();
140
- }
141
- function readSessionEntries(lines) {
142
- const entries = [];
143
- for (const line of lines) {
144
- if (!line.trim())
145
- continue;
146
- try {
147
- entries.push(JSON.parse(line));
148
- }
149
- catch {
150
- // Skip malformed lines.
151
- }
152
- }
153
- return entries;
154
- }
155
- function readSessionHeader(entries) {
156
- const header = entries[0];
157
- if (!header || header.type !== "session" || typeof header.id !== "string") {
158
- return undefined;
159
- }
160
- return header;
161
- }
162
- function buildEntryIndex(entries) {
163
- const byId = new Map();
164
- const labelsById = new Map();
165
- let leafId = null;
166
- for (const entry of entries) {
167
- if (entry.type === "session")
168
- continue;
169
- byId.set(entry.id, entry);
170
- leafId = entry.id;
171
- if (entry.type === "label") {
172
- if (entry.label)
173
- labelsById.set(entry.targetId, entry.label);
174
- else
175
- labelsById.delete(entry.targetId);
176
- }
177
- }
178
- return { byId, labelsById, leafId };
179
- }
180
- function resolveBranchPath(byId, fromId) {
181
- const path = [];
182
- let current = fromId ? byId.get(fromId) : undefined;
183
- while (current) {
184
- path.unshift(current);
185
- current = current.parentId ? byId.get(current.parentId) : undefined;
186
- }
187
- return path;
188
- }
189
- function buildSessionTree(entries, labelsById) {
190
- const nodeMap = new Map();
191
- const roots = [];
192
- for (const entry of entries) {
193
- nodeMap.set(entry.id, { entry, children: [], label: labelsById.get(entry.id) });
194
- }
195
- for (const entry of entries) {
196
- const node = nodeMap.get(entry.id);
197
- if (entry.parentId === null || entry.parentId === entry.id) {
198
- roots.push(node);
199
- continue;
200
- }
201
- const parent = nodeMap.get(entry.parentId);
202
- if (parent)
203
- parent.children.push(node);
204
- else
205
- roots.push(node);
206
- }
207
- const stack = [...roots];
208
- while (stack.length > 0) {
209
- const node = stack.pop();
210
- node.children.sort((a, b) => new Date(a.entry.timestamp).getTime() - new Date(b.entry.timestamp).getTime());
211
- stack.push(...node.children);
212
- }
213
- return roots;
214
- }
215
- function appendSessionEntry(sessionFile, entry) {
216
- appendFileSync(sessionFile, `${JSON.stringify(entry)}\n`);
217
- }
218
- /** Migrate v1 → v2: add id/parentId tree structure. Mutates in place. */
219
- function migrateV1ToV2(entries) {
220
- const ids = new Set();
221
- let prevId = null;
222
- for (const entry of entries) {
223
- if (entry.type === "session") {
224
- entry.version = 2;
225
- continue;
226
- }
227
- entry.id = generateId(ids);
228
- entry.parentId = prevId;
229
- prevId = entry.id;
230
- // Convert firstKeptEntryIndex to firstKeptEntryId for compaction
231
- if (entry.type === "compaction") {
232
- const comp = entry;
233
- if (typeof comp.firstKeptEntryIndex === "number") {
234
- const targetEntry = entries[comp.firstKeptEntryIndex];
235
- if (targetEntry && targetEntry.type !== "session") {
236
- comp.firstKeptEntryId = targetEntry.id;
237
- }
238
- delete comp.firstKeptEntryIndex;
239
- }
240
- }
241
- }
242
- }
243
- /** Migrate v2 → v3: rename hookMessage role to custom. Mutates in place. */
244
- function migrateV2ToV3(entries) {
245
- for (const entry of entries) {
246
- if (entry.type === "session") {
247
- entry.version = 3;
248
- continue;
249
- }
250
- // Update message entries with hookMessage role
251
- if (entry.type === "message") {
252
- const msgEntry = entry;
253
- if (msgEntry.message && msgEntry.message.role === "hookMessage") {
254
- msgEntry.message.role = "custom";
255
- }
256
- }
257
- }
258
- }
259
- /**
260
- * Run all necessary migrations to bring entries to current version.
261
- * Mutates entries in place. Returns true if any migration was applied.
262
- */
263
- function migrateToCurrentVersion(entries) {
264
- const header = entries.find((e) => e.type === "session");
265
- const version = header?.version ?? 1;
266
- if (version >= CURRENT_SESSION_VERSION)
267
- return false;
268
- if (version < 2)
269
- migrateV1ToV2(entries);
270
- if (version < 3)
271
- migrateV2ToV3(entries);
272
- return true;
273
- }
274
- /** Exported for testing */
275
- export function migrateSessionEntries(entries) {
276
- migrateToCurrentVersion(entries);
277
- }
278
- /** Exported for compaction.test.ts */
279
- export function parseSessionEntries(content) {
280
- return readSessionEntries(content.trim().split("\n"));
281
- }
282
- export function getLatestCompactionEntry(entries) {
283
- for (let i = entries.length - 1; i >= 0; i--) {
284
- if (entries[i].type === "compaction") {
285
- return entries[i];
286
- }
287
- }
288
- return null;
289
- }
290
- /**
291
- * Build the session context from entries using tree traversal.
292
- * If leafId is provided, walks from that entry to root.
293
- * Handles compaction and branch summaries along the path.
294
- */
295
- export function buildSessionContext(entries, leafId, byId) {
296
- // Build uuid index if not available
297
- if (!byId) {
298
- byId = new Map();
299
- for (const entry of entries) {
300
- byId.set(entry.id, entry);
301
- }
302
- }
303
- // Find leaf
304
- let leaf;
305
- if (leafId === null) {
306
- // Explicitly null - return no messages (navigated to before first entry)
307
- return { messages: [], thinkingLevel: "off", model: null };
308
- }
309
- if (leafId) {
310
- leaf = byId.get(leafId);
311
- }
312
- if (!leaf) {
313
- // Fallback to last entry (when leafId is undefined)
314
- leaf = entries[entries.length - 1];
315
- }
316
- if (!leaf) {
317
- return { messages: [], thinkingLevel: "off", model: null };
318
- }
319
- // Walk from leaf to root, collecting path
320
- const path = resolveBranchPath(byId, leaf.id);
321
- // Extract settings and find compaction
322
- let thinkingLevel = "off";
323
- let model = null;
324
- let compaction = null;
325
- for (const entry of path) {
326
- if (entry.type === "thinking_level_change") {
327
- thinkingLevel = entry.thinkingLevel;
328
- }
329
- else if (entry.type === "model_change") {
330
- model = { provider: entry.provider, modelId: entry.modelId };
331
- }
332
- else if (entry.type === "message" && entry.message.role === "assistant") {
333
- model = { provider: entry.message.provider, modelId: entry.message.model };
334
- }
335
- else if (entry.type === "compaction") {
336
- compaction = entry;
337
- }
338
- }
339
- // Build messages and collect corresponding entries
340
- // When there's a compaction, we need to:
341
- // 1. Emit summary first (entry = compaction)
342
- // 2. Emit kept messages (from firstKeptEntryId up to compaction)
343
- // 3. Emit messages after compaction
344
- const messages = [];
345
- const appendMessage = (entry) => {
346
- if (entry.type === "message") {
347
- messages.push(entry.message);
348
- }
349
- else if (entry.type === "custom_message") {
350
- messages.push(createCustomMessage(entry.customType, entry.content, entry.display, entry.details, entry.timestamp));
351
- }
352
- else if (entry.type === "branch_summary" && entry.summary) {
353
- messages.push(createBranchSummaryMessage(entry.summary, entry.fromId, entry.timestamp));
354
- }
355
- };
356
- if (compaction) {
357
- // Emit summary first
358
- messages.push(createCompactionSummaryMessage(compaction.summary, compaction.tokensBefore, compaction.timestamp));
359
- // Find compaction index in path
360
- const compactionIdx = path.findIndex((e) => e.type === "compaction" && e.id === compaction.id);
361
- // Emit kept messages (before compaction, starting from firstKeptEntryId)
362
- let foundFirstKept = false;
363
- for (let i = 0; i < compactionIdx; i++) {
364
- const entry = path[i];
365
- if (entry.id === compaction.firstKeptEntryId) {
366
- foundFirstKept = true;
367
- }
368
- if (foundFirstKept) {
369
- appendMessage(entry);
370
- }
371
- }
372
- // Emit messages after compaction
373
- for (let i = compactionIdx + 1; i < path.length; i++) {
374
- const entry = path[i];
375
- appendMessage(entry);
376
- }
377
- }
378
- else {
379
- // No compaction - emit all messages, handle branch summaries and custom messages
380
- for (const entry of path) {
381
- appendMessage(entry);
382
- }
383
- }
384
- return { messages, thinkingLevel, model };
385
- }
386
- /**
387
- * Compute the default session directory for a cwd.
388
- * Encodes cwd into a safe directory name under ~/.indusagi/agent/sessions/.
389
- */
390
- function getDefaultSessionDir(cwd) {
391
- const safePath = `--${cwd.replace(/^[/\\]/, "").replace(/[/\\:]/g, "-")}--`;
392
- const sessionDir = join(getDefaultAgentDir(), "sessions", safePath);
393
- if (!existsSync(sessionDir)) {
394
- mkdirSync(sessionDir, { recursive: true });
395
- }
396
- return sessionDir;
397
- }
398
- /** Exported for testing */
399
- export function loadEntriesFromFile(filePath) {
400
- if (!existsSync(filePath))
401
- return [];
402
- const entries = readSessionEntries(readFileSync(filePath, "utf8").trim().split("\n"));
403
- return readSessionHeader(entries) ? entries : [];
404
- }
405
- function isValidSessionFile(filePath) {
406
- try {
407
- const fd = openSync(filePath, "r");
408
- const buffer = Buffer.alloc(512);
409
- const bytesRead = readSync(fd, buffer, 0, 512, 0);
410
- closeSync(fd);
411
- const firstLine = buffer.toString("utf8", 0, bytesRead).split("\n")[0];
412
- if (!firstLine)
413
- return false;
414
- const header = JSON.parse(firstLine);
415
- return header.type === "session" && typeof header.id === "string";
416
- }
417
- catch {
418
- return false;
419
- }
420
- }
421
- /** Exported for testing */
422
- export function findMostRecentSession(sessionDir) {
423
- try {
424
- const files = readdirSync(sessionDir)
425
- .filter((f) => f.endsWith(".jsonl"))
426
- .map((f) => join(sessionDir, f))
427
- .filter(isValidSessionFile)
428
- .map((path) => ({ path, mtime: statSync(path).mtime }))
429
- .sort((a, b) => b.mtime.getTime() - a.mtime.getTime());
430
- return files[0]?.path || null;
431
- }
432
- catch {
433
- return null;
434
- }
435
- }
436
- function isMessageWithContent(message) {
437
- return typeof message.role === "string" && "content" in message;
438
- }
439
- function extractTextContent(message) {
440
- const content = message.content;
441
- if (typeof content === "string") {
442
- return content;
443
- }
444
- return content
445
- .filter((block) => block.type === "text")
446
- .map((block) => block.text)
447
- .join(" ");
448
- }
449
- function getLastActivityTime(entries) {
450
- let lastActivityTime;
451
- for (const entry of entries) {
452
- if (entry.type !== "message")
453
- continue;
454
- const message = entry.message;
455
- if (!isMessageWithContent(message))
456
- continue;
457
- if (message.role !== "user" && message.role !== "assistant")
458
- continue;
459
- const msgTimestamp = message.timestamp;
460
- if (typeof msgTimestamp === "number") {
461
- lastActivityTime = Math.max(lastActivityTime ?? 0, msgTimestamp);
462
- continue;
463
- }
464
- const entryTimestamp = entry.timestamp;
465
- if (typeof entryTimestamp === "string") {
466
- const t = new Date(entryTimestamp).getTime();
467
- if (!Number.isNaN(t)) {
468
- lastActivityTime = Math.max(lastActivityTime ?? 0, t);
469
- }
470
- }
471
- }
472
- return lastActivityTime;
473
- }
474
- function getSessionModifiedDate(entries, header, statsMtime) {
475
- const lastActivityTime = getLastActivityTime(entries);
476
- if (typeof lastActivityTime === "number" && lastActivityTime > 0) {
477
- return new Date(lastActivityTime);
478
- }
479
- const headerTime = typeof header.timestamp === "string" ? new Date(header.timestamp).getTime() : NaN;
480
- return !Number.isNaN(headerTime) ? new Date(headerTime) : statsMtime;
481
- }
482
- async function buildSessionInfo(filePath) {
483
- try {
484
- const content = await readFile(filePath, "utf8");
485
- const entries = readSessionEntries(content.trim().split("\n"));
486
- if (entries.length === 0)
487
- return null;
488
- const header = readSessionHeader(entries);
489
- if (!header)
490
- return null;
491
- const stats = await stat(filePath);
492
- let messageCount = 0;
493
- let firstMessage = "";
494
- const allMessages = [];
495
- let name;
496
- for (const entry of entries) {
497
- // Extract session name (use latest)
498
- if (entry.type === "session_info") {
499
- const infoEntry = entry;
500
- if (infoEntry.name) {
501
- name = infoEntry.name.trim();
502
- }
503
- }
504
- if (entry.type !== "message")
505
- continue;
506
- messageCount++;
507
- const message = entry.message;
508
- if (!isMessageWithContent(message))
509
- continue;
510
- if (message.role !== "user" && message.role !== "assistant")
511
- continue;
512
- const textContent = extractTextContent(message);
513
- if (!textContent)
514
- continue;
515
- allMessages.push(textContent);
516
- if (!firstMessage && message.role === "user") {
517
- firstMessage = textContent;
518
- }
519
- }
520
- const cwd = typeof header.cwd === "string" ? header.cwd : "";
521
- const modified = getSessionModifiedDate(entries, header, stats.mtime);
522
- return {
523
- path: filePath,
524
- id: header.id,
525
- cwd,
526
- name,
527
- created: new Date(header.timestamp),
528
- modified,
529
- lastModified: modified.getTime(),
530
- messageCount,
531
- firstMessage: firstMessage || "(no messages)",
532
- allMessagesText: allMessages.join(" "),
533
- size: stats.size,
534
- };
535
- }
536
- catch {
537
- return null;
538
- }
539
- }
540
- async function listSessionsFromDir(dir, onProgress, progressOffset = 0, progressTotal) {
541
- const sessions = [];
542
- if (!existsSync(dir)) {
543
- return sessions;
544
- }
545
- try {
546
- const dirEntries = await readdir(dir);
547
- const files = dirEntries.filter((f) => f.endsWith(".jsonl")).map((f) => join(dir, f));
548
- const total = progressTotal ?? files.length;
549
- let loaded = 0;
550
- const results = await Promise.all(files.map(async (file) => {
551
- const info = await buildSessionInfo(file);
552
- loaded++;
553
- onProgress?.(progressOffset + loaded, total);
554
- return info;
555
- }));
556
- for (const info of results) {
557
- if (info) {
558
- sessions.push(info);
559
- }
560
- }
561
- }
562
- catch {
563
- // Return empty list on error
564
- }
565
- return sessions;
566
- }
567
- /**
568
- * Manages conversation sessions as append-only trees stored in JSONL files.
569
- *
570
- * Each session entry has an id and parentId forming a tree structure. The "leaf"
571
- * pointer tracks the current position. Appending creates a child of the current leaf.
572
- * Branching moves the leaf to an earlier entry, allowing new branches without
573
- * modifying history.
574
- *
575
- * Use buildSessionContext() to get the resolved message list for the LLM, which
576
- * handles compaction summaries and follows the path from root to current leaf.
577
- */
578
- export class SessionManager {
579
- constructor(cwd, sessionDir, sessionFile, persist) {
580
- this.sessionId = "";
581
- this.flushed = false;
582
- this.fileEntries = [];
583
- this.byId = new Map();
584
- this.labelsById = new Map();
585
- this.leafId = null;
586
- this.cwd = cwd;
587
- this.sessionDir = sessionDir;
588
- this.persist = persist;
589
- if (persist && sessionDir && !existsSync(sessionDir)) {
590
- mkdirSync(sessionDir, { recursive: true });
591
- }
592
- if (sessionFile) {
593
- this.setSessionFile(sessionFile);
594
- }
595
- else {
596
- this.newSession();
597
- }
598
- }
599
- /** Switch to a different session file (used for resume and branching) */
600
- setSessionFile(sessionFile) {
601
- this.sessionFile = resolve(sessionFile);
602
- if (existsSync(this.sessionFile)) {
603
- this.fileEntries = loadEntriesFromFile(this.sessionFile);
604
- if (this.fileEntries.length === 0) {
605
- const explicitPath = this.sessionFile;
606
- this.newSession();
607
- this.sessionFile = explicitPath;
608
- this._rewriteFile();
609
- this.flushed = true;
610
- return;
611
- }
612
- const header = readSessionHeader(this.fileEntries);
613
- this.sessionId = header?.id ?? randomUUID();
614
- if (migrateToCurrentVersion(this.fileEntries)) {
615
- this._rewriteFile();
616
- }
617
- this._buildIndex();
618
- this.flushed = true;
619
- }
620
- else {
621
- const explicitPath = this.sessionFile;
622
- this.newSession();
623
- this.sessionFile = explicitPath; // preserve explicit path from --session flag
624
- }
625
- }
626
- newSession(options) {
627
- this.sessionId = randomUUID();
628
- const timestamp = new Date().toISOString();
629
- const header = {
630
- type: "session",
631
- version: CURRENT_SESSION_VERSION,
632
- id: this.sessionId,
633
- timestamp,
634
- cwd: this.cwd,
635
- parentSession: options?.parentSession,
636
- };
637
- this.fileEntries = [header];
638
- this.byId.clear();
639
- this.labelsById.clear();
640
- this.leafId = null;
641
- this.flushed = false;
642
- if (this.persist) {
643
- const fileTimestamp = timestamp.replace(/[:.]/g, "-");
644
- this.sessionFile = join(this.getSessionDir(), `${fileTimestamp}_${this.sessionId}.jsonl`);
645
- }
646
- return this.sessionFile;
647
- }
648
- _buildIndex() {
649
- const index = buildEntryIndex(this.fileEntries);
650
- this.byId = index.byId;
651
- this.labelsById = index.labelsById;
652
- this.leafId = index.leafId;
653
- }
654
- _rewriteFile() {
655
- if (!this.persist || !this.sessionFile)
656
- return;
657
- const content = `${this.fileEntries.map((e) => JSON.stringify(e)).join("\n")}\n`;
658
- writeFileSync(this.sessionFile, content);
659
- }
660
- isPersisted() {
661
- return this.persist;
662
- }
663
- getCwd() {
664
- return this.cwd;
665
- }
666
- getSessionDir() {
667
- return this.sessionDir;
668
- }
669
- getSessionId() {
670
- return this.sessionId;
671
- }
672
- getSessionFile() {
673
- return this.sessionFile;
674
- }
675
- _persist(entry) {
676
- if (!this.persist || !this.sessionFile)
677
- return;
678
- const hasAssistant = this.fileEntries.some((e) => e.type === "message" && e.message.role === "assistant");
679
- if (!hasAssistant)
680
- return;
681
- if (!this.flushed) {
682
- for (const fileEntry of this.fileEntries) {
683
- appendSessionEntry(this.sessionFile, fileEntry);
684
- }
685
- this.flushed = true;
686
- }
687
- else {
688
- appendSessionEntry(this.sessionFile, entry);
689
- }
690
- }
691
- _appendEntry(entry) {
692
- this.fileEntries.push(entry);
693
- this.byId.set(entry.id, entry);
694
- this.leafId = entry.id;
695
- this._persist(entry);
696
- }
697
- /** Append a message as child of current leaf, then advance leaf. Returns entry id.
698
- * Does not allow writing CompactionSummaryMessage and BranchSummaryMessage directly.
699
- * Reason: we want these to be top-level entries in the session, not message session entries,
700
- * so it is easier to find them.
701
- * These need to be appended via appendCompaction() and appendBranchSummary() methods.
702
- */
703
- appendMessage(message) {
704
- const entry = {
705
- type: "message",
706
- id: generateId(this.byId),
707
- parentId: this.leafId,
708
- timestamp: new Date().toISOString(),
709
- message,
710
- };
711
- this._appendEntry(entry);
712
- return entry.id;
713
- }
714
- /** Append a thinking level change as child of current leaf, then advance leaf. Returns entry id. */
715
- appendThinkingLevelChange(thinkingLevel) {
716
- const entry = {
717
- type: "thinking_level_change",
718
- id: generateId(this.byId),
719
- parentId: this.leafId,
720
- timestamp: new Date().toISOString(),
721
- thinkingLevel,
722
- };
723
- this._appendEntry(entry);
724
- return entry.id;
725
- }
726
- /** Append a model change as child of current leaf, then advance leaf. Returns entry id. */
727
- appendModelChange(provider, modelId) {
728
- const entry = {
729
- type: "model_change",
730
- id: generateId(this.byId),
731
- parentId: this.leafId,
732
- timestamp: new Date().toISOString(),
733
- provider,
734
- modelId,
735
- };
736
- this._appendEntry(entry);
737
- return entry.id;
738
- }
739
- /** Append a compaction summary as child of current leaf, then advance leaf. Returns entry id. */
740
- appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook) {
741
- const entry = {
742
- type: "compaction",
743
- id: generateId(this.byId),
744
- parentId: this.leafId,
745
- timestamp: new Date().toISOString(),
746
- summary,
747
- firstKeptEntryId,
748
- tokensBefore,
749
- details,
750
- fromHook,
751
- };
752
- this._appendEntry(entry);
753
- return entry.id;
754
- }
755
- /** Append a custom entry (for extensions) as child of current leaf, then advance leaf. Returns entry id. */
756
- appendCustomEntry(customType, data) {
757
- const entry = {
758
- type: "custom",
759
- customType,
760
- data,
761
- id: generateId(this.byId),
762
- parentId: this.leafId,
763
- timestamp: new Date().toISOString(),
764
- };
765
- this._appendEntry(entry);
766
- return entry.id;
767
- }
768
- /** Append a session info entry (e.g., display name). Returns entry id. */
769
- appendSessionInfo(name) {
770
- const entry = {
771
- type: "session_info",
772
- id: generateId(this.byId),
773
- parentId: this.leafId,
774
- timestamp: new Date().toISOString(),
775
- name: name.trim(),
776
- };
777
- this._appendEntry(entry);
778
- return entry.id;
779
- }
780
- /** Get the current session name from the latest session_info entry, if any. */
781
- getSessionName() {
782
- // Walk entries in reverse to find the latest session_info with a name
783
- const entries = this.getEntries();
784
- for (let i = entries.length - 1; i >= 0; i--) {
785
- const entry = entries[i];
786
- if (entry.type === "session_info" && entry.name) {
787
- return entry.name;
788
- }
789
- }
790
- return undefined;
791
- }
792
- /**
793
- * Append a custom message entry (for extensions) that participates in LLM context.
794
- * @param customType Extension identifier for filtering on reload
795
- * @param content Message content (string or TextContent/ImageContent array)
796
- * @param display Whether to show in TUI (true = styled display, false = hidden)
797
- * @param details Optional extension-specific metadata (not sent to LLM)
798
- * @returns Entry id
799
- */
800
- appendCustomMessageEntry(customType, content, display, details) {
801
- const entry = {
802
- type: "custom_message",
803
- customType,
804
- content,
805
- display,
806
- details,
807
- id: generateId(this.byId),
808
- parentId: this.leafId,
809
- timestamp: new Date().toISOString(),
810
- };
811
- this._appendEntry(entry);
812
- return entry.id;
813
- }
814
- // =========================================================================
815
- // Tree Traversal
816
- // =========================================================================
817
- getLeafId() {
818
- return this.leafId;
819
- }
820
- getLeafEntry() {
821
- return this.leafId ? this.byId.get(this.leafId) : undefined;
822
- }
823
- getEntry(id) {
824
- return this.byId.get(id);
825
- }
826
- /**
827
- * Get all direct children of an entry.
828
- */
829
- getChildren(parentId) {
830
- const children = [];
831
- for (const entry of this.byId.values()) {
832
- if (entry.parentId === parentId) {
833
- children.push(entry);
834
- }
835
- }
836
- return children;
837
- }
838
- /**
839
- * Get the label for an entry, if any.
840
- */
841
- getLabel(id) {
842
- return this.labelsById.get(id);
843
- }
844
- /**
845
- * Set or clear a label on an entry.
846
- * Labels are user-defined markers for bookmarking/navigation.
847
- * Pass undefined or empty string to clear the label.
848
- */
849
- appendLabelChange(targetId, label) {
850
- if (!this.byId.has(targetId)) {
851
- throw new Error(`Entry ${targetId} not found`);
852
- }
853
- const entry = {
854
- type: "label",
855
- id: generateId(this.byId),
856
- parentId: this.leafId,
857
- timestamp: new Date().toISOString(),
858
- targetId,
859
- label,
860
- };
861
- this._appendEntry(entry);
862
- if (label) {
863
- this.labelsById.set(targetId, label);
864
- }
865
- else {
866
- this.labelsById.delete(targetId);
867
- }
868
- return entry.id;
869
- }
870
- /**
871
- * Walk from entry to root, returning all entries in path order.
872
- * Includes all entry types (messages, compaction, model changes, etc.).
873
- * Use buildSessionContext() to get the resolved messages for the LLM.
874
- */
875
- getBranch(fromId) {
876
- return resolveBranchPath(this.byId, fromId ?? this.leafId);
877
- }
878
- /**
879
- * Build the session context (what gets sent to the LLM).
880
- * Uses tree traversal from current leaf.
881
- */
882
- buildSessionContext() {
883
- return buildSessionContext(this.getEntries(), this.leafId, this.byId);
884
- }
885
- /**
886
- * Get session header.
887
- */
888
- getHeader() {
889
- const h = this.fileEntries.find((e) => e.type === "session");
890
- return h ? h : null;
891
- }
892
- /**
893
- * Get all session entries (excludes header). Returns a shallow copy.
894
- * The session is append-only: use appendXXX() to add entries, branch() to
895
- * change the leaf pointer. Entries cannot be modified or deleted.
896
- */
897
- getEntries() {
898
- return this.fileEntries.filter((e) => e.type !== "session");
899
- }
900
- /**
901
- * Get the session as a tree structure. Returns a shallow defensive copy of all entries.
902
- * A well-formed session has exactly one root (first entry with parentId === null).
903
- * Orphaned entries (broken parent chain) are also returned as roots.
904
- */
905
- getTree() {
906
- return buildSessionTree(this.getEntries(), this.labelsById);
907
- }
908
- // =========================================================================
909
- // Branching
910
- // =========================================================================
911
- /**
912
- * Start a new branch from an earlier entry.
913
- * Moves the leaf pointer to the specified entry. The next appendXXX() call
914
- * will create a child of that entry, forming a new branch. Existing entries
915
- * are not modified or deleted.
916
- */
917
- branch(branchFromId) {
918
- if (!this.byId.has(branchFromId)) {
919
- throw new Error(`Entry ${branchFromId} not found`);
920
- }
921
- this.leafId = branchFromId;
922
- }
923
- /**
924
- * Reset the leaf pointer to null (before any entries).
925
- * The next appendXXX() call will create a new root entry (parentId = null).
926
- * Use this when navigating to re-edit the first user message.
927
- */
928
- resetLeaf() {
929
- this.leafId = null;
930
- }
931
- /**
932
- * Start a new branch with a summary of the abandoned path.
933
- * Same as branch(), but also appends a branch_summary entry that captures
934
- * context from the abandoned conversation path.
935
- */
936
- branchWithSummary(branchFromId, summary, details, fromHook) {
937
- if (branchFromId !== null && !this.byId.has(branchFromId)) {
938
- throw new Error(`Entry ${branchFromId} not found`);
939
- }
940
- this.leafId = branchFromId;
941
- const entry = {
942
- type: "branch_summary",
943
- id: generateId(this.byId),
944
- parentId: branchFromId,
945
- timestamp: new Date().toISOString(),
946
- fromId: branchFromId ?? "root",
947
- summary,
948
- details,
949
- fromHook,
950
- };
951
- this._appendEntry(entry);
952
- return entry.id;
953
- }
954
- /**
955
- * Create a new session file containing only the path from root to the specified leaf.
956
- * Useful for extracting a single conversation path from a branched session.
957
- * Returns the new session file path, or undefined if not persisting.
958
- */
959
- createBranchedSession(leafId) {
960
- const path = this.getBranch(leafId);
961
- if (path.length === 0) {
962
- throw new Error(`Entry ${leafId} not found`);
963
- }
964
- // Filter out LabelEntry from path - we'll recreate them from the resolved map
965
- const pathWithoutLabels = path.filter((e) => e.type !== "label");
966
- const newSessionId = randomUUID();
967
- const timestamp = new Date().toISOString();
968
- const fileTimestamp = timestamp.replace(/[:.]/g, "-");
969
- const newSessionFile = join(this.getSessionDir(), `${fileTimestamp}_${newSessionId}.jsonl`);
970
- const header = {
971
- type: "session",
972
- version: CURRENT_SESSION_VERSION,
973
- id: newSessionId,
974
- timestamp,
975
- cwd: this.cwd,
976
- parentSession: this.persist ? this.sessionFile : undefined,
977
- };
978
- // Collect labels for entries in the path
979
- const pathEntryIds = new Set(pathWithoutLabels.map((e) => e.id));
980
- const labelsToWrite = [];
981
- for (const [targetId, label] of this.labelsById) {
982
- if (pathEntryIds.has(targetId)) {
983
- labelsToWrite.push({ targetId, label });
984
- }
985
- }
986
- if (this.persist) {
987
- appendSessionEntry(newSessionFile, header);
988
- for (const entry of pathWithoutLabels) {
989
- appendSessionEntry(newSessionFile, entry);
990
- }
991
- // Write fresh label entries at the end
992
- const lastEntryId = pathWithoutLabels[pathWithoutLabels.length - 1]?.id || null;
993
- let parentId = lastEntryId;
994
- const labelEntries = [];
995
- for (const { targetId, label } of labelsToWrite) {
996
- const labelEntry = {
997
- type: "label",
998
- id: generateId(new Set(pathEntryIds)),
999
- parentId,
1000
- timestamp: new Date().toISOString(),
1001
- targetId,
1002
- label,
1003
- };
1004
- appendSessionEntry(newSessionFile, labelEntry);
1005
- pathEntryIds.add(labelEntry.id);
1006
- labelEntries.push(labelEntry);
1007
- parentId = labelEntry.id;
1008
- }
1009
- this.fileEntries = [header, ...pathWithoutLabels, ...labelEntries];
1010
- this.sessionId = newSessionId;
1011
- this._buildIndex();
1012
- return newSessionFile;
1013
- }
1014
- // In-memory mode: replace current session with the path + labels
1015
- const labelEntries = [];
1016
- let parentId = pathWithoutLabels[pathWithoutLabels.length - 1]?.id || null;
1017
- for (const { targetId, label } of labelsToWrite) {
1018
- const labelEntry = {
1019
- type: "label",
1020
- id: generateId(new Set([...pathEntryIds, ...labelEntries.map((e) => e.id)])),
1021
- parentId,
1022
- timestamp: new Date().toISOString(),
1023
- targetId,
1024
- label,
1025
- };
1026
- labelEntries.push(labelEntry);
1027
- parentId = labelEntry.id;
1028
- }
1029
- this.fileEntries = [header, ...pathWithoutLabels, ...labelEntries];
1030
- this.sessionId = newSessionId;
1031
- this._buildIndex();
1032
- return undefined;
1033
- }
1034
- /**
1035
- * Create a new session.
1036
- * @param cwd Working directory (stored in session header)
1037
- * @param sessionDir Optional session directory. If omitted, uses default (~/.indusagi/agent/sessions/<encoded-cwd>/).
1038
- */
1039
- static create(cwd, sessionDir) {
1040
- const dir = sessionDir ?? getDefaultSessionDir(cwd);
1041
- return new SessionManager(cwd, dir, undefined, true);
1042
- }
1043
- /**
1044
- * Open a specific session file.
1045
- * @param path Path to session file
1046
- * @param sessionDir Optional session directory for /new or /branch. If omitted, derives from file's parent.
1047
- */
1048
- static open(path, sessionDir) {
1049
- // Extract cwd from session header if possible, otherwise use process.cwd()
1050
- const entries = loadEntriesFromFile(path);
1051
- const header = entries.find((e) => e.type === "session");
1052
- const cwd = header?.cwd ?? process.cwd();
1053
- // If no sessionDir provided, derive from file's parent directory
1054
- const dir = sessionDir ?? resolve(path, "..");
1055
- return new SessionManager(cwd, dir, path, true);
1056
- }
1057
- /**
1058
- * Continue the most recent session, or create new if none.
1059
- * @param cwd Working directory
1060
- * @param sessionDir Optional session directory. If omitted, uses default (~/.indusagi/agent/sessions/<encoded-cwd>/).
1061
- */
1062
- static continueRecent(cwd, sessionDir) {
1063
- const dir = sessionDir ?? getDefaultSessionDir(cwd);
1064
- const mostRecent = findMostRecentSession(dir);
1065
- if (mostRecent) {
1066
- return new SessionManager(cwd, dir, mostRecent, true);
1067
- }
1068
- return new SessionManager(cwd, dir, undefined, true);
1069
- }
1070
- /** Create an in-memory session (no file persistence) */
1071
- static inMemory(cwd = process.cwd()) {
1072
- return new SessionManager(cwd, "", undefined, false);
1073
- }
1074
- /**
1075
- * Fork a session from another project directory into the current project.
1076
- * Creates a new session in the target cwd with the full history from the source session.
1077
- * @param sourcePath Path to the source session file
1078
- * @param targetCwd Target working directory (where the new session will be stored)
1079
- * @param sessionDir Optional session directory. If omitted, uses default for targetCwd.
1080
- */
1081
- static forkFrom(sourcePath, targetCwd, sessionDir) {
1082
- const sourceEntries = loadEntriesFromFile(sourcePath);
1083
- if (sourceEntries.length === 0) {
1084
- throw new Error(`Cannot fork: source session file is empty or invalid: ${sourcePath}`);
1085
- }
1086
- const sourceHeader = sourceEntries.find((e) => e.type === "session");
1087
- if (!sourceHeader) {
1088
- throw new Error(`Cannot fork: source session has no header: ${sourcePath}`);
1089
- }
1090
- const dir = sessionDir ?? getDefaultSessionDir(targetCwd);
1091
- if (!existsSync(dir)) {
1092
- mkdirSync(dir, { recursive: true });
1093
- }
1094
- // Create new session file with new ID but forked content
1095
- const newSessionId = randomUUID();
1096
- const timestamp = new Date().toISOString();
1097
- const fileTimestamp = timestamp.replace(/[:.]/g, "-");
1098
- const newSessionFile = join(dir, `${fileTimestamp}_${newSessionId}.jsonl`);
1099
- // Write new header pointing to source as parent, with updated cwd
1100
- const newHeader = {
1101
- type: "session",
1102
- version: CURRENT_SESSION_VERSION,
1103
- id: newSessionId,
1104
- timestamp,
1105
- cwd: targetCwd,
1106
- parentSession: sourcePath,
1107
- };
1108
- appendSessionEntry(newSessionFile, newHeader);
1109
- // Copy all non-header entries from source
1110
- for (const entry of sourceEntries) {
1111
- if (entry.type !== "session") {
1112
- appendSessionEntry(newSessionFile, entry);
1113
- }
1114
- }
1115
- return new SessionManager(targetCwd, dir, newSessionFile, true);
1116
- }
1117
- /**
1118
- * List all sessions for a directory.
1119
- * @param cwd Working directory (used to compute default session directory)
1120
- * @param sessionDir Optional session directory. If omitted, uses default (~/.indusagi/agent/sessions/<encoded-cwd>/).
1121
- * @param onProgress Optional callback for progress updates (loaded, total)
1122
- */
1123
- static async list(cwd, sessionDir, onProgress) {
1124
- const dir = sessionDir ?? getDefaultSessionDir(cwd);
1125
- const sessions = await listSessionsFromDir(dir, onProgress);
1126
- sessions.sort((a, b) => b.modified.getTime() - a.modified.getTime());
1127
- return sessions;
1128
- }
1129
- /**
1130
- * List all sessions across all project directories.
1131
- * @param onProgress Optional callback for progress updates (loaded, total)
1132
- */
1133
- static async listAll(onProgress) {
1134
- const sessionsDir = getSessionsDir();
1135
- try {
1136
- if (!existsSync(sessionsDir)) {
1137
- return [];
1138
- }
1139
- const entries = await readdir(sessionsDir, { withFileTypes: true });
1140
- const dirs = entries.filter((e) => e.isDirectory()).map((e) => join(sessionsDir, e.name));
1141
- // Count total files first for accurate progress
1142
- let totalFiles = 0;
1143
- const dirFiles = [];
1144
- for (const dir of dirs) {
1145
- try {
1146
- const files = (await readdir(dir)).filter((f) => f.endsWith(".jsonl"));
1147
- dirFiles.push(files.map((f) => join(dir, f)));
1148
- totalFiles += files.length;
1149
- }
1150
- catch {
1151
- dirFiles.push([]);
1152
- }
1153
- }
1154
- // Process all files with progress tracking
1155
- let loaded = 0;
1156
- const sessions = [];
1157
- const allFiles = dirFiles.flat();
1158
- const results = await Promise.all(allFiles.map(async (file) => {
1159
- const info = await buildSessionInfo(file);
1160
- loaded++;
1161
- onProgress?.(loaded, totalFiles);
1162
- return info;
1163
- }));
1164
- for (const info of results) {
1165
- if (info) {
1166
- sessions.push(info);
1167
- }
1168
- }
1169
- sessions.sort((a, b) => b.modified.getTime() - a.modified.getTime());
1170
- return sessions;
1171
- }
1172
- catch {
1173
- return [];
1174
- }
1175
- }
1176
- }
1177
- //# sourceMappingURL=session-manager.js.map