@circuitwall/jarela 2.2.1 → 2.3.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 (651) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +6 -5
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/routes-manifest.json +8 -0
  6. package/.next/standalone/.next/server/app/_global-error/page.js +68 -68
  7. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page.js +76 -76
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +93 -93
  22. package/.next/standalone/.next/server/app/api/v1/access/route.js +169 -169
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +82 -56
  24. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +122 -122
  26. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +100 -100
  27. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +753 -753
  28. package/.next/standalone/.next/server/app/api/v1/agents/route.js +65 -65
  29. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +364 -364
  30. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +802 -802
  31. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +2 -2
  32. package/.next/standalone/.next/server/app/api/v1/attachments/files/route.js +49 -49
  33. package/.next/standalone/.next/server/app/api/v1/attachments/images/route.js +910 -910
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +589 -16
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +23 -23
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +30 -30
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +703 -130
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +708 -135
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +802 -229
  43. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +739 -739
  45. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +1035 -1035
  46. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +679 -106
  47. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +804 -804
  49. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +700 -700
  50. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js +9 -9
  51. package/.next/standalone/.next/server/app/api/v1/builtin-tools/route.js.nft.json +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/config/route.js +85 -85
  53. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js +709 -709
  54. package/.next/standalone/.next/server/app/api/v1/credentials/[id]/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/v1/credentials/route.js +2 -2
  56. package/.next/standalone/.next/server/app/api/v1/credentials/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/dashboard/currency/route.js +10 -10
  58. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +784 -784
  59. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +23 -23
  60. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +86 -86
  61. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js.nft.json +1 -1
  62. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js +57 -57
  63. package/.next/standalone/.next/server/app/api/v1/delegations/codex/[job_id]/route.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +523 -523
  65. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +44 -44
  66. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js +65 -65
  67. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/reindex/route.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +122 -122
  69. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js.nft.json +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +37 -37
  71. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js.nft.json +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/env/route.js +9 -9
  73. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +368 -368
  74. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +44 -44
  75. package/.next/standalone/.next/server/app/api/v1/events/route.js +751 -178
  76. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/v1/events/test/route.js +77 -77
  78. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +763 -763
  79. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js.nft.json +1 -1
  80. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +44 -44
  81. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +9 -9
  82. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +65 -65
  83. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +34 -34
  84. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +204 -204
  85. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +133 -133
  86. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +106 -106
  87. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +114 -114
  88. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +134 -134
  89. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +690 -690
  90. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +93 -93
  92. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +9 -9
  94. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +185 -185
  96. package/.next/standalone/.next/server/app/api/v1/extensions/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +171 -171
  98. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +396 -396
  100. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +212 -212
  102. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/v1/files/[name]/route.js +235 -235
  104. package/.next/standalone/.next/server/app/api/v1/fs/browse/route.js +26 -26
  105. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +221 -221
  106. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +58 -58
  107. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +72 -72
  108. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js +9 -9
  109. package/.next/standalone/.next/server/app/api/v1/health/probes/route.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/api/v1/health/route.js +772 -772
  111. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +133 -133
  112. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js +9 -9
  113. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/test/route.js.nft.json +1 -1
  114. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +363 -363
  115. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +233 -233
  116. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +682 -682
  117. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +879 -879
  118. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +108 -108
  119. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +952 -952
  120. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +216 -216
  121. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +864 -847
  122. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js.nft.json +1 -1
  123. package/.next/standalone/.next/server/app/api/v1/local-file/route.js +26 -26
  124. package/.next/standalone/.next/server/app/api/v1/logs/route.js +70 -70
  125. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +72 -72
  126. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +979 -979
  127. package/.next/standalone/.next/server/app/api/v1/mcp-servers/registry/route.js +196 -196
  128. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +2 -2
  129. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +381 -381
  130. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +79 -79
  131. package/.next/standalone/.next/server/app/api/v1/memory/route.js +51 -51
  132. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +131 -131
  133. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +374 -369
  134. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js.nft.json +1 -1
  135. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +143 -143
  136. package/.next/standalone/.next/server/app/api/v1/models/route.js +543 -543
  137. package/.next/standalone/.next/server/app/api/v1/packages/catalog/route.js +445 -445
  138. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +120 -120
  139. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js.nft.json +1 -1
  140. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js +234 -234
  141. package/.next/standalone/.next/server/app/api/v1/packages/install/[id]/route.js.nft.json +1 -1
  142. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js +407 -407
  143. package/.next/standalone/.next/server/app/api/v1/packages/install/route.js.nft.json +1 -1
  144. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js +37 -37
  145. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/enabled/route.js.nft.json +1 -1
  146. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js +107 -107
  147. package/.next/standalone/.next/server/app/api/v1/packages/manifests/[name]/route.js.nft.json +1 -1
  148. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js +228 -228
  149. package/.next/standalone/.next/server/app/api/v1/packages/manifests/route.js.nft.json +1 -1
  150. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +9 -9
  151. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js.nft.json +1 -1
  152. package/.next/standalone/.next/server/app/api/v1/packages/route.js +148 -148
  153. package/.next/standalone/.next/server/app/api/v1/packages/route.js.nft.json +1 -1
  154. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +787 -787
  155. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js.nft.json +1 -1
  156. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +507 -507
  157. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js.nft.json +1 -1
  158. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js +181 -181
  159. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/deny/route.js.nft.json +1 -1
  160. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js +258 -258
  161. package/.next/standalone/.next/server/app/api/v1/pending-actions/route.js.nft.json +1 -1
  162. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +30 -30
  163. package/.next/standalone/.next/server/app/api/v1/profile/route.js +164 -164
  164. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +44 -44
  165. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +9 -9
  166. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +164 -164
  167. package/.next/standalone/.next/server/app/api/v1/providers/route.js +94 -94
  168. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +450 -450
  169. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +37 -37
  170. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +58 -58
  171. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +600 -600
  172. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +44 -44
  173. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js.nft.json +1 -1
  174. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +732 -732
  175. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +359 -359
  176. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +197 -197
  177. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +51 -51
  178. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +176 -176
  179. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +190 -190
  180. package/.next/standalone/.next/server/app/api/v1/setup/test-key/route.js +26 -26
  181. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +770 -770
  182. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +115 -115
  183. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +327 -327
  184. package/.next/standalone/.next/server/app/api/v1/skills/route.js +870 -870
  185. package/.next/standalone/.next/server/app/api/v1/system/abort/route.js +838 -808
  186. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js +177 -177
  187. package/.next/standalone/.next/server/app/api/v1/system/restart/route.js.nft.json +1 -1
  188. package/.next/standalone/.next/server/app/api/v1/tailscale/route.js +164 -164
  189. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +115 -115
  190. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +23 -23
  191. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +1429 -0
  192. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js.nft.json +1 -0
  193. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route_client-reference-manifest.js +1 -0
  194. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +635 -634
  195. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js.nft.json +1 -1
  196. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +53 -439
  197. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js.nft.json +1 -1
  198. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +172 -172
  199. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js.nft.json +1 -1
  200. package/.next/standalone/.next/server/app/api/v1/threads/route.js +908 -908
  201. package/.next/standalone/.next/server/app/api/v1/tools/route.js +2 -2
  202. package/.next/standalone/.next/server/app/api/v1/tools/route.js.nft.json +1 -1
  203. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js +17 -17
  204. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  205. package/.next/standalone/.next/server/app/api/v1/update/route.js +570 -570
  206. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +224 -224
  207. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +975 -975
  208. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +23 -23
  209. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +72 -72
  210. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js.nft.json +1 -1
  211. package/.next/standalone/.next/server/app/api/v1/watchers/reaction-scripts/route.js +128 -128
  212. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +164 -164
  213. package/.next/standalone/.next/server/app/api/v1/watchers/route.js.nft.json +1 -1
  214. package/.next/standalone/.next/server/app/icon.svg/route.js +62 -62
  215. package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +436 -436
  216. package/.next/standalone/.next/server/app/page.js +1243 -854
  217. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  218. package/.next/standalone/.next/server/app/setup/page.js +91 -91
  219. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  220. package/.next/standalone/.next/server/app-paths-manifest.json +6 -5
  221. package/.next/standalone/.next/server/chunks/{424.js → 1388.js} +335 -986
  222. package/.next/standalone/.next/server/chunks/1433.js +1 -1
  223. package/.next/standalone/.next/server/chunks/1638.js +1 -2
  224. package/.next/standalone/.next/server/chunks/1738.js +1 -1
  225. package/.next/standalone/.next/server/chunks/210.js +6 -6
  226. package/.next/standalone/.next/server/chunks/2151.js +31 -1
  227. package/.next/standalone/.next/server/chunks/2207.js +1 -0
  228. package/.next/standalone/.next/server/chunks/2471.js +28 -28
  229. package/.next/standalone/.next/server/chunks/2504.js +1 -1
  230. package/.next/standalone/.next/server/chunks/2695.js +17 -17
  231. package/.next/standalone/.next/server/chunks/3042.js +14 -8
  232. package/.next/standalone/.next/server/chunks/3399.js +1 -1
  233. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  234. package/.next/standalone/.next/server/chunks/4189.js +946 -0
  235. package/.next/standalone/.next/server/chunks/{9590.js → 423.js} +8 -3
  236. package/.next/standalone/.next/server/chunks/4433.js +146 -146
  237. package/.next/standalone/.next/server/chunks/4508.js +1 -1
  238. package/.next/standalone/.next/server/chunks/4588.js +1 -0
  239. package/.next/standalone/.next/server/chunks/46.js +5 -0
  240. package/.next/standalone/.next/server/chunks/466.js +12 -0
  241. package/.next/standalone/.next/server/chunks/4868.js +206 -206
  242. package/.next/standalone/.next/server/chunks/4992.js +13 -0
  243. package/.next/standalone/.next/server/chunks/5120.js +963 -0
  244. package/.next/standalone/.next/server/chunks/5701.js +1 -1
  245. package/.next/standalone/.next/server/chunks/5900.js +1 -1
  246. package/.next/standalone/.next/server/chunks/6210.js +1 -0
  247. package/.next/standalone/.next/server/chunks/6213.js +1 -1
  248. package/.next/standalone/.next/server/chunks/6649.js +2 -2
  249. package/.next/standalone/.next/server/chunks/6703.js +3 -3
  250. package/.next/standalone/.next/server/chunks/7445.js +1 -0
  251. package/.next/standalone/.next/server/chunks/8067.js +12 -0
  252. package/.next/standalone/.next/server/chunks/8461.js +14 -9
  253. package/.next/standalone/.next/server/chunks/8558.js +1 -1
  254. package/.next/standalone/.next/server/chunks/8724.js +1 -1
  255. package/.next/standalone/.next/server/chunks/8849.js +91 -91
  256. package/.next/standalone/.next/server/chunks/9032.js +6 -5
  257. package/.next/standalone/.next/server/chunks/{2563.js → 9164.js} +33173 -31461
  258. package/.next/standalone/.next/server/chunks/9237.js +396 -396
  259. package/.next/standalone/.next/server/chunks/{9640.js → 9304.js} +1628 -570
  260. package/.next/standalone/.next/server/chunks/9406.js +1 -1
  261. package/.next/standalone/.next/server/chunks/9824.js +98 -98
  262. package/.next/standalone/.next/server/chunks/9826.js +1 -0
  263. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  264. package/.next/standalone/.next/server/middleware.js +415 -397
  265. package/.next/standalone/.next/server/pages/404.html +2 -2
  266. package/.next/standalone/.next/server/pages/500.html +1 -1
  267. package/.next/standalone/.next/server/preview-props.json +3 -3
  268. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  269. package/.next/standalone/.next/static/chunks/{1395-a340fb0a345382a4.js → 1395-e4a99912b8f83044.js} +13 -1
  270. package/.next/standalone/.next/static/chunks/app/_global-error/{page-36cb8b428b38b26a.js → page-6fc5f8e744c81802.js} +1 -1
  271. package/.next/standalone/.next/static/chunks/app/api/v1/access/[identity]/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  272. package/.next/standalone/.next/static/chunks/app/api/v1/access/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  273. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/compact/{route-36cb8b428b38b26a.js → route-6fc5f8e744c81802.js} +1 -1
  274. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-6fc5f8e744c81802.js +17 -0
  275. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-6fc5f8e744c81802.js +17 -0
  276. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-6fc5f8e744c81802.js +17 -0
  277. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-6fc5f8e744c81802.js +17 -0
  278. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-6fc5f8e744c81802.js +17 -0
  279. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-6fc5f8e744c81802.js +17 -0
  280. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-6fc5f8e744c81802.js +17 -0
  281. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-6fc5f8e744c81802.js +17 -0
  282. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-6fc5f8e744c81802.js +17 -0
  283. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-6fc5f8e744c81802.js +17 -0
  284. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-6fc5f8e744c81802.js +17 -0
  285. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-6fc5f8e744c81802.js +17 -0
  286. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-6fc5f8e744c81802.js +17 -0
  287. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-6fc5f8e744c81802.js +17 -0
  288. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-6fc5f8e744c81802.js +17 -0
  289. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-6fc5f8e744c81802.js +17 -0
  290. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-6fc5f8e744c81802.js +17 -0
  291. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-6fc5f8e744c81802.js +17 -0
  292. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-6fc5f8e744c81802.js +17 -0
  293. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-6fc5f8e744c81802.js +17 -0
  294. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-6fc5f8e744c81802.js +17 -0
  295. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-6fc5f8e744c81802.js +17 -0
  296. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-6fc5f8e744c81802.js +17 -0
  297. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-6fc5f8e744c81802.js +17 -0
  298. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-6fc5f8e744c81802.js +17 -0
  299. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-6fc5f8e744c81802.js +17 -0
  300. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-6fc5f8e744c81802.js +17 -0
  301. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-6fc5f8e744c81802.js +17 -0
  302. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-6fc5f8e744c81802.js +17 -0
  303. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-6fc5f8e744c81802.js +17 -0
  304. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-6fc5f8e744c81802.js +17 -0
  305. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-6fc5f8e744c81802.js +17 -0
  306. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-6fc5f8e744c81802.js +17 -0
  307. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-6fc5f8e744c81802.js +17 -0
  308. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-6fc5f8e744c81802.js +17 -0
  309. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-6fc5f8e744c81802.js +17 -0
  310. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-6fc5f8e744c81802.js +17 -0
  311. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-6fc5f8e744c81802.js +17 -0
  312. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-6fc5f8e744c81802.js +17 -0
  313. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-6fc5f8e744c81802.js +17 -0
  314. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-6fc5f8e744c81802.js +17 -0
  315. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-6fc5f8e744c81802.js +17 -0
  316. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-6fc5f8e744c81802.js +17 -0
  317. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-6fc5f8e744c81802.js +17 -0
  318. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-6fc5f8e744c81802.js +17 -0
  319. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-6fc5f8e744c81802.js +17 -0
  320. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-6fc5f8e744c81802.js +17 -0
  321. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-6fc5f8e744c81802.js +17 -0
  322. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-6fc5f8e744c81802.js +17 -0
  323. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-6fc5f8e744c81802.js +17 -0
  324. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-6fc5f8e744c81802.js +17 -0
  325. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-6fc5f8e744c81802.js +17 -0
  326. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-6fc5f8e744c81802.js +17 -0
  327. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-6fc5f8e744c81802.js +17 -0
  328. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-6fc5f8e744c81802.js +17 -0
  329. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-6fc5f8e744c81802.js +17 -0
  330. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-6fc5f8e744c81802.js +17 -0
  331. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-6fc5f8e744c81802.js +17 -0
  332. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-6fc5f8e744c81802.js +17 -0
  333. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-6fc5f8e744c81802.js +17 -0
  334. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-6fc5f8e744c81802.js +17 -0
  335. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-6fc5f8e744c81802.js +17 -0
  336. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-6fc5f8e744c81802.js +17 -0
  337. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-6fc5f8e744c81802.js +17 -0
  338. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-6fc5f8e744c81802.js +17 -0
  339. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  340. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-6fc5f8e744c81802.js +17 -0
  341. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-6fc5f8e744c81802.js +17 -0
  342. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-6fc5f8e744c81802.js +17 -0
  343. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-6fc5f8e744c81802.js +17 -0
  344. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-6fc5f8e744c81802.js +17 -0
  345. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-6fc5f8e744c81802.js +17 -0
  346. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-6fc5f8e744c81802.js +17 -0
  347. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-6fc5f8e744c81802.js +17 -0
  348. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-6fc5f8e744c81802.js +17 -0
  349. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-6fc5f8e744c81802.js +17 -0
  350. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-6fc5f8e744c81802.js +17 -0
  351. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-6fc5f8e744c81802.js +17 -0
  352. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-6fc5f8e744c81802.js +17 -0
  353. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-6fc5f8e744c81802.js +17 -0
  354. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-6fc5f8e744c81802.js +17 -0
  355. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-6fc5f8e744c81802.js +17 -0
  356. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-6fc5f8e744c81802.js +17 -0
  357. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-6fc5f8e744c81802.js +17 -0
  358. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-6fc5f8e744c81802.js +17 -0
  359. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-6fc5f8e744c81802.js +17 -0
  360. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-6fc5f8e744c81802.js +17 -0
  361. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-6fc5f8e744c81802.js +17 -0
  362. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-6fc5f8e744c81802.js +17 -0
  363. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-6fc5f8e744c81802.js +17 -0
  364. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-6fc5f8e744c81802.js +17 -0
  365. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-6fc5f8e744c81802.js +17 -0
  366. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-6fc5f8e744c81802.js +17 -0
  367. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-6fc5f8e744c81802.js +17 -0
  368. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-6fc5f8e744c81802.js +17 -0
  369. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-6fc5f8e744c81802.js +17 -0
  370. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-6fc5f8e744c81802.js +17 -0
  371. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-6fc5f8e744c81802.js +17 -0
  372. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-6fc5f8e744c81802.js +17 -0
  373. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-6fc5f8e744c81802.js +17 -0
  374. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-6fc5f8e744c81802.js +17 -0
  375. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-6fc5f8e744c81802.js +17 -0
  376. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-6fc5f8e744c81802.js +17 -0
  377. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-6fc5f8e744c81802.js +17 -0
  378. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-6fc5f8e744c81802.js +17 -0
  379. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-6fc5f8e744c81802.js +17 -0
  380. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-6fc5f8e744c81802.js +17 -0
  381. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-6fc5f8e744c81802.js +17 -0
  382. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-6fc5f8e744c81802.js +17 -0
  383. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-6fc5f8e744c81802.js +17 -0
  384. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-6fc5f8e744c81802.js +17 -0
  385. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-6fc5f8e744c81802.js +17 -0
  386. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-6fc5f8e744c81802.js +17 -0
  387. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-6fc5f8e744c81802.js +17 -0
  388. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-6fc5f8e744c81802.js +17 -0
  389. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-6fc5f8e744c81802.js +17 -0
  390. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-6fc5f8e744c81802.js +17 -0
  391. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-6fc5f8e744c81802.js +17 -0
  392. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-6fc5f8e744c81802.js +17 -0
  393. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-6fc5f8e744c81802.js +17 -0
  394. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-6fc5f8e744c81802.js +17 -0
  395. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-6fc5f8e744c81802.js +17 -0
  396. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-6fc5f8e744c81802.js +17 -0
  397. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-6fc5f8e744c81802.js +17 -0
  398. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-6fc5f8e744c81802.js +17 -0
  399. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-6fc5f8e744c81802.js +17 -0
  400. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/activity/route-6fc5f8e744c81802.js +17 -0
  401. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-6fc5f8e744c81802.js +17 -0
  402. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-6fc5f8e744c81802.js +17 -0
  403. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-6fc5f8e744c81802.js +17 -0
  404. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-6fc5f8e744c81802.js +17 -0
  405. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-6fc5f8e744c81802.js +17 -0
  406. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-6fc5f8e744c81802.js +17 -0
  407. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-6fc5f8e744c81802.js +17 -0
  408. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-6fc5f8e744c81802.js +17 -0
  409. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-6fc5f8e744c81802.js +17 -0
  410. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-6fc5f8e744c81802.js +17 -0
  411. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-6fc5f8e744c81802.js +17 -0
  412. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-6fc5f8e744c81802.js +17 -0
  413. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-6fc5f8e744c81802.js +17 -0
  414. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-6fc5f8e744c81802.js +17 -0
  415. package/.next/standalone/.next/static/chunks/app/{page-7017f07f8a7a083c.js → page-213a623b37226452.js} +1041 -652
  416. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-6fc5f8e744c81802.js +17 -0
  417. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-6fc5f8e744c81802.js +17 -0
  418. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-6fc5f8e744c81802.js +17 -0
  419. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-6fc5f8e744c81802.js +17 -0
  420. package/.next/standalone/.next/static/css/{d80058f0b9b41c09.css → 312542a5725ba0d5.css} +2 -2
  421. package/.next/standalone/docs/adoption/changesets.json +309 -0
  422. package/.next/standalone/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  423. package/.next/standalone/package.json +3 -3
  424. package/CHANGELOG.md +25 -0
  425. package/api/client.ts +9 -0
  426. package/api/types.ts +29 -0
  427. package/app/api/v1/lifecycle/adoption/route.ts +14 -2
  428. package/app/api/v1/models/[name]/compact-threads/route.ts +14 -11
  429. package/app/api/v1/threads/[thread_id]/activity/route.ts +19 -0
  430. package/app/api/v1/threads/[thread_id]/context-pin/route.test.ts +1 -0
  431. package/app/api/v1/threads/[thread_id]/context-pin/route.ts +2 -1
  432. package/app/api/v1/threads/[thread_id]/route.ts +5 -1
  433. package/components/chat/ChatView.tsx +52 -11
  434. package/components/chat/ContextBoundary.test.tsx +68 -1
  435. package/components/chat/ContextBoundary.tsx +92 -13
  436. package/components/chat/MessageList.test.tsx +31 -0
  437. package/components/chat/MessageList.tsx +49 -28
  438. package/components/chat/ToolList.test.tsx +92 -16
  439. package/components/chat/ToolList.tsx +59 -4
  440. package/components/chat/chat-helpers.test.tsx +24 -1
  441. package/components/chat/chat-helpers.ts +47 -4
  442. package/components/chat/useThreadActivity.test.tsx +113 -0
  443. package/components/chat/useThreadActivity.ts +94 -0
  444. package/components/chat/useThreadData.ts +16 -16
  445. package/components/chat/workflow-step-retry.ts +25 -0
  446. package/components/ui/BootScreen.tsx +17 -0
  447. package/components/ui/WorkflowChecklist.tsx +71 -33
  448. package/hooks/useSSE.ts +28 -3
  449. package/lib/agents/compaction-pipeline.test.ts +202 -0
  450. package/lib/agents/compaction-pipeline.ts +483 -0
  451. package/lib/agents/conversation-summary.ts +37 -21
  452. package/lib/agents/prepare/history-window.test.ts +18 -0
  453. package/lib/agents/prepare/history-window.ts +11 -2
  454. package/lib/agents/prepare/request.ts +4 -0
  455. package/lib/agents/prepare/system-prompt.test.ts +39 -0
  456. package/lib/agents/prepare/system-prompt.ts +8 -3
  457. package/lib/agents/prompt-registry.test.ts +5 -140
  458. package/lib/agents/prompt-registry.ts +45 -1
  459. package/lib/agents/prompt-variants.ts +146 -0
  460. package/lib/agents/run-registry.test.ts +22 -0
  461. package/lib/agents/run-registry.ts +29 -0
  462. package/lib/agents/run-thread.retry.test.ts +67 -1
  463. package/lib/agents/run-thread.ts +86 -1
  464. package/lib/agents/thread-activity.test.ts +31 -0
  465. package/lib/agents/thread-activity.ts +27 -0
  466. package/lib/agents/thread-compaction-state.test.ts +82 -0
  467. package/lib/agents/thread-compaction-state.ts +121 -0
  468. package/lib/agents/thread-compaction.test.ts +83 -4
  469. package/lib/agents/thread-compaction.ts +34 -11
  470. package/lib/agents/warm-summary-background.test.ts +219 -5
  471. package/lib/agents/warm-summary-background.ts +325 -142
  472. package/lib/agents/warm-topics.test.ts +37 -0
  473. package/lib/agents/warm-topics.ts +297 -0
  474. package/lib/agents/workflow-step-retry.test.ts +96 -0
  475. package/lib/agents/workflow-step-retry.ts +216 -0
  476. package/lib/api/browser-control.ts +0 -3
  477. package/lib/db/migrations.ts +5 -0
  478. package/lib/env/config.ts +2 -0
  479. package/lib/env/schema.ts +12 -0
  480. package/lib/lifecycle/changeset-build.test.ts +93 -0
  481. package/lib/lifecycle/changeset-build.ts +210 -0
  482. package/lib/lifecycle/changesets.test.ts +101 -0
  483. package/lib/lifecycle/changesets.ts +166 -0
  484. package/lib/lifecycle/surface-collect.test.ts +88 -0
  485. package/lib/lifecycle/surface-collect.ts +64 -0
  486. package/lib/lifecycle/surface-snapshot.test.ts +104 -0
  487. package/lib/lifecycle/surface-snapshot.ts +210 -0
  488. package/lib/memory/record.ts +0 -2
  489. package/lib/providers/external.ts +0 -2
  490. package/lib/skills/builtins/memory-organization/SKILL.md +16 -0
  491. package/lib/stores/threads.test.ts +9 -0
  492. package/lib/stores/threads.ts +21 -11
  493. package/lib/stores/version-adoption.test.ts +96 -0
  494. package/lib/stores/version-adoption.ts +239 -26
  495. package/lib/stores/workflow-progress.ts +3 -0
  496. package/lib/tools/communications/ms-todo.ts +0 -7
  497. package/lib/tools/general/memory.ts +1 -1
  498. package/lib/tools/general/workflow-progress.ts +2 -0
  499. package/lib/tools/runtime/catalog.ts +1 -25
  500. package/lib/triggers/registry.ts +0 -4
  501. package/package.json +3 -3
  502. package/scripts/install-to-system.ps1 +39 -11
  503. package/scripts/install-to-system.sh +37 -3
  504. package/.next/standalone/.next/server/chunks/3979.js +0 -581
  505. package/.next/standalone/.next/server/chunks/5936.js +0 -594
  506. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/display-filters/route-36cb8b428b38b26a.js +0 -17
  507. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/route-36cb8b428b38b26a.js +0 -17
  508. package/.next/standalone/.next/static/chunks/app/api/v1/agents/[id]/thread/route-36cb8b428b38b26a.js +0 -17
  509. package/.next/standalone/.next/static/chunks/app/api/v1/agents/route-36cb8b428b38b26a.js +0 -17
  510. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/[hostname]/route-36cb8b428b38b26a.js +0 -17
  511. package/.next/standalone/.next/static/chunks/app/api/v1/allowed-sites/route-36cb8b428b38b26a.js +0 -17
  512. package/.next/standalone/.next/static/chunks/app/api/v1/artifacts/lifecycle/route-36cb8b428b38b26a.js +0 -17
  513. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/files/route-36cb8b428b38b26a.js +0 -17
  514. package/.next/standalone/.next/static/chunks/app/api/v1/attachments/images/route-36cb8b428b38b26a.js +0 -17
  515. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/chats/route-36cb8b428b38b26a.js +0 -17
  516. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/[remote_jid]/route-36cb8b428b38b26a.js +0 -17
  517. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/ignores/route-36cb8b428b38b26a.js +0 -17
  518. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/lookup/route-36cb8b428b38b26a.js +0 -17
  519. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/pair/route-36cb8b428b38b26a.js +0 -17
  520. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/route-36cb8b428b38b26a.js +0 -17
  521. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/[route_id]/route-36cb8b428b38b26a.js +0 -17
  522. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/routes/route-36cb8b428b38b26a.js +0 -17
  523. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/[id]/status/route-36cb8b428b38b26a.js +0 -17
  524. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/kinds/route-36cb8b428b38b26a.js +0 -17
  525. package/.next/standalone/.next/static/chunks/app/api/v1/bridges/route-36cb8b428b38b26a.js +0 -17
  526. package/.next/standalone/.next/static/chunks/app/api/v1/builtin-tools/route-36cb8b428b38b26a.js +0 -17
  527. package/.next/standalone/.next/static/chunks/app/api/v1/config/route-36cb8b428b38b26a.js +0 -17
  528. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/[id]/route-36cb8b428b38b26a.js +0 -17
  529. package/.next/standalone/.next/static/chunks/app/api/v1/credentials/route-36cb8b428b38b26a.js +0 -17
  530. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/currency/route-36cb8b428b38b26a.js +0 -17
  531. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/metrics/route-36cb8b428b38b26a.js +0 -17
  532. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing/route-36cb8b428b38b26a.js +0 -17
  533. package/.next/standalone/.next/static/chunks/app/api/v1/dashboard/pricing-task/route-36cb8b428b38b26a.js +0 -17
  534. package/.next/standalone/.next/static/chunks/app/api/v1/delegations/codex/[job_id]/route-36cb8b428b38b26a.js +0 -17
  535. package/.next/standalone/.next/static/chunks/app/api/v1/documents/search/route-36cb8b428b38b26a.js +0 -17
  536. package/.next/standalone/.next/static/chunks/app/api/v1/documents/settings/route-36cb8b428b38b26a.js +0 -17
  537. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/reindex/route-36cb8b428b38b26a.js +0 -17
  538. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/[id]/route-36cb8b428b38b26a.js +0 -17
  539. package/.next/standalone/.next/static/chunks/app/api/v1/documents/sources/route-36cb8b428b38b26a.js +0 -17
  540. package/.next/standalone/.next/static/chunks/app/api/v1/env/route-36cb8b428b38b26a.js +0 -17
  541. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/allowlist/route-36cb8b428b38b26a.js +0 -17
  542. package/.next/standalone/.next/static/chunks/app/api/v1/env-sync/route-36cb8b428b38b26a.js +0 -17
  543. package/.next/standalone/.next/static/chunks/app/api/v1/events/route-36cb8b428b38b26a.js +0 -17
  544. package/.next/standalone/.next/static/chunks/app/api/v1/events/test/route-36cb8b428b38b26a.js +0 -17
  545. package/.next/standalone/.next/static/chunks/app/api/v1/extension/agents/route-36cb8b428b38b26a.js +0 -17
  546. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/activate/route-36cb8b428b38b26a.js +0 -17
  547. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/foreground/route-36cb8b428b38b26a.js +0 -17
  548. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/history/route-36cb8b428b38b26a.js +0 -17
  549. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/poll/route-36cb8b428b38b26a.js +0 -17
  550. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/progress/route-36cb8b428b38b26a.js +0 -17
  551. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/result/route-36cb8b428b38b26a.js +0 -17
  552. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/retry/route-36cb8b428b38b26a.js +0 -17
  553. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/status/route-36cb8b428b38b26a.js +0 -17
  554. package/.next/standalone/.next/static/chunks/app/api/v1/extension/browser/tabs/route-36cb8b428b38b26a.js +0 -17
  555. package/.next/standalone/.next/static/chunks/app/api/v1/extension/fill/route-36cb8b428b38b26a.js +0 -17
  556. package/.next/standalone/.next/static/chunks/app/api/v1/extension/refine/route-36cb8b428b38b26a.js +0 -17
  557. package/.next/standalone/.next/static/chunks/app/api/v1/extension/turn/route-36cb8b428b38b26a.js +0 -17
  558. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/route-36cb8b428b38b26a.js +0 -17
  559. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/config/route-36cb8b428b38b26a.js +0 -17
  560. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/route-36cb8b428b38b26a.js +0 -17
  561. package/.next/standalone/.next/static/chunks/app/api/v1/extensions/tools/[name]/secrets/route-36cb8b428b38b26a.js +0 -17
  562. package/.next/standalone/.next/static/chunks/app/api/v1/files/[name]/route-36cb8b428b38b26a.js +0 -17
  563. package/.next/standalone/.next/static/chunks/app/api/v1/fs/browse/route-36cb8b428b38b26a.js +0 -17
  564. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/[id]/route-36cb8b428b38b26a.js +0 -17
  565. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/default/route-36cb8b428b38b26a.js +0 -17
  566. package/.next/standalone/.next/static/chunks/app/api/v1/harnesses/route-36cb8b428b38b26a.js +0 -17
  567. package/.next/standalone/.next/static/chunks/app/api/v1/health/probes/route-36cb8b428b38b26a.js +0 -17
  568. package/.next/standalone/.next/static/chunks/app/api/v1/health/route-36cb8b428b38b26a.js +0 -17
  569. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/route-36cb8b428b38b26a.js +0 -17
  570. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/[name]/test/route-36cb8b428b38b26a.js +0 -17
  571. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  572. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/start/route-36cb8b428b38b26a.js +0 -17
  573. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/gmail/oauth/status/route-36cb8b428b38b26a.js +0 -17
  574. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/callback/route-36cb8b428b38b26a.js +0 -17
  575. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/start/route-36cb8b428b38b26a.js +0 -17
  576. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/outlook/oauth/status/route-36cb8b428b38b26a.js +0 -17
  577. package/.next/standalone/.next/static/chunks/app/api/v1/integrations/route-36cb8b428b38b26a.js +0 -17
  578. package/.next/standalone/.next/static/chunks/app/api/v1/lifecycle/adoption/route-36cb8b428b38b26a.js +0 -17
  579. package/.next/standalone/.next/static/chunks/app/api/v1/local-file/route-36cb8b428b38b26a.js +0 -17
  580. package/.next/standalone/.next/static/chunks/app/api/v1/logs/route-36cb8b428b38b26a.js +0 -17
  581. package/.next/standalone/.next/static/chunks/app/api/v1/maps/embed/route-36cb8b428b38b26a.js +0 -17
  582. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/[name]/route-36cb8b428b38b26a.js +0 -17
  583. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/registry/route-36cb8b428b38b26a.js +0 -17
  584. package/.next/standalone/.next/static/chunks/app/api/v1/mcp-servers/route-36cb8b428b38b26a.js +0 -17
  585. package/.next/standalone/.next/static/chunks/app/api/v1/memory/[namespace]/[key]/route-36cb8b428b38b26a.js +0 -17
  586. package/.next/standalone/.next/static/chunks/app/api/v1/memory/policy/route-36cb8b428b38b26a.js +0 -17
  587. package/.next/standalone/.next/static/chunks/app/api/v1/memory/route-36cb8b428b38b26a.js +0 -17
  588. package/.next/standalone/.next/static/chunks/app/api/v1/memory/search/route-36cb8b428b38b26a.js +0 -17
  589. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/compact-threads/route-36cb8b428b38b26a.js +0 -17
  590. package/.next/standalone/.next/static/chunks/app/api/v1/models/[name]/route-36cb8b428b38b26a.js +0 -17
  591. package/.next/standalone/.next/static/chunks/app/api/v1/models/route-36cb8b428b38b26a.js +0 -17
  592. package/.next/standalone/.next/static/chunks/app/api/v1/packages/catalog/route-36cb8b428b38b26a.js +0 -17
  593. package/.next/standalone/.next/static/chunks/app/api/v1/packages/defaults/[id]/route-36cb8b428b38b26a.js +0 -17
  594. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/[id]/route-36cb8b428b38b26a.js +0 -17
  595. package/.next/standalone/.next/static/chunks/app/api/v1/packages/install/route-36cb8b428b38b26a.js +0 -17
  596. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/enabled/route-36cb8b428b38b26a.js +0 -17
  597. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/[name]/route-36cb8b428b38b26a.js +0 -17
  598. package/.next/standalone/.next/static/chunks/app/api/v1/packages/manifests/route-36cb8b428b38b26a.js +0 -17
  599. package/.next/standalone/.next/static/chunks/app/api/v1/packages/reload/route-36cb8b428b38b26a.js +0 -17
  600. package/.next/standalone/.next/static/chunks/app/api/v1/packages/route-36cb8b428b38b26a.js +0 -17
  601. package/.next/standalone/.next/static/chunks/app/api/v1/page-capture/route-36cb8b428b38b26a.js +0 -17
  602. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/approve/route-36cb8b428b38b26a.js +0 -17
  603. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/[id]/deny/route-36cb8b428b38b26a.js +0 -17
  604. package/.next/standalone/.next/static/chunks/app/api/v1/pending-actions/route-36cb8b428b38b26a.js +0 -17
  605. package/.next/standalone/.next/static/chunks/app/api/v1/profile/location/route-36cb8b428b38b26a.js +0 -17
  606. package/.next/standalone/.next/static/chunks/app/api/v1/profile/route-36cb8b428b38b26a.js +0 -17
  607. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/models/route-36cb8b428b38b26a.js +0 -17
  608. package/.next/standalone/.next/static/chunks/app/api/v1/providers/[provider]/probe/route-36cb8b428b38b26a.js +0 -17
  609. package/.next/standalone/.next/static/chunks/app/api/v1/providers/github-copilot/auth/route-36cb8b428b38b26a.js +0 -17
  610. package/.next/standalone/.next/static/chunks/app/api/v1/providers/route-36cb8b428b38b26a.js +0 -17
  611. package/.next/standalone/.next/static/chunks/app/api/v1/proxy-config/route-36cb8b428b38b26a.js +0 -17
  612. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/init/route-36cb8b428b38b26a.js +0 -17
  613. package/.next/standalone/.next/static/chunks/app/api/v1/redaction/route-36cb8b428b38b26a.js +0 -17
  614. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/route-36cb8b428b38b26a.js +0 -17
  615. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/[id]/run/route-36cb8b428b38b26a.js +0 -17
  616. package/.next/standalone/.next/static/chunks/app/api/v1/scheduled-tasks/route-36cb8b428b38b26a.js +0 -17
  617. package/.next/standalone/.next/static/chunks/app/api/v1/security/idle-timeout/route-36cb8b428b38b26a.js +0 -17
  618. package/.next/standalone/.next/static/chunks/app/api/v1/security/pin/route-36cb8b428b38b26a.js +0 -17
  619. package/.next/standalone/.next/static/chunks/app/api/v1/security/state/route-36cb8b428b38b26a.js +0 -17
  620. package/.next/standalone/.next/static/chunks/app/api/v1/security/unlock/route-36cb8b428b38b26a.js +0 -17
  621. package/.next/standalone/.next/static/chunks/app/api/v1/security/verify-pin/route-36cb8b428b38b26a.js +0 -17
  622. package/.next/standalone/.next/static/chunks/app/api/v1/setup/test-key/route-36cb8b428b38b26a.js +0 -17
  623. package/.next/standalone/.next/static/chunks/app/api/v1/skills/[id]/route-36cb8b428b38b26a.js +0 -17
  624. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/[id]/route-36cb8b428b38b26a.js +0 -17
  625. package/.next/standalone/.next/static/chunks/app/api/v1/skills/repos/route-36cb8b428b38b26a.js +0 -17
  626. package/.next/standalone/.next/static/chunks/app/api/v1/skills/route-36cb8b428b38b26a.js +0 -17
  627. package/.next/standalone/.next/static/chunks/app/api/v1/system/abort/route-36cb8b428b38b26a.js +0 -17
  628. package/.next/standalone/.next/static/chunks/app/api/v1/system/restart/route-36cb8b428b38b26a.js +0 -17
  629. package/.next/standalone/.next/static/chunks/app/api/v1/tailscale/route-36cb8b428b38b26a.js +0 -17
  630. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/[agent_id]/route-36cb8b428b38b26a.js +0 -17
  631. package/.next/standalone/.next/static/chunks/app/api/v1/tasks/route-36cb8b428b38b26a.js +0 -17
  632. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/context-pin/route-36cb8b428b38b26a.js +0 -17
  633. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/route-36cb8b428b38b26a.js +0 -17
  634. package/.next/standalone/.next/static/chunks/app/api/v1/threads/[thread_id]/run/route-36cb8b428b38b26a.js +0 -17
  635. package/.next/standalone/.next/static/chunks/app/api/v1/threads/route-36cb8b428b38b26a.js +0 -17
  636. package/.next/standalone/.next/static/chunks/app/api/v1/tools/route-36cb8b428b38b26a.js +0 -17
  637. package/.next/standalone/.next/static/chunks/app/api/v1/update/apply/route-36cb8b428b38b26a.js +0 -17
  638. package/.next/standalone/.next/static/chunks/app/api/v1/update/route-36cb8b428b38b26a.js +0 -17
  639. package/.next/standalone/.next/static/chunks/app/api/v1/voice/transcribe/route-36cb8b428b38b26a.js +0 -17
  640. package/.next/standalone/.next/static/chunks/app/api/v1/voice/tts/route-36cb8b428b38b26a.js +0 -17
  641. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/route-36cb8b428b38b26a.js +0 -17
  642. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/[id]/run/route-36cb8b428b38b26a.js +0 -17
  643. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/reaction-scripts/route-36cb8b428b38b26a.js +0 -17
  644. package/.next/standalone/.next/static/chunks/app/api/v1/watchers/route-36cb8b428b38b26a.js +0 -17
  645. package/.next/standalone/.next/static/chunks/app/manifest.webmanifest/route-36cb8b428b38b26a.js +0 -17
  646. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/app-error-36cb8b428b38b26a.js +0 -17
  647. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/forbidden-36cb8b428b38b26a.js +0 -17
  648. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/not-found-36cb8b428b38b26a.js +0 -17
  649. package/.next/standalone/.next/static/chunks/next/dist/client/components/builtin/unauthorized-36cb8b428b38b26a.js +0 -17
  650. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_buildManifest.js +0 -0
  651. /package/.next/standalone/.next/static/{NUrC9xax1sp1Q70nlFqS6 → bMRK5y3ruT7c3WtBfCQOG}/_ssgManifest.js +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
- exports.id = 424;
3
- exports.ids = [424,3944,8154];
2
+ exports.id = 1388;
3
+ exports.ids = [1388,8154];
4
4
  exports.modules = {
5
5
 
6
6
  /***/ 2522:
@@ -27,9 +27,6 @@ const state = (0,global_state/* getOrCreateGlobal */.X)("__jarela_trigger_regist
27
27
  function registerTriggerHandler(handler) {
28
28
  state.handlers.set(handler.kind, handler);
29
29
  }
30
- function getTriggerHandler(kind) {
31
- return state.handlers.get(kind);
32
- }
33
30
  function registry_listTriggerHandlers() {
34
31
  return Array.from(state.handlers.values());
35
32
  }
@@ -1364,120 +1361,6 @@ registerHandlers();
1364
1361
 
1365
1362
 
1366
1363
 
1367
- /***/ }),
1368
-
1369
- /***/ 3944:
1370
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1371
-
1372
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1373
- /* harmony export */ M6: () => (/* binding */ enqueueThreadRun),
1374
- /* harmony export */ Zm: () => (/* binding */ QueueFullError),
1375
- /* harmony export */ getQueueDepth: () => (/* binding */ getQueueDepth),
1376
- /* harmony export */ vR: () => (/* binding */ QueueExpiredError)
1377
- /* harmony export */ });
1378
- /* unused harmony export __resetForTests */
1379
- /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15559);
1380
- // Per-thread priority queue for agent runs.
1381
- //
1382
- // A thread can have one active run. Waiting interactive runs are selected
1383
- // before waiting background runs, while FIFO order is preserved within each
1384
- // lane. Different threads drain independently.
1385
- //
1386
- // In-memory + single-process. Multi-instance deployment would need a shared
1387
- // lock (Redis, Postgres advisory locks) — explicitly out of scope.
1388
-
1389
- const queues = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_0__/* .getOrCreateGlobal */ .X)("__jarela_thread_run_queues", ()=>new Map());
1390
- const DEFAULT_MAX_DEPTH = 16;
1391
- const sourceLanes = {
1392
- user: "interactive",
1393
- bridge: "interactive",
1394
- delegate: "interactive",
1395
- scheduler: "background",
1396
- watcher: "background",
1397
- trigger: "background",
1398
- extension: "background"
1399
- };
1400
- class QueueFullError extends Error {
1401
- constructor(thread_id, depth){
1402
- super(`Per-thread run queue full for thread ${thread_id} (depth=${depth})`);
1403
- this.name = "QueueFullError";
1404
- }
1405
- }
1406
- class QueueExpiredError extends Error {
1407
- constructor(thread_id, expiresAt){
1408
- super(`Queued run expired for thread ${thread_id} at ${expiresAt}`);
1409
- this.name = "QueueExpiredError";
1410
- }
1411
- }
1412
- function depth(queue) {
1413
- return (queue.active ? 1 : 0) + queue.interactive.length + queue.background.length;
1414
- }
1415
- function drain(thread_id, queue) {
1416
- if (queue.active) return;
1417
- const job = queue.interactive.shift() ?? queue.background.shift();
1418
- if (!job) {
1419
- if (queues.get(thread_id) === queue) queues.delete(thread_id);
1420
- return;
1421
- }
1422
- queue.active = job;
1423
- Promise.resolve().then(()=>{
1424
- if (job.expiresAt !== undefined && Date.now() >= job.expiresAt) {
1425
- throw new QueueExpiredError(thread_id, job.expiresAt);
1426
- }
1427
- return job.runner();
1428
- }).then((value)=>{
1429
- finish(thread_id, queue);
1430
- job.resolve(value);
1431
- }, (error)=>{
1432
- finish(thread_id, queue);
1433
- job.reject(error);
1434
- });
1435
- }
1436
- function finish(thread_id, queue) {
1437
- queue.active = undefined;
1438
- if (queues.get(thread_id) === queue) drain(thread_id, queue);
1439
- }
1440
- function enqueueThreadRun(thread_id, source, runner, options = {}) {
1441
- const queue = queues.get(thread_id) ?? {
1442
- interactive: [],
1443
- background: []
1444
- };
1445
- const currentDepth = depth(queue);
1446
- const max = options.maxDepth ?? DEFAULT_MAX_DEPTH;
1447
- if (currentDepth >= max) {
1448
- throw new QueueFullError(thread_id, currentDepth);
1449
- }
1450
- const lane = options.lane ?? sourceLanes[source];
1451
- const position = queue.active ? 1 + queue.interactive.length + (lane === "background" ? queue.background.length : 0) : queue.interactive.length + (lane === "background" ? queue.background.length : 0);
1452
- let resolve;
1453
- let reject;
1454
- const result = new Promise((res, rej)=>{
1455
- resolve = res;
1456
- reject = rej;
1457
- });
1458
- const job = {
1459
- runner,
1460
- expiresAt: options.expiresAt,
1461
- resolve,
1462
- reject
1463
- };
1464
- queue[lane].push(job);
1465
- queues.set(thread_id, queue);
1466
- drain(thread_id, queue);
1467
- return {
1468
- result,
1469
- position
1470
- };
1471
- }
1472
- /** Current queue depth for a thread, including the active job. */ function getQueueDepth(thread_id) {
1473
- const queue = queues.get(thread_id);
1474
- return queue ? depth(queue) : 0;
1475
- }
1476
- /** Reset all queue state. Test-only — never call from production code. */ function __resetForTests() {
1477
- queues.clear();
1478
- }
1479
-
1480
-
1481
1364
  /***/ }),
1482
1365
 
1483
1366
  /***/ 5209:
@@ -1490,18 +1373,20 @@ function enqueueThreadRun(thread_id, source, runner, options = {}) {
1490
1373
  /* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(41720);
1491
1374
  /* harmony import */ var _lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83042);
1492
1375
  /* harmony import */ var _lib_stores_memory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(80956);
1493
- /* harmony import */ var _lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(79640);
1494
- /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(67500);
1376
+ /* harmony import */ var _lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(36923);
1377
+ /* harmony import */ var _lib_agents_thread_compaction_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(87313);
1378
+ /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(67500);
1379
+
1495
1380
 
1496
1381
 
1497
1382
 
1498
1383
 
1499
1384
 
1500
1385
  function maxThreadMessages() {
1501
- return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .z)().maxThreadMessages;
1386
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_5__/* .getConfig */ .z)().maxThreadMessages;
1502
1387
  }
1503
1388
  function maxSessionArchives() {
1504
- return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_4__/* .getConfig */ .z)().maxSessionArchives;
1389
+ return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_5__/* .getConfig */ .z)().maxSessionArchives;
1505
1390
  }
1506
1391
  function autoCompactionKeepLast(cap) {
1507
1392
  return Math.max(1, cap - Math.max(20, Math.ceil(cap * 0.1)));
@@ -1532,19 +1417,43 @@ async function compactAgentThread(agentId, keepLast = maxThreadMessages(), reset
1532
1417
  const lastRow = rows[rows.length - 1];
1533
1418
  const boundaryRow = fullSessionReset ? null : rows[Math.max(0, rows.length - keepLast)] ?? lastRow;
1534
1419
  const boundarySeq = fullSessionReset ? lastRow.seq + 1 : boundaryRow.seq;
1535
- const context = await (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__/* .trackManualCompaction */ .bO)(thread.thread_id, boundarySeq, ()=>(0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__/* .compactThreadWarmContext */ .gQ)(thread.thread_id, boundarySeq, {
1536
- expectedHotSinceSeq: thread.hot_since_seq ?? null,
1537
- alignTopicBoundary: !fullSessionReset
1538
- }));
1420
+ if ((0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__/* .isManualCompactionRunning */ .xU)(thread.thread_id)) {
1421
+ return {
1422
+ compacted: false,
1423
+ reason: "already compacting"
1424
+ };
1425
+ }
1426
+ let context;
1427
+ try {
1428
+ context = await (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__/* .trackManualCompaction */ .bO)(thread.thread_id, boundarySeq, (attempt)=>(0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_3__/* .compactThreadWarmContext */ .gQ)(thread.thread_id, boundarySeq, {
1429
+ expectedHotSinceSeq: thread.hot_since_seq ?? null,
1430
+ alignTopicBoundary: !fullSessionReset,
1431
+ attempt
1432
+ }));
1433
+ } catch (err) {
1434
+ if (err instanceof _lib_agents_thread_compaction_state__WEBPACK_IMPORTED_MODULE_4__/* .CompactionTimeoutError */ .nQ) return {
1435
+ compacted: false,
1436
+ reason: "timed out"
1437
+ };
1438
+ throw err;
1439
+ }
1539
1440
  if (!context) return {
1540
1441
  compacted: false,
1541
- reason: "summary was not committed"
1442
+ reason: "no summary produced"
1542
1443
  };
1444
+ // Automation channels (bridge, watcher, scheduled task) are compacted at the
1445
+ // same boundary; a bridge-only agent has nothing but channel recaps.
1446
+ const channelRecaps = context.channels.filter((c)=>!!c.summary);
1447
+ const archivedSummary = [
1448
+ context.summary,
1449
+ ...channelRecaps.map((c)=>c.summary)
1450
+ ].filter(Boolean).join("\n\n");
1451
+ const messageCount = context.sourceMessages + channelRecaps.reduce((n, c)=>n + c.sourceMessages, 0);
1543
1452
  (0,_lib_stores_memory__WEBPACK_IMPORTED_MODULE_2__/* .putMemory */ .Ri)("sessions", `${agentId}/${Date.now()}`, {
1544
- summary: context.summary,
1453
+ summary: archivedSummary,
1545
1454
  agent_id: agentId,
1546
1455
  agent_name: agent.name,
1547
- message_count: context.sourceMessages,
1456
+ message_count: messageCount,
1548
1457
  compacted_at: new Date().toISOString()
1549
1458
  });
1550
1459
  const archivePruned = pruneSessionArchives(agentId, maxSessionArchives());
@@ -1553,7 +1462,7 @@ async function compactAgentThread(agentId, keepLast = maxThreadMessages(), reset
1553
1462
  return {
1554
1463
  compacted: true,
1555
1464
  summary: context.summary,
1556
- message_count: context.sourceMessages,
1465
+ message_count: messageCount,
1557
1466
  context_chars: context.sourceChars,
1558
1467
  pruned,
1559
1468
  archive_pruned: archivePruned,
@@ -2219,7 +2128,7 @@ __webpack_require__.d(__webpack_exports__, {
2219
2128
  rw: () => (/* reexport */ applyToolBindBudget),
2220
2129
  o8: () => (/* reexport */ executeTool),
2221
2130
  tA: () => (/* reexport */ getAllToolCatalogAsync),
2222
- n0: () => (/* reexport */ runtime_getAllToolsAsync),
2131
+ n0: () => (/* reexport */ getAllToolsAsync),
2223
2132
  sT: () => (/* reexport */ getBuiltinToolNames),
2224
2133
  vL: () => (/* reexport */ getDefaultAgentToolNames),
2225
2134
  iD: () => (/* reexport */ isHotLoadTool),
@@ -2227,7 +2136,7 @@ __webpack_require__.d(__webpack_exports__, {
2227
2136
  pe: () => (/* reexport */ toOpenAITools)
2228
2137
  });
2229
2138
 
2230
- // UNUSED EXPORTS: allBuiltins, builtinNames, getAllTools, getDefaultAgentToolNamesAsync, getPackagesDir, getToolCapability, getToolCategory, getToolCredentialsRequired, getToolGroup, getToolIntegration, getToolSource, getToolsDir, initTools, loadExternal, loadLangChainPackages, registerTools, reloadLangChainPackages, toCatalogEntry
2139
+ // UNUSED EXPORTS: allBuiltins, builtinNames, getAllTools, getPackagesDir, getToolCategory, getToolCredentialsRequired, getToolIntegration, getToolSource, getToolsDir, initTools, loadExternal, loadLangChainPackages, registerTools, reloadLangChainPackages, toCatalogEntry
2231
2140
 
2232
2141
  // EXTERNAL MODULE: ./lib/tools/runtime/external.ts
2233
2142
  var external = __webpack_require__(16836);
@@ -2382,7 +2291,7 @@ const memoryUpsertTool = (0,tools/* tool */.z6)(async ({ namespace, key, record
2382
2291
  });
2383
2292
  }, {
2384
2293
  name: "memory_upsert",
2385
- description: "Store a durable, structured memory record for proactive semantic recall. Use namespace='facts' for information that should surface in future conversations. Store explicit user preferences, verified facts, decisions, constraints, and reusable project context; do not store transient chat details or secrets. Use an expiry for temporary facts, and status='archived' to soft-retire a record instead of deleting it.",
2294
+ description: "Store a durable, structured memory record for proactive semantic recall. Use namespace='facts' for information that should surface in future conversations. Store explicit user preferences, verified facts, decisions, constraints, and reusable project context; do not store transient chat details or secrets. Use an expiry for temporary facts, and status='archived' to soft-retire a record instead of deleting it. Save proactively in the same turn the information appears so other agents can use it immediately; do not defer to background compaction.",
2386
2295
  schema: schemas/* object */.Ikc({
2387
2296
  namespace: schemas/* string */.YjP().describe("Memory namespace. Use 'facts' for proactively recalled durable knowledge."),
2388
2297
  key: schemas/* string */.YjP().describe("Stable, descriptive key such as 'user-research-preference' or 'project-auth-decision'."),
@@ -8390,8 +8299,8 @@ const getIntegrationSetupTool = (0,tools/* tool */.z6)(async ({ id })=>{
8390
8299
  }
8391
8300
  });
8392
8301
 
8393
- // EXTERNAL MODULE: ./lib/stores/version-adoption.ts + 2 modules
8394
- var version_adoption = __webpack_require__(95936);
8302
+ // EXTERNAL MODULE: ./lib/stores/version-adoption.ts + 4 modules
8303
+ var version_adoption = __webpack_require__(96570);
8395
8304
  ;// ./lib/tools/general/workflow-progress.ts
8396
8305
 
8397
8306
 
@@ -8423,7 +8332,8 @@ const workflowProgressSchema = schemas/* object */.Ikc({
8423
8332
  validation_evidence: schemas/* string */.YjP().trim().min(1).max(500).optional().describe("Exact check performed and observed result. Required when marking a version_adoption item done."),
8424
8333
  summary: schemas/* string */.YjP().max(300).optional().describe("Optional short workflow summary shown in the chat checklist."),
8425
8334
  detail: schemas/* string */.YjP().max(300).optional().describe("Optional live progress text to stream immediately to the UI."),
8426
- needs_attention_reason: schemas/* string */.YjP().max(300).optional().describe("Optional reason shown when the item or workflow needs user attention.")
8335
+ needs_attention_reason: schemas/* string */.YjP().max(300).optional().describe("Optional reason shown when the item or workflow needs user attention."),
8336
+ needs_user: schemas/* boolean */.zMY().optional().describe("For version_adoption only: set true when item_id cannot progress without the user's input or approval.")
8427
8337
  });
8428
8338
  function versionAdoptionPhase(phase) {
8429
8339
  return phase === "impact_radius" || phase === "adoption" || phase === "complete" ? phase : undefined;
@@ -8517,7 +8427,7 @@ const workflowProgressTool = (0,tools/* tool */.z6)(async (input, config)=>{
8517
8427
  }
8518
8428
  }, {
8519
8429
  name: "workflow_progress",
8520
- description: "Report structured progress for a substantial multi-step task. Use only when the task has several dependent phases, likely spans turns, or needs explicit verification; skip simple tasks and work already covered by native tool progress. For agent-created workflows, send the full current items snapshot on every call and reuse the same workflow_id. Keep secrets and private data out of workflow fields. Mark items done only with observed validation evidence; use needs_attention for blockers; phase=complete requires every item done or skipped. " + "Every item needs input, expected output, and concrete validation criteria. Completed items also need observed validation_evidence. The system-owned version_adoption workflow has its own durable checklist.",
8430
+ description: "Report structured progress for a substantial multi-step task. Use only when the task has several dependent phases, likely spans turns, or needs explicit verification; skip simple tasks and work already covered by native tool progress. For agent-created workflows, send the full current items snapshot on every call and reuse the same workflow_id. Keep secrets and private data out of workflow fields. Mark items done only with observed validation evidence; use needs_attention for blockers; phase=complete requires every item done or skipped. " + "A rejected update, or a step left checking or needs_attention at the end of the turn, is retried automatically (at most 3 attempts per step); set needs_user=true on a step that only the user can unblock. " + "Every item needs input, expected output, and concrete validation criteria. Completed items also need observed validation_evidence. The system-owned version_adoption workflow has its own durable checklist.",
8521
8431
  schema: workflowProgressSchema
8522
8432
  });
8523
8433
  (0,langchain_package/* registerLangChainPackage */.p)({
@@ -9222,11 +9132,6 @@ var optional_package = __webpack_require__(71239);
9222
9132
  const msTodoReadTools = (0,optional_package/* optionalTools */.am)("@circuitwall/ms-todo-langchain", "msTodoReadTools");
9223
9133
  const msTodoWriteTools = (0,optional_package/* optionalTools */.am)("@circuitwall/ms-todo-langchain", "msTodoWriteTools");
9224
9134
  const setAuthResolver = (0,optional_package/* optionalFunction */.rz)("@circuitwall/ms-todo-langchain", "setAuthResolver", ()=>undefined);
9225
- // Exposed for the integrations test endpoint, matching the gmail/outlook
9226
- // `_resolveXxxAuth` probe convention.
9227
- function _resolveMsTodoAuth() {
9228
- return resolveMicrosoftAuth();
9229
- }
9230
9135
  // Bridge: the package calls this on every tool invocation. We resolve
9231
9136
  // the user's Microsoft credentials from Jarela's encrypted store (or env
9232
9137
  // vars) and exchange them for a short-lived access token via the shared
@@ -9473,8 +9378,8 @@ const msPeopleResolveTool = (0,tools/* tool */.z6)(async (args)=>{
9473
9378
  }
9474
9379
  });
9475
9380
 
9476
- // EXTERNAL MODULE: ./lib/agents/run-thread.ts + 22 modules
9477
- var run_thread = __webpack_require__(90424);
9381
+ // EXTERNAL MODULE: ./lib/agents/run-thread.ts + 23 modules
9382
+ var run_thread = __webpack_require__(91388);
9478
9383
  // EXTERNAL MODULE: ./lib/agents/model-router.ts + 1 modules
9479
9384
  var model_router = __webpack_require__(56236);
9480
9385
  // EXTERNAL MODULE: ./lib/agents/stream-collector.ts
@@ -9906,7 +9811,7 @@ const listToolsTool = (0,tools/* tool */.z6)(async ({ query, names, category, ca
9906
9811
  })
9907
9812
  });
9908
9813
  async function loadInputSchemas() {
9909
- const tools = await runtime_getAllToolsAsync();
9814
+ const tools = await getAllToolsAsync();
9910
9815
  return new Map(toOpenAITools(tools).map((toolDef)=>[
9911
9816
  toolDef.function.name,
9912
9817
  toolDef.function.parameters
@@ -12925,7 +12830,7 @@ function getAllTools(policy) {
12925
12830
  ...ext.tools.filter((t)=>!(0,disabled_dropin_tools/* isDropinDisabled */.H)(t.name)).map(wallclock/* wrapWithWallclock */.ZW)
12926
12831
  ], policy);
12927
12832
  }
12928
- async function runtime_getAllToolsAsync(policy) {
12833
+ async function getAllToolsAsync(policy) {
12929
12834
  try {
12930
12835
  await (0,langchain_packages/* loadLangChainPackages */.Jv)();
12931
12836
  } catch (err) {
@@ -13069,9 +12974,6 @@ function getToolSource(name) {
13069
12974
  if (catalog_loadExternal().tools.some((t)=>t.name === name)) return "external";
13070
12975
  return "mcp";
13071
12976
  }
13072
- function getToolCapability(name) {
13073
- return registeredCapability(name) ?? "execute";
13074
- }
13075
12977
  function getToolCategory(name) {
13076
12978
  const builtin = (0,registry/* registeredCategory */.RY)(name);
13077
12979
  if (builtin) return builtin;
@@ -13081,15 +12983,6 @@ function getToolCategory(name) {
13081
12983
  const mcpCat = (0,client/* getMcpToolMeta */.k2)(name)?.category;
13082
12984
  return (0,categories/* normalizeToolCategory */.eb)(mcpCat);
13083
12985
  }
13084
- function getToolGroup(name) {
13085
- const cat = getToolCategory(name);
13086
- if (cat === "MCP") return null;
13087
- const builtinGroup = registeredGroup(name);
13088
- if (builtinGroup !== undefined) return builtinGroup;
13089
- const mcpGroup = getMcpToolMeta(name)?.group;
13090
- if (mcpGroup !== undefined) return mcpGroup;
13091
- return groupForCategory(cat);
13092
- }
13093
12986
  function getToolCredentialsRequired(name) {
13094
12987
  if (registeredCategory(name)) return [];
13095
12988
  const ext = catalog_loadExternal().credentialsRequired.get(name);
@@ -13122,10 +13015,6 @@ function unconfiguredReason(entry) {
13122
13015
  function getDefaultAgentToolNames() {
13123
13016
  return getAllTools().filter((t)=>isDefaultBasicTool(t.name, getToolCategory(t.name))).map((t)=>t.name);
13124
13017
  }
13125
- async function getDefaultAgentToolNamesAsync() {
13126
- const tools = await getAllToolsAsync();
13127
- return tools.filter((t)=>isDefaultBasicTool(t.name, getToolCategory(t.name))).map((t)=>t.name);
13128
- }
13129
13018
  function isDefaultBasicTool(name, category) {
13130
13019
  return (0,categories/* isBasicToolCategory */.D6)(category) && !DEFAULT_EXCLUDED_BASIC_TOOLS.has(name);
13131
13020
  }
@@ -14575,7 +14464,7 @@ function cookiePathMatches(reqPath, cookiePath) {
14575
14464
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14576
14465
  /* harmony export */ V: () => (/* binding */ collectStream)
14577
14466
  /* harmony export */ });
14578
- /* harmony import */ var _lib_agents_run_thread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90424);
14467
+ /* harmony import */ var _lib_agents_run_thread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91388);
14579
14468
  /* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22032);
14580
14469
  // Shared collector for agent stream consumers.
14581
14470
  //
@@ -14720,7 +14609,7 @@ function cookiePathMatches(reqPath, cookiePath) {
14720
14609
  /* harmony export */ $: () => (/* binding */ moveThreadContextBoundary)
14721
14610
  /* harmony export */ });
14722
14611
  /* harmony import */ var _lib_stores_threads__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(83042);
14723
- /* harmony import */ var _lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(79640);
14612
+ /* harmony import */ var _lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36923);
14724
14613
 
14725
14614
 
14726
14615
  // Every caller of moveThreadContextBoundary represents a user-initiated
@@ -15407,7 +15296,7 @@ async function spillFileBuffer(raw, media_type, filename) {
15407
15296
  /* harmony export */ runAgentTurn: () => (/* binding */ runAgentTurn)
15408
15297
  /* harmony export */ });
15409
15298
  /* unused harmony export AgentTurnStreamError */
15410
- /* harmony import */ var _lib_agents_run_thread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(90424);
15299
+ /* harmony import */ var _lib_agents_run_thread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91388);
15411
15300
  /* harmony import */ var _lib_agents_transcript_draft__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(87627);
15412
15301
  /* harmony import */ var _api_message_content__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9104);
15413
15302
  /* harmony import */ var _lib_agents_model_router__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56236);
@@ -15581,436 +15470,6 @@ class AgentTurnStreamError extends Error {
15581
15470
  }
15582
15471
 
15583
15472
 
15584
- /***/ }),
15585
-
15586
- /***/ 62174:
15587
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15588
-
15589
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15590
- /* harmony export */ $V: () => (/* binding */ getLatestMessageUsageForThread),
15591
- /* harmony export */ kw: () => (/* binding */ getMessageUsageByIds),
15592
- /* harmony export */ up: () => (/* binding */ recordMessageUsage)
15593
- /* harmony export */ });
15594
- /* harmony import */ var _lib_db__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
15595
- // ADR-0041. Immutable per-assistant-turn snapshot of LLM usage.
15596
- //
15597
- // Written once when an assistant turn is persisted (see
15598
- // `persistAssistantMessage` in lib/agents/run-thread.ts). Never updated.
15599
- // The dashboard reads this table in preference to recomputing tokens /
15600
- // cost from `messages.content` + current agent_configs joins.
15601
-
15602
- function recordMessageUsage(input) {
15603
- const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
15604
- const t = input.tier_usage ?? null;
15605
- db.prepare(`INSERT OR IGNORE INTO message_usage (
15606
- message_id, thread_id, agent_id, agent_name, provider, model_id,
15607
- model_config_name, input_tokens, output_tokens,
15608
- input_rate_usd_per_mtok, output_rate_usd_per_mtok, cost_usd, created_at,
15609
- hot_tokens, warm_tokens, facts_tokens, overhead_tokens,
15610
- hot_budget_tokens, warm_budget_tokens, facts_budget_tokens, context_window_tokens,
15611
- cache_creation_input_tokens, cache_read_input_tokens, thinking_tokens
15612
- ) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`).run(input.message_id, input.thread_id, input.agent_id, input.agent_name, input.provider, input.model_id, input.model_config_name, input.input_tokens, input.output_tokens, input.input_rate_usd_per_mtok, input.output_rate_usd_per_mtok, input.cost_usd, new Date().toISOString(), t?.hot_tokens ?? null, t?.warm_tokens ?? null, t?.facts_tokens ?? null, t?.overhead_tokens ?? null, t?.hot_budget_tokens ?? null, t?.warm_budget_tokens ?? null, t?.facts_budget_tokens ?? null, t?.context_window_tokens ?? null, input.cache_creation_input_tokens ?? null, input.cache_read_input_tokens ?? null, input.thinking_tokens ?? null);
15613
- }
15614
- function getMessageUsageByIds(messageIds) {
15615
- const out = new Map();
15616
- if (messageIds.length === 0) return out;
15617
- const placeholders = messageIds.map(()=>"?").join(",");
15618
- const rows = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare(`SELECT * FROM message_usage WHERE message_id IN (${placeholders})`).all(...messageIds);
15619
- for (const row of rows)out.set(row.message_id, row);
15620
- return out;
15621
- }
15622
- function getLatestMessageUsageForThread(threadId) {
15623
- return (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)().prepare("SELECT * FROM message_usage WHERE thread_id=? ORDER BY created_at DESC LIMIT 1").get(threadId) ?? null;
15624
- }
15625
-
15626
-
15627
- /***/ }),
15628
-
15629
- /***/ 66963:
15630
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15631
-
15632
-
15633
- // EXPORTS
15634
- __webpack_require__.d(__webpack_exports__, {
15635
- w: () => (/* binding */ getCheckpointer)
15636
- });
15637
-
15638
- // EXTERNAL MODULE: external "node:path"
15639
- var external_node_path_ = __webpack_require__(76760);
15640
- // EXTERNAL MODULE: ./lib/db/data-dir.ts
15641
- var data_dir = __webpack_require__(57477);
15642
- // EXTERNAL MODULE: external "node:sqlite"
15643
- var external_node_sqlite_ = __webpack_require__(80099);
15644
- // EXTERNAL MODULE: ./node_modules/@langchain/langgraph-checkpoint/dist/index.js + 86 modules
15645
- var dist = __webpack_require__(8808);
15646
- ;// ./lib/agents/sqlite-checkpoint-saver.ts
15647
-
15648
-
15649
- // In-tree LangGraph checkpoint saver backed by node:sqlite.
15650
- //
15651
- // Schema-compatible drop-in replacement for SqliteSaver from
15652
- // @langchain/langgraph-checkpoint-sqlite. The DDL is byte-identical so an
15653
- // existing checkpoints.db keeps working without migration.
15654
- const VALID_FILTER_KEYS = [
15655
- "source",
15656
- "step",
15657
- "parents"
15658
- ];
15659
- function buildLatestSelect(includeCheckpointId) {
15660
- return `
15661
- SELECT
15662
- thread_id,
15663
- checkpoint_ns,
15664
- checkpoint_id,
15665
- parent_checkpoint_id,
15666
- type,
15667
- checkpoint,
15668
- metadata,
15669
- (
15670
- SELECT
15671
- json_group_array(
15672
- json_object(
15673
- 'task_id', pw.task_id,
15674
- 'channel', pw.channel,
15675
- 'type', pw.type,
15676
- 'value', CAST(pw.value AS TEXT)
15677
- )
15678
- )
15679
- FROM writes as pw
15680
- WHERE pw.thread_id = checkpoints.thread_id
15681
- AND pw.checkpoint_ns = checkpoints.checkpoint_ns
15682
- AND pw.checkpoint_id = checkpoints.checkpoint_id
15683
- ) as pending_writes,
15684
- (
15685
- SELECT
15686
- json_group_array(
15687
- json_object(
15688
- 'type', ps.type,
15689
- 'value', CAST(ps.value AS TEXT)
15690
- )
15691
- )
15692
- FROM writes as ps
15693
- WHERE ps.thread_id = checkpoints.thread_id
15694
- AND ps.checkpoint_ns = checkpoints.checkpoint_ns
15695
- AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
15696
- AND ps.channel = '${dist/* TASKS */.n3}'
15697
- ORDER BY ps.idx
15698
- ) as pending_sends
15699
- FROM checkpoints
15700
- WHERE thread_id = ? AND checkpoint_ns = ? ${includeCheckpointId ? "AND checkpoint_id = ?" : "ORDER BY checkpoint_id DESC LIMIT 1"}`;
15701
- }
15702
- // node:sqlite rejects `undefined` parameter binds; coerce to null.
15703
- function nv(v) {
15704
- return v === undefined ? null : v;
15705
- }
15706
- class NodeSqliteSaver extends dist/* BaseCheckpointSaver */.R1 {
15707
- constructor(db, serde){
15708
- super(serde), this.isSetup = false;
15709
- this.db = db;
15710
- }
15711
- static fromConnString(connStringOrLocalPath) {
15712
- return new NodeSqliteSaver(new external_node_sqlite_.DatabaseSync(connStringOrLocalPath));
15713
- }
15714
- setup() {
15715
- if (this.isSetup) return;
15716
- this.db.exec("PRAGMA journal_mode=WAL");
15717
- this.db.exec(`
15718
- CREATE TABLE IF NOT EXISTS checkpoints (
15719
- thread_id TEXT NOT NULL,
15720
- checkpoint_ns TEXT NOT NULL DEFAULT '',
15721
- checkpoint_id TEXT NOT NULL,
15722
- parent_checkpoint_id TEXT,
15723
- type TEXT,
15724
- checkpoint BLOB,
15725
- metadata BLOB,
15726
- PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id)
15727
- );`);
15728
- this.db.exec(`
15729
- CREATE TABLE IF NOT EXISTS writes (
15730
- thread_id TEXT NOT NULL,
15731
- checkpoint_ns TEXT NOT NULL DEFAULT '',
15732
- checkpoint_id TEXT NOT NULL,
15733
- task_id TEXT NOT NULL,
15734
- idx INTEGER NOT NULL,
15735
- channel TEXT NOT NULL,
15736
- type TEXT,
15737
- value BLOB,
15738
- PRIMARY KEY (thread_id, checkpoint_ns, checkpoint_id, task_id, idx)
15739
- );`);
15740
- this.withoutCheckpoint = this.db.prepare(buildLatestSelect(false));
15741
- this.withCheckpoint = this.db.prepare(buildLatestSelect(true));
15742
- this.isSetup = true;
15743
- }
15744
- txn(fn) {
15745
- this.db.exec("BEGIN");
15746
- try {
15747
- const result = fn();
15748
- this.db.exec("COMMIT");
15749
- return result;
15750
- } catch (err) {
15751
- try {
15752
- this.db.exec("ROLLBACK");
15753
- } catch {
15754
- // ignore rollback failure; surface the original error
15755
- }
15756
- throw err;
15757
- }
15758
- }
15759
- async decodeRowState(row) {
15760
- const pendingWrites = await Promise.all(JSON.parse(String(row.pending_writes ?? "[]")).map(async (write)=>{
15761
- return [
15762
- write.task_id,
15763
- write.channel,
15764
- await this.serde.loadsTyped(write.type ?? "json", write.value ?? "")
15765
- ];
15766
- }));
15767
- const checkpoint = await this.serde.loadsTyped(row.type ?? "json", row.checkpoint);
15768
- if (checkpoint.v < 4 && row.parent_checkpoint_id != null) {
15769
- await this.migratePendingSends(checkpoint, row.thread_id, row.parent_checkpoint_id);
15770
- }
15771
- const metadata = await this.serde.loadsTyped(row.type ?? "json", row.metadata);
15772
- return {
15773
- pendingWrites,
15774
- checkpoint,
15775
- metadata
15776
- };
15777
- }
15778
- async getTuple(config) {
15779
- this.setup();
15780
- const { thread_id, checkpoint_ns = "", checkpoint_id } = config.configurable ?? {};
15781
- const args = [
15782
- nv(thread_id),
15783
- checkpoint_ns
15784
- ];
15785
- if (checkpoint_id) args.push(checkpoint_id);
15786
- const stmt = checkpoint_id ? this.withCheckpoint : this.withoutCheckpoint;
15787
- const row = stmt.get(...args);
15788
- if (row === undefined) return undefined;
15789
- let finalConfig = config;
15790
- if (!checkpoint_id) {
15791
- finalConfig = {
15792
- configurable: {
15793
- thread_id: row.thread_id,
15794
- checkpoint_ns,
15795
- checkpoint_id: row.checkpoint_id
15796
- }
15797
- };
15798
- }
15799
- if (finalConfig.configurable?.thread_id === undefined || finalConfig.configurable?.checkpoint_id === undefined) {
15800
- throw new Error("Missing thread_id or checkpoint_id");
15801
- }
15802
- const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
15803
- return {
15804
- checkpoint,
15805
- config: finalConfig,
15806
- metadata,
15807
- parentConfig: row.parent_checkpoint_id ? {
15808
- configurable: {
15809
- thread_id: row.thread_id,
15810
- checkpoint_ns,
15811
- checkpoint_id: row.parent_checkpoint_id
15812
- }
15813
- } : undefined,
15814
- pendingWrites
15815
- };
15816
- }
15817
- async *list(config, options) {
15818
- const { limit, before, filter } = options ?? {};
15819
- this.setup();
15820
- const thread_id = config.configurable?.thread_id;
15821
- const checkpoint_ns = config.configurable?.checkpoint_ns;
15822
- let sql = `
15823
- SELECT
15824
- thread_id,
15825
- checkpoint_ns,
15826
- checkpoint_id,
15827
- parent_checkpoint_id,
15828
- type,
15829
- checkpoint,
15830
- metadata,
15831
- (
15832
- SELECT
15833
- json_group_array(
15834
- json_object(
15835
- 'task_id', pw.task_id,
15836
- 'channel', pw.channel,
15837
- 'type', pw.type,
15838
- 'value', CAST(pw.value AS TEXT)
15839
- )
15840
- )
15841
- FROM writes as pw
15842
- WHERE pw.thread_id = checkpoints.thread_id
15843
- AND pw.checkpoint_ns = checkpoints.checkpoint_ns
15844
- AND pw.checkpoint_id = checkpoints.checkpoint_id
15845
- ) as pending_writes,
15846
- (
15847
- SELECT
15848
- json_group_array(
15849
- json_object(
15850
- 'type', ps.type,
15851
- 'value', CAST(ps.value AS TEXT)
15852
- )
15853
- )
15854
- FROM writes as ps
15855
- WHERE ps.thread_id = checkpoints.thread_id
15856
- AND ps.checkpoint_ns = checkpoints.checkpoint_ns
15857
- AND ps.checkpoint_id = checkpoints.parent_checkpoint_id
15858
- AND ps.channel = '${dist/* TASKS */.n3}'
15859
- ORDER BY ps.idx
15860
- ) as pending_sends
15861
- FROM checkpoints\n`;
15862
- const whereClause = [];
15863
- if (thread_id !== undefined && thread_id !== null) whereClause.push("thread_id = ?");
15864
- if (checkpoint_ns !== undefined && checkpoint_ns !== null) {
15865
- whereClause.push("checkpoint_ns = ?");
15866
- }
15867
- if (before?.configurable?.checkpoint_id !== undefined) {
15868
- whereClause.push("checkpoint_id < ?");
15869
- }
15870
- const sanitizedFilter = Object.fromEntries(Object.entries(filter ?? {}).filter(([key, value])=>value !== undefined && VALID_FILTER_KEYS.includes(key)));
15871
- whereClause.push(...Object.entries(sanitizedFilter).map(([key])=>`jsonb(CAST(metadata AS TEXT))->'$.${key}' = ?`));
15872
- if (whereClause.length > 0) sql += `WHERE\n ${whereClause.join(" AND\n ")}\n`;
15873
- sql += "\nORDER BY checkpoint_id DESC";
15874
- if (limit) sql += ` LIMIT ${parseInt(String(limit), 10)}`;
15875
- const args = [
15876
- thread_id,
15877
- checkpoint_ns,
15878
- before?.configurable?.checkpoint_id,
15879
- ...Object.values(sanitizedFilter).map((value)=>JSON.stringify(value))
15880
- ].filter((value)=>value !== undefined && value !== null);
15881
- const rows = this.db.prepare(sql).all(...args);
15882
- for (const row of rows){
15883
- const { pendingWrites, checkpoint, metadata } = await this.decodeRowState(row);
15884
- yield {
15885
- config: {
15886
- configurable: {
15887
- thread_id: row.thread_id,
15888
- checkpoint_ns: row.checkpoint_ns,
15889
- checkpoint_id: row.checkpoint_id
15890
- }
15891
- },
15892
- checkpoint,
15893
- metadata,
15894
- parentConfig: row.parent_checkpoint_id ? {
15895
- configurable: {
15896
- thread_id: row.thread_id,
15897
- checkpoint_ns: row.checkpoint_ns,
15898
- checkpoint_id: row.parent_checkpoint_id
15899
- }
15900
- } : undefined,
15901
- pendingWrites
15902
- };
15903
- }
15904
- }
15905
- async put(config, checkpoint, metadata) {
15906
- this.setup();
15907
- if (!config.configurable) throw new Error("Empty configuration supplied.");
15908
- const thread_id = config.configurable?.thread_id;
15909
- const checkpoint_ns = config.configurable?.checkpoint_ns ?? "";
15910
- const parent_checkpoint_id = config.configurable?.checkpoint_id;
15911
- if (!thread_id) {
15912
- throw new Error(`Missing "thread_id" field in passed "config.configurable".`);
15913
- }
15914
- const preparedCheckpoint = (0,dist/* copyCheckpoint */.IE)(checkpoint);
15915
- const [[type1, serializedCheckpoint], [type2, serializedMetadata]] = await Promise.all([
15916
- this.serde.dumpsTyped(preparedCheckpoint),
15917
- this.serde.dumpsTyped(metadata)
15918
- ]);
15919
- if (type1 !== type2) {
15920
- throw new Error("Failed to serialized checkpoint and metadata to the same type.");
15921
- }
15922
- this.db.prepare(`INSERT OR REPLACE INTO checkpoints (thread_id, checkpoint_ns, checkpoint_id, parent_checkpoint_id, type, checkpoint, metadata) VALUES (?, ?, ?, ?, ?, ?, ?)`).run(thread_id, checkpoint_ns, checkpoint.id, nv(parent_checkpoint_id), type1, serializedCheckpoint, serializedMetadata);
15923
- return {
15924
- configurable: {
15925
- thread_id,
15926
- checkpoint_ns,
15927
- checkpoint_id: checkpoint.id
15928
- }
15929
- };
15930
- }
15931
- async putWrites(config, writes, taskId) {
15932
- this.setup();
15933
- if (!config.configurable) throw new Error("Empty configuration supplied.");
15934
- if (!config.configurable?.thread_id) {
15935
- throw new Error("Missing thread_id field in config.configurable.");
15936
- }
15937
- if (!config.configurable?.checkpoint_id) {
15938
- throw new Error("Missing checkpoint_id field in config.configurable.");
15939
- }
15940
- const stmt = this.db.prepare(`
15941
- INSERT OR REPLACE INTO writes
15942
- (thread_id, checkpoint_ns, checkpoint_id, task_id, idx, channel, type, value)
15943
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)
15944
- `);
15945
- const rows = await Promise.all(writes.map(async (write, idx)=>{
15946
- const [type, serializedWrite] = await this.serde.dumpsTyped(write[1]);
15947
- return [
15948
- config.configurable?.thread_id,
15949
- config.configurable?.checkpoint_ns ?? "",
15950
- config.configurable?.checkpoint_id,
15951
- taskId,
15952
- idx,
15953
- write[0],
15954
- type,
15955
- serializedWrite
15956
- ];
15957
- }));
15958
- this.txn(()=>{
15959
- for (const row of rows)stmt.run(...row);
15960
- });
15961
- }
15962
- async deleteThread(threadId) {
15963
- this.setup();
15964
- this.txn(()=>{
15965
- this.db.prepare(`DELETE FROM checkpoints WHERE thread_id = ?`).run(threadId);
15966
- this.db.prepare(`DELETE FROM writes WHERE thread_id = ?`).run(threadId);
15967
- });
15968
- }
15969
- async migratePendingSends(checkpoint, threadId, parentCheckpointId) {
15970
- const row = this.db.prepare(`
15971
- SELECT
15972
- checkpoint_id,
15973
- json_group_array(
15974
- json_object(
15975
- 'type', ps.type,
15976
- 'value', CAST(ps.value AS TEXT)
15977
- )
15978
- ) as pending_sends
15979
- FROM writes as ps
15980
- WHERE ps.thread_id = ?
15981
- AND ps.checkpoint_id = ?
15982
- AND ps.channel = '${dist/* TASKS */.n3}'
15983
- ORDER BY ps.idx
15984
- `).get(threadId, parentCheckpointId);
15985
- const pendingSendsJson = String(row?.pending_sends ?? "[]");
15986
- const mutable = checkpoint;
15987
- mutable.channel_values ??= {};
15988
- mutable.channel_values[dist/* TASKS */.n3] = await Promise.all(JSON.parse(pendingSendsJson).map(({ type, value })=>this.serde.loadsTyped(type ?? "json", value ?? "")));
15989
- mutable.channel_versions[dist/* TASKS */.n3] = Object.keys(checkpoint.channel_versions).length > 0 ? (0,dist/* maxChannelVersion */.qU)(...Object.values(checkpoint.channel_versions)) : this.getNextVersion(undefined);
15990
- }
15991
- }
15992
-
15993
- ;// ./lib/agents/checkpointer.ts
15994
-
15995
-
15996
-
15997
- // Persistent graph state per thread_id. Multi-step plans, scratchpad messages,
15998
- // and any pending tool-call sequence survive process restarts and resume on
15999
- // the next agent.stream() with the same thread_id.
16000
- //
16001
- // Stored in a separate DB file (~/.jarela/checkpoints.db) so LangGraph
16002
- // manages its own schema independently of our own migrations under
16003
- // lib/db/. Both files use WAL mode via the same node:sqlite driver.
16004
- const CHECKPOINT_PATH = (0,external_node_path_.join)((0,data_dir/* getDataDir */.o)(), "checkpoints.db");
16005
- let _saver = null;
16006
- function getCheckpointer() {
16007
- if (!_saver) {
16008
- _saver = NodeSqliteSaver.fromConnString(CHECKPOINT_PATH);
16009
- }
16010
- return _saver;
16011
- }
16012
-
16013
-
16014
15473
  /***/ }),
16015
15474
 
16016
15475
  /***/ 67032:
@@ -16163,387 +15622,6 @@ function setUserPreset(preset) {
16163
15622
  }
16164
15623
 
16165
15624
 
16166
- /***/ }),
16167
-
16168
- /***/ 68564:
16169
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16170
-
16171
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16172
- /* harmony export */ AD: () => (/* binding */ startRun),
16173
- /* harmony export */ B1: () => (/* binding */ subscribe),
16174
- /* harmony export */ Cs: () => (/* binding */ waitForRun),
16175
- /* harmony export */ ES: () => (/* binding */ abortAllRuns),
16176
- /* harmony export */ JH: () => (/* binding */ finishRun),
16177
- /* harmony export */ KD: () => (/* binding */ abortRun),
16178
- /* harmony export */ Mh: () => (/* binding */ getRun),
16179
- /* harmony export */ QK: () => (/* binding */ drainSteering),
16180
- /* harmony export */ mq: () => (/* binding */ broadcast),
16181
- /* harmony export */ mx: () => (/* binding */ pushSteering)
16182
- /* harmony export */ });
16183
- /* unused harmony export waitForRunsToSettle */
16184
- /* harmony import */ var _lib_env_config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67500);
16185
- /* harmony import */ var _lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15559);
16186
-
16187
-
16188
- // Read once at module init. JARELA_RUN_BUFFER_SIZE / JARELA_RUN_REGISTRY_TTL_MS
16189
- // override the defaults.
16190
- const MAX_BUFFERED = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runBufferSize;
16191
- const RECENT_TTL_MS = (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runRegistryTtlMs;
16192
- // Idle (no-progress) ceiling and wall-clock ceiling: read fresh per-run
16193
- // from getConfig() so non-restart-required env reloads take effect.
16194
- function runIdleMs() {
16195
- return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runIdleMs;
16196
- }
16197
- function runMaxMs() {
16198
- return (0,_lib_env_config__WEBPACK_IMPORTED_MODULE_0__/* .getConfig */ .z)().runMaxMs;
16199
- }
16200
- const registryState = (0,_lib_utils_global_state__WEBPACK_IMPORTED_MODULE_1__/* .getOrCreateGlobal */ .X)("__jarela_active_run_registry", ()=>({
16201
- runs: new Map(),
16202
- waiters: new Map()
16203
- }));
16204
- const runs = registryState.runs;
16205
- // Cold-attach waiters: subscribers that opened a GET /run before the
16206
- // server-side run actually called startRun (typical for triggers /
16207
- // scheduler / watcher, which submit through `after()` + the per-thread
16208
- // queue, so there's a real delay between the user clicking "Run now"
16209
- // and the registry entry appearing). Resolved by `startRun` below.
16210
- const waiters = registryState.waiters;
16211
- /** Wait up to `timeoutMs` for a run to be registered on `thread_id`.
16212
- * Resolves immediately with the current run if one is already active,
16213
- * with the new run when `startRun` fires inside the window, or with
16214
- * `null` on timeout. `timeoutMs <= 0` short-circuits to the current
16215
- * state without waiting. Caller is responsible for closing the SSE
16216
- * stream when this resolves null. */ function waitForRun(thread_id, timeoutMs) {
16217
- const existing = runs.get(thread_id);
16218
- if (existing) return Promise.resolve(existing);
16219
- if (timeoutMs <= 0) return Promise.resolve(null);
16220
- return new Promise((resolve)=>{
16221
- let set = waiters.get(thread_id);
16222
- if (!set) {
16223
- set = new Set();
16224
- waiters.set(thread_id, set);
16225
- }
16226
- const fn = (run)=>{
16227
- clearTimeout(timer);
16228
- resolve(run);
16229
- };
16230
- set.add(fn);
16231
- const timer = setTimeout(()=>{
16232
- const cur = waiters.get(thread_id);
16233
- cur?.delete(fn);
16234
- if (cur && cur.size === 0) waiters.delete(thread_id);
16235
- resolve(null);
16236
- }, timeoutMs);
16237
- timer.unref?.();
16238
- });
16239
- }
16240
- function startRun(thread_id, agent_id) {
16241
- // If a stale completed run exists, drop it before starting a new one.
16242
- const existing = runs.get(thread_id);
16243
- if (existing && existing.status === "running") {
16244
- throw new Error(`A run is already active for thread ${thread_id}`);
16245
- }
16246
- const now = Date.now();
16247
- const run = {
16248
- thread_id,
16249
- agent_id,
16250
- started_at: now,
16251
- finished_at: null,
16252
- status: "running",
16253
- events: [],
16254
- subscribers: new Set(),
16255
- final_text: "",
16256
- abort: new AbortController(),
16257
- last_chunk_at: now,
16258
- inflight_tools: new Set(),
16259
- tool_started_at: new Map(),
16260
- tool_time_ms_done: 0,
16261
- steering: []
16262
- };
16263
- runs.set(thread_id, run);
16264
- // Wake any GET subscribers that attached before the run was registered.
16265
- const pending = waiters.get(thread_id);
16266
- if (pending) {
16267
- waiters.delete(thread_id);
16268
- for (const fn of pending){
16269
- try {
16270
- fn(run);
16271
- } catch {}
16272
- }
16273
- }
16274
- scheduleIdleWatchdog(run);
16275
- scheduleMaxWatchdog(run);
16276
- return run;
16277
- }
16278
- // Synthesise a typed error chunk for the watchdog termination paths and
16279
- // fan it out to subscribers BEFORE flipping `status` to "error". The order
16280
- // matters: `broadcast()`'s status guard drops any chunk delivered after
16281
- // `finishRun()` has run, so calling finishRun first would silently swallow
16282
- // the error and the client's EventSource would just see the connection
16283
- // close with no terminal event — bubble keeps spinning, no toast. Doing
16284
- // it the other way around lets the client receive a real error event,
16285
- // render a "Run timed out" toast, and (if the consumer wires it up)
16286
- // trigger an auto-retry path. Followed by `done` so the consumer's
16287
- // for-await loop can break cleanly without waiting for an EOF.
16288
- function emitWatchdogTermination(run, code, message) {
16289
- if (run.status !== "running") return;
16290
- // Direct registry mutation so the broadcast goes through the regular
16291
- // path (subscribers + buffer + seq stamp) without re-entering any of
16292
- // the watchdog scheduling. Mirrors broadcast() but bypasses the
16293
- // status check we'd otherwise be racing against.
16294
- run.last_chunk_at = Date.now();
16295
- const errChunk = {
16296
- type: "error",
16297
- data: {
16298
- message,
16299
- code
16300
- }
16301
- };
16302
- if (run.events.length < MAX_BUFFERED) run.events.push(errChunk);
16303
- for (const fn of run.subscribers){
16304
- try {
16305
- fn(errChunk);
16306
- } catch {}
16307
- }
16308
- // Pair with a synthetic `done` so the client's consume() loop breaks
16309
- // on a terminal event rather than waiting for the EventSource to close.
16310
- const doneChunk = {
16311
- type: "done",
16312
- data: {}
16313
- };
16314
- if (run.events.length < MAX_BUFFERED) run.events.push(doneChunk);
16315
- for (const fn of run.subscribers){
16316
- try {
16317
- fn(doneChunk);
16318
- } catch {}
16319
- }
16320
- }
16321
- // Self-rearming idle watchdog. Fires when no chunk has arrived for
16322
- // `idleMs`; otherwise reschedules itself for `(last_chunk_at + idleMs) -
16323
- // now`. We never carry a handle on the run — the closure just bails if
16324
- // the run is no longer the registry's entry or no longer running.
16325
- function scheduleIdleWatchdog(run) {
16326
- const idleMs = runIdleMs();
16327
- const fireIn = Math.max(0, run.last_chunk_at + idleMs - Date.now());
16328
- setTimeout(()=>{
16329
- const cur = runs.get(run.thread_id);
16330
- if (cur !== run) return;
16331
- if (run.status !== "running") return;
16332
- const idle = Date.now() - run.last_chunk_at;
16333
- if (idle < idleMs) {
16334
- scheduleIdleWatchdog(run);
16335
- return;
16336
- }
16337
- if (run.inflight_tools.size > 0) {
16338
- // Tool execution in progress — silence here is the tool working,
16339
- // not a wedged provider stream. Skip the kill, re-check in idleMs.
16340
- // The tool_result will bump last_chunk_at when it lands.
16341
- setTimeout(()=>scheduleIdleWatchdog(run), idleMs).unref?.();
16342
- return;
16343
- }
16344
- console.warn(`[run-registry] idle watchdog: force-finishing stalled run for thread ${run.thread_id} after ${idle}ms of no progress`);
16345
- emitWatchdogTermination(run, "run_idle_timeout", `Run timed out — no progress for ${Math.round(idle / 1000)}s. The provider stream went silent before the agent finished. Try again, or split the request into smaller steps.`);
16346
- try {
16347
- run.abort.abort("run_idle_timeout");
16348
- } catch {}
16349
- finishRun(run, "error");
16350
- }, fireIn).unref?.();
16351
- }
16352
- // Wall-clock elapsed minus time spent inside tool calls (both completed and
16353
- // currently in flight). The wall-clock watchdog uses this so a 5-minute
16354
- // shell exec or a slow MCP roundtrip doesn't burn the agent's budget;
16355
- // tools enforce their own timeouts. See ActiveRun.tool_started_at for the
16356
- // rationale.
16357
- function effectiveElapsedMs(run, now) {
16358
- let inflightToolMs = 0;
16359
- for (const startedAt of run.tool_started_at.values()){
16360
- inflightToolMs += Math.max(0, now - startedAt);
16361
- }
16362
- return Math.max(0, now - run.started_at - run.tool_time_ms_done - inflightToolMs);
16363
- }
16364
- function scheduleMaxWatchdog(run) {
16365
- const max = runMaxMs();
16366
- const now = Date.now();
16367
- const fireIn = Math.max(0, max - effectiveElapsedMs(run, now));
16368
- setTimeout(()=>{
16369
- const cur = runs.get(run.thread_id);
16370
- if (cur !== run) return;
16371
- if (run.status !== "running") return;
16372
- const elapsed = effectiveElapsedMs(run, Date.now());
16373
- if (elapsed < max) {
16374
- // Tool time pushed the effective elapsed back below the ceiling —
16375
- // re-arm for the remaining budget. Without this, a tool that runs
16376
- // for longer than `max` between firing and resolving would let
16377
- // the next setTimeout overshoot.
16378
- scheduleMaxWatchdog(run);
16379
- return;
16380
- }
16381
- console.warn(`[run-registry] wall-clock watchdog: force-finishing run for thread ${run.thread_id} after ${elapsed}ms of agent time (excluding tool execution)`);
16382
- emitWatchdogTermination(run, "run_max_timeout", `Run exceeded the wall-clock limit (${Math.round(max / 1000)}s of agent time, excluding tool execution). The agent was force-stopped. Try a smaller scope or raise JARELA_RUN_MAX_MS if this is expected.`);
16383
- try {
16384
- run.abort.abort("run_watchdog_timeout");
16385
- } catch {}
16386
- finishRun(run, "error");
16387
- }, fireIn).unref?.();
16388
- }
16389
- function broadcast(run, chunk) {
16390
- // Identity-check: a superseded run must not smear trailing chunks onto
16391
- // the replacement entry in the registry.
16392
- if (runs.get(run.thread_id) !== run) return;
16393
- run.last_chunk_at = Date.now();
16394
- // Heartbeats exist solely to reset the idle watchdog when the provider
16395
- // is producing chunks that don't surface downstream (most commonly
16396
- // partial tool-call args while the model streams a large file_write
16397
- // body). The last_chunk_at bump above is the entire payload — don't
16398
- // buffer, don't fan out to subscribers, or the SSE wire would carry
16399
- // meaningless tick events.
16400
- if (chunk.type === "heartbeat") return;
16401
- if (chunk.type === "text_delta") {
16402
- run.final_text += chunk.data.delta ?? "";
16403
- } else if (chunk.type === "reset_text") {
16404
- // Output-validator retry (ADR-0037) discarding a flagged completed
16405
- // reply — see StreamChunk in base.ts.
16406
- run.final_text = "";
16407
- } else if (chunk.type === "tool_call") {
16408
- const id = chunk.data.id;
16409
- if (id) {
16410
- run.inflight_tools.add(id);
16411
- run.tool_started_at.set(id, Date.now());
16412
- }
16413
- } else if (chunk.type === "tool_result") {
16414
- const id = chunk.data.id;
16415
- if (id) {
16416
- run.inflight_tools.delete(id);
16417
- const startedAt = run.tool_started_at.get(id);
16418
- if (startedAt !== undefined) {
16419
- run.tool_time_ms_done += Math.max(0, Date.now() - startedAt);
16420
- run.tool_started_at.delete(id);
16421
- // The tool just gave the agent its budget back; re-arm the
16422
- // wall-clock watchdog against the new effective elapsed.
16423
- scheduleMaxWatchdog(run);
16424
- }
16425
- }
16426
- }
16427
- if (run.events.length < MAX_BUFFERED) {
16428
- run.events.push(chunk);
16429
- }
16430
- for (const fn of run.subscribers){
16431
- try {
16432
- fn(chunk);
16433
- } catch {}
16434
- }
16435
- }
16436
- function finishRun(run, status) {
16437
- // Identity-check: a stale run finishing late must not flip the
16438
- // replacement's status or evict it from the registry.
16439
- if (runs.get(run.thread_id) !== run) return;
16440
- run.status = status;
16441
- run.finished_at = Date.now();
16442
- // Drop subscribers — late attachers should NOT keep getting events on a
16443
- // dead run. They'll get the buffered events on subscribe and that's it.
16444
- run.subscribers.clear();
16445
- // Auto-evict after TTL so memory doesn't grow with every conversation.
16446
- setTimeout(()=>{
16447
- const cur = runs.get(run.thread_id);
16448
- if (cur === run) runs.delete(run.thread_id);
16449
- }, RECENT_TTL_MS).unref?.();
16450
- }
16451
- function getRun(thread_id) {
16452
- return runs.get(thread_id) ?? null;
16453
- }
16454
- // Signal the agent stream to cancel. The stream loop in the route is wired
16455
- // to listen on the AbortController and exit early, emitting an error chunk
16456
- // the client (and the queue-drain hook) can react to. Idempotent.
16457
- function abortRun(thread_id, reason = "user_interrupted") {
16458
- const run = runs.get(thread_id);
16459
- if (!run || run.status !== "running") return false;
16460
- if (!run.abort.signal.aborted) {
16461
- try {
16462
- run.abort.abort(reason);
16463
- } catch {}
16464
- }
16465
- return true;
16466
- }
16467
- // Queue a user message typed while `thread_id` is streaming (ADR-0080).
16468
- // Returns false when there is nothing to steer, so the caller can fall back
16469
- // to starting a fresh turn.
16470
- function pushSteering(thread_id, text) {
16471
- const run = runs.get(thread_id);
16472
- if (!run || run.status !== "running" || run.abort.signal.aborted) return false;
16473
- const trimmed = text.trim();
16474
- if (!trimmed) return false;
16475
- run.steering.push(trimmed);
16476
- return true;
16477
- }
16478
- // Take everything queued so far, in arrival order. Deliberately not merged
16479
- // into a summary — collapsing several messages loses the user's intent.
16480
- function drainSteering(thread_id) {
16481
- const run = runs.get(thread_id);
16482
- if (!run || run.steering.length === 0) return [];
16483
- return run.steering.splice(0, run.steering.length);
16484
- }
16485
- // Abort every currently-running run. Used by the graceful-shutdown path so
16486
- // LangGraph stream loops bail out instead of continuing past process exit.
16487
- // Returns the number of runs that were signalled.
16488
- function abortAllRuns(reason = "server_shutdown") {
16489
- let count = 0;
16490
- for (const run of runs.values()){
16491
- if (run.status !== "running") continue;
16492
- if (run.abort.signal.aborted) continue;
16493
- try {
16494
- run.abort.abort(reason);
16495
- count++;
16496
- } catch {}
16497
- }
16498
- return count;
16499
- }
16500
- // Poll until every run has transitioned out of "running" (or until the
16501
- // caller-supplied deadline elapses). Used during graceful shutdown after
16502
- // `abortAllRuns()` so the stream `finally` blocks have a chance to flush
16503
- // the trailing error chunk and call `finishRun()`. Resolves to the count
16504
- // of runs still stuck in "running" when the deadline hit (0 = clean).
16505
- async function waitForRunsToSettle(timeoutMs) {
16506
- const deadline = Date.now() + Math.max(0, timeoutMs);
16507
- while(Date.now() < deadline){
16508
- let stillRunning = 0;
16509
- for (const run of runs.values())if (run.status === "running") stillRunning++;
16510
- if (stillRunning === 0) return 0;
16511
- await new Promise((resolve)=>setTimeout(resolve, 50));
16512
- }
16513
- let stillRunning = 0;
16514
- for (const run of runs.values())if (run.status === "running") stillRunning++;
16515
- return stillRunning;
16516
- }
16517
- // Replays buffered events synchronously, then subscribes for live ones.
16518
- // Returns an unsubscribe fn. Caller is responsible for calling it.
16519
- function subscribe(thread_id, onEvent) {
16520
- const run = runs.get(thread_id);
16521
- if (!run) return {
16522
- run: null,
16523
- unsubscribe: ()=>{}
16524
- };
16525
- // Replay buffered events first (so the new subscriber catches up).
16526
- for (const ev of run.events){
16527
- try {
16528
- onEvent(ev);
16529
- } catch {}
16530
- }
16531
- if (run.status !== "running") {
16532
- return {
16533
- run,
16534
- unsubscribe: ()=>{}
16535
- };
16536
- }
16537
- run.subscribers.add(onEvent);
16538
- return {
16539
- run,
16540
- unsubscribe: ()=>{
16541
- run.subscribers.delete(onEvent);
16542
- }
16543
- };
16544
- }
16545
-
16546
-
16547
15625
  /***/ }),
16548
15626
 
16549
15627
  /***/ 69428:
@@ -17977,7 +17055,7 @@ function persistAssistantDraftChunk(draft, chunk) {
17977
17055
 
17978
17056
  /***/ }),
17979
17057
 
17980
- /***/ 90424:
17058
+ /***/ 91388:
17981
17059
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
17982
17060
 
17983
17061
 
@@ -20133,8 +19211,8 @@ var registry = __webpack_require__(32068);
20133
19211
  var attachments_reference = __webpack_require__(43424);
20134
19212
  // EXTERNAL MODULE: ./lib/agents/thread-compaction.ts
20135
19213
  var thread_compaction = __webpack_require__(5209);
20136
- // EXTERNAL MODULE: ./lib/agents/warm-summary-background.ts
20137
- var warm_summary_background = __webpack_require__(79640);
19214
+ // EXTERNAL MODULE: ./lib/agents/warm-summary-background.ts + 1 modules
19215
+ var warm_summary_background = __webpack_require__(36923);
20138
19216
  // EXTERNAL MODULE: ./lib/agents/context-boundary.ts
20139
19217
  var context_boundary = __webpack_require__(39583);
20140
19218
  // EXTERNAL MODULE: ./lib/api/foreground-presence.ts
@@ -20311,6 +19389,194 @@ const SUMMARY_PATTERNS = [
20311
19389
 
20312
19390
 
20313
19391
 
19392
+ ;// ./lib/agents/workflow-step-retry.ts
19393
+ // Workflow-step contract enforcement. Every workflow_progress step promises
19394
+ // an input, an output, and a validation check; a model can still end a turn
19395
+ // with a rejected update, a step left mid-flight, or a step whose validation
19396
+ // failed. This module detects those breaches from the turn's own tool results
19397
+ // (code, not model judgement) and builds the targeted auto-retry nudge.
19398
+ /** Total attempts per step: the original attempt plus two automatic retries. */ const WORKFLOW_STEP_MAX_ATTEMPTS = 3;
19399
+ const WORKFLOW_STEP_AUTO_RETRIES = WORKFLOW_STEP_MAX_ATTEMPTS - 1;
19400
+ /** Hard cap on automatic workflow retries in one turn, across all steps. */ const WORKFLOW_TURN_AUTO_RETRY_LIMIT = 6;
19401
+ function asObject(value) {
19402
+ if (typeof value === "string") {
19403
+ try {
19404
+ return asObject(JSON.parse(value));
19405
+ } catch {
19406
+ return null;
19407
+ }
19408
+ }
19409
+ if (value && typeof value === "object" && !Array.isArray(value)) {
19410
+ const obj = value;
19411
+ // LangChain ToolMessage-ish wrappers carry the JSON string in `content`
19412
+ // or `kwargs.content`.
19413
+ if (obj.workflow_id === undefined) {
19414
+ // invoke_tool envelope: { ok, tool, status, result }.
19415
+ if (obj.tool === "workflow_progress" && obj.result !== undefined) return asObject(obj.result);
19416
+ const kwargs = asPlainObject(obj.kwargs);
19417
+ const content = obj.content ?? kwargs?.content;
19418
+ if (typeof content === "string") return asObject(content);
19419
+ }
19420
+ return obj;
19421
+ }
19422
+ return null;
19423
+ }
19424
+ function asPlainObject(value) {
19425
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
19426
+ }
19427
+ function str(value) {
19428
+ return typeof value === "string" && value.trim() ? value.trim() : null;
19429
+ }
19430
+ /** Normalizes a direct workflow_progress call or an invoke_tool proxy of one. */ function workflowProgressArgs(name, args) {
19431
+ const obj = asPlainObject(args);
19432
+ if (!obj) return null;
19433
+ if (name === "workflow_progress") return obj;
19434
+ if (name === "invoke_tool" && obj.name === "workflow_progress") {
19435
+ const inner = obj.args_json ?? obj.args;
19436
+ return asObject(inner);
19437
+ }
19438
+ return null;
19439
+ }
19440
+ function labelFor(itemId, items) {
19441
+ if (!itemId) return "workflow update";
19442
+ if (Array.isArray(items)) {
19443
+ for (const raw of items){
19444
+ const item = asPlainObject(raw);
19445
+ if (item?.id === itemId && str(item.label)) return str(item.label);
19446
+ }
19447
+ }
19448
+ return itemId.replace(/[_-]/g, " ");
19449
+ }
19450
+ function rejectedItemId(args) {
19451
+ if (!args) return null;
19452
+ if (str(args.item_id)) return str(args.item_id);
19453
+ if (Array.isArray(args.items)) {
19454
+ for (const raw of args.items){
19455
+ const item = asPlainObject(raw);
19456
+ if (item?.status === "done" && !str(item.validation_evidence) && str(item.id)) return str(item.id);
19457
+ }
19458
+ }
19459
+ return null;
19460
+ }
19461
+ /**
19462
+ * Returns the contract breaches still standing at the end of the turn, in
19463
+ * the order the workflows were last touched. A later accepted update for the
19464
+ * same workflow clears an earlier rejection.
19465
+ */ function collectWorkflowContractFailures(observations) {
19466
+ const latest = new Map();
19467
+ for (const { args, result } of observations){
19468
+ const payload = asObject(result);
19469
+ const callArgs = asPlainObject(args);
19470
+ const workflowId = str(payload?.workflow_id) ?? str(callArgs?.workflow_id);
19471
+ if (!workflowId) continue;
19472
+ const previous = latest.get(workflowId) ?? {
19473
+ rejected: null,
19474
+ checklist: [],
19475
+ phase: null,
19476
+ error: null,
19477
+ needsUser: new Set()
19478
+ };
19479
+ latest.delete(workflowId);
19480
+ if (payload?.ok === false) {
19481
+ const itemId = rejectedItemId(callArgs);
19482
+ latest.set(workflowId, {
19483
+ ...previous,
19484
+ rejected: {
19485
+ itemId,
19486
+ label: labelFor(itemId, callArgs?.items ?? previous.checklist),
19487
+ error: str(payload.error) ?? "the update was rejected"
19488
+ }
19489
+ });
19490
+ continue;
19491
+ }
19492
+ const state = asPlainObject(payload?.state);
19493
+ const needsUser = new Set(previous.needsUser);
19494
+ const updatedItemId = str(callArgs?.item_id);
19495
+ if (updatedItemId) {
19496
+ if (callArgs?.needs_user === true) needsUser.add(updatedItemId);
19497
+ else needsUser.delete(updatedItemId);
19498
+ }
19499
+ latest.set(workflowId, {
19500
+ rejected: null,
19501
+ checklist: Array.isArray(state?.checklist) ? state.checklist : previous.checklist,
19502
+ phase: typeof state?.phase === "string" ? state.phase : null,
19503
+ error: str(state?.error),
19504
+ needsUser
19505
+ });
19506
+ }
19507
+ const failures = [];
19508
+ for (const [workflowId, entry] of latest){
19509
+ if (entry.rejected) {
19510
+ const { itemId, label, error } = entry.rejected;
19511
+ failures.push({
19512
+ key: `${workflowId}:${itemId ?? "*"}`,
19513
+ workflowId,
19514
+ itemId,
19515
+ label,
19516
+ reason: `workflow_progress rejected the update: ${error}`
19517
+ });
19518
+ continue;
19519
+ }
19520
+ if (entry.phase === "complete") continue;
19521
+ for (const raw of entry.checklist){
19522
+ const item = asPlainObject(raw);
19523
+ const itemId = str(item?.id);
19524
+ if (!item || !itemId || item.needs_user === true || entry.needsUser.has(itemId)) continue;
19525
+ const label = str(item.label) ?? itemId;
19526
+ if (item.status === "checking") {
19527
+ failures.push({
19528
+ key: `${workflowId}:${itemId}`,
19529
+ workflowId,
19530
+ itemId,
19531
+ label,
19532
+ reason: "the step was started but the turn ended before its output was validated"
19533
+ });
19534
+ } else if (item.status === "needs_attention") {
19535
+ const why = entry.error;
19536
+ failures.push({
19537
+ key: `${workflowId}:${itemId}`,
19538
+ workflowId,
19539
+ itemId,
19540
+ label,
19541
+ reason: `the step's validation did not pass (needs_attention${why ? `: ${why}` : ""})`
19542
+ });
19543
+ }
19544
+ }
19545
+ }
19546
+ return failures;
19547
+ }
19548
+ /** Splits failures into those with automatic retries left and those exhausted. */ function planWorkflowStepRetries(failures, spent = {}) {
19549
+ const retry = [];
19550
+ const exhausted = [];
19551
+ for (const failure of failures){
19552
+ const used = spent[failure.key] ?? 0;
19553
+ if (used < WORKFLOW_STEP_AUTO_RETRIES) retry.push({
19554
+ ...failure,
19555
+ attempt: used + 2
19556
+ });
19557
+ else exhausted.push(failure);
19558
+ }
19559
+ return {
19560
+ retry,
19561
+ exhausted
19562
+ };
19563
+ }
19564
+ function workflowStepRetryInstruction(workflowId, itemId, label) {
19565
+ if (!itemId) {
19566
+ return `Resend the \`workflow_progress\` update for workflow \`${workflowId}\` so it satisfies the contract.`;
19567
+ }
19568
+ const progressUpdate = workflowId === "version_adoption" ? `Call \`workflow_progress\` with \`workflow_id: "version_adoption"\`, \`item_id: "${itemId}"\`, and \`status: "checking"\`` : `Call \`workflow_progress\` for workflow \`${workflowId}\` with the complete items snapshot, setting this step to \`checking\``;
19569
+ return `${progressUpdate}, then redo "${label}" from its stated input and run its validation again. Finally mark it \`done\` with newly observed \`validation_evidence\`, or \`needs_attention\` with the reason.`;
19570
+ }
19571
+ function buildWorkflowStepRetryNudge(retries) {
19572
+ const lines = retries.map((failure)=>`- "${failure.label}" in \`${failure.workflowId}\` (attempt ${failure.attempt} of ${WORKFLOW_STEP_MAX_ATTEMPTS}): ${failure.reason}. ${workflowStepRetryInstruction(failure.workflowId, failure.itemId, failure.label)}`);
19573
+ return [
19574
+ `↻ Auto-retry: ${retries.length === 1 ? "a workflow step has" : `${retries.length} workflow steps have`} not met the step contract (input → output → validation):`,
19575
+ ...lines,
19576
+ "Work only on these steps and leave the others unchanged. Do not reuse earlier evidence or claim a result you did not observe. If a step is genuinely paused for the user's approval or input, mark it `needs_attention` with `needs_user: true` and say what you need instead of retrying."
19577
+ ].join("\n");
19578
+ }
19579
+
20314
19580
  // EXTERNAL MODULE: external "node:os"
20315
19581
  var external_node_os_ = __webpack_require__(48161);
20316
19582
  var external_node_os_default = /*#__PURE__*/__webpack_require__.n(external_node_os_);
@@ -20769,7 +20035,7 @@ function buildSharedToolCatalogContext() {
20769
20035
  return [
20770
20036
  "--- Tool usage SOP ---",
20771
20037
  "Static cross-agent procedure. The per-turn bound list and counts appear later under \"Enabled tools\".",
20772
- `0. Classify the request. Informational answers may be direct; read/retrieve requests need a read tool; write/change requests need a state-changing tool; destructive requests also need the required confirmation. ${(0,action_vocabulary/* formatActionVocabularyInstruction */.q2)()} For substantial tasks with several dependent phases, likely cross-turn progress, or explicit verification, use workflow_progress to create and update a concise checklist; skip simple tasks and work already covered by native tool progress. This contract applies to every built-in Jarela workflow and every workflow you create or follow: each step must state its input, expected output, and concrete validation criteria; validate each output before passing it to a later step. Prefer executable checks whenever code can verify the result, and record observed validation_evidence before marking an item done. Keep a stable workflow_id, send the complete current item list on each update, and keep secrets or private data out of checklist fields. Use needs_attention for blockers; set phase=complete only when all items are done or skipped. Never claim an output or validation result that you did not observe.`,
20038
+ `0. Classify the request. Informational answers may be direct; read/retrieve requests need a read tool; write/change requests need a state-changing tool; destructive requests also need the required confirmation. ${(0,action_vocabulary/* formatActionVocabularyInstruction */.q2)()} For substantial tasks with several dependent phases, likely cross-turn progress, or explicit verification, use workflow_progress to create and update a concise checklist; skip simple tasks and work already covered by native tool progress. This contract applies to every built-in Jarela workflow and every workflow you create or follow: each step must state its input, expected output, and concrete validation criteria; validate each output before passing it to a later step. Prefer executable checks whenever code can verify the result, and record observed validation_evidence before marking an item done. Keep a stable workflow_id, send the complete current item list on each update, and keep secrets or private data out of checklist fields. Use needs_attention for blockers, with needs_user=true when only the user can unblock the step; a rejected update or a step you leave checking or needs_attention without needs_user is retried automatically, up to 3 attempts per step. Set phase=complete only when all items are done or skipped. Never claim an output or validation result that you did not observe.`,
20773
20039
  "1. Bound first. If a tool listed under \"Enabled tools\" fits the task, call it directly.",
20774
20040
  "2. Otherwise look it up. Names of permitted tools that are not bound this turn are listed after the bound tools under \"Enabled tools\", capped, with no definitions. A name that is not listed there may still exist, so never conclude a capability does not exist from the bound list alone. Call list_tools with service/object/action keywords: scope=\"enabled\" searches executable tools, scope=\"all\" also returns disabled, unavailable and cap-omitted tools with flags.",
20775
20041
  "3. Named target. When a skill, harness or instruction names an exact tool, call list_tools names=[\"exact_name\"] include_schema=true instead of a keyword query. Exact lookup ignores every other filter, so it also describes tools you cannot currently execute.",
@@ -21023,11 +20289,16 @@ function buildMemoryContext(budget) {
21023
20289
  const writeGuidance = policy === "important" ? "Store only explicit preferences, verified facts, durable decisions, constraints, and project context. Do not store inferred details, routine status, contacts, or transient tasks." : policy === "detailed" ? "Store relevant durable details, including recurring workflow context and task state, but never secrets or raw private transcripts. Prefer concise records over duplicates." : "Store explicit preferences, verified facts, durable decisions, constraints, and project context. Store task details only when they will matter across sessions.";
21024
20290
  return [
21025
20291
  "--- Memory & recall ---",
21026
- "You have long-term memory across sessions.",
20292
+ "You have long-term memory across sessions, shared with every other Jarela agent. A record you save is available to other agents immediately. Background compaction also extracts facts later, but it runs late and can miss details, so it is a backstop, not your save step.",
21027
20293
  `- Hot conversation history is budgeted by model context size: ${(0,context_budget/* formatContextBudgetSummary */.qm)(budget)}.`,
21028
20294
  `- Active memory policy: ${policy}. ${writeGuidance}`,
21029
- "- Use memory_upsert proactively for structured records. Use namespace='facts', concise tags, confidence='explicit' for user-stated information, observed_at when the information was true, and expires_at for temporary facts. Keep memory_write only for legacy/free-form notes.",
21030
- "- Use memory_search proactively when relevant saved facts or prior conversations could help. Use memory_read / memory_list to inspect known entries."
20295
+ "- Use memory_search proactively when relevant saved facts or prior conversations could help. Use memory_read / memory_list to inspect known entries.",
20296
+ "Proactive save procedure — run it whenever information fits the active memory policy, without waiting to be asked:",
20297
+ "1. Trigger: the user states a preference, a fact about themselves or their work, a decision, a constraint, or a correction to something saved; or a tool result verifies a durable fact. Routine status, one-off chatter, secrets, credentials, and raw transcripts never qualify.",
20298
+ "2. Check: memory_search (or memory_read for a known key) for an existing record on the same subject. Update that stable key rather than creating a duplicate or contradictory copy.",
20299
+ "3. Write: call memory_upsert in the same turn, before your final reply, with namespace='facts', a stable descriptive key, standalone content, concise tags, confidence='explicit' for user-stated information ('verified' when tool-backed, 'inferred' only when useful and reversible), observed_at when the information became true, and expires_at for temporary facts. Keep memory_write only for legacy/free-form notes.",
20300
+ "4. Validate: the memory_upsert result must contain ok:true and the key you sent. If it failed, correct the arguments and retry once; if it still fails, tell the user it was not saved.",
20301
+ "5. Cite: end your reply with one short line naming each saved key, for example 'Saved to memory: facts/answer-format-preference'. Omit the line when nothing was saved."
21031
20302
  ].join("\n");
21032
20303
  }
21033
20304
  function buildAutomaticRecallGuidance(autoRecallEnabled, autoFactsEnabled) {
@@ -21893,6 +21164,7 @@ var transaction = __webpack_require__(99043);
21893
21164
 
21894
21165
 
21895
21166
 
21167
+
21896
21168
 
21897
21169
 
21898
21170
  const SELF_CONFIG_TOOLS = [
@@ -22702,6 +21974,10 @@ async function* stallRetryStream(inner, originalReq, allowedTools, retriesLeft,
22702
21974
  // turns where the model's claimed action didn't actually happen.
22703
21975
  const toolCallIds = new Map();
22704
21976
  const failedProxyCallIds = new Set();
21977
+ // workflow_progress calls (direct or proxied) awaiting their result, so the
21978
+ // step contract can be checked from observed tool output at turn end.
21979
+ const pendingWorkflowArgs = new Map();
21980
+ const workflowObservations = [];
22705
21981
  let loopedToolName = null;
22706
21982
  let doneChunk = null;
22707
21983
  let sawError = false;
@@ -22717,7 +21993,11 @@ async function* stallRetryStream(inner, originalReq, allowedTools, retriesLeft,
22717
21993
  const name = unwrapInvokedToolName(rawName, args);
22718
21994
  if (name) {
22719
21995
  toolNames.push(name);
22720
- if (typeof data?.id === "string") toolCallIds.set(data.id, name);
21996
+ if (typeof data?.id === "string") {
21997
+ toolCallIds.set(data.id, name);
21998
+ const workflowArgs = workflowProgressArgs(rawName, args);
21999
+ if (workflowArgs) pendingWorkflowArgs.set(data.id, workflowArgs);
22000
+ }
22721
22001
  const sig = toolCallSignature(rawName, args);
22722
22002
  const count = (signatureCounts.get(sig) ?? 0) + 1;
22723
22003
  signatureCounts.set(sig, count);
@@ -22745,6 +22025,13 @@ async function* stallRetryStream(inner, originalReq, allowedTools, retriesLeft,
22745
22025
  failedProxyCallIds.add(data.id);
22746
22026
  }
22747
22027
  }
22028
+ if (typeof data?.id === "string" && pendingWorkflowArgs.has(data.id)) {
22029
+ workflowObservations.push({
22030
+ args: pendingWorkflowArgs.get(data.id),
22031
+ result: data.result
22032
+ });
22033
+ pendingWorkflowArgs.delete(data.id);
22034
+ }
22748
22035
  const summary = summarizeRetryValue(data?.result).trim();
22749
22036
  if (summary) {
22750
22037
  const clipped = summary.length > 240 ? `${summary.slice(0, 237)}...` : summary;
@@ -22860,6 +22147,10 @@ async function* stallRetryStream(inner, originalReq, allowedTools, retriesLeft,
22860
22147
  }
22861
22148
  const citationFail = uncitedHighClaims.length > 0;
22862
22149
  if (!stalled && !looped && fabrication.ok && !citationFail) {
22150
+ if (!sawError && workflowObservations.length > 0) {
22151
+ yield* workflowStepRetryStream(workflowObservations, originalReq, retriesLeft, attemptAbort, doneChunk, textBuf, toolNames, toolResultSummaries);
22152
+ return;
22153
+ }
22863
22154
  if (doneChunk) yield doneChunk;
22864
22155
  return;
22865
22156
  }
@@ -22978,6 +22269,64 @@ async function* stallRetryStream(inner, originalReq, allowedTools, retriesLeft,
22978
22269
  }
22979
22270
  }
22980
22271
  }
22272
+ // Workflow step contract auto-retry. Runs only after every other quality
22273
+ // gate passed, and has its own per-step budget (WORKFLOW_STEP_MAX_ATTEMPTS)
22274
+ // so a stall retry earlier in the turn never starves it. The retry is an
22275
+ // append-mode continuation: the turn's work stays visible, followed by the
22276
+ // model redoing only the failed steps.
22277
+ async function* workflowStepRetryStream(observations, originalReq, stallRetriesLeft, attemptAbort, doneChunk, textBuf, toolNames, toolResultSummaries) {
22278
+ const spent = originalReq._workflow_step_retries ?? {};
22279
+ const failures = collectWorkflowContractFailures(observations);
22280
+ const { retry, exhausted } = planWorkflowStepRetries(failures, spent);
22281
+ const spentTotal = Object.values(spent).reduce((sum, n)=>sum + n, 0);
22282
+ if (retry.length === 0 || spentTotal >= WORKFLOW_TURN_AUTO_RETRY_LIMIT) {
22283
+ const unresolved = [
22284
+ ...exhausted,
22285
+ ...retry
22286
+ ];
22287
+ if (unresolved.length > 0) {
22288
+ console.warn(`[workflow-retry] contract still failing after auto-retry: ${unresolved.map((f)=>f.key).join(", ")} thread=${originalReq.thread_id}`);
22289
+ yield {
22290
+ type: "text_delta",
22291
+ data: {
22292
+ delta: `\n\n*⚠️ Workflow step${unresolved.length === 1 ? "" : "s"} still failing the step contract after automatic retries: ${unresolved.slice(0, 4).map((f)=>`"${f.label}"`).join(", ")}. Use the step's retry button or review it manually.*`
22293
+ }
22294
+ };
22295
+ }
22296
+ if (doneChunk) yield doneChunk;
22297
+ return;
22298
+ }
22299
+ console.warn(`[workflow-retry] retrying ${retry.map((f)=>`${f.key}#${f.attempt}`).join(", ")} thread=${originalReq.thread_id}`);
22300
+ yield {
22301
+ type: "text_delta",
22302
+ data: {
22303
+ delta: "\n\n↻ "
22304
+ }
22305
+ };
22306
+ const nudge = buildWorkflowStepRetryNudge(retry);
22307
+ const retryContext = buildRetryContextSummary(textBuf, [
22308
+ ...toolNames
22309
+ ], [
22310
+ ...toolResultSummaries
22311
+ ]);
22312
+ const nudgeWithContext = retryContext ? `${nudge}\n\n${retryContext}` : nudge;
22313
+ const nextSpent = {
22314
+ ...spent
22315
+ };
22316
+ for (const failure of retry)nextSpent[failure.key] = (nextSpent[failure.key] ?? 0) + 1;
22317
+ attemptAbort.abort("workflow_step_retry");
22318
+ const next = await prepareThreadRun({
22319
+ ...originalReq,
22320
+ message: nudgeWithContext,
22321
+ attachments: undefined,
22322
+ _stall_retries_left: stallRetriesLeft,
22323
+ _workflow_step_retries: nextSpent,
22324
+ _retry_count: (originalReq._retry_count ?? 0) + 1,
22325
+ _skip_persist_message: true,
22326
+ _history_append_message: nudgeWithContext
22327
+ });
22328
+ for await (const chunk of next.stream)yield chunk;
22329
+ }
22981
22330
  // Footer appended to an assistant message that was cut off by the user
22982
22331
  // (Stop button or steer-while-streaming). Both human readers and the LLM
22983
22332
  // see this on the next turn — the agent treats it as "the previous reply
@@ -23832,4 +23181,4 @@ function recordWatcherPollError(id, error) {
23832
23181
 
23833
23182
  };
23834
23183
  ;
23835
- //# sourceMappingURL=424.js.map
23184
+ //# sourceMappingURL=1388.js.map