@circuitwall/jarela 2.3.0 → 2.5.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 (290) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +5 -5
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/prerender-manifest.json +4 -4
  5. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.html +14 -2
  13. package/.next/standalone/.next/server/app/_not-found.rsc +16 -4
  14. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +16 -4
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +16 -4
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/api/v1/access/[identity]/route.js +7 -0
  19. package/.next/standalone/.next/server/app/api/v1/access/route.js +7 -0
  20. package/.next/standalone/.next/server/app/api/v1/agents/[id]/compact/route.js +7 -0
  21. package/.next/standalone/.next/server/app/api/v1/agents/[id]/display-filters/route.js +17 -5
  22. package/.next/standalone/.next/server/app/api/v1/agents/[id]/route.js +7 -0
  23. package/.next/standalone/.next/server/app/api/v1/agents/[id]/thread/route.js +17 -5
  24. package/.next/standalone/.next/server/app/api/v1/agents/route.js +7 -0
  25. package/.next/standalone/.next/server/app/api/v1/allowed-sites/[hostname]/route.js +7 -0
  26. package/.next/standalone/.next/server/app/api/v1/allowed-sites/route.js +7 -0
  27. package/.next/standalone/.next/server/app/api/v1/artifacts/lifecycle/route.js +7 -0
  28. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js +26 -32
  29. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/chats/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/[remote_jid]/route.js +18 -7
  31. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/ignores/route.js +18 -7
  32. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js +26 -32
  33. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/lookup/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js +27 -33
  35. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/pair/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js +26 -32
  37. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/[route_id]/route.js +28 -12
  39. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/routes/route.js +28 -12
  40. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js +26 -32
  41. package/.next/standalone/.next/server/app/api/v1/bridges/[id]/status/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js +9 -2
  43. package/.next/standalone/.next/server/app/api/v1/bridges/kinds/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/v1/bridges/route.js +19 -7
  45. package/.next/standalone/.next/server/app/api/v1/bridges/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/v1/dashboard/metrics/route.js +17 -5
  47. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing/route.js +7 -0
  48. package/.next/standalone/.next/server/app/api/v1/dashboard/pricing-task/route.js +1 -1
  49. package/.next/standalone/.next/server/app/api/v1/documents/search/route.js +7 -0
  50. package/.next/standalone/.next/server/app/api/v1/documents/settings/route.js +7 -0
  51. package/.next/standalone/.next/server/app/api/v1/documents/sources/[id]/route.js +1 -1
  52. package/.next/standalone/.next/server/app/api/v1/documents/sources/route.js +1 -1
  53. package/.next/standalone/.next/server/app/api/v1/env-sync/allowlist/route.js +7 -0
  54. package/.next/standalone/.next/server/app/api/v1/env-sync/route.js +7 -0
  55. package/.next/standalone/.next/server/app/api/v1/events/route.js +26 -32
  56. package/.next/standalone/.next/server/app/api/v1/events/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/v1/extension/agents/route.js +1 -1
  58. package/.next/standalone/.next/server/app/api/v1/extension/browser/activate/route.js +7 -0
  59. package/.next/standalone/.next/server/app/api/v1/extension/browser/foreground/route.js +7 -0
  60. package/.next/standalone/.next/server/app/api/v1/extension/browser/history/route.js +7 -0
  61. package/.next/standalone/.next/server/app/api/v1/extension/browser/poll/route.js +7 -0
  62. package/.next/standalone/.next/server/app/api/v1/extension/browser/progress/route.js +7 -0
  63. package/.next/standalone/.next/server/app/api/v1/extension/browser/result/route.js +7 -0
  64. package/.next/standalone/.next/server/app/api/v1/extension/browser/retry/route.js +7 -0
  65. package/.next/standalone/.next/server/app/api/v1/extension/browser/status/route.js +7 -0
  66. package/.next/standalone/.next/server/app/api/v1/extension/browser/tabs/route.js +7 -0
  67. package/.next/standalone/.next/server/app/api/v1/extension/fill/route.js +1 -1
  68. package/.next/standalone/.next/server/app/api/v1/extension/refine/route.js +1 -1
  69. package/.next/standalone/.next/server/app/api/v1/extension/turn/route.js +1 -1
  70. package/.next/standalone/.next/server/app/api/v1/extensions/route.js +1 -1
  71. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/config/route.js +1 -1
  72. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/route.js +1 -1
  73. package/.next/standalone/.next/server/app/api/v1/extensions/tools/[name]/secrets/route.js +1 -1
  74. package/.next/standalone/.next/server/app/api/v1/harnesses/[id]/route.js +7 -0
  75. package/.next/standalone/.next/server/app/api/v1/harnesses/default/route.js +7 -0
  76. package/.next/standalone/.next/server/app/api/v1/harnesses/route.js +7 -0
  77. package/.next/standalone/.next/server/app/api/v1/health/route.js +17 -5
  78. package/.next/standalone/.next/server/app/api/v1/integrations/[name]/route.js +7 -0
  79. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/callback/route.js +7 -0
  80. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/start/route.js +7 -0
  81. package/.next/standalone/.next/server/app/api/v1/integrations/gmail/oauth/status/route.js +7 -0
  82. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/callback/route.js +7 -0
  83. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/start/route.js +7 -0
  84. package/.next/standalone/.next/server/app/api/v1/integrations/outlook/oauth/status/route.js +7 -0
  85. package/.next/standalone/.next/server/app/api/v1/integrations/route.js +7 -0
  86. package/.next/standalone/.next/server/app/api/v1/lifecycle/adoption/route.js +17 -5
  87. package/.next/standalone/.next/server/app/api/v1/maps/embed/route.js +7 -0
  88. package/.next/standalone/.next/server/app/api/v1/mcp-servers/[name]/route.js +17 -5
  89. package/.next/standalone/.next/server/app/api/v1/mcp-servers/route.js +17 -5
  90. package/.next/standalone/.next/server/app/api/v1/memory/[namespace]/[key]/route.js +7 -0
  91. package/.next/standalone/.next/server/app/api/v1/memory/policy/route.js +7 -0
  92. package/.next/standalone/.next/server/app/api/v1/memory/route.js +7 -0
  93. package/.next/standalone/.next/server/app/api/v1/memory/search/route.js +7 -0
  94. package/.next/standalone/.next/server/app/api/v1/models/[name]/compact-threads/route.js +7 -0
  95. package/.next/standalone/.next/server/app/api/v1/models/[name]/route.js +7 -0
  96. package/.next/standalone/.next/server/app/api/v1/models/route.js +7 -0
  97. package/.next/standalone/.next/server/app/api/v1/packages/defaults/[id]/route.js +28 -4
  98. package/.next/standalone/.next/server/app/api/v1/packages/reload/route.js +28 -4
  99. package/.next/standalone/.next/server/app/api/v1/packages/route.js +28 -4
  100. package/.next/standalone/.next/server/app/api/v1/page-capture/route.js +1 -1
  101. package/.next/standalone/.next/server/app/api/v1/pending-actions/[id]/approve/route.js +27 -12
  102. package/.next/standalone/.next/server/app/api/v1/profile/location/route.js +7 -0
  103. package/.next/standalone/.next/server/app/api/v1/profile/route.js +7 -0
  104. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/models/route.js +585 -58
  105. package/.next/standalone/.next/server/app/api/v1/providers/[provider]/probe/route.js +7 -0
  106. package/.next/standalone/.next/server/app/api/v1/providers/github-copilot/auth/route.js +7 -0
  107. package/.next/standalone/.next/server/app/api/v1/providers/route.js +7 -0
  108. package/.next/standalone/.next/server/app/api/v1/proxy-config/route.js +7 -0
  109. package/.next/standalone/.next/server/app/api/v1/redaction/init/route.js +7 -0
  110. package/.next/standalone/.next/server/app/api/v1/redaction/route.js +7 -0
  111. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/route.js +17 -5
  112. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/[id]/run/route.js +1 -1
  113. package/.next/standalone/.next/server/app/api/v1/scheduled-tasks/route.js +7 -0
  114. package/.next/standalone/.next/server/app/api/v1/security/idle-timeout/route.js +7 -0
  115. package/.next/standalone/.next/server/app/api/v1/security/pin/route.js +7 -0
  116. package/.next/standalone/.next/server/app/api/v1/security/state/route.js +7 -0
  117. package/.next/standalone/.next/server/app/api/v1/security/unlock/route.js +7 -0
  118. package/.next/standalone/.next/server/app/api/v1/security/verify-pin/route.js +7 -0
  119. package/.next/standalone/.next/server/app/api/v1/skills/[id]/route.js +7 -0
  120. package/.next/standalone/.next/server/app/api/v1/skills/repos/[id]/route.js +7 -0
  121. package/.next/standalone/.next/server/app/api/v1/skills/repos/route.js +7 -0
  122. package/.next/standalone/.next/server/app/api/v1/skills/route.js +7 -0
  123. package/.next/standalone/.next/server/app/api/v1/tasks/[agent_id]/route.js +7 -0
  124. package/.next/standalone/.next/server/app/api/v1/tasks/route.js +7 -0
  125. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/activity/route.js +7 -0
  126. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/context-pin/route.js +12 -6
  127. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/route.js +125 -26
  128. package/.next/standalone/.next/server/app/api/v1/threads/[thread_id]/run/route.js +1 -2
  129. package/.next/standalone/.next/server/app/api/v1/threads/route.js +17 -5
  130. package/.next/standalone/.next/server/app/api/v1/tools/route.js +1 -1
  131. package/.next/standalone/.next/server/app/api/v1/update/apply/route.js.nft.json +1 -1
  132. package/.next/standalone/.next/server/app/api/v1/voice/transcribe/route.js +17 -5
  133. package/.next/standalone/.next/server/app/api/v1/voice/tts/route.js +17 -5
  134. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/route.js +17 -5
  135. package/.next/standalone/.next/server/app/api/v1/watchers/[id]/run/route.js +1 -1
  136. package/.next/standalone/.next/server/app/api/v1/watchers/route.js +1 -1
  137. package/.next/standalone/.next/server/app/page.js +27323 -27034
  138. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  139. package/.next/standalone/.next/server/app/setup/page.js +8 -0
  140. package/.next/standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
  141. package/.next/standalone/.next/server/app-paths-manifest.json +5 -5
  142. package/.next/standalone/.next/server/chunks/1388.js +106 -36
  143. package/.next/standalone/.next/server/chunks/2068.js +47 -10
  144. package/.next/standalone/.next/server/chunks/210.js +6 -6
  145. package/.next/standalone/.next/server/chunks/2447.js +10 -5
  146. package/.next/standalone/.next/server/chunks/2653.js +80 -1
  147. package/.next/standalone/.next/server/chunks/3042.js +10 -8
  148. package/.next/standalone/.next/server/chunks/{4540.js → 309.js} +104 -38
  149. package/.next/standalone/.next/server/chunks/{2350.js → 3272.js} +104 -37
  150. package/.next/standalone/.next/server/chunks/3524.js +150 -67
  151. package/.next/standalone/.next/server/chunks/3566.js +1 -1
  152. package/.next/standalone/.next/server/chunks/4189.js +1 -1
  153. package/.next/standalone/.next/server/chunks/4596.js +28 -4
  154. package/.next/standalone/.next/server/chunks/46.js +91 -31
  155. package/.next/standalone/.next/server/chunks/466.js +53 -7
  156. package/.next/standalone/.next/server/chunks/4955.js +30 -3
  157. package/.next/standalone/.next/server/chunks/5585.js +28 -4
  158. package/.next/standalone/.next/server/chunks/5908.js +63 -42
  159. package/.next/standalone/.next/server/chunks/6142.js +10 -2
  160. package/.next/standalone/.next/server/chunks/8461.js +10 -8
  161. package/.next/standalone/.next/server/chunks/9032.js +5 -5
  162. package/.next/standalone/.next/server/chunks/9164.js +487 -177
  163. package/.next/standalone/.next/server/chunks/9304.js +51 -12
  164. package/.next/standalone/.next/server/chunks/{423.js → 9590.js} +84 -24
  165. package/.next/standalone/.next/server/middleware-build-manifest.js +2 -2
  166. package/.next/standalone/.next/server/middleware.js +89 -21
  167. package/.next/standalone/.next/server/pages/404.html +14 -2
  168. package/.next/standalone/.next/server/pages/500.html +1 -1
  169. package/.next/standalone/.next/server/preview-props.json +3 -3
  170. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  171. package/.next/standalone/.next/static/chunks/{1395-e4a99912b8f83044.js → 1395-bfe1f3ef760c0f50.js} +54 -8
  172. package/.next/standalone/.next/static/chunks/app/{layout-9bc0b10127cb7d42.js → layout-7b24ad13faa3944b.js} +69 -2
  173. package/.next/standalone/.next/static/chunks/app/{page-213a623b37226452.js → page-2ef8d75d40eb4311.js} +10643 -10295
  174. package/.next/standalone/.next/static/css/c160ea862133acd2.css +5 -0
  175. package/.next/standalone/docs/adoption/changesets.json +2805 -0
  176. package/.next/standalone/package.json +1 -1
  177. package/CHANGELOG.md +52 -0
  178. package/api/client.models.test.ts +10 -0
  179. package/api/client.startup.test.ts +129 -0
  180. package/api/client.ts +51 -9
  181. package/api/thread-metadata.test.ts +72 -0
  182. package/api/types.ts +6 -3
  183. package/app/api/v1/providers/[provider]/models/route.test.ts +216 -6
  184. package/app/api/v1/providers/[provider]/models/route.ts +259 -40
  185. package/app/api/v1/threads/[thread_id]/route.ts +26 -23
  186. package/app/api/v1/threads/[thread_id]/run/route.ts +0 -1
  187. package/app/globals.css +119 -29
  188. package/app/layout.tsx +12 -0
  189. package/components/agents/AgentsPanel.tsx +5 -13
  190. package/components/chat/ChatView.tsx +9 -18
  191. package/components/chat/InputBar.tsx +1 -1
  192. package/components/chat/MessageBubble.tsx +13 -1
  193. package/components/chat/MessageList.test.tsx +45 -4
  194. package/components/chat/MessageList.tsx +123 -89
  195. package/components/chat/ToolList.tsx +88 -84
  196. package/components/chat/useThreadActivity.test.tsx +2 -2
  197. package/components/chat/useThreadActivity.ts +2 -2
  198. package/components/chat/useThreadData.ts +1 -30
  199. package/components/chat/useThreadMetadataPolling.test.tsx +128 -0
  200. package/components/chat/useThreadMetadataPolling.ts +50 -0
  201. package/components/chat/useUserProfileAndAgent.test.tsx +31 -0
  202. package/components/chat/useUserProfileAndAgent.ts +13 -2
  203. package/components/dashboard/DashboardPanel.tsx +1 -1
  204. package/components/dashboard/Series.tsx +34 -21
  205. package/components/dashboard/SummaryCards.tsx +1 -1
  206. package/components/integrations/NetworkSection.tsx +2 -2
  207. package/components/layout/AppShell.tsx +22 -7
  208. package/components/layout/MenuPanel.tsx +14 -24
  209. package/components/profile/ProfilePanel.tsx +2 -2
  210. package/components/settings/AppearancePanel.tsx +70 -3
  211. package/components/settings/SettingsPanel.tsx +2 -2
  212. package/components/tools/ToolsPanel.tsx +2 -7
  213. package/components/ui/AppearancePreferences.test.tsx +68 -0
  214. package/components/ui/BootScreen.test.tsx +44 -0
  215. package/components/ui/BootScreen.tsx +24 -11
  216. package/components/ui/NotificationStatus.test.tsx +2 -2
  217. package/components/ui/NotificationStatus.tsx +5 -5
  218. package/components/ui/SubTabBar.tsx +2 -3
  219. package/contexts/ThemeContext.tsx +84 -1
  220. package/hooks/useAgentSession.test.ts +12 -1
  221. package/hooks/useAgentSession.ts +6 -4
  222. package/hooks/useUrlSync.test.ts +13 -0
  223. package/hooks/useUrlSync.ts +0 -4
  224. package/lib/agents/citation-checker.test.ts +40 -2
  225. package/lib/agents/citation-checker.ts +56 -11
  226. package/lib/agents/context-boundary.ts +5 -6
  227. package/lib/agents/instruction-edits.test.ts +120 -0
  228. package/lib/agents/instruction-edits.ts +65 -42
  229. package/lib/agents/prepare/request.ts +0 -2
  230. package/lib/agents/prepare/system-prompt.test.ts +10 -0
  231. package/lib/agents/prepare/system-prompt.ts +8 -2
  232. package/lib/agents/proposals.test.ts +76 -0
  233. package/lib/agents/proposals.ts +13 -5
  234. package/lib/agents/run-thread.auto-boundary.test.ts +125 -5
  235. package/lib/agents/run-thread.ts +24 -9
  236. package/lib/agents/sqlite-checkpoint-saver.test.ts +91 -0
  237. package/lib/agents/warm-summary-background.ts +22 -2
  238. package/lib/agents/warm-topics.test.ts +155 -1
  239. package/lib/agents/warm-topics.ts +27 -7
  240. package/lib/bridges/dispatcher.ts +1 -0
  241. package/lib/bridges/message-role.test.ts +81 -0
  242. package/lib/bridges/message-role.ts +23 -10
  243. package/lib/bridges/types.ts +6 -0
  244. package/lib/bridges/whatsapp-link.test.ts +32 -0
  245. package/lib/bridges/whatsapp-link.ts +21 -0
  246. package/lib/bridges/whatsapp.inbound.test.ts +239 -0
  247. package/lib/bridges/whatsapp.sender.test.ts +80 -1
  248. package/lib/bridges/whatsapp.ts +76 -38
  249. package/lib/db/migrations.test.ts +61 -0
  250. package/lib/db/migrations.ts +13 -0
  251. package/lib/embeddings/performance.test.ts +114 -0
  252. package/lib/pricing/snapshot.test.ts +70 -0
  253. package/lib/pricing/snapshot.ts +10 -2
  254. package/lib/proxy/dispatcher.test.ts +119 -1
  255. package/lib/proxy/dispatcher.ts +22 -9
  256. package/lib/stores/agent-configs.ts +10 -5
  257. package/lib/stores/bridges.test.ts +81 -0
  258. package/lib/stores/bridges.ts +9 -8
  259. package/lib/stores/dashboard-metrics-cache.test.ts +99 -0
  260. package/lib/stores/dashboard-metrics.ts +30 -4
  261. package/lib/stores/message-embedding-jobs.test.ts +27 -0
  262. package/lib/stores/message-embedding-jobs.ts +5 -3
  263. package/lib/stores/message-usage.test.ts +21 -1
  264. package/lib/stores/pricing-cache.test.ts +31 -0
  265. package/lib/stores/pricing.ts +3 -0
  266. package/lib/stores/proxy-config.test.ts +120 -0
  267. package/lib/stores/proxy-config.ts +22 -4
  268. package/lib/stores/threads.ts +12 -8
  269. package/lib/tools/communications/calendar.test.ts +43 -2
  270. package/lib/tools/communications/calendar.ts +2 -0
  271. package/lib/tools/communications/gmail.test.ts +51 -1
  272. package/lib/tools/communications/gmail.ts +44 -2
  273. package/lib/tools/communications/outlook-calendar.ts +2 -0
  274. package/lib/tools/communications/outlook.test.ts +33 -2
  275. package/lib/tools/communications/outlook.ts +2 -0
  276. package/lib/tools/filesystem/edit-match.test.ts +133 -0
  277. package/lib/tools/filesystem/edit-match.ts +7 -2
  278. package/lib/tools/packages/default-packages.test.ts +21 -0
  279. package/lib/tools/packages/optional-package.test.ts +72 -0
  280. package/lib/tools/packages/optional-package.ts +33 -4
  281. package/lib/tools/support/result-refs.test.ts +131 -0
  282. package/lib/tools/support/result-refs.ts +41 -9
  283. package/lib/ui/navigate.test.ts +13 -0
  284. package/lib/ui/navigate.ts +10 -2
  285. package/lib/utils/source-link.test.ts +51 -0
  286. package/lib/utils/source-link.ts +45 -0
  287. package/package.json +1 -1
  288. package/.next/standalone/.next/static/css/312542a5725ba0d5.css +0 -5
  289. /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → 544OFJV-q0RC6Gjgje4LT}/_buildManifest.js +0 -0
  290. /package/.next/standalone/.next/static/{bMRK5y3ruT7c3WtBfCQOG → 544OFJV-q0RC6Gjgje4LT}/_ssgManifest.js +0 -0
@@ -858,6 +858,13 @@ module.exports = require("node:path");
858
858
 
859
859
  /***/ }),
860
860
 
861
+ /***/ 77030:
862
+ /***/ ((module) => {
863
+
864
+ module.exports = require("node:net");
865
+
866
+ /***/ }),
867
+
861
868
  /***/ 77598:
862
869
  /***/ ((module) => {
863
870
 
@@ -801,6 +801,13 @@ module.exports = require("node:path");
801
801
 
802
802
  /***/ }),
803
803
 
804
+ /***/ 77030:
805
+ /***/ ((module) => {
806
+
807
+ module.exports = require("node:net");
808
+
809
+ /***/ }),
810
+
804
811
  /***/ 77598:
805
812
  /***/ ((module) => {
806
813
 
@@ -761,6 +761,13 @@ module.exports = require("node:path");
761
761
 
762
762
  /***/ }),
763
763
 
764
+ /***/ 77030:
765
+ /***/ ((module) => {
766
+
767
+ module.exports = require("node:net");
768
+
769
+ /***/ }),
770
+
764
771
  /***/ 77598:
765
772
  /***/ ((module) => {
766
773
 
@@ -812,6 +812,13 @@ module.exports = require("node:path");
812
812
 
813
813
  /***/ }),
814
814
 
815
+ /***/ 77030:
816
+ /***/ ((module) => {
817
+
818
+ module.exports = require("node:net");
819
+
820
+ /***/ }),
821
+
815
822
  /***/ 77598:
816
823
  /***/ ((module) => {
817
824
 
@@ -964,6 +964,13 @@ module.exports = require("node:path");
964
964
 
965
965
  /***/ }),
966
966
 
967
+ /***/ 77030:
968
+ /***/ ((module) => {
969
+
970
+ module.exports = require("node:net");
971
+
972
+ /***/ }),
973
+
967
974
  /***/ 77598:
968
975
  /***/ ((module) => {
969
976
 
@@ -1004,6 +1004,13 @@ module.exports = require("node:path");
1004
1004
 
1005
1005
  /***/ }),
1006
1006
 
1007
+ /***/ 77030:
1008
+ /***/ ((module) => {
1009
+
1010
+ module.exports = require("node:net");
1011
+
1012
+ /***/ }),
1013
+
1007
1014
  /***/ 77598:
1008
1015
  /***/ ((module) => {
1009
1016
 
@@ -388,12 +388,17 @@ function upsertAgentConfigTransaction(input) {
388
388
  const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
389
389
  const existing = getAgentConfig(input.id);
390
390
  const created_at = existing?.created_at ?? t;
391
- const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
391
+ const existingMbti = toMbti(existing?.adaptive_mbti);
392
+ const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
392
393
  const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
393
- const strength = input.adaptive_persona_strength ?? preset.strength;
394
- const empathy = input.adaptive_empathy ?? preset.empathy;
395
- const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
396
- const verbosity = input.adaptive_verbosity ?? preset.verbosity;
394
+ // Omitted sliders keep their tuned values; they only fall back to the
395
+ // preset when the type changes or the agent is new. Otherwise every
396
+ // partial update (approved proposals, tool edits) reset them.
397
+ const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
398
+ const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
399
+ const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
400
+ const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
401
+ const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
397
402
  if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
398
403
  // harness_id: explicit `undefined` means "keep existing"; explicit `null`
399
404
  // means "use the global default". Empty string is normalised to null too,
@@ -890,6 +895,13 @@ module.exports = require("node:path");
890
895
 
891
896
  /***/ }),
892
897
 
898
+ /***/ 77030:
899
+ /***/ ((module) => {
900
+
901
+ module.exports = require("node:net");
902
+
903
+ /***/ }),
904
+
893
905
  /***/ 77598:
894
906
  /***/ ((module) => {
895
907
 
@@ -802,7 +802,7 @@ module.exports = import("@huggingface/transformers");;
802
802
  var __webpack_require__ = require("../../../../../../webpack-runtime.js");
803
803
  __webpack_require__.C(exports);
804
804
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
805
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388], () => (__webpack_exec__(35107)));
805
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,4189,540,4955,5908,5120,1388], () => (__webpack_exec__(35107)));
806
806
  module.exports = __webpack_exports__;
807
807
 
808
808
  })();
@@ -463,6 +463,13 @@ module.exports = require("node:path");
463
463
 
464
464
  /***/ }),
465
465
 
466
+ /***/ 77030:
467
+ /***/ ((module) => {
468
+
469
+ module.exports = require("node:net");
470
+
471
+ /***/ }),
472
+
466
473
  /***/ 77598:
467
474
  /***/ ((module) => {
468
475
 
@@ -824,6 +824,13 @@ module.exports = require("node:path");
824
824
 
825
825
  /***/ }),
826
826
 
827
+ /***/ 77030:
828
+ /***/ ((module) => {
829
+
830
+ module.exports = require("node:net");
831
+
832
+ /***/ }),
833
+
827
834
  /***/ 77598:
828
835
  /***/ ((module) => {
829
836
 
@@ -1068,6 +1068,13 @@ module.exports = require("node:path");
1068
1068
 
1069
1069
  /***/ }),
1070
1070
 
1071
+ /***/ 77030:
1072
+ /***/ ((module) => {
1073
+
1074
+ module.exports = require("node:net");
1075
+
1076
+ /***/ }),
1077
+
1071
1078
  /***/ 77598:
1072
1079
  /***/ ((module) => {
1073
1080
 
@@ -802,6 +802,13 @@ module.exports = require("node:path");
802
802
 
803
803
  /***/ }),
804
804
 
805
+ /***/ 77030:
806
+ /***/ ((module) => {
807
+
808
+ module.exports = require("node:net");
809
+
810
+ /***/ }),
811
+
805
812
  /***/ 77598:
806
813
  /***/ ((module) => {
807
814
 
@@ -375,6 +375,13 @@ module.exports = require("node:path");
375
375
 
376
376
  /***/ }),
377
377
 
378
+ /***/ 77030:
379
+ /***/ ((module) => {
380
+
381
+ module.exports = require("node:net");
382
+
383
+ /***/ }),
384
+
378
385
  /***/ 77598:
379
386
  /***/ ((module) => {
380
387
 
@@ -819,6 +819,13 @@ module.exports = require("node:path");
819
819
 
820
820
  /***/ }),
821
821
 
822
+ /***/ 77030:
823
+ /***/ ((module) => {
824
+
825
+ module.exports = require("node:net");
826
+
827
+ /***/ }),
828
+
822
829
  /***/ 77598:
823
830
  /***/ ((module) => {
824
831
 
@@ -1095,6 +1095,13 @@ module.exports = require("node:path");
1095
1095
 
1096
1096
  /***/ }),
1097
1097
 
1098
+ /***/ 77030:
1099
+ /***/ ((module) => {
1100
+
1101
+ module.exports = require("node:net");
1102
+
1103
+ /***/ }),
1104
+
1098
1105
  /***/ 77598:
1099
1106
  /***/ ((module) => {
1100
1107
 
@@ -872,6 +872,13 @@ module.exports = require("node:path");
872
872
 
873
873
  /***/ }),
874
874
 
875
+ /***/ 77030:
876
+ /***/ ((module) => {
877
+
878
+ module.exports = require("node:net");
879
+
880
+ /***/ }),
881
+
875
882
  /***/ 77598:
876
883
  /***/ ((module) => {
877
884
 
@@ -813,6 +813,13 @@ module.exports = require("node:path");
813
813
 
814
814
  /***/ }),
815
815
 
816
+ /***/ 77030:
817
+ /***/ ((module) => {
818
+
819
+ module.exports = require("node:net");
820
+
821
+ /***/ }),
822
+
816
823
  /***/ 77598:
817
824
  /***/ ((module) => {
818
825
 
@@ -1084,6 +1084,13 @@ module.exports = require("node:path");
1084
1084
 
1085
1085
  /***/ }),
1086
1086
 
1087
+ /***/ 77030:
1088
+ /***/ ((module) => {
1089
+
1090
+ module.exports = require("node:net");
1091
+
1092
+ /***/ }),
1093
+
1087
1094
  /***/ 77598:
1088
1095
  /***/ ((module) => {
1089
1096
 
@@ -790,6 +790,13 @@ module.exports = require("node:path");
790
790
 
791
791
  /***/ }),
792
792
 
793
+ /***/ 77030:
794
+ /***/ ((module) => {
795
+
796
+ module.exports = require("node:net");
797
+
798
+ /***/ }),
799
+
793
800
  /***/ 77598:
794
801
  /***/ ((module) => {
795
802
 
@@ -755,6 +755,13 @@ module.exports = require("node:path");
755
755
 
756
756
  /***/ }),
757
757
 
758
+ /***/ 77030:
759
+ /***/ ((module) => {
760
+
761
+ module.exports = require("node:net");
762
+
763
+ /***/ }),
764
+
758
765
  /***/ 77598:
759
766
  /***/ ((module) => {
760
767
 
@@ -1252,6 +1252,13 @@ module.exports = require("node:path");
1252
1252
 
1253
1253
  /***/ }),
1254
1254
 
1255
+ /***/ 77030:
1256
+ /***/ ((module) => {
1257
+
1258
+ module.exports = require("node:net");
1259
+
1260
+ /***/ }),
1261
+
1255
1262
  /***/ 77598:
1256
1263
  /***/ ((module) => {
1257
1264
 
@@ -136,12 +136,11 @@ module.exports = require("node:zlib");
136
136
 
137
137
  // Every caller of moveThreadContextBoundary represents a user-initiated
138
138
  // boundary change (drag the line, the manual /compact command, or the agent's
139
- // compact_context tool acting on the user's say-so) — the
140
- // auto-detector's own commit (lib/agents/warm-summary-background.ts
141
- // commitBoundaryCompaction) calls setThreadContextPin directly instead, so
142
- // it never re-arms this lock. Suppresses the hot-turn-limit compaction in
143
- // lib/agents/run-thread.ts for the next N eligible turns so a manual
144
- // choice doesn't get silently re-moved on the very next turn.
139
+ // compact_context tool acting on the user's say-so). Suppresses the
140
+ // hot-turn-limit compaction in lib/agents/run-thread.ts for the next N
141
+ // eligible turns so a manual choice doesn't get silently re-moved on the very
142
+ // next turn. The auto-detector arms a shorter cooldown of its own
143
+ // (hotTurnCooldownUntil) so it doesn't re-run on every turn either.
145
144
  // Counted in messages (~2 per turn: one user + one assistant row) since
146
145
  // that's what's already on the thread row — no extra query or per-turn
147
146
  // write needed to check it.
@@ -329,6 +328,13 @@ module.exports = require("node:path");
329
328
 
330
329
  /***/ }),
331
330
 
331
+ /***/ 77030:
332
+ /***/ ((module) => {
333
+
334
+ module.exports = require("node:net");
335
+
336
+ /***/ }),
337
+
332
338
  /***/ 77598:
333
339
  /***/ ((module) => {
334
340
 
@@ -566,6 +566,91 @@ module.exports = require("node:http");
566
566
 
567
567
  module.exports = require("node:zlib");
568
568
 
569
+ /***/ }),
570
+
571
+ /***/ 39947:
572
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
573
+
574
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
575
+ /* harmony export */ Bm: () => (/* binding */ cachedJson),
576
+ /* harmony export */ HN: () => (/* binding */ notFoundResponse),
577
+ /* harmony export */ Jb: () => (/* binding */ validateBody),
578
+ /* harmony export */ K2: () => (/* binding */ createdResponse),
579
+ /* harmony export */ Ng: () => (/* binding */ noStoreJson),
580
+ /* harmony export */ yj: () => (/* binding */ errorResponse)
581
+ /* harmony export */ });
582
+ /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
583
+ // Shared HTTP response builders for app/api/v1/** route handlers.
584
+ //
585
+ // Goal: every error/success payload across the v1 surface has the same
586
+ // shape. Before this lived inline, response bodies drifted —
587
+ // `{error: "x"}` vs `{message: "x"}`, 400 vs 422 for the same condition,
588
+ // some routes returned Zod's raw issue array, others stringified it.
589
+
590
+ function errorResponse(message, status = 400) {
591
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
592
+ error: message
593
+ }, {
594
+ status
595
+ });
596
+ }
597
+ function notFoundResponse(message = "Not found") {
598
+ return errorResponse(message, 404);
599
+ }
600
+ function createdResponse(data) {
601
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
602
+ status: 201
603
+ });
604
+ }
605
+ // Wrap a 200 JSON response with a private Cache-Control header. Use on safe
606
+ // GET endpoints that serve user-scoped data the client refetches often (panel
607
+ // mounts, navigation back/forward) but mutates rarely. The TTL is short
608
+ // enough that explicit mutations — which patch the client-side ApiClient
609
+ // cache in place — stay observably consistent without an extra roundtrip.
610
+ //
611
+ // swrSeconds (optional): stale-while-revalidate window. When set, the browser
612
+ // serves the cached response immediately and refreshes in the background,
613
+ // making navigation feel instant. Use for data that can tolerate brief
614
+ // staleness (tool list, agent configs, model list). Omit for real-time data
615
+ // (dashboard metrics, credential state).
616
+ function cachedJson(data, maxAgeSeconds, swrSeconds) {
617
+ const swr = swrSeconds ? `, stale-while-revalidate=${swrSeconds}` : "";
618
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
619
+ headers: {
620
+ "Cache-Control": `private, max-age=${maxAgeSeconds}${swr}`
621
+ }
622
+ });
623
+ }
624
+ // Use for endpoints whose response contains live state that must never be
625
+ // served from cache — credentials, connection status, live config values.
626
+ function noStoreJson(data) {
627
+ return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json(data, {
628
+ headers: {
629
+ "Cache-Control": "no-store"
630
+ }
631
+ });
632
+ }
633
+ // Validate a JSON request body against a zod schema.
634
+ // Returns either the parsed data or a 400 NextResponse explaining the issue.
635
+ // Caller pattern:
636
+ // const parsed = await validateBody(req, Schema);
637
+ // if (parsed instanceof NextResponse) return parsed;
638
+ // // use parsed.field
639
+ async function validateBody(req, schema) {
640
+ let raw;
641
+ try {
642
+ raw = await req.json();
643
+ } catch {
644
+ return errorResponse("Request body must be valid JSON", 400);
645
+ }
646
+ const parsed = schema.safeParse(raw);
647
+ if (!parsed.success) {
648
+ return errorResponse(parsed.error.issues[0]?.message ?? "invalid body", 400);
649
+ }
650
+ return parsed.data;
651
+ }
652
+
653
+
569
654
  /***/ }),
570
655
 
571
656
  /***/ 44708:
@@ -711,6 +796,13 @@ module.exports = require("node:path");
711
796
 
712
797
  /***/ }),
713
798
 
799
+ /***/ 77030:
800
+ /***/ ((module) => {
801
+
802
+ module.exports = require("node:net");
803
+
804
+ /***/ }),
805
+
714
806
  /***/ 77598:
715
807
  /***/ ((module) => {
716
808
 
@@ -939,16 +1031,18 @@ __webpack_require__.r(__webpack_exports__);
939
1031
  /* harmony export */ GET: () => (/* binding */ GET)
940
1032
  /* harmony export */ });
941
1033
  /* harmony import */ var next_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(23211);
1034
+ /* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(97377);
942
1035
  /* harmony import */ var _lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(83042);
943
1036
  /* harmony import */ var _lib_stores_message_usage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62174);
944
1037
  /* harmony import */ var _lib_stores_agent_configs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(41720);
945
1038
  /* harmony import */ var _lib_stores_model_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(80937);
946
1039
  /* harmony import */ var _lib_api_serializers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(85678);
947
1040
  /* harmony import */ var _lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(36923);
948
- /* harmony import */ var _lib_agents_conversation_summary__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(15393);
1041
+ /* harmony import */ var _lib_agents_conversation_summary__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(15393);
949
1042
  /* harmony import */ var _lib_agents_thread_activity__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(63541);
950
1043
  /* harmony import */ var _lib_agents_checkpointer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(66963);
951
- /* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22032);
1044
+ /* harmony import */ var _lib_utils_error__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(22032);
1045
+ /* harmony import */ var _lib_api_responses__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(39947);
952
1046
  /**
953
1047
  * @public — `GET /api/v1/threads/[thread_id]` (read messages),
954
1048
  * `PATCH /api/v1/threads/[thread_id]` (rename / set agent),
@@ -966,6 +1060,8 @@ __webpack_require__.r(__webpack_exports__);
966
1060
 
967
1061
 
968
1062
 
1063
+
1064
+
969
1065
  const DEFAULT_PAGE = 50;
970
1066
  const DEFAULT_CONTEXT_WINDOW_TOKENS = 8192;
971
1067
  function parseSeqParam(raw) {
@@ -982,32 +1078,17 @@ async function GET(req, { params }) {
982
1078
  status: 404
983
1079
  });
984
1080
  const url = new URL(req.url);
1081
+ const view = zod__WEBPACK_IMPORTED_MODULE_10__/* ["enum"] */ .k5n([
1082
+ "messages",
1083
+ "metadata"
1084
+ ]).default("messages").safeParse(url.searchParams.get("view") ?? undefined);
1085
+ if (!view.success) return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_9__/* .errorResponse */ .yj)("Invalid thread view", 400);
985
1086
  const limit = Math.max(1, Math.min(200, Number(url.searchParams.get("limit")) || DEFAULT_PAGE));
986
1087
  // Cursors are the message `seq` (SQLite rowid) — a monotonic order key,
987
1088
  // not a timestamp — so pagination can't skip/duplicate rows on a
988
1089
  // created_at collision.
989
1090
  const before = parseSeqParam(url.searchParams.get("before"));
990
1091
  const after = parseSeqParam(url.searchParams.get("after"));
991
- // `after` is a forward-fetch shortcut: caller (typically ChatView's
992
- // run-completion handler) already has the recent messages and just wants
993
- // the freshly-persisted ones. has_more is fixed to false because the
994
- // forward window is not paginated — caller already has everything older.
995
- let messages;
996
- let has_more;
997
- if (after !== undefined) {
998
- messages = (0,_lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__/* .getMessagesAfter */ .Nn)(thread_id, after, limit);
999
- has_more = false;
1000
- } else {
1001
- const page = (0,_lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__/* .getMessagesPage */ .qI)(thread_id, limit, before);
1002
- messages = page.messages;
1003
- has_more = page.has_more;
1004
- }
1005
- // Attach per-assistant-turn usage so the chat UI can render a context
1006
- // utilisation bar without an extra round-trip per message. User turns
1007
- // and legacy assistant rows (pre-message_usage table) simply omit the
1008
- // field.
1009
- const assistantIds = messages.filter((m)=>m.role === "assistant").map((m)=>m.msg_id);
1010
- const usageById = (0,_lib_stores_message_usage__WEBPACK_IMPORTED_MODULE_2__/* .getMessageUsageByIds */ .kw)(assistantIds);
1011
1092
  // Resolve the agent's effective context-window size once for the whole
1012
1093
  // thread. The bar scales against this cap so the visual matches the
1013
1094
  // budget the agent applies at run time.
@@ -1016,15 +1097,33 @@ async function GET(req, { params }) {
1016
1097
  const modelParams = modelCfg ? (0,_lib_stores_model_config__WEBPACK_IMPORTED_MODULE_4__/* .getModelParams */ .mN)(modelCfg) : null;
1017
1098
  const rawCtx = modelParams?.context_window_tokens;
1018
1099
  const contextWindowTokens = (0,_lib_api_serializers__WEBPACK_IMPORTED_MODULE_5__/* .resolveContextWindowTokens */ .G4)(typeof rawCtx === "number" ? rawCtx : null, DEFAULT_CONTEXT_WINDOW_TOKENS);
1019
- return next_server__WEBPACK_IMPORTED_MODULE_0__.NextResponse.json({
1100
+ const metadata = {
1020
1101
  ...thread,
1021
- warm_summary_topics: (0,_lib_agents_conversation_summary__WEBPACK_IMPORTED_MODULE_9__/* .parseStoredTopics */ .hP)(thread.warm_summary_topics),
1102
+ warm_summary_topics: (0,_lib_agents_conversation_summary__WEBPACK_IMPORTED_MODULE_11__/* .parseStoredTopics */ .hP)(thread.warm_summary_topics),
1022
1103
  warm_channel_summaries: (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_6__/* .currentChannelSummaries */ .XG)(thread_id, thread.hot_since_seq),
1023
1104
  context_window_tokens: contextWindowTokens,
1024
1105
  pending_hot_since: (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_6__/* .pendingCompactionBoundary */ .Xm)(thread_id),
1025
1106
  pending_hot_since_seq: (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_6__/* .pendingCompactionBoundarySeq */ .Wn)(thread_id),
1026
1107
  manual_compaction_pending: (0,_lib_agents_warm_summary_background__WEBPACK_IMPORTED_MODULE_6__/* .isManualCompactionRunning */ .xU)(thread_id),
1027
- activity: (0,_lib_agents_thread_activity__WEBPACK_IMPORTED_MODULE_7__/* .getThreadActivity */ .C)(thread_id),
1108
+ activity: (0,_lib_agents_thread_activity__WEBPACK_IMPORTED_MODULE_7__/* .getThreadActivity */ .C)(thread_id)
1109
+ };
1110
+ if (view.data === "metadata") return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_9__/* .noStoreJson */ .Ng)(metadata);
1111
+ // `after` is a forward-fetch shortcut: caller already has the recent
1112
+ // messages and just wants the freshly persisted ones.
1113
+ let messages;
1114
+ let has_more;
1115
+ if (after !== undefined) {
1116
+ messages = (0,_lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__/* .getMessagesAfter */ .Nn)(thread_id, after, limit);
1117
+ has_more = false;
1118
+ } else {
1119
+ const page = (0,_lib_stores_threads__WEBPACK_IMPORTED_MODULE_1__/* .getMessagesPage */ .qI)(thread_id, limit, before);
1120
+ messages = page.messages;
1121
+ has_more = page.has_more;
1122
+ }
1123
+ const assistantIds = messages.filter((m)=>m.role === "assistant").map((m)=>m.msg_id);
1124
+ const usageById = (0,_lib_stores_message_usage__WEBPACK_IMPORTED_MODULE_2__/* .getMessageUsageByIds */ .kw)(assistantIds);
1125
+ return (0,_lib_api_responses__WEBPACK_IMPORTED_MODULE_9__/* .noStoreJson */ .Ng)({
1126
+ ...metadata,
1028
1127
  // No server-side filtering: clients receive every message with its
1029
1128
  // `category` tag and apply the chat-panel filter toolbar on the
1030
1129
  // render side. Keeping the raw transcript over the wire means audit
@@ -1048,7 +1147,7 @@ async function DELETE(_req, { params }) {
1048
1147
  try {
1049
1148
  await (0,_lib_agents_checkpointer__WEBPACK_IMPORTED_MODULE_8__/* .getCheckpointer */ .w)().deleteThread(thread_id);
1050
1149
  } catch (err) {
1051
- const msg = (0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_10__/* .errorMessage */ .g)(err);
1150
+ const msg = (0,_lib_utils_error__WEBPACK_IMPORTED_MODULE_12__/* .errorMessage */ .g)(err);
1052
1151
  if (!/no such table:\s*checkpoints/i.test(msg)) {
1053
1152
  console.error("[threads] checkpoint cleanup failed for thread", thread_id, err);
1054
1153
  }
@@ -1062,7 +1062,6 @@ async function POST(req, { params }) {
1062
1062
  }
1063
1063
  }),
1064
1064
  _user_message_persisted: true,
1065
- _message_count_before_user: admittedTurn.messageCountBefore,
1066
1065
  _idle_ms_before_user: admittedTurn.idleMsBefore
1067
1066
  });
1068
1067
  prepDurationMs = Date.now() - prepStartedAt;
@@ -1556,7 +1555,7 @@ module.exports = import("@huggingface/transformers");;
1556
1555
  var __webpack_require__ = require("../../../../../../webpack-runtime.js");
1557
1556
  __webpack_require__.C(exports);
1558
1557
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1559
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388], () => (__webpack_exec__(25243)));
1558
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,4189,540,4955,5908,5120,1388], () => (__webpack_exec__(25243)));
1560
1559
  module.exports = __webpack_exports__;
1561
1560
 
1562
1561
  })();
@@ -390,12 +390,17 @@ function upsertAgentConfigTransaction(input) {
390
390
  const db = (0,_lib_db__WEBPACK_IMPORTED_MODULE_0__/* .getDb */ .Lf)();
391
391
  const existing = getAgentConfig(input.id);
392
392
  const created_at = existing?.created_at ?? t;
393
- const mbti = input.adaptive_mbti ?? toMbti(existing?.adaptive_mbti) ?? "INTJ";
393
+ const existingMbti = toMbti(existing?.adaptive_mbti);
394
+ const mbti = input.adaptive_mbti ?? existingMbti ?? "INTJ";
394
395
  const preset = _lib_agents_adaptive_persona_presets__WEBPACK_IMPORTED_MODULE_2__/* .MBTI_PRESETS */ .e[mbti];
395
- const strength = input.adaptive_persona_strength ?? preset.strength;
396
- const empathy = input.adaptive_empathy ?? preset.empathy;
397
- const expressiveness = input.adaptive_expressiveness ?? preset.expressiveness;
398
- const verbosity = input.adaptive_verbosity ?? preset.verbosity;
396
+ // Omitted sliders keep their tuned values; they only fall back to the
397
+ // preset when the type changes or the agent is new. Otherwise every
398
+ // partial update (approved proposals, tool edits) reset them.
399
+ const keepTuned = existing !== null && existing !== undefined && mbti === existingMbti;
400
+ const strength = input.adaptive_persona_strength ?? (keepTuned ? existing.adaptive_persona_strength : preset.strength);
401
+ const empathy = input.adaptive_empathy ?? (keepTuned ? existing.adaptive_empathy : preset.empathy);
402
+ const expressiveness = input.adaptive_expressiveness ?? (keepTuned ? existing.adaptive_expressiveness : preset.expressiveness);
403
+ const verbosity = input.adaptive_verbosity ?? (keepTuned ? existing.adaptive_verbosity : preset.verbosity);
399
404
  if (input.is_default) db.prepare("UPDATE agent_configs SET is_default=0").run();
400
405
  // harness_id: explicit `undefined` means "keep existing"; explicit `null`
401
406
  // means "use the global default". Empty string is normalised to null too,
@@ -633,6 +638,13 @@ module.exports = require("node:path");
633
638
 
634
639
  /***/ }),
635
640
 
641
+ /***/ 77030:
642
+ /***/ ((module) => {
643
+
644
+ module.exports = require("node:net");
645
+
646
+ /***/ }),
647
+
636
648
  /***/ 77598:
637
649
  /***/ ((module) => {
638
650
 
@@ -924,7 +924,7 @@ module.exports = import("@huggingface/transformers");;
924
924
  var __webpack_require__ = require("../../../../webpack-runtime.js");
925
925
  __webpack_require__.C(exports);
926
926
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
927
- var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,540,4189,4955,5908,5120,1388], () => (__webpack_exec__(87469)));
927
+ var __webpack_exports__ = __webpack_require__.X(0, [2970,7377,1813,7981,513,6299,563,8808,7547,4992,46,3042,3566,2068,4377,1638,5585,9304,3524,3175,6142,4189,540,4955,5908,5120,1388], () => (__webpack_exec__(87469)));
928
928
  module.exports = __webpack_exports__;
929
929
 
930
930
  })();