@maudecode/talaria-web 1.17.2 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (623) hide show
  1. package/_release.json +8 -8
  2. package/dist/api/auth-raw.d.ts +1 -1
  3. package/dist/api/auth-raw.js +20 -20
  4. package/dist/api/auth-raw.js.map +1 -1
  5. package/dist/api/automation-raw.d.ts +7 -1
  6. package/dist/api/automation-raw.js +74 -27
  7. package/dist/api/automation-raw.js.map +1 -1
  8. package/dist/api/automation-router.d.ts +128 -23
  9. package/dist/api/automation-router.js +29 -13
  10. package/dist/api/automation-router.js.map +1 -1
  11. package/dist/api/chat-router.d.ts +1845 -40
  12. package/dist/api/chat-router.js +196 -114
  13. package/dist/api/chat-router.js.map +1 -1
  14. package/dist/api/git-router.d.ts +37 -3
  15. package/dist/api/git-router.js +47 -48
  16. package/dist/api/git-router.js.map +1 -1
  17. package/dist/api/raw-routes.d.ts +9 -1
  18. package/dist/api/raw-routes.js +286 -73
  19. package/dist/api/raw-routes.js.map +1 -1
  20. package/dist/api/router.d.ts +16 -6
  21. package/dist/api/router.js +28 -26
  22. package/dist/api/router.js.map +1 -1
  23. package/dist/api/session-visibility.d.ts +4 -4
  24. package/dist/api/session-visibility.js +26 -16
  25. package/dist/api/session-visibility.js.map +1 -1
  26. package/dist/api/sessions-router.d.ts +3312 -131
  27. package/dist/api/sessions-router.js +287 -157
  28. package/dist/api/sessions-router.js.map +1 -1
  29. package/dist/api/settings-router.d.ts +457 -8
  30. package/dist/api/settings-router.js +54 -33
  31. package/dist/api/settings-router.js.map +1 -1
  32. package/dist/api/sse-routes.d.ts +7 -2
  33. package/dist/api/sse-routes.js +109 -62
  34. package/dist/api/sse-routes.js.map +1 -1
  35. package/dist/api/tools-raw.d.ts +5 -0
  36. package/dist/api/tools-raw.js +63 -55
  37. package/dist/api/tools-raw.js.map +1 -1
  38. package/dist/api/tools-router.d.ts +998 -85
  39. package/dist/api/tools-router.js +447 -61
  40. package/dist/api/tools-router.js.map +1 -1
  41. package/dist/api/transcribe-stream.d.ts +16 -0
  42. package/dist/api/transcribe-stream.js +172 -0
  43. package/dist/api/transcribe-stream.js.map +1 -0
  44. package/dist/app.d.ts +4 -1
  45. package/dist/app.js +98 -59
  46. package/dist/app.js.map +1 -1
  47. package/dist/auth/gate.js +15 -11
  48. package/dist/auth/gate.js.map +1 -1
  49. package/dist/auth/oidc.d.ts +5 -2
  50. package/dist/auth/oidc.js +8 -7
  51. package/dist/auth/oidc.js.map +1 -1
  52. package/dist/auth/passkeys.d.ts +15 -14
  53. package/dist/auth/passkeys.js +89 -91
  54. package/dist/auth/passkeys.js.map +1 -1
  55. package/dist/auth/store.d.ts +17 -7
  56. package/dist/auth/store.js +93 -52
  57. package/dist/auth/store.js.map +1 -1
  58. package/dist/bin/talaria-web.js +12 -81
  59. package/dist/bin/talaria-web.js.map +1 -1
  60. package/dist/cli/ctl.js +2 -1
  61. package/dist/cli/ctl.js.map +1 -1
  62. package/dist/cli/dotenv.d.ts +5 -0
  63. package/dist/cli/dotenv.js +15 -2
  64. package/dist/cli/dotenv.js.map +1 -1
  65. package/dist/cli/launcher.js +5 -5
  66. package/dist/cli/launcher.js.map +1 -1
  67. package/dist/cli/main.d.ts +1 -0
  68. package/dist/cli/main.js +85 -0
  69. package/dist/cli/main.js.map +1 -0
  70. package/dist/cli/supervise.d.ts +2 -0
  71. package/dist/cli/supervise.js +67 -4
  72. package/dist/cli/supervise.js.map +1 -1
  73. package/dist/config/agent-config.d.ts +34 -11
  74. package/dist/config/agent-config.js +116 -60
  75. package/dist/config/agent-config.js.map +1 -1
  76. package/dist/config.d.ts +4 -0
  77. package/dist/config.js +19 -6
  78. package/dist/config.js.map +1 -1
  79. package/dist/fs/atomic.d.ts +1 -0
  80. package/dist/fs/atomic.js +4 -1
  81. package/dist/fs/atomic.js.map +1 -1
  82. package/dist/fs/stat.d.ts +1 -0
  83. package/dist/fs/stat.js +11 -0
  84. package/dist/fs/stat.js.map +1 -0
  85. package/dist/http/context.d.ts +31 -12
  86. package/dist/http/context.js +60 -24
  87. package/dist/http/context.js.map +1 -1
  88. package/dist/http/csp.d.ts +2 -1
  89. package/dist/http/csp.js +3 -2
  90. package/dist/http/csp.js.map +1 -1
  91. package/dist/onboarding.d.ts +2 -2
  92. package/dist/onboarding.js +10 -8
  93. package/dist/onboarding.js.map +1 -1
  94. package/dist/profiles/profiles.d.ts +20 -4
  95. package/dist/profiles/profiles.js +115 -30
  96. package/dist/profiles/profiles.js.map +1 -1
  97. package/dist/projects.d.ts +15 -6
  98. package/dist/projects.js +55 -47
  99. package/dist/projects.js.map +1 -1
  100. package/dist/providers/catalog.d.ts +84 -14
  101. package/dist/providers/catalog.js +474 -151
  102. package/dist/providers/catalog.js.map +1 -1
  103. package/dist/providers/env-file.d.ts +10 -3
  104. package/dist/providers/env-file.js +24 -75
  105. package/dist/providers/env-file.js.map +1 -1
  106. package/dist/providers/runtime-env.d.ts +4 -2
  107. package/dist/providers/runtime-env.js +9 -6
  108. package/dist/providers/runtime-env.js.map +1 -1
  109. package/dist/providers/tables.d.ts +3 -1
  110. package/dist/providers/tables.js +4 -2
  111. package/dist/providers/tables.js.map +1 -1
  112. package/dist/raster-image.d.ts +7 -0
  113. package/dist/raster-image.js +267 -0
  114. package/dist/raster-image.js.map +1 -0
  115. package/dist/redact.js +342 -46
  116. package/dist/redact.js.map +1 -1
  117. package/dist/release.d.ts +7 -0
  118. package/dist/release.js +14 -0
  119. package/dist/release.js.map +1 -1
  120. package/dist/runtime.d.ts +5 -1
  121. package/dist/runtime.js +305 -96
  122. package/dist/runtime.js.map +1 -1
  123. package/dist/server.js +15 -0
  124. package/dist/server.js.map +1 -1
  125. package/dist/sessions/anchor.d.ts +9 -3
  126. package/dist/sessions/anchor.js +28 -36
  127. package/dist/sessions/anchor.js.map +1 -1
  128. package/dist/sessions/background-events.d.ts +2 -0
  129. package/dist/sessions/background-events.js +10 -0
  130. package/dist/sessions/background-events.js.map +1 -0
  131. package/dist/sessions/background-tasks.d.ts +26 -27
  132. package/dist/sessions/background-tasks.js +89 -97
  133. package/dist/sessions/background-tasks.js.map +1 -1
  134. package/dist/sessions/background-updates.d.ts +15 -8
  135. package/dist/sessions/background-updates.js +101 -25
  136. package/dist/sessions/background-updates.js.map +1 -1
  137. package/dist/sessions/cli-sessions.d.ts +27 -6
  138. package/dist/sessions/cli-sessions.js +152 -42
  139. package/dist/sessions/cli-sessions.js.map +1 -1
  140. package/dist/sessions/completions.d.ts +77 -9
  141. package/dist/sessions/completions.js +482 -45
  142. package/dist/sessions/completions.js.map +1 -1
  143. package/dist/sessions/compress.d.ts +8 -0
  144. package/dist/sessions/compress.js +2 -2
  145. package/dist/sessions/compress.js.map +1 -1
  146. package/dist/sessions/drafts.d.ts +14 -10
  147. package/dist/sessions/drafts.js +38 -43
  148. package/dist/sessions/drafts.js.map +1 -1
  149. package/dist/sessions/export.d.ts +5 -0
  150. package/dist/sessions/export.js +30 -0
  151. package/dist/sessions/export.js.map +1 -1
  152. package/dist/sessions/gateway-sessions.d.ts +46 -0
  153. package/dist/sessions/gateway-sessions.js +378 -0
  154. package/dist/sessions/gateway-sessions.js.map +1 -0
  155. package/dist/sessions/gateway-watcher.d.ts +7 -3
  156. package/dist/sessions/gateway-watcher.js +31 -19
  157. package/dist/sessions/gateway-watcher.js.map +1 -1
  158. package/dist/sessions/goals.d.ts +31 -0
  159. package/dist/sessions/goals.js +75 -0
  160. package/dist/sessions/goals.js.map +1 -0
  161. package/dist/sessions/handoff.d.ts +32 -0
  162. package/dist/sessions/handoff.js +114 -0
  163. package/dist/sessions/handoff.js.map +1 -0
  164. package/dist/sessions/journal.d.ts +5 -79
  165. package/dist/sessions/journal.js +15 -606
  166. package/dist/sessions/journal.js.map +1 -1
  167. package/dist/sessions/list.d.ts +31 -16
  168. package/dist/sessions/list.js +139 -129
  169. package/dist/sessions/list.js.map +1 -1
  170. package/dist/sessions/merge.d.ts +69 -13
  171. package/dist/sessions/merge.js +265 -64
  172. package/dist/sessions/merge.js.map +1 -1
  173. package/dist/sessions/notices.d.ts +22 -0
  174. package/dist/sessions/notices.js +72 -0
  175. package/dist/sessions/notices.js.map +1 -0
  176. package/dist/sessions/pending.d.ts +10 -4
  177. package/dist/sessions/pending.js +83 -7
  178. package/dist/sessions/pending.js.map +1 -1
  179. package/dist/sessions/prefix-index.d.ts +82 -0
  180. package/dist/sessions/prefix-index.js +232 -0
  181. package/dist/sessions/prefix-index.js.map +1 -0
  182. package/dist/sessions/recovery.d.ts +19 -0
  183. package/dist/sessions/recovery.js +322 -0
  184. package/dist/sessions/recovery.js.map +1 -0
  185. package/dist/sessions/relay.d.ts +38 -19
  186. package/dist/sessions/relay.js +302 -79
  187. package/dist/sessions/relay.js.map +1 -1
  188. package/dist/sessions/service.d.ts +260 -55
  189. package/dist/sessions/service.js +1448 -462
  190. package/dist/sessions/service.js.map +1 -1
  191. package/dist/sessions/session.d.ts +24 -2
  192. package/dist/sessions/session.js +69 -7
  193. package/dist/sessions/session.js.map +1 -1
  194. package/dist/sessions/shares.d.ts +7 -6
  195. package/dist/sessions/shares.js +22 -45
  196. package/dist/sessions/shares.js.map +1 -1
  197. package/dist/sessions/source-kind.js +1 -0
  198. package/dist/sessions/source-kind.js.map +1 -1
  199. package/dist/sessions/state-db-identity.d.ts +18 -0
  200. package/dist/sessions/state-db-identity.js +67 -0
  201. package/dist/sessions/state-db-identity.js.map +1 -0
  202. package/dist/sessions/state-db-worker.d.ts +1 -0
  203. package/dist/sessions/state-db-worker.js +35 -0
  204. package/dist/sessions/state-db-worker.js.map +1 -0
  205. package/dist/sessions/state-db.d.ts +113 -7
  206. package/dist/sessions/state-db.js +861 -44
  207. package/dist/sessions/state-db.js.map +1 -1
  208. package/dist/sessions/storage/backend.d.ts +162 -0
  209. package/dist/sessions/storage/backend.js +19 -0
  210. package/dist/sessions/storage/backend.js.map +1 -0
  211. package/dist/sessions/storage/conformance.d.ts +20 -0
  212. package/dist/sessions/storage/conformance.js +237 -0
  213. package/dist/sessions/storage/conformance.js.map +1 -0
  214. package/dist/sessions/storage/document.d.ts +16 -0
  215. package/dist/sessions/storage/document.js +44 -0
  216. package/dist/sessions/storage/document.js.map +1 -0
  217. package/dist/sessions/storage/json-documents.d.ts +23 -0
  218. package/dist/sessions/storage/json-documents.js +233 -0
  219. package/dist/sessions/storage/json-documents.js.map +1 -0
  220. package/dist/sessions/storage/json-files.d.ts +12 -0
  221. package/dist/sessions/storage/json-files.js +124 -0
  222. package/dist/sessions/storage/json-files.js.map +1 -0
  223. package/dist/sessions/storage/json-installation.d.ts +3 -0
  224. package/dist/sessions/storage/json-installation.js +31 -0
  225. package/dist/sessions/storage/json-installation.js.map +1 -0
  226. package/dist/sessions/storage/json-journal.d.ts +114 -0
  227. package/dist/sessions/storage/json-journal.js +686 -0
  228. package/dist/sessions/storage/json-journal.js.map +1 -0
  229. package/dist/sessions/storage/json-recovery.d.ts +4 -0
  230. package/dist/sessions/storage/json-recovery.js +195 -0
  231. package/dist/sessions/storage/json-recovery.js.map +1 -0
  232. package/dist/sessions/storage/json.d.ts +68 -0
  233. package/dist/sessions/storage/json.js +258 -0
  234. package/dist/sessions/storage/json.js.map +1 -0
  235. package/dist/sessions/storage/row.d.ts +6 -0
  236. package/dist/sessions/storage/row.js +49 -0
  237. package/dist/sessions/storage/row.js.map +1 -0
  238. package/dist/sessions/storage/search-text.d.ts +4 -0
  239. package/dist/sessions/storage/search-text.js +16 -0
  240. package/dist/sessions/storage/search-text.js.map +1 -0
  241. package/dist/sessions/store.d.ts +65 -68
  242. package/dist/sessions/store.js +305 -602
  243. package/dist/sessions/store.js.map +1 -1
  244. package/dist/sessions/streams.d.ts +4 -0
  245. package/dist/sessions/streams.js +9 -1
  246. package/dist/sessions/streams.js.map +1 -1
  247. package/dist/sessions/titles.d.ts +2 -0
  248. package/dist/sessions/titles.js +5 -1
  249. package/dist/sessions/titles.js.map +1 -1
  250. package/dist/sessions/todo.d.ts +5 -0
  251. package/dist/sessions/todo.js +28 -21
  252. package/dist/sessions/todo.js.map +1 -1
  253. package/dist/sessions/tool-display.d.ts +5 -4
  254. package/dist/sessions/tool-display.js +30 -50
  255. package/dist/sessions/tool-display.js.map +1 -1
  256. package/dist/sessions/turn-context.d.ts +11 -2
  257. package/dist/sessions/turn-context.js +18 -11
  258. package/dist/sessions/turn-context.js.map +1 -1
  259. package/dist/sessions/turn.d.ts +122 -17
  260. package/dist/sessions/turn.js +939 -358
  261. package/dist/sessions/turn.js.map +1 -1
  262. package/dist/sessions/wakeup-pause.d.ts +54 -0
  263. package/dist/sessions/wakeup-pause.js +163 -0
  264. package/dist/sessions/wakeup-pause.js.map +1 -0
  265. package/dist/sessions/window.js +13 -12
  266. package/dist/sessions/window.js.map +1 -1
  267. package/dist/settings.d.ts +19 -7
  268. package/dist/settings.js +178 -184
  269. package/dist/settings.js.map +1 -1
  270. package/dist/sidecar/client.d.ts +17 -3
  271. package/dist/sidecar/client.js +78 -8
  272. package/dist/sidecar/client.js.map +1 -1
  273. package/dist/sidecar/discover.d.ts +2 -1
  274. package/dist/sidecar/discover.js +93 -10
  275. package/dist/sidecar/discover.js.map +1 -1
  276. package/dist/sidecar/env.d.ts +4 -0
  277. package/dist/sidecar/env.js +3 -0
  278. package/dist/sidecar/env.js.map +1 -0
  279. package/dist/sidecar/fake.d.ts +2 -2
  280. package/dist/sidecar/fake.js +19 -2
  281. package/dist/sidecar/fake.js.map +1 -1
  282. package/dist/startup.d.ts +13 -5
  283. package/dist/startup.js +48 -0
  284. package/dist/startup.js.map +1 -1
  285. package/dist/test/env-file.d.ts +5 -0
  286. package/dist/test/env-file.js +88 -0
  287. package/dist/test/env-file.js.map +1 -0
  288. package/dist/test/harness.d.ts +1 -0
  289. package/dist/test/harness.js +1 -1
  290. package/dist/test/harness.js.map +1 -1
  291. package/dist/test/passkeys.d.ts +22 -0
  292. package/dist/test/passkeys.js +62 -0
  293. package/dist/test/passkeys.js.map +1 -0
  294. package/dist/test/storage.d.ts +15 -0
  295. package/dist/test/storage.js +26 -0
  296. package/dist/test/storage.js.map +1 -0
  297. package/dist/test/ts-worker-hooks.d.ts +1 -0
  298. package/dist/test/ts-worker-hooks.js +24 -0
  299. package/dist/test/ts-worker-hooks.js.map +1 -0
  300. package/dist/text/diff.d.ts +9 -14
  301. package/dist/text/diff.js +74 -108
  302. package/dist/text/diff.js.map +1 -1
  303. package/dist/tools/commands.d.ts +6 -1
  304. package/dist/tools/commands.js +8 -2
  305. package/dist/tools/commands.js.map +1 -1
  306. package/dist/tools/connectors.d.ts +33 -0
  307. package/dist/tools/connectors.js +121 -0
  308. package/dist/tools/connectors.js.map +1 -0
  309. package/dist/tools/crons.d.ts +38 -1
  310. package/dist/tools/crons.js +122 -18
  311. package/dist/tools/crons.js.map +1 -1
  312. package/dist/tools/dashboard-plugins.d.ts +53 -0
  313. package/dist/tools/dashboard-plugins.js +188 -0
  314. package/dist/tools/dashboard-plugins.js.map +1 -0
  315. package/dist/tools/extensions.d.ts +18 -5
  316. package/dist/tools/extensions.js +344 -266
  317. package/dist/tools/extensions.js.map +1 -1
  318. package/dist/tools/gateway-restart.d.ts +62 -0
  319. package/dist/tools/gateway-restart.js +142 -0
  320. package/dist/tools/gateway-restart.js.map +1 -0
  321. package/dist/tools/health.d.ts +44 -0
  322. package/dist/tools/health.js +201 -46
  323. package/dist/tools/health.js.map +1 -1
  324. package/dist/tools/hygiene.d.ts +4 -3
  325. package/dist/tools/hygiene.js +23 -9
  326. package/dist/tools/hygiene.js.map +1 -1
  327. package/dist/tools/kanban.d.ts +4 -2
  328. package/dist/tools/kanban.js +28 -19
  329. package/dist/tools/kanban.js.map +1 -1
  330. package/dist/tools/mcp.d.ts +13 -0
  331. package/dist/tools/mcp.js +88 -0
  332. package/dist/tools/mcp.js.map +1 -1
  333. package/dist/tools/memory-masks.d.ts +5 -0
  334. package/dist/tools/memory-masks.js +256 -0
  335. package/dist/tools/memory-masks.js.map +1 -0
  336. package/dist/tools/memory.d.ts +29 -3
  337. package/dist/tools/memory.js +69 -27
  338. package/dist/tools/memory.js.map +1 -1
  339. package/dist/tools/plugin-settings.d.ts +15 -0
  340. package/dist/tools/plugin-settings.js +90 -0
  341. package/dist/tools/plugin-settings.js.map +1 -0
  342. package/dist/tools/project-os.d.ts +11 -0
  343. package/dist/tools/project-os.js +267 -0
  344. package/dist/tools/project-os.js.map +1 -0
  345. package/dist/tools/skills.d.ts +14 -5
  346. package/dist/tools/skills.js +49 -16
  347. package/dist/tools/skills.js.map +1 -1
  348. package/dist/tools/update-notifications.d.ts +34 -15
  349. package/dist/tools/update-notifications.js +141 -57
  350. package/dist/tools/update-notifications.js.map +1 -1
  351. package/dist/tools/update-rollback.d.ts +11 -0
  352. package/dist/tools/update-rollback.js +28 -0
  353. package/dist/tools/update-rollback.js.map +1 -0
  354. package/dist/tools/updates.d.ts +110 -32
  355. package/dist/tools/updates.js +1112 -294
  356. package/dist/tools/updates.js.map +1 -1
  357. package/dist/tools/wiki.d.ts +68 -0
  358. package/dist/tools/wiki.js +413 -0
  359. package/dist/tools/wiki.js.map +1 -0
  360. package/dist/util.d.ts +2 -0
  361. package/dist/util.js +5 -0
  362. package/dist/util.js.map +1 -1
  363. package/dist/workspace/escape.d.ts +61 -0
  364. package/dist/workspace/escape.js +149 -0
  365. package/dist/workspace/escape.js.map +1 -0
  366. package/dist/workspace/extract.d.ts +22 -0
  367. package/dist/workspace/extract.js +308 -0
  368. package/dist/workspace/extract.js.map +1 -0
  369. package/dist/workspace/fs.d.ts +12 -0
  370. package/dist/workspace/fs.js +92 -23
  371. package/dist/workspace/fs.js.map +1 -1
  372. package/dist/workspace/git.d.ts +34 -1
  373. package/dist/workspace/git.js +328 -35
  374. package/dist/workspace/git.js.map +1 -1
  375. package/dist/workspace/media.d.ts +16 -13
  376. package/dist/workspace/media.js +43 -61
  377. package/dist/workspace/media.js.map +1 -1
  378. package/dist/workspace/rollback.d.ts +36 -22
  379. package/dist/workspace/rollback.js +178 -272
  380. package/dist/workspace/rollback.js.map +1 -1
  381. package/dist/workspace/unzip.js +4 -1
  382. package/dist/workspace/unzip.js.map +1 -1
  383. package/dist/workspace/upload.d.ts +7 -4
  384. package/dist/workspace/upload.js +5 -2
  385. package/dist/workspace/upload.js.map +1 -1
  386. package/dist/workspace/workspaces.d.ts +15 -19
  387. package/dist/workspace/workspaces.js +55 -127
  388. package/dist/workspace/workspaces.js.map +1 -1
  389. package/dist/workspace/worktrees.d.ts +2 -1
  390. package/dist/workspace/worktrees.js +179 -42
  391. package/dist/workspace/worktrees.js.map +1 -1
  392. package/package.json +7 -3
  393. package/sidecar/agent_dependency.json +4 -4
  394. package/sidecar/agent_support.json +26 -0
  395. package/sidecar/scripts/record-fixtures.py +12 -3
  396. package/sidecar/scripts/replay_sidecar.py +32 -0
  397. package/sidecar/scripts/suite_runner.py +302 -0
  398. package/sidecar/scripts/test.sh +12 -4
  399. package/sidecar/talaria_sidecar/__init__.py +6 -1
  400. package/sidecar/talaria_sidecar/__main__.py +4 -2
  401. package/sidecar/talaria_sidecar/agent_mutation.py +975 -0
  402. package/sidecar/talaria_sidecar/agent_services.py +1053 -0
  403. package/sidecar/talaria_sidecar/dependency_sync.py +85 -0
  404. package/sidecar/talaria_sidecar/home.py +56 -3
  405. package/sidecar/talaria_sidecar/methods/__init__.py +2 -2
  406. package/sidecar/talaria_sidecar/methods/aux.py +166 -24
  407. package/sidecar/talaria_sidecar/methods/chat.py +852 -135
  408. package/sidecar/talaria_sidecar/methods/checkpoints.py +89 -0
  409. package/sidecar/talaria_sidecar/methods/commands.py +294 -4
  410. package/sidecar/talaria_sidecar/methods/config.py +123 -4
  411. package/sidecar/talaria_sidecar/methods/connectors.py +343 -0
  412. package/sidecar/talaria_sidecar/methods/cron.py +395 -36
  413. package/sidecar/talaria_sidecar/methods/cron_execution.py +284 -0
  414. package/sidecar/talaria_sidecar/methods/gateway.py +212 -55
  415. package/sidecar/talaria_sidecar/methods/gateway_sessions.py +234 -0
  416. package/sidecar/talaria_sidecar/methods/goals.py +81 -41
  417. package/sidecar/talaria_sidecar/methods/kanban.py +108 -34
  418. package/sidecar/talaria_sidecar/methods/mcp.py +1 -1
  419. package/sidecar/talaria_sidecar/methods/memory.py +84 -0
  420. package/sidecar/talaria_sidecar/methods/oauth.py +5 -2
  421. package/sidecar/talaria_sidecar/methods/process.py +218 -15
  422. package/sidecar/talaria_sidecar/methods/profiles.py +121 -13
  423. package/sidecar/talaria_sidecar/methods/providers.py +217 -28
  424. package/sidecar/talaria_sidecar/methods/runtime.py +69 -1
  425. package/sidecar/talaria_sidecar/methods/skills.py +67 -4
  426. package/sidecar/talaria_sidecar/methods/state_db.py +316 -75
  427. package/sidecar/talaria_sidecar/methods/stt.py +159 -78
  428. package/sidecar/talaria_sidecar/methods/text.py +14 -1
  429. package/sidecar/talaria_sidecar/methods/toolsets.py +49 -0
  430. package/sidecar/talaria_sidecar/methods/usage.py +113 -14
  431. package/sidecar/talaria_sidecar/methods/worktree.py +26 -19
  432. package/sidecar/talaria_sidecar/methods/write_approval.py +181 -0
  433. package/sidecar/talaria_sidecar/rpc.py +45 -4
  434. package/sidecar/talaria_sidecar/runtime.py +98 -13
  435. package/sidecar/talaria_sidecar/speed.py +35 -0
  436. package/static/dist/FILES.txt +126 -126
  437. package/static/dist/assets/AppShell-cey33v9s.js +8 -0
  438. package/static/dist/assets/ChatPage-i8wnugr7.js +18 -0
  439. package/static/dist/assets/ConnectTargets-hg19553x.js +1 -0
  440. package/static/dist/assets/ExtensionRoute-cly4apm5.js +1 -0
  441. package/static/dist/assets/Field-j8uqoigz.js +9 -0
  442. package/static/dist/assets/HubRoute-e4bgz41j.js +2 -0
  443. package/static/dist/assets/Markdown-lahuichm.js +598 -0
  444. package/static/dist/assets/RightPanel-lbo4i0fn.js +1 -0
  445. package/static/dist/assets/Select-gqatm2e0.js +1 -0
  446. package/static/dist/assets/SessionListPanel-mfqayfjh.js +1 -0
  447. package/static/dist/assets/SettingsLayout-b8980u7k.js +1 -0
  448. package/static/dist/assets/States-e7dkgtxf.js +1 -0
  449. package/static/dist/assets/Toaster-bfqqy786.js +1 -0
  450. package/static/dist/assets/_app-n1n6pfx1.js +1 -0
  451. package/static/dist/assets/{_app.ext._extensionId-opyh9y0v.js → _app.ext._extensionId-buxjxav3.js} +1 -1
  452. package/static/dist/assets/_app.index-jt8zwiu2.js +1 -0
  453. package/static/dist/assets/_app.insights-cv76ml71.js +1 -0
  454. package/static/dist/assets/_app.kanban-h6ts53j7.js +1 -0
  455. package/static/dist/assets/_app.logs-dm873z90.js +1 -0
  456. package/static/dist/assets/_app.memory-glk5y6m8.js +1 -0
  457. package/static/dist/assets/_app.profiles-ka6zpstq.js +1 -0
  458. package/static/dist/assets/{_app.session._sessionId-bfd4h3id.js → _app.session._sessionId-g2vzghvc.js} +1 -1
  459. package/static/dist/assets/_app.settings-hgjdhzcd.js +1 -0
  460. package/static/dist/assets/_app.settings._section-jf2kmhae.js +3 -0
  461. package/static/dist/assets/_app.skills-cii852yq.js +1 -0
  462. package/static/dist/assets/_app.tasks-fp9q7atm.js +1 -0
  463. package/static/dist/assets/_app.todos-dw94qzue.js +1 -0
  464. package/static/dist/assets/_app.workspaces-inyygzze.js +1 -0
  465. package/static/dist/assets/{abnfDiagram-VCTEODGH-b2x1lqot.js → abnfDiagram-VCTEODGH-gjayq3ra.js} +1 -1
  466. package/static/dist/assets/architecture-7GRP2DOG-lp56972r.js +1 -0
  467. package/static/dist/assets/{architectureDiagram-5GKGNRK7-h38o5l7b.js → architectureDiagram-5GKGNRK7-nwb3xovn.js} +1 -1
  468. package/static/dist/assets/archive-b1j004vn.js +1 -0
  469. package/static/dist/assets/back-g74gkozu.js +1 -0
  470. package/static/dist/assets/{blockDiagram-I7D4REHJ-bqquxv2u.js → blockDiagram-I7D4REHJ-joedghi3.js} +1 -1
  471. package/static/dist/assets/{c4Diagram-7LVT6UL2-f3fb8w6z.js → c4Diagram-7LVT6UL2-hyrjrohe.js} +1 -1
  472. package/static/dist/assets/channel-es95o4y8.js +1 -0
  473. package/static/dist/assets/{chunk-4HAMMTFA-bzfyyzp3.js → chunk-4HAMMTFA-koouqbut.js} +1 -1
  474. package/static/dist/assets/{chunk-75Z2AOVW-ly99rfx5.js → chunk-75Z2AOVW-bl4bhdnt.js} +1 -1
  475. package/static/dist/assets/{chunk-DU6HZSFF-bg6ecfqf.js → chunk-DU6HZSFF-gpedttsp.js} +3 -3
  476. package/static/dist/assets/{chunk-F27PBJKO-e8k7mmqw.js → chunk-F27PBJKO-d8xxi0zi.js} +1 -1
  477. package/static/dist/assets/{chunk-GMAD6QVW-cmalnoaj.js → chunk-GMAD6QVW-jro0hl73.js} +1 -1
  478. package/static/dist/assets/{chunk-GVQU2GXP-gmif5o01.js → chunk-GVQU2GXP-djn6gbyu.js} +1 -1
  479. package/static/dist/assets/{chunk-IMKFNOWR-f1nwwh6u.js → chunk-IMKFNOWR-vw4p5p7o.js} +1 -1
  480. package/static/dist/assets/{chunk-L3NEJ4N5-oktfh5v7.js → chunk-L3NEJ4N5-n1hj77q8.js} +1 -1
  481. package/static/dist/assets/{chunk-OSK3NFVY-b1sdx96z.js → chunk-OSK3NFVY-oy0gwn2n.js} +1 -1
  482. package/static/dist/assets/{chunk-P2QGCYS3-fhu4nzxt.js → chunk-P2QGCYS3-onf1hz6c.js} +1 -1
  483. package/static/dist/assets/{chunk-POPQ4Y6H-em31rnef.js → chunk-POPQ4Y6H-m8sqn7cs.js} +1 -1
  484. package/static/dist/assets/{chunk-PWAF6VOD-bxhhyftw.js → chunk-PWAF6VOD-ek4smc8x.js} +1 -1
  485. package/static/dist/assets/{chunk-SHT3W25Y-fmrvwcav.js → chunk-SHT3W25Y-g9gfvefo.js} +3 -3
  486. package/static/dist/assets/{chunk-SVP7TREG-lymukl2j.js → chunk-SVP7TREG-f9nfv2cu.js} +1 -1
  487. package/static/dist/assets/{chunk-TICWLB2K-lmza6k23.js → chunk-TICWLB2K-bnk3m1mq.js} +1 -1
  488. package/static/dist/assets/classDiagram-ZZMXUADV-kmihoqxh.js +1 -0
  489. package/static/dist/assets/classDiagram-v2-VYDZK3BY-kmihoqxh.js +1 -0
  490. package/static/dist/assets/copied-bli9tbcx.js +1 -0
  491. package/static/dist/assets/{copy-fw5b1pc6.js → copy-jamtd1pf.js} +1 -1
  492. package/static/dist/assets/{cynefin-OW5HDTMX-czlhbyhs.js → cynefin-OW5HDTMX-f8xfdd3f.js} +1 -1
  493. package/static/dist/assets/{cynefinDiagram-5FMLGOSQ-gq7mvswb.js → cynefinDiagram-5FMLGOSQ-n9lb99h9.js} +1 -1
  494. package/static/dist/assets/{dagre-GXQ25YYZ-cqdbf7dr.js → dagre-GXQ25YYZ-dgailddi.js} +4 -4
  495. package/static/dist/assets/{diagram-S7CK7UJ4-o6arxa58.js → diagram-S7CK7UJ4-m6aeoe7c.js} +1 -1
  496. package/static/dist/assets/{diagram-UQ7AKVKN-nhnd68tz.js → diagram-UQ7AKVKN-jall3j0x.js} +1 -1
  497. package/static/dist/assets/{diagram-VSXAHHWV-dk2sclzn.js → diagram-VSXAHHWV-hbawi7hn.js} +1 -1
  498. package/static/dist/assets/{diagram-VX7I27RA-n3k5nyx3.js → diagram-VX7I27RA-hendl2tt.js} +1 -1
  499. package/static/dist/assets/{diagram-Z3DM3KII-m6q9cwdh.js → diagram-Z3DM3KII-igwc35p3.js} +1 -1
  500. package/static/dist/assets/{ebnfDiagram-PWID7BFC-lsa5641p.js → ebnfDiagram-PWID7BFC-c64knz08.js} +1 -1
  501. package/static/dist/assets/{erDiagram-RLTQ6QDP-fo2ckbe6.js → erDiagram-RLTQ6QDP-brdu9lcm.js} +1 -1
  502. package/static/dist/assets/eventmodeling-NTZA5JFV-njk1j8wl.js +1 -0
  503. package/static/dist/assets/flowDiagram-HODETNUW-nma6f0ga.js +1 -0
  504. package/static/dist/assets/folder-plus-lvt9kudb.js +1 -0
  505. package/static/dist/assets/{ganttDiagram-EL5Y4UJY-nzqz6x9g.js → ganttDiagram-EL5Y4UJY-ma6jxj5i.js} +1 -1
  506. package/static/dist/assets/{gitGraph-4MIJSDKK-gukvcxe6.js → gitGraph-4MIJSDKK-naa9w6xa.js} +1 -1
  507. package/static/dist/assets/{gitGraphDiagram-WWUBYQGX-lqhdp8f0.js → gitGraphDiagram-WWUBYQGX-hzltvsod.js} +1 -1
  508. package/static/dist/assets/{highlighted-body-KPVGNVTW-igw6cp39.js → highlighted-body-KPVGNVTW-ghoavj8d.js} +1 -1
  509. package/static/dist/assets/host-hzm8n85n.js +1 -0
  510. package/static/dist/assets/index-drdcaqeq.css +2 -0
  511. package/static/dist/assets/index-jzm844he.js +11 -0
  512. package/static/dist/assets/{info-A6RAGUB7-gvu7a93l.js → info-A6RAGUB7-mn2ut5ko.js} +1 -1
  513. package/static/dist/assets/{infoDiagram-27XIBGKW-m8t8g6w1.js → infoDiagram-27XIBGKW-h6kuqvsb.js} +1 -1
  514. package/static/dist/assets/{ishikawaDiagram-5VMMS53U-l07vkbgj.js → ishikawaDiagram-5VMMS53U-e7bnwq7h.js} +1 -1
  515. package/static/dist/assets/{journeyDiagram-3NMN7TZE-hybkgj8l.js → journeyDiagram-3NMN7TZE-etd1bi6p.js} +1 -1
  516. package/static/dist/assets/{kanban-definition-UXKFOSKX-by13uvtn.js → kanban-definition-UXKFOSKX-emb1g9dz.js} +4 -4
  517. package/static/dist/assets/lazyRouteComponent-o816ytzl.js +1 -0
  518. package/static/dist/assets/{line-osxq6fq7.js → line-h0ojzsvs.js} +1 -1
  519. package/static/dist/assets/link-k01ryaf9.js +1 -0
  520. package/static/dist/assets/login-bsae49ew.js +1 -0
  521. package/static/dist/assets/mermaid-HWGCJPDP-ihl34s74.js +1 -0
  522. package/static/dist/assets/{mermaid-parser.core-i91oxmou.js → mermaid-parser.core-bnre27u8.js} +3 -3
  523. package/static/dist/assets/{mindmap-definition-YA3MSWOX-m82mx8ww.js → mindmap-definition-YA3MSWOX-o1vathns.js} +1 -1
  524. package/static/dist/assets/onboarding-c65tysya.js +1 -0
  525. package/static/dist/assets/onboarding_model_label-gpn28uix.js +1 -0
  526. package/static/dist/assets/{packet-AYTQ26CC-nbtgge2o.js → packet-AYTQ26CC-hatq7m2e.js} +1 -1
  527. package/static/dist/assets/pcmTap.worklet-74EKjWAZ.js +1 -0
  528. package/static/dist/assets/{pegDiagram-XKGWAZYB-f1zxzga1.js → pegDiagram-XKGWAZYB-gwisz8jv.js} +1 -1
  529. package/static/dist/assets/{pie-WAS4IAKB-of8vuhxs.js → pie-WAS4IAKB-fpftf0mk.js} +1 -1
  530. package/static/dist/assets/{pieDiagram-E7YTZNPT-o7y8ftio.js → pieDiagram-E7YTZNPT-khm1o9a6.js} +1 -1
  531. package/static/dist/assets/{quadrantDiagram-AXDQQJYC-iqiwia1t.js → quadrantDiagram-AXDQQJYC-owqc4uqn.js} +1 -1
  532. package/static/dist/assets/{radar-RG4KPBEZ-delnsy2v.js → radar-RG4KPBEZ-cntfwjpq.js} +1 -1
  533. package/static/dist/assets/{railroad-74A4TZTK-nspnyq9u.js → railroad-74A4TZTK-a7t5eibp.js} +1 -1
  534. package/static/dist/assets/railroad-abnf-HS5TGJTU-ol8cdktf.js +1 -0
  535. package/static/dist/assets/railroad-ebnf-LZEXJU2U-i8vzd429.js +1 -0
  536. package/static/dist/assets/railroad-peg-WCYAUIDC-nw3ulewz.js +1 -0
  537. package/static/dist/assets/{railroadDiagram-O6MQD6OU-z41tqx5z.js → railroadDiagram-O6MQD6OU-etuh0qa0.js} +1 -1
  538. package/static/dist/assets/{refresh-cw-nt1dtsx4.js → refresh-cw-mqbkv2a3.js} +1 -1
  539. package/static/dist/assets/refresh-l29ljp76.js +1 -0
  540. package/static/dist/assets/{requirementDiagram-BXWQKSXE-bdvif194.js → requirementDiagram-BXWQKSXE-oq2ulk22.js} +1 -1
  541. package/static/dist/assets/{sankeyDiagram-P5KCCOFB-h73e0rol.js → sankeyDiagram-P5KCCOFB-iqc02emv.js} +1 -1
  542. package/static/dist/assets/saved-ndd4t2xb.js +1 -0
  543. package/static/dist/assets/{sequenceDiagram-WJ2MYXX4-iv95mb1z.js → sequenceDiagram-WJ2MYXX4-i0v116q0.js} +2 -2
  544. package/static/dist/assets/settings_section_extensions_title-jhfo6o8z.js +1 -0
  545. package/static/dist/assets/share._token-c1ri0hy1.js +2 -0
  546. package/static/dist/assets/sliders-horizontal-j3jjt9tv.js +1 -0
  547. package/static/dist/assets/{stateDiagram-D77RDMKH-k417ixmf.js → stateDiagram-D77RDMKH-dnpt1ato.js} +1 -1
  548. package/static/dist/assets/stateDiagram-v2-MP3YSRHH-bxjacpk6.js +1 -0
  549. package/static/dist/assets/{swimlanes-42K2YHIH-esola70w.js → swimlanes-42K2YHIH-loqbdazb.js} +1 -1
  550. package/static/dist/assets/swimlanesDiagram-VR7AAH4N-id62p9hz.js +8 -0
  551. package/static/dist/assets/{timeline-definition-24CTP7MA-getrz2y8.js → timeline-definition-24CTP7MA-ol2hnvma.js} +1 -1
  552. package/static/dist/assets/toast-i3h34v6o.js +64 -0
  553. package/static/dist/assets/{treeView-Q6P3EWNA-hc7ap1q7.js → treeView-Q6P3EWNA-idrj6iox.js} +1 -1
  554. package/static/dist/assets/{treemap-WGGIJYW6-b7k1syy5.js → treemap-WGGIJYW6-lzr49vv5.js} +1 -1
  555. package/static/dist/assets/untitled-oaoya4qj.js +1 -0
  556. package/static/dist/assets/useForm-nfaxgmsk.js +1 -0
  557. package/static/dist/assets/{useParams-lhg566ew.js → useParams-gjc70qru.js} +1 -1
  558. package/static/dist/assets/{useSearch-lbrh6ejn.js → useSearch-e6ae539u.js} +1 -1
  559. package/static/dist/assets/{vennDiagram-4TSXK5OY-n6pcy5qb.js → vennDiagram-4TSXK5OY-bvwr9o2z.js} +1 -1
  560. package/static/dist/assets/{wardley-WFR3VGLG-lpa18vz1.js → wardley-WFR3VGLG-31ui8tma.js} +1 -1
  561. package/static/dist/assets/{wardleyDiagram-VM6X3IG4-kpclwwg7.js → wardleyDiagram-VM6X3IG4-k5wqtx4b.js} +1 -1
  562. package/static/dist/assets/{xychartDiagram-S5SC5T6Z-paa2n8y0.js → xychartDiagram-S5SC5T6Z-aqbgvujg.js} +1 -1
  563. package/static/dist/index.html +1 -1
  564. package/static/dist/sw.js +1 -1
  565. package/static/dist/assets/AppShell-fb2td9zi.js +0 -1
  566. package/static/dist/assets/ChatPage-cj96kiy9.js +0 -25
  567. package/static/dist/assets/Dialog-kxcg7ard.js +0 -1
  568. package/static/dist/assets/ExtensionRoute-jf7h0754.js +0 -1
  569. package/static/dist/assets/HubRoute-gmanpd5y.js +0 -2
  570. package/static/dist/assets/Markdown-mdwlvj3w.js +0 -598
  571. package/static/dist/assets/RightPanel-ftvrjlcp.js +0 -1
  572. package/static/dist/assets/Select-bilaypej.js +0 -1
  573. package/static/dist/assets/SessionListPanel-og8n36qs.js +0 -1
  574. package/static/dist/assets/SettingsLayout-jonjefmj.js +0 -1
  575. package/static/dist/assets/States-nmejrwrm.js +0 -1
  576. package/static/dist/assets/Toaster-nnl8zkt9.js +0 -1
  577. package/static/dist/assets/_app-gdidzd94.js +0 -1
  578. package/static/dist/assets/_app.index-hbarzbjx.js +0 -1
  579. package/static/dist/assets/_app.insights-luywlarz.js +0 -1
  580. package/static/dist/assets/_app.kanban-kincnbr8.js +0 -1
  581. package/static/dist/assets/_app.logs-oi2gr3gs.js +0 -1
  582. package/static/dist/assets/_app.memory-b6jfivt6.js +0 -1
  583. package/static/dist/assets/_app.profiles-lpvixmqp.js +0 -1
  584. package/static/dist/assets/_app.settings-vowx3iq0.js +0 -1
  585. package/static/dist/assets/_app.settings._section-cnntg1tu.js +0 -3
  586. package/static/dist/assets/_app.skills-fb57lpau.js +0 -1
  587. package/static/dist/assets/_app.tasks-eszpx1q7.js +0 -2
  588. package/static/dist/assets/_app.todos-nr05ac6w.js +0 -1
  589. package/static/dist/assets/_app.workspaces-d2luomu6.js +0 -1
  590. package/static/dist/assets/architecture-7GRP2DOG-hd0o7bde.js +0 -1
  591. package/static/dist/assets/back-bemaer09.js +0 -1
  592. package/static/dist/assets/cancel-drd0g6d9.js +0 -1
  593. package/static/dist/assets/channel-cpdgf867.js +0 -1
  594. package/static/dist/assets/classDiagram-ZZMXUADV-ko09sguk.js +0 -1
  595. package/static/dist/assets/classDiagram-v2-VYDZK3BY-ko09sguk.js +0 -1
  596. package/static/dist/assets/copied-ima3pysb.js +0 -1
  597. package/static/dist/assets/endpoints-d33siokx.js +0 -64
  598. package/static/dist/assets/eventmodeling-NTZA5JFV-emctlo64.js +0 -1
  599. package/static/dist/assets/flowDiagram-HODETNUW-bfi3moqa.js +0 -1
  600. package/static/dist/assets/index-cxq58xb1.js +0 -11
  601. package/static/dist/assets/index-hgtx08n5.css +0 -2
  602. package/static/dist/assets/lazyRouteComponent-af0lvgjx.js +0 -1
  603. package/static/dist/assets/link-jyxicdhg.js +0 -1
  604. package/static/dist/assets/login-ec21t39x.js +0 -1
  605. package/static/dist/assets/mermaid-HWGCJPDP-gfl8z3ep.js +0 -1
  606. package/static/dist/assets/onboarding-btnltvyz.js +0 -1
  607. package/static/dist/assets/onboarding_model_label-dp7xffoh.js +0 -1
  608. package/static/dist/assets/railroad-abnf-HS5TGJTU-nst1qxyn.js +0 -1
  609. package/static/dist/assets/railroad-ebnf-LZEXJU2U-ci37x8qy.js +0 -1
  610. package/static/dist/assets/railroad-peg-WCYAUIDC-aimkk07z.js +0 -1
  611. package/static/dist/assets/refresh-b4uams1i.js +0 -1
  612. package/static/dist/assets/saved-kg52csy7.js +0 -1
  613. package/static/dist/assets/settings_section_extensions_title-ej0iapxe.js +0 -1
  614. package/static/dist/assets/share._token-f97e94r0.js +0 -2
  615. package/static/dist/assets/sliders-horizontal-fj18it47.js +0 -1
  616. package/static/dist/assets/sse-fwpqtzbg.js +0 -1
  617. package/static/dist/assets/stateDiagram-v2-MP3YSRHH-hwn4apct.js +0 -1
  618. package/static/dist/assets/swimlanesDiagram-VR7AAH4N-d1h97oyg.js +0 -8
  619. package/static/dist/assets/todoStore-eginf9h4.js +0 -1
  620. package/static/dist/assets/tts-lxdxnmjd.js +0 -1
  621. package/static/dist/assets/untitled-ovpfthg4.js +0 -1
  622. package/static/dist/assets/useForm-bcblv1rx.js +0 -1
  623. package/static/dist/assets/useLocale-fi5jb8ma.js +0 -1
@@ -3,7 +3,7 @@
3
3
  * detail payload, list and search, and every mutation with its guards.
4
4
  * Runtime concerns owned by other domains arrive through `SessionServiceDeps`.
5
5
  */
6
- import type { PendingSteer } from '@maudecode/talaria-web-contracts';
6
+ import type { AgentStorage, ChatReadiness, PendingSteer, RecoveryAudit, RunStatus, SessionGoal, SessionNotice, RecoveryRepair, SidecarResult } from '@maudecode/talaria-web-contracts';
7
7
  import type { RunJournal } from './journal.js';
8
8
  import type { DraftStore } from './drafts.js';
9
9
  import type { SessionEventBus } from './events.js';
@@ -11,7 +11,7 @@ import { type ListParams, type ListResponse, type Row, type RuntimeOverlay } fro
11
11
  import { Session, titleFrom, type Message } from './session.js';
12
12
  import { type SessionStore } from './store.js';
13
13
  import { type ClaudeCodeSessionSource } from './claude-code.js';
14
- import { type StateDbRead } from './state-db.js';
14
+ import { type StateDbRead, type StateDbSessionSource } from './state-db.js';
15
15
  import { type CompressionJob } from './compress.js';
16
16
  import { type SidecarLike } from '../sidecar/client.js';
17
17
  import { type ToolResultView } from './merge.js';
@@ -21,6 +21,7 @@ import { type ShareStore } from './shares.js';
21
21
  import { type MediaAccessDeps } from '../workspace/media.js';
22
22
  import { type MediaProjection } from '../workspace/media-refs.js';
23
23
  import type { ProjectStore } from '../projects.js';
24
+ import type { GatewaySessions } from './gateway-sessions.js';
24
25
  export declare class HttpFailure extends Error {
25
26
  readonly status: number;
26
27
  readonly extra: Record<string, unknown>;
@@ -31,7 +32,15 @@ export declare class HttpFailure extends Error {
31
32
  * mutates anything. Any other failure of the check is not a verdict and lets the caller proceed.
32
33
  */
33
34
  export declare function ensureAgentRuntimeCurrent(sidecar: SidecarLike | null): Promise<void>;
35
+ /**
36
+ * TAL-951: whether a chat turn would be admitted now. Ready and source-stale incompatible sidecars both run turn
37
+ * admission's live check: recovery state can change after the handshake. A check
38
+ * that cannot answer fails closed as `sidecar_unavailable`.
39
+ */
40
+ export declare function currentChatReadiness(sidecar: SidecarLike | null): Promise<ChatReadiness>;
34
41
  export interface SessionServiceDeps {
42
+ /** TAL-259: epoch seconds of the state directory's `recovery_stamping_since` marker. */
43
+ recoveryStampingSince: () => Promise<number>;
35
44
  /** TAL-255: the Agent sidecar for manual compression (`chat.compress`); null while it is down. */
36
45
  sidecar?: () => SidecarLike | null;
37
46
  /** Detached sidecar work for a profile: deletion waits for the returned release, so the home outlives the work. */
@@ -39,7 +48,8 @@ export interface SessionServiceDeps {
39
48
  /** A profile whose deletion has started takes no new detached work. */
40
49
  profileDeleting?: (profile: string | null) => boolean;
41
50
  /** TAL-372: the session's background work receipts, for the delegation rows that started them. */
42
- backgroundReceipts?: (sid: string) => Receipt[];
51
+ backgroundReceipts?: (sid: string) => Receipt[] | Promise<Receipt[]>;
52
+ backgroundPending?: (sid: string) => Promise<Set<string>>;
43
53
  store: SessionStore;
44
54
  drafts: DraftStore;
45
55
  events: SessionEventBus;
@@ -62,21 +72,34 @@ export interface SessionServiceDeps {
62
72
  journalDegraded: (streamId: string) => boolean;
63
73
  /** TAL-424: the live stream's pending steers, as clients show them. */
64
74
  pendingSteers?: (streamId: string) => PendingSteer[];
75
+ /** The live stream's server-selected presentation, else null. */
76
+ runStatus?: (streamId: string) => RunStatus | null;
77
+ /** TAL-1006: the live stream's open compression span start (epoch seconds), else null. */
78
+ compressionStartedAt?: (streamId: string) => number | null;
79
+ /** TAL-899: whether a Stop holds the session's automatic turns until the user's next turn. */
80
+ automaticTurnsHeld?: (sid: string) => Promise<boolean>;
81
+ sessionNotices?: (sid: string) => SessionNotice[];
82
+ sessionGoal?: (sid: string) => SessionGoal | null;
65
83
  /** Drop the session's cached agent; `endSession` (delete/clear) also ends its approval grants and parked approvals. */
66
- evictAgent: (sid: string, endSession?: boolean) => void;
84
+ evictAgent: (sid: string, endSession?: boolean) => Promise<void>;
67
85
  closeTerminal: (sid: string) => void;
68
- /** Python `delete_cli_session`: remove the session's rows from the profile's state.db; resolves false on failure. */
69
- deleteCliSession: (profile: string | null, sid: string) => Promise<boolean>;
86
+ /**
87
+ * Python `delete_cli_session`: remove the session and its compression continuations from the profile's state.db in one
88
+ * transaction; `ok` is false on failure, with `refused` when another Agent process holds any of them (TAL-792).
89
+ */
90
+ deleteCliSession: (profile: string | null, sid: string) => Promise<SidecarResult<'state_db.delete_cli_session'>>;
70
91
  };
71
92
  attachmentDir: (sid: string) => string;
72
93
  /** A deleted session can never be viewed, so its finished runs are cleared from the relay. */
73
- clearRelayCompletions?: (sid: string, profile: string | null) => void;
94
+ clearRelayCompletions?: (sid: string, profile: string | null) => Promise<void>;
74
95
  /** Run journals are removed with their session (Python `delete_run_journal`). */
75
96
  journal?: RunJournal;
76
97
  hermesHome: string;
77
98
  home: string;
78
- /** Sync title-only metadata to state.db when `sync_to_insights` is on. */
79
- syncTitle: (session: Session) => Promise<void>;
99
+ /** Sync title-only metadata to state.db when `sync_to_insights` is on; `manual` marks a user-requested title (rename or regenerate). */
100
+ syncTitle: (session: Session, manual?: boolean) => Promise<void>;
101
+ /** TAL-591: the background title job for a CLI session a mutation just claimed (Python `import_cli` queued one). */
102
+ titleClaimed?: (session: Session) => void;
80
103
  /** Context length lookup for a model (checkpoint 7 wires the catalog). */
81
104
  contextLengthFor: (model: string | null, provider: string | null) => number | null;
82
105
  /** TAL-301: the catalog entry id a stored `(model, provider)` pair selects (null when none or not yet known). */
@@ -99,15 +122,25 @@ export interface SessionServiceDeps {
99
122
  /** `truncated`: source kinds whose rows stopped at the per-kind window on this read (TAL-482). */
100
123
  cliSessions: (profile: string, opts: {
101
124
  sourceFilter: string | null;
102
- }) => {
125
+ sessionIds?: readonly string[];
126
+ }) => Promise<{
103
127
  rows: Row[];
104
128
  truncated: ReadonlySet<string>;
105
- };
129
+ storage: AgentStorage;
130
+ }>;
131
+ /** `cliSessions` read on this thread, for the synchronous single-session lookups. */
132
+ cliSessionsSync: (profile: string, opts: {
133
+ sourceFilter: string | null;
134
+ sessionIds?: readonly string[];
135
+ }) => Promise<{
136
+ rows: Row[];
137
+ truncated: ReadonlySet<string>;
138
+ }>;
106
139
  /** TAL-551: read-only Claude Code transcripts, listed with the CLI rows when both toggles are on. */
107
140
  claudeCode?: ClaudeCodeSessionSource;
108
141
  profileHome: (profile: string) => string;
109
142
  /** Python `commit_session_memory` (fire-and-forget): the cached Agent flushes memory for a session the user left. */
110
- commitSessionMemory?: (sid: string) => void;
143
+ commitSessionMemory?: (sid: string) => Promise<void>;
111
144
  /** TAL-186: the `/api/media` allow-list the transcript media projection rewrites against; without it nothing local is rewritten. */
112
145
  media?: {
113
146
  access: MediaAccessDeps;
@@ -116,15 +149,25 @@ export interface SessionServiceDeps {
116
149
  }
117
150
  export declare class SessionService {
118
151
  readonly deps: SessionServiceDeps;
152
+ owner: GatewaySessions | null;
119
153
  /** TAL-255: one manual compression worker per session, shared by every compress route. */
120
154
  private readonly compressionJobs;
155
+ /** TAL-1005: the turns now waiting on their session's compression job before they read its history. */
156
+ private readonly compactionWaiters;
121
157
  constructor(deps: SessionServiceDeps);
122
158
  private get store();
159
+ /**
160
+ * User-turn admission shared by `chat.start` and automatic turns through `TurnRunner.startServerTurn`.
161
+ * A requested workspace must be trusted; the session's own one, when its directory is gone, falls back to the last one.
162
+ */
163
+ turnWorkspace(s: Session, requested?: unknown): Promise<string>;
164
+ /** A `@provider:` id is split; any other model an explicit pick did not just choose is checked against the catalog (TAL-542). */
165
+ turnModel(s: Session, body?: Record<string, unknown>): [string | null, string | null, boolean];
123
166
  /**
124
167
  * TAL-186: rewrites a session's media references to their URLs. A local path is rewritten only when `/api/media`
125
168
  * serves it for this session, under the same resolution, so every rewritten reference loads.
126
169
  */
127
- mediaProjector(s: Session): (text: string) => MediaProjection | null;
170
+ mediaProjector(s: Session): Promise<(text: string) => MediaProjection | null>;
128
171
  publish(reason: string, profile?: string | null, sessionId?: string | null): void;
129
172
  visibleToActiveProfile(profile: string | null | undefined): boolean;
130
173
  /**
@@ -132,22 +175,50 @@ export declare class SessionService {
132
175
  * not slip past the profile check into a handler that trims and trusts it. A non-empty id that is still unsafe after
133
176
  * trimming can name no session and is refused here instead of falling through.
134
177
  */
135
- sessionIdVisible(raw: unknown): boolean;
178
+ sessionIdVisible(raw: unknown): Promise<boolean>;
179
+ private localTargets;
180
+ /** One receipt-backed physical target for every operation on a local conversation alias. */
181
+ resolveSessionId(sid: string): string;
136
182
  /** Python `_lookup_cli_session_metadata(...).get('read_only')` plus the persisted sidecar flag and a not-claimable foreign owner. */
137
183
  private isReadOnlyImport;
138
184
  /** Python `_session_is_subagent_view_only`: a delegated child by any signal — the persisted sidecar or the state.db row. */
139
- isSubagentViewOnly(sid: string): boolean;
185
+ isSubagentViewOnly(sid: string): Promise<boolean>;
140
186
  /** TAL-358: batched `sessions.source` owners from the active profile's state.db. */
141
- readonly stateDbSources: (ids: string[]) => Map<string, string> | null;
187
+ readonly stateDbSources: (ids: string[], profile?: string) => Map<string, StateDbSessionSource> | null;
188
+ /**
189
+ * TAL-590 (Python #3238): the read-only CLI or API-server imports among `rows` whose active-profile state.db row is
190
+ * gone, so their source was deleted outside Web and no Web action could remove them. An unreadable state.db proves
191
+ * nothing (`agentSessionRowsExisting`); another profile's session or one with a run the runtime still holds is never
192
+ * an orphan, while a stream id a crash left behind does not count as one.
193
+ */
194
+ private orphanedImports;
195
+ private orphanCandidates;
196
+ private isOrphanedImport;
197
+ /**
198
+ * The list's owner locks and orphan prune (an orphan's sidecar goes, as nothing else ever removes it), with their
199
+ * state.db reads made on the listing worker up front so the synchronous build never opens state.db (TAL-920).
200
+ */
201
+ private listStateDbLookups;
142
202
  /** The persisted flag folded with the state.db owner lock (TAL-358): the one read-only rule for mutation gates and the wire. */
143
- isReadOnly(s: Session): boolean;
203
+ readOnlyReason(s: Session | string, profile?: string): Promise<string | null>;
204
+ private loadedReadOnlyReason;
205
+ /** A loaded session's final owner check stays synchronous with the protected sidecar dispatch. */
206
+ assertWritable(session: Session, profile?: string): void;
207
+ assertWritable(session: string, profile?: string): Promise<void>;
208
+ /** Controls can exist without a local session file; use the same id the sidecar will address. */
209
+ idForMutation(sid: string): Promise<string>;
210
+ isReadOnly(s: Session): Promise<boolean>;
211
+ /** Recheck after the mutex wait; legacy local metadata/handoff actions keep their existing read-only allowance. */
212
+ private withMutationLock;
144
213
  /** Full session for mutation, refusing read-only imports (Python `_get_or_materialize_session`). */
145
- getForMutation(sid: string): Session;
214
+ getForMutation(sid: string): Promise<Session>;
146
215
  private get404;
147
216
  /** The Agent's state.db rows for this session (empty for subagent views, which never merge). */
148
217
  stateDbRows(s: Session): Message[];
149
218
  /** `stateDbRows` and whether the read succeeded on a state.db whose messages carry ids (TAL-493). */
150
219
  stateDbRead(s: Session): StateDbRead;
220
+ /** Preserve existing transcript provenance before a turn adds Agent rows from its starting database read. */
221
+ beginStateDbTurn(s: Session): StateDbRead;
151
222
  private stateDbPath;
152
223
  /**
153
224
  * Python `_merged_session_messages_for_display`: the sidecar transcript merged append-only with the Agent's state.db
@@ -176,7 +247,23 @@ export declare class SessionService {
176
247
  previousContext: Message[];
177
248
  agentRows?: Message[] | null;
178
249
  startId?: number | null;
250
+ startGeneration?: string | null;
251
+ read?: StateDbRead;
179
252
  }): void;
253
+ /**
254
+ * TAL-921: the model context a turn leaves when it ends without its settled result (an error, a Stop, a dead run), as a
255
+ * Stop's: the Agent's rows when they hold the turn's prompt, else its own rows among `stateRows` (the state.db rows
256
+ * committed after it started), then the prose that streamed past them. Null when it captured nothing the model can use.
257
+ */
258
+ unsettledTurnContext(turn: {
259
+ previousContext: Message[];
260
+ prompt: string | Record<string, unknown>[];
261
+ msgText: string;
262
+ streamedText: string;
263
+ historyLength: number;
264
+ agentRows?: Message[] | null;
265
+ stateRows: Message[];
266
+ }): Message[] | null;
180
267
  /**
181
268
  * Python `reconciled_state_db_messages_for_session(prefer_context=True)`: the model history is the owner context
182
269
  * extended append-only with the Agent's state.db rows (a CLI continuation of this session reaches the model), except
@@ -188,6 +275,8 @@ export declare class SessionService {
188
275
  * deferred save keeps out of `messages` and `context_messages` until settlement.
189
276
  */
190
277
  sideQuestionContext(s: Session): Message[];
278
+ /** Python `_is_messaging_session_id`: from the WebUI metadata or the Agent's row. */
279
+ private isMessagingSession;
191
280
  /** Python `_lookup_cli_session_metadata`: the sidebar row for a state.db session in the active profile. */
192
281
  private lookupCliMeta;
193
282
  private claudeCodeRows;
@@ -198,43 +287,59 @@ export declare class SessionService {
198
287
  * a WebUI sidecar. `materialized` sessions are writeable (the caller persists the sidecar), `not_claimable` ones are
199
288
  * read-only stubs, `was_webui`/`no_foreign_state`/`invalid_sid` answer 404.
200
289
  */
201
- claimOrSynthesizeCliSession(sid: string, metaIn?: Row | null): {
290
+ claimOrSynthesizeCliSession(sid: string, metaIn?: Row | null): Promise<{
202
291
  session: Session | null;
203
292
  reason: 'materialized' | 'not_claimable' | 'was_webui' | 'no_foreign_state' | 'invalid_sid';
204
- };
293
+ }>;
205
294
  private mutationTarget;
206
295
  /**
207
296
  * TAL-551: a Claude Code import is a live view of a transcript Claude Code keeps writing. Web never stores a copy,
208
297
  * which would freeze its messages and pin it to one profile.
209
298
  */
210
299
  private rejectClaudeCode;
211
- private rejectSubagent;
300
+ private rejectViewOnly;
301
+ /** All transcript transports use the same live-run and durable-pending evidence. */
302
+ backgroundUpdates<T>(s: Session, messages: T[], reviewRows?: (turnId: string) => Message[]): Promise<T[]>;
212
303
  /** TAL-372: each delegation row of a turn's scene carries the status of the work it started. */
213
- backgroundLinked(s: Session, messages: unknown[]): unknown[];
304
+ backgroundLinked(s: Session, messages: unknown[]): Promise<unknown[]>;
214
305
  /** `compact()` plus messages, redacted for the wire (Python `_public_session_projection`). */
215
- publicSession(s: Session, withMessages?: boolean): Record<string, unknown>;
306
+ publicSession(s: Session, withMessages?: boolean, messages?: Message[]): Promise<Record<string, unknown>>;
216
307
  /** `compact()` with the wire streaming/read-only flags (TAL-312), for replies that return the session row. */
217
- wireRow(s: Session): Record<string, unknown>;
308
+ wireRow(s: Session): Promise<Record<string, unknown>>;
218
309
  /**
219
310
  * TAL-303: the label for a session's workspace, from its own profile's registry (a profileless row is the root's).
220
311
  * One resolver serves one response, so each profile's registry is read once however many rows it names.
221
312
  */
222
- workspaceNames(): (row: {
313
+ workspaceNames(rows: readonly {
223
314
  profile?: unknown;
224
315
  workspace?: unknown;
225
- }) => string | null;
316
+ }[]): Promise<(row: {
317
+ profile?: unknown;
318
+ workspace?: unknown;
319
+ }) => string | null>;
226
320
  /** The agent's display name for a session's profile (`assistant_name`). */
227
321
  assistantName(s: Session): string;
228
322
  /** Python `public_session_projection(s.__dict__)`: every persisted field, redacted (session export). */
229
323
  publicSessionDocument(s: Session): Record<string, unknown>;
230
324
  private loadRevision;
325
+ private readonly pageTails;
326
+ private readonly pageContexts;
327
+ private prefixIndex;
328
+ /** Existing projections, once per complete turn range, in absolute transcript coordinates. */
329
+ private deriveRange;
330
+ private limitedDetail;
231
331
  /** Python `_handle_session_get` on the WebUI sidecar (state.db merge pending). */
232
332
  detail(sid: string, query: {
233
333
  messages?: string | null | undefined;
234
334
  msg_limit?: string | null | undefined;
235
335
  msg_before?: string | null | undefined;
236
336
  resolve_model?: string | null | undefined;
237
- }): Record<string, unknown>;
337
+ }): Promise<Record<string, unknown>>;
338
+ /**
339
+ * TAL-454: the chat `/branch` copied, while it still loads (archived included). A compression continuation is also a
340
+ * fork of its parent but not a branch, so it links nowhere.
341
+ */
342
+ private branchedFrom;
238
343
  /**
239
344
  * TAL-316: the active run whose journal can replay its output from the start. The detail then leaves that output to the
240
345
  * replay; with no active run, no identifiable prompt, or no complete journal, it returns the persisted transcript unchanged.
@@ -245,18 +350,21 @@ export declare class SessionService {
245
350
  /** A session without a sidecar, synthesized from state.db for this profile; 404/409 like the detail. */
246
351
  private foreignSession;
247
352
  /** Python `_handle_session_get` without a sidecar: the state.db transcript as a (read-only or claimable) foreign stub. */
353
+ foreignMessages(messages: Message[], session: object): Message[];
248
354
  private foreignSessionDetail;
249
355
  /** Clear persisted streaming flags when no live stream backs them (Python `_clear_stale_stream_state`). */
250
- clearStaleStreamState(session: Session): boolean;
251
- list(params: Omit<ListParams, 'activeProfile' | 'isolatedProfileMode' | 'profilesMatch' | 'cliRows' | 'gatewayIdentity' | 'stateDbSources' | 'truncatedSources'>): {
356
+ clearStaleStreamState(session: Session): Promise<boolean>;
357
+ /** Expand saved aliases in one worker query independently of the bounded native sidebar window. */
358
+ private persistedAliasMetadata;
359
+ list(params: Omit<ListParams, 'activeProfile' | 'isolatedProfileMode' | 'profilesMatch' | 'cliRows' | 'gatewayIdentity' | 'stateDbSources' | 'truncatedSources' | 'agentStorage' | 'pruneOrphanedImports' | 'webuiRows'>): Promise<{
252
360
  body: ListResponse;
253
361
  etag: string;
254
- };
362
+ }>;
255
363
  search(q: string, opts: {
256
364
  content: boolean;
257
365
  depth: number;
258
366
  allProfiles: boolean;
259
- }): Record<string, unknown>;
367
+ }): Promise<Record<string, unknown>>;
260
368
  /**
261
369
  * TAL-308: the sidebar search. The candidates are exactly the `/api/sessions` rows for `params` (visibility, source,
262
370
  * archived, projection and order), narrowed to `projectId` (`none`: rows without a project), then matched on the
@@ -266,12 +374,12 @@ export declare class SessionService {
266
374
  content: boolean;
267
375
  depth: number;
268
376
  projectId: string | null;
269
- }): Record<string, unknown>;
377
+ }): Promise<Record<string, unknown>>;
270
378
  /** The first of a stored session's first `depth` messages (0: all) containing every term, with its redacted excerpt. */
271
379
  private contentMatch;
272
- status(sid: string): Record<string, unknown>;
273
- usage(sid: string): Record<string, unknown>;
274
- resolveNewSessionWorkspace(body: Record<string, unknown>, visiblePrevSessionId: string | null, profile: string | null): string | null;
380
+ status(sid: string): Promise<Record<string, unknown>>;
381
+ usage(sid: string): Promise<Record<string, unknown>>;
382
+ resolveNewSessionWorkspace(body: Record<string, unknown>, visiblePrevSessionId: string | null, profile: string | null): Promise<string | null>;
275
383
  /** The server owns the names' normalization (TAL-631): trimmed, blanks dropped, and nothing left is the profile's defaults. */
276
384
  validateToolsetsShape(toolsets: unknown): string[] | null;
277
385
  create(body: Record<string, unknown>, opts?: {
@@ -281,7 +389,7 @@ export declare class SessionService {
281
389
  repo_root: string;
282
390
  created_at: number;
283
391
  } | null;
284
- }): Session;
392
+ }): Promise<Session>;
285
393
  /** Python `_persist_generated_session_title`: title + generated/manual flags under the session lock, then insights sync. */
286
394
  persistGeneratedTitle(sid: string, nextTitle: string, eventReason: string): Promise<Session>;
287
395
  rename(sid: string, rawTitle: unknown): Promise<Record<string, unknown>>;
@@ -290,58 +398,155 @@ export declare class SessionService {
290
398
  private pinUnserialized;
291
399
  archive(sid: string, archived: boolean): Promise<Record<string, unknown>>;
292
400
  move(sid: string, targetProjectId: string | null): Promise<Record<string, unknown>>;
401
+ private readonly modelConfirmationKey;
402
+ private confirmModelSwitch;
293
403
  update(sid: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
294
404
  setToolsets(sid: string, toolsets: unknown): Promise<Record<string, unknown>>;
295
405
  /** Python `/api/personality/set` persistence: the name only; the prompt is resolved by the caller. */
296
406
  setPersonality(sid: string, name: string | null): Promise<string | null>;
297
- truncate(sid: string, keepRaw: unknown): Promise<Record<string, unknown>>;
407
+ /**
408
+ * TAL-929: under a `hold`, a cut that discards more than one user turn changes nothing and answers with its counts,
409
+ * unless `confirmToken` is the token of the rows it would remove now: a transcript that changed since asks again.
410
+ * Without one (a released App, which asked on the device) the cut proceeds as before.
411
+ */
412
+ truncate(sid: string, keepRaw: unknown, hold?: {
413
+ confirmToken: string | null;
414
+ } | null): Promise<Record<string, unknown>>;
415
+ /**
416
+ * TAL-929: the confirmation a cut at `keep` needs, or null for one that removes at most one user turn. Counted on the rows
417
+ * the detail shows, state.db continuation included, since `keep` indexes them: the user turns the cut removes, and the
418
+ * messages after the row it starts at.
419
+ */
420
+ private heldCut;
298
421
  /**
299
422
  * Python `_handle_session_compress_start`: validate, then join the session's running job or start a fresh one (a
300
423
  * finished job is replaced). The stale-runtime refusal comes before a job exists; a running job is joined without it.
301
424
  */
302
- startCompression(sid: string, focusRaw: unknown): Promise<CompressionJob>;
425
+ startCompression(sid: string, focusRaw: unknown, opts?: {
426
+ automatic?: boolean;
427
+ }): Promise<CompressionJob>;
428
+ /**
429
+ * TAL-1005: compact the session in its joinable compression job before the next turn reads its history. A running job
430
+ * is always joined; a new one starts when the session is `due` (`compactionDue`, read from the store when omitted).
431
+ * `turn` is the waiting turn's stream: the job leaves its rows alone. `onWait` runs once a job is being waited on; an abort of `signal` (the turn's Stop) ends the wait but not the
432
+ * job. True when the job installed a compressed context. Never throws: a failed job leaves the Agent's own preflight.
433
+ */
434
+ ensureCompacted(sid: string, opts?: {
435
+ turn?: string;
436
+ signal?: AbortSignal;
437
+ onWait?: () => void | Promise<void>;
438
+ due?: boolean;
439
+ }): Promise<boolean>;
440
+ /**
441
+ * TAL-1005: measure the model context again when it holds a post-compression estimate the rows after it may have
442
+ * outgrown (a waiting turn's prompt, a stopped or failed turn's work). Skipped while a turn owns the session, which
443
+ * settles its own figures, or once the estimate changed meanwhile. True when it stored a new estimate.
444
+ */
445
+ remeasureContext(sid: string): Promise<boolean>;
446
+ private storedCompactionDue;
447
+ /** Whether the session's context (the post-compression estimate, else the last prompt) reached the next turn's threshold. */
448
+ compactionDue(s: Session): boolean;
303
449
  /** The session a compression may run on now, and the model history it compresses: the context a turn would send, so a
304
- * repeat compression builds on the previous summary instead of re-reading the whole display transcript. */
450
+ * repeat compression builds on the previous summary instead of re-reading the whole display transcript. `context` is
451
+ * that history unsanitized and `stateRows` the state.db read it came from. */
305
452
  private compressionTarget;
453
+ /**
454
+ * The loaded session's own compression guards: no running turn and enough model history. TAL-1005: a turn waiting on
455
+ * the compression has not read its history yet, so it does not block; the context leaves out its rows, as it does.
456
+ */
457
+ private compressionContext;
458
+ /** TAL-614: whether a manual compression would start now: `compressionTarget`'s gates, with `readOnly` the wire flag. */
459
+ private canCompress;
460
+ /** TAL-258: the session's WebUI record (absent for a CLI or gateway session) and the profile whose state.db holds its rows. */
461
+ private handoffTarget;
462
+ /** Python `_handle_conversation_rounds` (TAL-258): the session's rounds and whether the handoff dock is due. */
463
+ conversationRounds(sid: string, since: number | null): Promise<{
464
+ ok: true;
465
+ rounds: number;
466
+ threshold: number;
467
+ should_show: boolean;
468
+ }>;
469
+ /**
470
+ * Python `_handle_handoff_summary` (TAL-258): the session's main model summarizes its last 50 state.db messages after
471
+ * `since`, and the summary is appended as a display-only `handoff_summary` tool row. A failed or cut-off answer falls
472
+ * back to a deterministic local summary rather than an error.
473
+ */
474
+ handoffSummary(sid: string, since: number | null): Promise<{
475
+ ok: true;
476
+ summary: string;
477
+ message_count: number;
478
+ rounds: number;
479
+ fallback: boolean;
480
+ warning?: string;
481
+ }>;
482
+ /** The main model's summary at 700 tokens, once more at 1400 when it was cut off, else the local fallback. */
483
+ private generateHandoffSummary;
484
+ /**
485
+ * Python `_persist_handoff_summary`: a messaging session gets the marker in state.db and its WebUI record; any other
486
+ * session in its WebUI record, or in state.db when it has none. Each store skips a marker its tail already holds, and
487
+ * the session lock keeps two summaries from both passing that check. A card neither store saved answers 503.
488
+ */
489
+ private persistHandoffMarker;
490
+ /** The same live presentation for session detail and journal snapshot recovery. */
491
+ currentRunStatus(sid: string, streamId: string | null): RunStatus | null;
306
492
  /** The session's compression job; a deleted session's finished result is dropped rather than served. */
307
- compressionJob(sid: string): CompressionJob | undefined;
493
+ compressionJob(sid: string): Promise<CompressionJob | undefined>;
308
494
  /**
309
495
  * Python `_handle_session_compress`: compress the sanitized transcript in the sidecar outside the lock, then under the
310
- * session lock refuse a result the session moved past (stream state or transcript changed) and install it as the
496
+ * session lock refuse a result the session moved past (another stream, or a transcript changed) and install it as the
311
497
  * model context with the manual anchor and the #4836 boundary that keeps state.db from replaying compressed rows.
312
- * The guards run again first: a stream may have started while the caller awaited the runtime check.
498
+ * The guards run again first: a stream may have started while the caller awaited the runtime check. TAL-1005: rows
499
+ * the job's waiting turns added meanwhile (a prompt, a Stop) stay after the compressed context.
313
500
  */
314
501
  private compressSession;
502
+ /** Clear and delete share the profile-scoped, best-effort Agent session boundary. */
503
+ private finalizeSession;
315
504
  clear(sid: string): Promise<Record<string, unknown>>;
316
505
  retry(sid: string): Promise<Record<string, unknown>>;
317
506
  undo(sid: string): Promise<Record<string, unknown>>;
318
- duplicate(sid: string): Record<string, unknown>;
319
- branch(sid: string, body: Record<string, unknown>): Record<string, unknown>;
507
+ duplicate(sid: string): Promise<Record<string, unknown>>;
508
+ branch(sid: string, body: Record<string, unknown>): Promise<Record<string, unknown>>;
509
+ /** Python `read_session_lineage_report` on the active profile's state.db. */
510
+ lineageReport(sid: string): Record<string, unknown>;
511
+ /** TAL-259: recovery reads the active profile's state.db, and a recovered sidecar joins that profile. */
512
+ private recoveryDeps;
513
+ recoveryAudit(): Promise<RecoveryAudit>;
514
+ recoveryRepairSafe(): Promise<RecoveryRepair>;
515
+ /**
516
+ * Python `_handle_session_compression_recovery_start`: open a compression-exhausted session's focused continuation, an
517
+ * empty fork keeping its workspace, model, profile, toolsets and worktree. A retry opens the oldest continuation
518
+ * already started from it in the same profile; the source's lock makes concurrent starts converge on one child.
519
+ */
520
+ compressionRecoveryStart(sid: string): Promise<Record<string, unknown>>;
521
+ /** Python `find_compression_recovery_session`: the oldest same-profile continuation started from `sid`, cached or persisted. */
522
+ private compressionRecoveryChild;
320
523
  /** The run that keeps `delete` answering 409, if any; stream status reports it so a draining client can wait on it (TAL-622). */
321
- activeRunBlocking(sid: string): string | null;
524
+ activeRunBlocking(sid: string): Promise<string | null>;
322
525
  delete(sid: string): Promise<Record<string, unknown>>;
323
- cleanup(zeroOnly: boolean): Record<string, unknown>;
324
- import(body: Record<string, unknown>): Record<string, unknown>;
325
- readDraft(sid: string): Record<string, unknown>;
526
+ /** The committed Agent deletion targets and cleanup outcome; throws 409 `refused` while an Agent process holds a row. */
527
+ private deleteStateDbRows;
528
+ cleanup(zeroOnly: boolean): Promise<Record<string, unknown>>;
529
+ import(body: Record<string, unknown>): Promise<Record<string, unknown>>;
530
+ readDraft(sid: string): Promise<Record<string, unknown>>;
326
531
  writeDraft(body: Record<string, unknown>): Promise<Record<string, unknown>>;
327
532
  saveAnchorScene(body: Record<string, unknown>): Promise<Record<string, unknown>>;
328
533
  /** The session and the full transcript its detail is built from; a state.db-only session gives its synthesized one. */
329
534
  private fullTranscript;
330
- readAnchorScene(query: Record<string, string | null | undefined>): Record<string, unknown>;
535
+ readAnchorScene(query: Record<string, string | null | undefined>): Promise<Record<string, unknown>>;
331
536
  /** TAL-331: one tool call's whole result, which a limited response clipped (`result_truncated`), redacted like the detail. */
332
537
  readToolResult(query: {
333
538
  session_id: string;
334
539
  tool_call_id: string;
335
- }): {
540
+ }): Promise<{
336
541
  tool_call_id: string;
337
542
  result: string;
338
543
  result_view: ToolResultView;
339
- };
340
- createShare(sid: string): Record<string, unknown>;
341
- revokeShare(sid: string): Record<string, unknown>;
342
- loadShare(token: string): Record<string, unknown>;
544
+ }>;
545
+ createShare(sid: string): Promise<Record<string, unknown>>;
546
+ revokeShare(sid: string): Promise<Record<string, unknown>>;
547
+ loadShare(token: string): Promise<Record<string, unknown>>;
343
548
  yolo(sid: string): Record<string, unknown>;
344
- setYolo(sid: string, enabled: boolean): Record<string, unknown>;
549
+ setYolo(sid: string, enabled: boolean): Promise<Record<string, unknown>>;
345
550
  }
346
551
  export declare const AUTO_TITLE_LABELS: Set<string>;
347
552
  /** Python `apply_session_title_rename`. */