@xopcai/xopc 0.0.207 → 0.0.210

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 (204) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/xopc.extension.json +1 -1
  3. package/dist/gateway/static/root/assets/{activity-store-BmpM0zwM.js → activity-store-JLmEb1p0.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DhK5wi6_.js → agent-avatar-dicebear-CI1zQfzY.js} +1 -1
  5. package/dist/gateway/static/root/assets/agents-DqGMj3QJ.js +68 -0
  6. package/dist/gateway/static/root/assets/{api-CzaAcDOn.js → api-C6MmWfcb.js} +1 -1
  7. package/dist/gateway/static/root/assets/app-management-settings-panel-Cd02GGpV.js +1 -0
  8. package/dist/gateway/static/root/assets/appearance-settings-Db-h2I3G.js +1 -0
  9. package/dist/gateway/static/root/assets/apps-page-BT7F4WBI.js +1 -0
  10. package/dist/gateway/static/root/assets/{archive-plugin-CgnzBplN.js → archive-plugin-CMHzJT2a.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-Cuybcmhn.js → attachment-load-BzhI2LoH.js} +1 -1
  12. package/dist/gateway/static/root/assets/automations-page-CwOXGV9z.js +6 -0
  13. package/dist/gateway/static/root/assets/{binary-plugins-D6BBx6Ps.js → binary-plugins-DsUeHvZO.js} +1 -1
  14. package/dist/gateway/static/root/assets/{block-editor-Dk1c3Spa.js → block-editor-CFfsIeZ4.js} +46 -46
  15. package/dist/gateway/static/root/assets/browser-settings-page-CyRLhCod.js +8 -0
  16. package/dist/gateway/static/root/assets/{browser-workflow-inputs-DvfIzCgV.js → browser-workflow-inputs-BiWghvJ0.js} +1 -1
  17. package/dist/gateway/static/root/assets/{browser-workflows-page-DZScuPlF.js → browser-workflows-page-DPLdT6Zn.js} +2 -2
  18. package/dist/gateway/static/root/assets/capabilities-settings-panel-jRKcS7lZ.js +7 -0
  19. package/dist/gateway/static/root/assets/{capability-presets-api-hoA8R_J1.js → capability-presets-api-CTxGFvsS.js} +1 -1
  20. package/dist/gateway/static/root/assets/capability-presets-settings-panel-B3bKdtwU.js +3 -0
  21. package/dist/gateway/static/root/assets/{channel-recipient-api-BS8I65NT.js → channel-recipient-api-BklVUOxC.js} +1 -1
  22. package/dist/gateway/static/root/assets/channels-settings-yZBWH02s.js +1 -0
  23. package/dist/gateway/static/root/assets/channels-status-swr-C3zlimZd.js +1 -0
  24. package/dist/gateway/static/root/assets/chat-terminal-dock-0F4Jmma2.js +36 -0
  25. package/dist/gateway/static/root/assets/{connectors-api-B_78jmvM.js → connectors-api-BvIZ51ty.js} +1 -1
  26. package/dist/gateway/static/root/assets/connectors-page-OX4KvUkA.js +2 -0
  27. package/dist/gateway/static/root/assets/{cron-expression-BBheaBIr.js → cron-expression-BHmwaMbO.js} +1 -1
  28. package/dist/gateway/static/root/assets/{date-picker-CDwj7UrT.js → date-picker-fj_pPCv5.js} +1 -1
  29. package/dist/gateway/static/root/assets/{dependency-picker-Dnrc2qZe.js → dependency-picker-DsWvwOv-.js} +1 -1
  30. package/dist/gateway/static/root/assets/{desktop-pet-Bj_vUjXp.js → desktop-pet-mjkF0Xxh.js} +1 -1
  31. package/dist/gateway/static/root/assets/desktop-pet-settings-ClwUpRYu.js +1 -0
  32. package/dist/gateway/static/root/assets/directory-picker-path-field-OkqRFyRL.js +1 -0
  33. package/dist/gateway/static/root/assets/{extension-debug-page-_GZ4y2da.js → extension-debug-page-DC69wplH.js} +1 -1
  34. package/dist/gateway/static/root/assets/{extension-page-scR96Edg.js → extension-page-DCtk6zdJ.js} +1 -1
  35. package/dist/gateway/static/root/assets/extension-settings-page-Bkm4zzv-.js +1 -0
  36. package/dist/gateway/static/root/assets/{gateway-config-api-984O_4wM.js → gateway-config-api-Dr_NQt7v.js} +1 -1
  37. package/dist/gateway/static/root/assets/{gateway-config-swr-D4hvsdJA.js → gateway-config-swr-CEfv8N1J.js} +1 -1
  38. package/dist/gateway/static/root/assets/gateway-settings-V1XVxjHa.js +1 -0
  39. package/dist/gateway/static/root/assets/{gateway-startup-retry-Deo5-O87.js → gateway-startup-retry-B8hebJ7s.js} +1 -1
  40. package/dist/gateway/static/root/assets/heartbeat-settings-CWUBAQrE.js +1 -0
  41. package/dist/gateway/static/root/assets/home-page-D57cYRd3.js +1 -0
  42. package/dist/gateway/static/root/assets/index-DJ7HSgKs.js +85 -0
  43. package/dist/gateway/static/root/assets/index-PNBFdxHb.css +2 -0
  44. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DGmOlNcB.js → keyboard-shortcuts-settings-DCQvf05d.js} +1 -1
  45. package/dist/gateway/static/root/assets/local-app-workbench-page-BbAiMZE1.js +2 -0
  46. package/dist/gateway/static/root/assets/{local-apps-page-CzS2sCxg.js → local-apps-page-B3Ugd0my.js} +1 -1
  47. package/dist/gateway/static/root/assets/{locale-store-C7xtkP3D.js → locale-store-hDBVeG3G.js} +1 -1
  48. package/dist/gateway/static/root/assets/logs-page-nXdF3wOT.js +2 -0
  49. package/dist/gateway/static/root/assets/{management-settings-Cpxs43JB.js → management-settings-C-S5Llq3.js} +1 -1
  50. package/dist/gateway/static/root/assets/{markdown-split-CQvFHxUa.js → markdown-split-DuVq37Uh.js} +1 -1
  51. package/dist/gateway/static/root/assets/{markdown-view-BRwrSbwM.js → markdown-view-D8eO_6h3.js} +1 -1
  52. package/dist/gateway/static/root/assets/{media-plugins-Bs9MsiaM.js → media-plugins-C1V6pkX3.js} +1 -1
  53. package/dist/gateway/static/root/assets/messages-1qg_hOOd.js +3 -0
  54. package/dist/gateway/static/root/assets/{notes-page-Dux_g6aZ.js → notes-page-Dn71ZV8c.js} +1 -1
  55. package/dist/gateway/static/root/assets/notes-workbench-BYPoZeRw.js +4 -0
  56. package/dist/gateway/static/root/assets/page-tabs-B5a5aSoS.js +1 -0
  57. package/dist/gateway/static/root/assets/preview-open-alternatives-5041AIBX.js +1 -0
  58. package/dist/gateway/static/root/assets/{product-open-page-f_jbg-9N.js → product-open-page-7UkouFQU.js} +1 -1
  59. package/dist/gateway/static/root/assets/project-detail-page-D27nOKbo.js +1 -0
  60. package/dist/gateway/static/root/assets/projects-page-CdB5cJJ-.js +1 -0
  61. package/dist/gateway/static/root/assets/remote-access-hub-DFoZ3UNS.js +1 -0
  62. package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-zapSiJrv.js → runtime-tools-settings-panel-DvaXzHYS.js} +2 -2
  63. package/dist/gateway/static/root/assets/{schema-form-CFyz8y5v.js → schema-form-Dlxl_5X0.js} +1 -1
  64. package/dist/gateway/static/root/assets/sessions-page-C1cbIcJ7.js +1 -0
  65. package/dist/gateway/static/root/assets/settings-advanced-gate-DnXRlQXS.js +1 -0
  66. package/dist/gateway/static/root/assets/settings-form-section-CSaiuuer.js +1 -0
  67. package/dist/gateway/static/root/assets/{settings-loading-skeleton-DFUJEv4G.js → settings-loading-skeleton-H3mJwt3r.js} +1 -1
  68. package/dist/gateway/static/root/assets/{settings-page-Cnp9Bdd0.js → settings-page-Cs7zA4BS.js} +1 -1
  69. package/dist/gateway/static/root/assets/setup-status-panel-CwgMODfJ.js +1 -0
  70. package/dist/gateway/static/root/assets/{share-preview-page-DA8nA4cz.js → share-preview-page-Bdpw5m7M.js} +1 -1
  71. package/dist/gateway/static/root/assets/shares-settings-hlUgIkrp.js +1 -0
  72. package/dist/gateway/static/root/assets/skill-reload-api-DR31B_Gz.js +1 -0
  73. package/dist/gateway/static/root/assets/skills-page-Bup3Lg1Z.js +2 -0
  74. package/dist/gateway/static/root/assets/{skills-page.utils--1-vOg3V.js → skills-page.utils-D22ORR21.js} +1 -1
  75. package/dist/gateway/static/root/assets/system-settings-panel-GmtWsfjB.js +1 -0
  76. package/dist/gateway/static/root/assets/task-detail-page-CTKDpxhf.js +1 -0
  77. package/dist/gateway/static/root/assets/{theme-store-DoyRfkoi.js → theme-store-CtY8RwMX.js} +1 -1
  78. package/dist/gateway/static/root/assets/typed-models-lib-C2aOdlEA.js +1 -0
  79. package/dist/gateway/static/root/assets/{use-autosave-DzIR5Lxf.js → use-autosave-DOj5i8d_.js} +1 -1
  80. package/dist/gateway/static/root/assets/user-context-page-keJJYpix.js +1 -0
  81. package/dist/gateway/static/root/assets/{voice-api-key-field-B7MZS8tS.js → voice-api-key-field-5WfurWYa.js} +1 -1
  82. package/dist/gateway/static/root/assets/{work-discovery-overlay-zyX6yxxF.js → work-discovery-overlay-D5_MH3n3.js} +1 -1
  83. package/dist/gateway/static/root/assets/work-discovery-page-BcvBiebt.js +1 -0
  84. package/dist/gateway/static/root/assets/workflow-run-setup-panel-bBA8LinI.js +3 -0
  85. package/dist/gateway/static/root/assets/workflows-page-Cz2VpWdj.js +5 -0
  86. package/dist/gateway/static/root/index.html +11 -15
  87. package/dist/package.js +1 -1
  88. package/dist/src/agent/agent-manager.js +2 -2
  89. package/dist/src/agent/background-review/coordinator.d.ts +1 -1
  90. package/dist/src/agent/background-review/coordinator.js +4 -5
  91. package/dist/src/agent/background-review/run-background-review.js +0 -1
  92. package/dist/src/agent/background-review/settings.d.ts +1 -2
  93. package/dist/src/agent/background-review/settings.js +3 -4
  94. package/dist/src/agent/external-tools/composio-provider.js +8 -4
  95. package/dist/src/agent/memory/builtin-provider.js +1 -1
  96. package/dist/src/agent/memory/create-memory-manager.js +1 -1
  97. package/dist/src/agent/memory/manager.js +2 -0
  98. package/dist/src/agent/memory/sensitivity.js +1 -1
  99. package/dist/src/agent/memory/understanding/service.js +43 -19
  100. package/dist/src/agent/memory/user-context-coordinator.js +1 -1
  101. package/dist/src/agent-runtime/index.js +1 -1
  102. package/dist/src/agent-runtime/runtime-profile.js +1 -1
  103. package/dist/src/automations/domain/validation.d.ts +7 -7
  104. package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
  105. package/dist/src/connectors/auth-provider-registry.d.ts +2 -1
  106. package/dist/src/connectors/auth-provider-registry.js +5 -2
  107. package/dist/src/connectors/composio-sessions.d.ts +38 -0
  108. package/dist/src/connectors/composio-sessions.js +64 -6
  109. package/dist/src/connectors/composio.d.ts +4 -1
  110. package/dist/src/connectors/composio.js +26 -4
  111. package/dist/src/connectors/runtime-adapter-registry.js +14 -1
  112. package/dist/src/gateway/hono/routes/agent-stream.js +4 -1
  113. package/dist/src/gateway/hono/routes/connectors.js +15 -2
  114. package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -0
  115. package/dist/src/gateway/hono/routes/session-input-handler.js +75 -1
  116. package/dist/src/gateway/service/agent-runner.d.ts +9 -1
  117. package/dist/src/gateway/service/agent-runner.js +9 -0
  118. package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
  119. package/dist/src/gateway/service/session-input-coordinator.js +64 -6
  120. package/dist/src/gateway/service.d.ts +8 -0
  121. package/dist/src/gateway/service.js +8 -5
  122. package/dist/src/retrieval/audit.d.ts +1 -0
  123. package/dist/src/retrieval/audit.js +8 -0
  124. package/dist/src/retrieval/candidateFusion.d.ts +5 -0
  125. package/dist/src/retrieval/candidateFusion.js +20 -0
  126. package/dist/src/retrieval/queryProfile.d.ts +16 -0
  127. package/dist/src/retrieval/queryProfile.js +66 -0
  128. package/dist/src/retrieval/textFeatures.d.ts +5 -0
  129. package/dist/src/retrieval/textFeatures.js +71 -0
  130. package/dist/src/session/client-history.d.ts +1 -0
  131. package/dist/src/session/client-history.js +4 -0
  132. package/dist/src/session/index.js +1 -1
  133. package/dist/src/session/store.js +1 -1
  134. package/dist/src/storage/sqlite/fts.d.ts +0 -4
  135. package/dist/src/storage/sqlite/fts.js +2 -49
  136. package/dist/src/storage/sqlite/index.d.ts +3 -2
  137. package/dist/src/storage/sqlite/index.js +6 -5
  138. package/dist/src/storage/sqlite/memory-records-repository.js +60 -38
  139. package/dist/src/storage/sqlite/row-mappers.js +2 -2
  140. package/dist/src/storage/sqlite/session-repository.js +2 -2
  141. package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +34 -0
  142. package/dist/src/storage/sqlite/session-turn-replace-repository.js +110 -0
  143. package/dist/src/storage/sqlite/transcript-repository.js +1 -1
  144. package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +7 -0
  145. package/dist/src/storage/sqlite/user-context-quality-repository.js +25 -1
  146. package/dist/src/storage/sqlite/user-context-repository.d.ts +4 -0
  147. package/dist/src/storage/sqlite/user-context-repository.js +29 -3
  148. package/dist/src/tasks/home-query-service.d.ts +3 -1
  149. package/dist/src/tasks/home-query-service.js +73 -70
  150. package/dist/src/tui/backends/embedded-backend.js +1 -1
  151. package/dist/src/user-context/planner.d.ts +1 -0
  152. package/dist/src/user-context/planner.js +16 -29
  153. package/dist/src/user-context/retriever.d.ts +15 -0
  154. package/dist/src/user-context/retriever.js +65 -0
  155. package/dist/src/user-context/scope.d.ts +7 -0
  156. package/dist/src/user-context/scope.js +9 -0
  157. package/package.json +3 -3
  158. package/dist/gateway/static/root/assets/agents-Bc3Lc-n2.js +0 -68
  159. package/dist/gateway/static/root/assets/app-management-settings-panel-Dqj5G_cd.js +0 -1
  160. package/dist/gateway/static/root/assets/appearance-settings-Bm1uLGMi.js +0 -1
  161. package/dist/gateway/static/root/assets/apps-page-BKtwU47-.js +0 -1
  162. package/dist/gateway/static/root/assets/automations-page-ilGeRLDN.js +0 -6
  163. package/dist/gateway/static/root/assets/browser-settings-page-BCu8AZbs.js +0 -8
  164. package/dist/gateway/static/root/assets/capabilities-settings-panel-BbWQBtTe.js +0 -7
  165. package/dist/gateway/static/root/assets/capability-presets-settings-panel-BTVU46Yn.js +0 -3
  166. package/dist/gateway/static/root/assets/channels-settings-BEQsC9a9.js +0 -1
  167. package/dist/gateway/static/root/assets/channels-status-swr-DRwbgtOT.js +0 -1
  168. package/dist/gateway/static/root/assets/chat-terminal-dock-BIPhWBDI.js +0 -36
  169. package/dist/gateway/static/root/assets/connectors-page-w_3kpqbc.js +0 -2
  170. package/dist/gateway/static/root/assets/desktop-pet-settings-uiCwJJk4.js +0 -1
  171. package/dist/gateway/static/root/assets/directory-picker-path-field-D0zUQ-TO.js +0 -1
  172. package/dist/gateway/static/root/assets/extension-settings-page-CILsAwxx.js +0 -1
  173. package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +0 -1
  174. package/dist/gateway/static/root/assets/gateway-settings-aF4eQHo3.js +0 -1
  175. package/dist/gateway/static/root/assets/heartbeat-settings-D5DrFWH6.js +0 -1
  176. package/dist/gateway/static/root/assets/home-page-DiMWxngC.js +0 -3
  177. package/dist/gateway/static/root/assets/index-DzKLVgY-.js +0 -85
  178. package/dist/gateway/static/root/assets/index-wR5jX-lw.css +0 -2
  179. package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +0 -1
  180. package/dist/gateway/static/root/assets/local-app-workbench-page-De8vuwu1.js +0 -2
  181. package/dist/gateway/static/root/assets/logs-page-BI9stsVO.js +0 -2
  182. package/dist/gateway/static/root/assets/messages-Dxk5Rzj_.js +0 -3
  183. package/dist/gateway/static/root/assets/notes-workbench-CGafcgJ8.js +0 -4
  184. package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +0 -1
  185. package/dist/gateway/static/root/assets/preview-open-alternatives-fvhtN4Y2.js +0 -1
  186. package/dist/gateway/static/root/assets/project-detail-page-C6mNsjYr.js +0 -1
  187. package/dist/gateway/static/root/assets/projects-page-D1G6VIxR.js +0 -1
  188. package/dist/gateway/static/root/assets/remote-access-hub-CIez6X0x.js +0 -1
  189. package/dist/gateway/static/root/assets/sessions-page-6irxQjHb.js +0 -1
  190. package/dist/gateway/static/root/assets/settings-advanced-gate-CRb0QTG2.js +0 -1
  191. package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +0 -1
  192. package/dist/gateway/static/root/assets/settings-form-section-DCiK4TIq.js +0 -1
  193. package/dist/gateway/static/root/assets/setup-status-panel-BFMGTGBO.js +0 -1
  194. package/dist/gateway/static/root/assets/shares-settings-CaKfvJzQ.js +0 -1
  195. package/dist/gateway/static/root/assets/skill-reload-api-BOBUcYr5.js +0 -1
  196. package/dist/gateway/static/root/assets/skills-page-BJJACxzz.js +0 -2
  197. package/dist/gateway/static/root/assets/system-settings-panel-DY0lIaXY.js +0 -1
  198. package/dist/gateway/static/root/assets/task-detail-page-Ciuwe7AG.js +0 -1
  199. package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +0 -1
  200. package/dist/gateway/static/root/assets/user-context-page-yf18T_BZ.js +0 -1
  201. package/dist/gateway/static/root/assets/work-discovery-page-2e5J0sIp.js +0 -1
  202. package/dist/gateway/static/root/assets/workflow-run-setup-panel-Cj1vPWRM.js +0 -3
  203. package/dist/gateway/static/root/assets/workflows-page-D37zWlWY.js +0 -5
  204. package/dist/gateway/static/root/assets/working-directory-picker-modal-Bm7cox3y.js +0 -1
@@ -1,3 +0,0 @@
1
- import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{c as i,l as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as s}from"./check-DUBLcKHA.js";import{t as c}from"./loader-circle-CifKLtgG.js";import{t as l}from"./plus-Q2yW6OE7.js";import{t as u}from"./x-B_N4OPjy.js";import{t as d}from"./cn-JdwAhgNB.js";import{t as f}from"./button-CSEbl4zT.js";import{t as p}from"./messages-Dxk5Rzj_.js";import{n as m,o as h,r as g}from"./locale-store-C7xtkP3D.js";import{a as _,i as v,n as y,o as b,r as x,s as S,t as C}from"./dist-BPoKqzeH.js";import{n as w}from"./activity-store-BmpM0zwM.js";import{Aa as T,B as E,El as D,I as O,Kl as k,N as A,P as j,Sl as M,Tc as N,U as P,V as F,Va as I,as as ee,cl as L,is as R,j as te,q as ne,rn as re,sc as ie,si as z,tn as ae,xl as oe,yl as se,ys as ce,z as le}from"./index-DzKLVgY-.js";var B=e(t(),1),V=n();function H(e){try{return decodeURIComponent(e).trim()||null}catch{return null}}function U(e){if(!e)return null;let t=e.split(/[?#]/,1)[0],n=/^\/chat\/([^/]+)\/?$/.exec(t);if(n){let e=H(n[1]);return!e||e===`new`?null:{kind:`session`,id:e}}return null}async function W(e,t){let n=`/api/sessions/${encodeURIComponent(e.id)}?limit=1`;try{return(await h(g(n),{signal:t})).status===404?`missing`:`available`}catch(e){if(t?.aborted)throw e;return`available`}}var G=r(),K=3,q={info:{Icon:N,className:`text-accent-fg bg-accent-soft`},success:{Icon:se,className:`text-success bg-success-soft`},warning:{Icon:R,className:`text-warning bg-warning-soft`},error:{Icon:oe,className:`text-danger bg-danger-soft`}};function ue(e,t){let n=Math.max(0,Math.round((Date.now()-e)/1e3));if(n<60)return t===`zh`?`刚刚`:`Just now`;let r=Math.round(n/60);if(r<60)return t===`zh`?`${r} 分钟前`:`${r}m ago`;let i=Math.round(r/60);if(i<24)return t===`zh`?`${i} 小时前`:`${i}h ago`;let a=Math.round(i/24);return t===`zh`?`${a} 天前`:`${a}d ago`}function J(e){let t=(0,V.c)(55),{item:n,targetAvailability:r}=e,i=m(fe),a;t[0]===i?a=t[1]:(a=p(i),t[0]=i,t[1]=a);let s=a.projectsPage.home,l=w(de),{Icon:f,className:h}=q[n.tone],g;t[2]===h?g=t[3]:(g=d(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,h),t[2]=h,t[3]=g);let _;t[4]!==f||t[5]!==n.status?(_=n.status===`running`?(0,G.jsx)(c,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,G.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),t[4]=f,t[5]=n.status,t[6]=_):_=t[6];let v;t[7]!==g||t[8]!==_?(v=(0,G.jsx)(`div`,{className:g,children:_}),t[7]=g,t[8]=_,t[9]=v):v=t[9];let y;t[10]===n.title?y=t[11]:(y=(0,G.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium leading-5 text-fg`,children:n.title}),t[10]=n.title,t[11]=y);let b;t[12]!==s.activityUnread||t[13]!==n.read?(b=n.read?null:(0,G.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-accent`,"aria-label":s.activityUnread}),t[12]=s.activityUnread,t[13]=n.read,t[14]=b):b=t[14];let x;t[15]!==y||t[16]!==b?(x=(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[y,b]}),t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]===n.message?S=t[19]:(S=n.message?(0,G.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.message}):null,t[18]=n.message,t[19]=S);let C;t[20]===n.source?C=t[21]:(C=n.source?(0,G.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=C);let E;t[22]!==n.updatedAt||t[23]!==i?(E=ue(n.updatedAt,i),t[22]=n.updatedAt,t[23]=i,t[24]=E):E=t[24];let D;t[25]===E?D=t[26]:(D=(0,G.jsx)(`span`,{children:E}),t[25]=E,t[26]=D);let O;t[27]===n.occurrences?O=t[28]:(O=n.occurrences>1?(0,G.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=O);let k;t[29]!==s.activityCheckingRelated||t[30]!==s.activityRelatedMissing||t[31]!==s.activityViewRelated||t[32]!==n.href||t[33]!==r?(k=n.href&&r===`available`?(0,G.jsxs)(o,{to:n.href,className:`inline-flex items-center gap-0.5 font-medium text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[s.activityViewRelated,(0,G.jsx)(M,{className:`size-3`,"aria-hidden":!0})]}):n.href&&r===`checking`?(0,G.jsx)(T,{className:`h-3 w-20 rounded`,"aria-label":s.activityCheckingRelated}):n.href&&r===`missing`?(0,G.jsx)(`span`,{className:`font-medium text-fg-subtle`,role:`status`,children:s.activityRelatedMissing}):null,t[29]=s.activityCheckingRelated,t[30]=s.activityRelatedMissing,t[31]=s.activityViewRelated,t[32]=n.href,t[33]=r,t[34]=k):k=t[34];let A;t[35]!==D||t[36]!==O||t[37]!==k||t[38]!==C?(A=(0,G.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[C,D,O,k]}),t[35]=D,t[36]=O,t[37]=k,t[38]=C,t[39]=A):A=t[39];let j;t[40]!==A||t[41]!==x||t[42]!==S?(j=(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[x,S,A]}),t[40]=A,t[41]=x,t[42]=S,t[43]=j):j=t[43];let N;t[44]!==n.id||t[45]!==l?(N=()=>l(n.id),t[44]=n.id,t[45]=l,t[46]=N):N=t[46];let P;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,G.jsx)(u,{className:`size-3.5`,"aria-hidden":!0}),t[47]=P):P=t[47];let F;t[48]!==s.activityRemove||t[49]!==N?(F=(0,G.jsx)(`button`,{type:`button`,className:`rounded-md p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-hover hover:text-fg group-hover:opacity-100 focus:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.activityRemove,onClick:N,children:P}),t[48]=s.activityRemove,t[49]=N,t[50]=F):F=t[50];let I;return t[51]!==j||t[52]!==F||t[53]!==v?(I=(0,G.jsxs)(`article`,{className:`group flex items-start gap-3 border-t border-edge-subtle px-1 py-3 first:border-t-0`,children:[v,j,F]}),t[51]=j,t[52]=F,t[53]=v,t[54]=I):I=t[54],I}function de(e){return e.remove}function fe(e){return e.language}function pe(){let e=(0,V.c)(14),t=p(m(be)).projectsPage.home,n=w(ye),r=w(ve),i=w(_e),[a,o]=(0,B.useState)(!1),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={},e[0]=l):l=e[0];let[u,d]=(0,B.useState)(l),h;e[1]===n?h=e[2]:(h=n.filter($),e[1]=n,e[2]=h);let g=h.length,_;e[3]===n?_=e[4]:(_=n.filter(Q),e[3]=n,e[4]=_);let v=_.length,y;e[5]!==a||e[6]!==n?(y=a?n:n.slice(0,K),e[5]=a,e[6]=n,e[7]=y):y=e[7];let b=y,x;e[8]===n?x=e[9]:(x=[...new Set(n.flatMap(ge))].sort().join(`
2
- `),e[8]=n,e[9]=x);let S=x,C,T;e[10]===S?(C=e[11],T=e[12]):(C=()=>{let e=new AbortController,t=new Map((S?S.split(`
3
- `):[]).flatMap(he));return d(Object.fromEntries([...t.keys()].map(me))),Promise.all([...t].map(async t=>{let[n,r]=t,i=await W(r,e.signal);e.signal.aborted||d(e=>({...e,[n]:i}))})).catch(Z),()=>e.abort()},T=[S],e[10]=S,e[11]=C,e[12]=T),(0,B.useEffect)(C,T);let E;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,G.jsx)(k,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[13]=E):E=e[13],(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsx)(`div`,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[E,(0,G.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),g>0?(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:[(0,G.jsx)(c,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),g,` `,t.running]}):v>0?(0,G.jsxs)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[v,` `,t.activityNew]}):null]})}),a&&n.length>0?(0,G.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v>0?(0,G.jsxs)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,G.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some(X)?(0,G.jsxs)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,G.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,G.jsxs)(`div`,{className:`mt-3 px-1`,children:[b.map(e=>(0,G.jsx)(J,{item:e,targetAvailability:e.href&&U(e.href)?u[e.href]??`checking`:`available`},e.id)),n.length>K?(0,G.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>o(Y),children:a?t.activityShowLess:t.activityShowAll.replace(`{{count}}`,String(n.length))})}):null]}):(0,G.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(L,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,G.jsx)(`p`,{children:t.activityEmpty})]})]})}function Y(e){return!e}function X(e){return e.status===`done`}function Z(){}function me(e){return[e,`checking`]}function he(e){let t=U(e);return t?[[e,t]]:[]}function ge(e){return e.href&&U(e.href)?[e.href]:[]}function Q(e){return!e.read}function $(e){return e.status===`running`}function _e(e){return e.clearFinished}function ve(e){return e.markAllRead}function ye(e){return e.items}function be(e){return e.language}function xe(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Se(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:z(n)}function Ce(e){let t=(0,V.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function we(e){let t=(0,V.c)(18),{task:n,statusLabel:r,backgroundPath:i}=e,a;t[0]!==i||t[1]!==n.id?(a=re(i,n.id),t[0]=i,t[1]=n.id,t[2]=a):a=t[2];let s;t[3]===n.title?s=t[4]:(s=(0,G.jsx)(`h3`,{className:`line-clamp-2 text-sm font-semibold text-fg`,children:n.title}),t[3]=n.title,t[4]=s);let c;t[5]===n.updatedAt?c=t[6]:(c=Se(n.updatedAt,``),t[5]=n.updatedAt,t[6]=c);let l;t[7]===c?l=t[8]:(l=(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:c}),t[7]=c,t[8]=l);let u;t[9]!==s||t[10]!==l?(u=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[s,l]}),t[9]=s,t[10]=l,t[11]=u):u=t[11];let d;t[12]===r?d=t[13]:(d=(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:r}),t[12]=r,t[13]=d);let f;return t[14]!==a||t[15]!==u||t[16]!==d?(f=(0,G.jsxs)(o,{to:a,className:`group flex items-start justify-between gap-3 rounded-xl border border-edge-subtle bg-surface-panel p-4 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,d]}),t[14]=a,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function Te(e){let t=(0,V.c)(12),{receipt:n,evidenceLabel:r,remainingLabel:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,G.jsx)(se,{className:`mt-0.5 size-4 shrink-0 text-success`,"aria-hidden":!0}),t[0]=a):a=t[0];let o,s;t[1]===n.summary?(o=t[2],s=t[3]):(o=(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:n.summary}),s=(0,G.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.summary}),t[1]=n.summary,t[2]=o,t[3]=s);let c=n.remainingWork.length>0?` · ${n.remainingWork.length} ${i}`:``,l;t[4]!==r||t[5]!==n.evidence.length||t[6]!==c?(l=(0,G.jsxs)(`p`,{className:`mt-2 text-[11px] text-fg-subtle`,children:[n.evidence.length,` `,r,c]}),t[4]=r,t[5]=n.evidence.length,t[6]=c,t[7]=l):l=t[7];let u;return t[8]!==o||t[9]!==s||t[10]!==l?(u=(0,G.jsx)(`div`,{className:`block rounded-xl border border-edge-subtle px-3 py-3`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-2`,children:[a,(0,G.jsxs)(`div`,{className:`min-w-0`,children:[o,s,l]})]})}),t[8]=o,t[9]=s,t[10]=l,t[11]=u):u=t[11],u}function Ee(){let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,G.jsx)(T,{className:`h-20 rounded-2xl`}),(0,G.jsx)(T,{className:`h-72 rounded-2xl`}),(0,G.jsx)(T,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function De(e){let t=(0,V.c)(15),{chat:n,statusLabel:r}=e,i=`/chat/${encodeURIComponent(n.key)}`,a;t[0]===n.name?a=t[1]:(a=(0,G.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:n.name}),t[0]=n.name,t[1]=a);let s;t[2]===r?s=t[3]:(s=(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:r}),t[2]=r,t[3]=s);let c;t[4]!==a||t[5]!==s?(c=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6];let l;t[7]===n.updatedAt?l=t[8]:(l=Se(n.updatedAt,``),t[7]=n.updatedAt,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,G.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:l}),t[9]=l,t[10]=u);let d;return t[11]!==i||t[12]!==c||t[13]!==u?(d=(0,G.jsxs)(o,{to:i,className:`group block rounded-xl border border-edge-subtle bg-surface-panel p-4 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[c,u]}),t[11]=i,t[12]=c,t[13]=u,t[14]=d):d=t[14],d}function Oe(e){let t=(0,V.c)(27),{item:n,href:r,kindLabel:i,reasonLabel:a,approveLabel:s,denyLabel:c,busy:l,onRespond:u}=e,d;t[0]===n.title?d=t[1]:(d=(0,G.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=d);let p=n.projectName||i,m;t[2]===p?m=t[3]:(m=(0,G.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:p}),t[2]=p,t[3]=m);let h;t[4]!==d||t[5]!==m?(h=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[d,m]}),t[4]=d,t[5]=m,t[6]=h):h=t[6];let g;t[7]===a?g=t[8]:(g=(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:a}),t[7]=a,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===n.detail?v=t[13]:(v=n.detail?(0,G.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.detail}):null,t[12]=n.detail,t[13]=v);let y;t[14]!==r||t[15]!==_||t[16]!==v?(y=(0,G.jsxs)(o,{to:r,className:`group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[_,v]}),t[14]=r,t[15]=_,t[16]=v,t[17]=y):y=t[17];let b;t[18]!==s||t[19]!==l||t[20]!==c||t[21]!==n.response||t[22]!==u?(b=n.response?(0,G.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:l,onClick:()=>u(`deny`),children:c}),(0,G.jsx)(f,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:l,onClick:()=>u(`approve`),children:s})]}):null,t[18]=s,t[19]=l,t[20]=c,t[21]=n.response,t[22]=u,t[23]=b):b=t[23];let x;return t[24]!==y||t[25]!==b?(x=(0,G.jsxs)(`article`,{className:`rounded-xl border border-warning/35 bg-warning-soft/25 p-3.5 transition-colors hover:bg-warning-soft/40`,children:[y,b]}),t[24]=y,t[25]=b,t[26]=x):x=t[26],x}function ke(e){let t=(0,V.c)(74),{item:n,labels:r,busy:i,onDecide:a,onSnooze:o,onDismiss:s,onInstruct:c}=e,[l,u]=(0,B.useState)(``),d=n.judgment,p;t[0]===n.title?p=t[1]:(p=(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=p);let m;t[2]===n.detail?m=t[3]:(m=(0,G.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n.detail}),t[2]=n.detail,t[3]=m);let h;t[4]!==p||t[5]!==m?(h=(0,G.jsxs)(`div`,{className:`min-w-0`,children:[p,m]}),t[4]=p,t[5]=m,t[6]=h):h=t[6];let g;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,G.jsx)(ce,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=g):g=t[7];let _;t[8]===h?_=t[9]:(_=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[h,g]}),t[8]=h,t[9]=_);let v;t[10]!==d.whyNow||t[11]!==r.whyNow?(v=[r.whyNow,d.whyNow],t[10]=d.whyNow,t[11]=r.whyNow,t[12]=v):v=t[12];let y;t[13]!==d.impact||t[14]!==r.impact?(y=[r.impact,d.impact],t[13]=d.impact,t[14]=r.impact,t[15]=y):y=t[15];let b;t[16]!==d.workDone||t[17]!==r.workDone?(b=[r.workDone,d.workDone],t[16]=d.workDone,t[17]=r.workDone,t[18]=b):b=t[18];let x;t[19]!==d.recommendation||t[20]!==r.recommendation?(x=[r.recommendation,d.recommendation],t[19]=d.recommendation,t[20]=r.recommendation,t[21]=x):x=t[21];let S;t[22]!==v||t[23]!==y||t[24]!==b||t[25]!==x?(S=(0,G.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[v,y,b,x].map(Ae)}),t[22]=v,t[23]=y,t[24]=b,t[25]=x,t[26]=S):S=t[26];let C;t[27]!==d.actionError||t[28]!==d.actionStatus||t[29]!==d.dispositionReason||t[30]!==d.proposedActionTitle||t[31]!==r.actionStates||t[32]!==r.policyReason||t[33]!==r.proposedAction?(C=d.dispositionReason?(0,G.jsxs)(`div`,{className:`mt-3 rounded-lg border border-edge-subtle bg-surface-panel/70 p-3 text-xs leading-5`,children:[(0,G.jsx)(`p`,{className:`font-medium text-fg-subtle`,children:r.policyReason}),(0,G.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:d.dispositionReason}),d.proposedActionTitle?(0,G.jsxs)(`p`,{className:`mt-2 text-fg`,children:[(0,G.jsxs)(`span`,{className:`font-medium`,children:[r.proposedAction,`:`]}),d.proposedActionTitle,d.actionStatus?` · ${r.actionStates[d.actionStatus]}`:``]}):null,d.actionError?(0,G.jsx)(`p`,{className:`mt-1 text-danger`,children:d.actionError}):null]}):null,t[27]=d.actionError,t[28]=d.actionStatus,t[29]=d.dispositionReason,t[30]=d.proposedActionTitle,t[31]=r.actionStates,t[32]=r.policyReason,t[33]=r.proposedAction,t[34]=C):C=t[34];let w;t[35]!==i||t[36]!==d.decision||t[37]!==a?(w=d.decision?(0,G.jsxs)(`div`,{className:`mt-4`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:d.decision.question}),(0,G.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:d.decision.options.map(e=>(0,G.jsxs)(f,{type:`button`,variant:`secondary`,className:`h-auto min-h-9 flex-col items-start px-3 py-2 text-left`,disabled:i,title:e.consequence,onClick:()=>a(e.id),children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(`span`,{className:`text-[10px] font-normal text-fg-muted`,children:e.consequence})]},e.id))})]}):null,t[35]=i,t[36]=d.decision,t[37]=a,t[38]=w):w=t[38];let T;t[39]!==i||t[40]!==r.snooze||t[41]!==o?(T=(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:i,onClick:o,children:r.snooze}),t[39]=i,t[40]=r.snooze,t[41]=o,t[42]=T):T=t[42];let E;t[43]!==i||t[44]!==r.dismiss||t[45]!==s?(E=(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:i,onClick:s,children:r.dismiss}),t[43]=i,t[44]=r.dismiss,t[45]=s,t[46]=E):E=t[46];let D;t[47]!==T||t[48]!==E?(D=(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 border-t border-edge-subtle pt-3`,children:[T,E]}),t[47]=T,t[48]=E,t[49]=D):D=t[49];let O;t[50]!==l||t[51]!==c?(O=e=>{e.preventDefault();let t=l.trim();t&&(c(t),u(``))},t[50]=l,t[51]=c,t[52]=O):O=t[52];let k;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>u(e.target.value),t[53]=k):k=t[53];let A;t[54]!==l||t[55]!==r.feedbackPlaceholder?(A=(0,G.jsx)(`input`,{className:`min-w-0 flex-1 rounded-lg border border-edge bg-surface-base px-3 py-2 text-xs text-fg outline-none focus:border-accent`,value:l,onChange:k,placeholder:r.feedbackPlaceholder}),t[54]=l,t[55]=r.feedbackPlaceholder,t[56]=A):A=t[56];let j;t[57]!==i||t[58]!==l?(j=i||!l.trim(),t[57]=i,t[58]=l,t[59]=j):j=t[59];let M;t[60]!==r.applyFeedback||t[61]!==j?(M=(0,G.jsx)(f,{type:`submit`,variant:`secondary`,className:`h-9 px-3`,disabled:j,children:r.applyFeedback}),t[60]=r.applyFeedback,t[61]=j,t[62]=M):M=t[62];let N;t[63]!==O||t[64]!==A||t[65]!==M?(N=(0,G.jsxs)(`form`,{className:`mt-3 flex gap-2`,onSubmit:O,children:[A,M]}),t[63]=O,t[64]=A,t[65]=M,t[66]=N):N=t[66];let P;return t[67]!==S||t[68]!==C||t[69]!==w||t[70]!==D||t[71]!==N||t[72]!==_?(P=(0,G.jsxs)(`article`,{className:`rounded-xl border border-accent/25 bg-accent-soft/15 p-4`,children:[_,S,C,w,D,N]}),t[67]=S,t[68]=C,t[69]=w,t[70]=D,t[71]=N,t[72]=_,t[73]=P):P=t[73],P}function Ae(e){let[t,n]=e;return(0,G.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 p-3`,children:[(0,G.jsx)(`p`,{className:`text-[11px] font-medium text-fg-subtle`,children:t}),(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg`,children:n})]},t)}function je(e){let t=(0,V.c)(32),{item:n,href:r,statusLabel:i,retryLabel:a,viewLabel:s,acknowledgeLabel:c,busy:l,onView:u,onRetry:d,onAcknowledge:p}=e,m;t[0]===n.title?m=t[1]:(m=(0,G.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=m);let h;t[2]===i?h=t[3]:(h=(0,G.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-danger`,children:i}),t[2]=i,t[3]=h);let g;t[4]!==m||t[5]!==h?(g=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[m,h]}),t[4]=m,t[5]=h,t[6]=g):g=t[6];let _;t[7]===n.detail?_=t[8]:(_=(0,G.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n.detail}),t[7]=n.detail,t[8]=_);let v;t[9]!==r||t[10]!==g||t[11]!==_?(v=(0,G.jsxs)(o,{to:r,className:`block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[g,_]}),t[9]=r,t[10]=g,t[11]=_,t[12]=v):v=t[12];let y;t[13]!==c||t[14]!==l||t[15]!==p?(y=(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:l,onClick:p,children:c}),t[13]=c,t[14]=l,t[15]=p,t[16]=y):y=t[16];let b;t[17]!==l||t[18]!==u||t[19]!==s?(b=(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:l,onClick:u,children:s}),t[17]=l,t[18]=u,t[19]=s,t[20]=b):b=t[20];let x;t[21]!==l||t[22]!==d||t[23]!==a?(x=(0,G.jsx)(f,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:l,onClick:d,children:a}),t[21]=l,t[22]=d,t[23]=a,t[24]=x):x=t[24];let S;t[25]!==y||t[26]!==b||t[27]!==x?(S=(0,G.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2 border-t border-danger/15 pt-3`,children:[y,b,x]}),t[25]=y,t[26]=b,t[27]=x,t[28]=S):S=t[28];let C;return t[29]!==v||t[30]!==S?(C=(0,G.jsxs)(`article`,{className:`rounded-xl border border-danger/25 bg-danger-soft/35 p-3.5`,children:[v,S]}),t[29]=v,t[30]=S,t[31]=C):C=t[31],C}function Me(){let e=m(e=>e.language),t=p(e).projectsPage,n=ne(e),r=a(),s=i(),c=`${s.pathname}${s.search}`,d=I(e=>e.setPageHeader),h=I(e=>e.clearPageHeader),[g,w]=(0,B.useState)(null),[T,k]=(0,B.useState)(!0),[M,N]=(0,B.useState)(null),[ee,L]=(0,B.useState)(!1),[R,z]=(0,B.useState)(``),[V,H]=(0,B.useState)(()=>crypto.randomUUID()),[U,W]=(0,B.useState)(!1),[K,q]=(0,B.useState)(null),[ue,J]=(0,B.useState)(null),[de,fe]=(0,B.useState)(null),Y=(0,B.useCallback)(async(t=!1)=>{t&&k(!0),N(null);try{w(await O(e))}catch(e){N(e instanceof Error?e.message:String(e))}finally{k(!1)}},[e]);(0,B.useEffect)(()=>{Y(!0)},[Y]),(0,B.useEffect)(()=>{let e,t=t=>{e!==void 0&&window.clearTimeout(e),e=window.setTimeout(()=>{e=void 0,Y()},t)},n=()=>t(100),r=()=>t(750),i=[`session-created`,`agent-run-started`,`agent-run-ended`,`automation-run-completed`,`workflow-run-updated`,`workflow-run-error`],a=[`session-updated`,`session-transcript-updated`];return i.forEach(e=>window.addEventListener(e,n)),a.forEach(e=>window.addEventListener(e,r)),()=>{i.forEach(e=>window.removeEventListener(e,n)),a.forEach(e=>window.removeEventListener(e,r)),e!==void 0&&window.clearTimeout(e)}},[Y]);let X=(0,B.useMemo)(()=>g?.decisions??[],[g]),Z=(0,B.useMemo)(()=>g?.attention??[],[g]),me=(0,B.useCallback)(async t=>{t.preventDefault();let n=R.trim();if(!(!n||U)){W(!0),q(null);try{let t=await A({idempotencyKey:V,title:n,locale:e,priority:`normal`,contract:{objective:n,expectedOutputs:[],acceptanceCriteria:[],constraints:[],approvalRequired:[],assumptions:[],risks:[],acceptancePolicy:`manual`,outputDestinations:[]},dependencies:[],context:[],authorityGrants:[],activation:{mode:`start`}});L(!1),z(``),H(crypto.randomUUID()),r(re(c,t.task.id))}catch(e){q(e instanceof Error?e.message:String(e))}finally{W(!1)}}},[c,V,U,e,r,R]),he=(0,B.useMemo)(()=>(0,G.jsxs)(f,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>L(!0),children:[(0,G.jsx)(l,{className:`size-4`,"aria-hidden":!0}),n.newWork]}),[n.newWork]),ge=(0,B.useCallback)(async(e,t)=>{if(e.response){J(e.id),N(null);try{await E(e.response,t),await Y()}catch(e){N(e instanceof Error?e.message:String(e))}finally{J(null)}}},[Y]),Q=(0,B.useCallback)(async(e,t)=>{J(e.id),N(null);try{await t(),await Y()}catch(e){N(e instanceof Error?e.message:String(e))}finally{J(null)}},[Y]),$=(0,B.useCallback)(async(e,t)=>{fe(e.id),N(null);try{await t({kind:e.kind,runId:e.runId}),await Y()}catch(e){N(e instanceof Error?e.message:String(e))}finally{fe(null)}},[Y]);return(0,B.useLayoutEffect)(()=>(d({startExtra:null,main:(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),(0,G.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:t.home.subtitle})]}),end:he}),()=>h()),[h,he,d,t.title,t.home.subtitle]),(0,G.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[1200px] flex-1 flex-col gap-7 px-4 py-7 sm:px-6 lg:px-8 lg:py-9`,children:[(0,G.jsx)(C,{open:ee,onOpenChange:e=>{U||L(e),e&&(q(null),H(crypto.randomUUID()))},children:(0,G.jsxs)(b,{children:[(0,G.jsx)(_,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,G.jsxs)(x,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-float focus:outline-none`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(S,{className:`text-base font-semibold text-fg`,children:n.dialogTitle}),(0,G.jsx)(v,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:n.dialogDescription})]}),(0,G.jsx)(y,{asChild:!0,children:(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:t.cancel,"aria-label":t.cancel,children:(0,G.jsx)(u,{className:`size-4`,"aria-hidden":!0})})})]}),(0,G.jsxs)(`form`,{onSubmit:me,className:`flex min-h-0 flex-1 flex-col`,children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,G.jsx)(`label`,{htmlFor:`new-work-task`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:n.intentLabel}),(0,G.jsx)(`textarea`,{id:`new-work-task`,className:`min-h-32 w-full flex-1 resize-none rounded-xl border border-edge bg-surface-base p-3 text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,value:R,onChange:e=>{z(e.target.value),H(crypto.randomUUID())},onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},placeholder:n.intentPlaceholder,maxLength:12e3,autoFocus:!0}),(0,G.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,G.jsx)(`span`,{children:t.home.submitShortcut}),(0,G.jsxs)(`span`,{className:`tabular-nums`,children:[R.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),K?(0,G.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:K}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,G.jsx)(y,{asChild:!0,children:(0,G.jsx)(f,{type:`button`,variant:`ghost`,disabled:U,children:t.cancel})}),(0,G.jsxs)(f,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:!R.trim()||U,children:[(0,G.jsx)(ce,{className:`size-4`,"aria-hidden":!0}),U?n.starting:n.submit]})]})]})]})]})}),M?(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,G.jsx)(`span`,{children:M}),(0,G.jsx)(f,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void Y(),children:t.home.retry})]}):null,T?(0,G.jsx)(Ee,{}):g?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,G.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:t.home.briefingTitle}),(0,G.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:g.decisions.length+g.attention.length>0?xe(t.home.todaySummary,{attention:g.decisions.length+g.attention.length,moving:g.briefing.progress.movingCount+g.chats.running.length}):xe(t.home.todaySummaryClear,{moving:g.briefing.progress.movingCount+g.chats.running.length})}),g.briefing.summary?(0,G.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:g.briefing.summary}):null]}),g.tasks.running.length===0&&g.workflowRuns.active.length===0&&g.decisions.length===0&&g.attention.length===0&&g.chats.running.length===0&&g.chats.recent.length===0&&g.upcomingAutomations.length===0?(0,G.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,G.jsx)(ie,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,G.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:t.home.emptyTitle}),(0,G.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:t.home.emptyBody}),(0,G.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,G.jsx)(f,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:t.home.startChat}),(0,G.jsx)(f,{type:`button`,variant:`secondary`,onClick:()=>L(!0),children:n.newWork})]})]}):null,(0,G.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[Z.length>0?(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(oe,{className:`size-4 text-danger`,"aria-hidden":!0}),(0,G.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.runAttention}),(0,G.jsx)(Ce,{children:Z.length.toLocaleString()})]}),(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,children:Z.map(e=>(0,G.jsx)(je,{item:e,href:ae(c,e.href),statusLabel:e.reason===`run_timeout`?t.home.attentionTimeout:t.home.attentionFailed,retryLabel:t.home.attentionRetry,viewLabel:t.home.attentionView,acknowledgeLabel:t.home.attentionAcknowledge,busy:de===e.id,onView:()=>r(ae(c,e.href)),onRetry:()=>void $(e,F),onAcknowledge:()=>void $(e,te)},e.id))})]}):null,X.length>0?(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(oe,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,G.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.needsAttention}),(0,G.jsx)(Ce,{children:X.length.toLocaleString()})]}),(0,G.jsx)(`div`,{className:`mt-4 space-y-2`,children:X.map(e=>e.kind===`agent_judgment`&&e.judgment?(0,G.jsx)(ke,{item:e,labels:n,busy:ue===e.id,onDecide:t=>void Q(e,()=>j(e.judgment.inboxItemId,t)),onSnooze:()=>void Q(e,()=>P(e.judgment.inboxItemId,`snoozed`)),onDismiss:()=>void Q(e,()=>P(e.judgment.inboxItemId,`resolved`)),onInstruct:t=>void Q(e,()=>le(e.judgment.inboxItemId,t))},e.id):(0,G.jsx)(Oe,{item:e,href:ae(c,e.href),kindLabel:t.home.decisionKinds[e.kind],reasonLabel:t.home.decisionReasons[e.reason],approveLabel:t.home.approve,denyLabel:t.home.deny,busy:ue===e.id,onRespond:t=>void ge(e,t)},e.id))})]}):(0,G.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(`span`,{className:`flex size-5 items-center justify-center rounded-full bg-success-soft text-xs text-success`,"aria-hidden":!0,children:`✓`}),t.home.nothingNeedsYou]}),(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(ce,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,G.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.running}),(0,G.jsx)(Ce,{children:g.tasks.running.length.toLocaleString()})]}),(0,G.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[g.tasks.running.map(e=>(0,G.jsx)(we,{task:e,statusLabel:n.taskStatuses.running,backgroundPath:c},e.id)),g.tasks.running.length===0?(0,G.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.emptyRunning}):null]})]}),g.chats.recent.length>0?(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,G.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.recent})}),(0,G.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:g.chats.recent.slice(0,6).map(e=>(0,G.jsx)(De,{chat:e,statusLabel:n.openChat},e.key))})]}):null]}),(0,G.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":t.home.nowTitle,children:[(0,G.jsx)(`div`,{className:`px-1`,children:(0,G.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.home.nowTitle})}),g.upcomingAutomations.length>0?(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(D,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.home.scheduled})]}),(0,G.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:g.upcomingAutomations.slice(0,3).map(e=>(0,G.jsxs)(o,{to:`/automations`,className:`flex items-center justify-between gap-3 rounded-lg px-1 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,G.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,G.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:Se(e.nextRunAt,t.never)})]},e.id))})]}):null,g.recentTasks.length>0?(0,G.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(se,{className:`size-4 text-success`,"aria-hidden":!0}),(0,G.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.recentTasks})]}),(0,G.jsx)(`div`,{className:`mt-3 space-y-2`,children:g.recentTasks.slice(0,3).map(e=>(0,G.jsx)(Te,{receipt:e,evidenceLabel:n.evidenceCount,remainingLabel:n.remainingCount},e.runId))})]}):null,(0,G.jsx)(pe,{}),g.briefing.wins.length>0?(0,G.jsxs)(o,{to:g.briefing.wins[0].href,className:`flex items-center justify-between gap-3 rounded-xl px-2 py-2 text-sm text-fg-muted hover:bg-surface-hover/55 hover:text-fg`,children:[(0,G.jsx)(`span`,{children:xe(t.home.completedSummary,{count:g.briefing.wins.length})}),(0,G.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[t.home.viewLatestResult,` →`]})]}):null]})]})]}):null]})}export{Me as HomePage};