@xopcai/xopc 0.0.154 → 0.0.155

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 (98) 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-CzdG0bk4.js → activity-store-Btmg10yU.js} +1 -1
  4. package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DFWvUDnw.js → agent-avatar-dicebear-pdlJJov8.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agents-D1VBNTLF.js → agents-NDjTqOIb.js} +1 -1
  6. package/dist/gateway/static/root/assets/{api-CsyI9oBh.js → api-GGYxPxVF.js} +1 -1
  7. package/dist/gateway/static/root/assets/{app-management-settings-panel-DjnqOKBb.js → app-management-settings-panel-BU9oSmtJ.js} +1 -1
  8. package/dist/gateway/static/root/assets/{appearance-settings-CRqe823O.js → appearance-settings-B2chSkbj.js} +1 -1
  9. package/dist/gateway/static/root/assets/{apps-page-BcTujyqO.js → apps-page-DHvwQknj.js} +1 -1
  10. package/dist/gateway/static/root/assets/{archive-plugin-BXq09JWB.js → archive-plugin-BC83GwY1.js} +1 -1
  11. package/dist/gateway/static/root/assets/{attachment-load-zlQDh1aZ.js → attachment-load-DWSH5325.js} +1 -1
  12. package/dist/gateway/static/root/assets/{automation-suggestion-card-gGgpY4-w.js → automation-suggestion-card-Bc25f4wz.js} +1 -1
  13. package/dist/gateway/static/root/assets/{automations-page-BToFWoa2.js → automations-page-32U6mfy-.js} +1 -1
  14. package/dist/gateway/static/root/assets/{binary-plugins-DCndLyIW.js → binary-plugins-Kgu5yX35.js} +1 -1
  15. package/dist/gateway/static/root/assets/{block-editor-msfuLqvE.js → block-editor-B9gJmzdE.js} +4 -4
  16. package/dist/gateway/static/root/assets/{browser-settings-page-QKmt9rhz.js → browser-settings-page-CTWycuu_.js} +1 -1
  17. package/dist/gateway/static/root/assets/{capability-presets-api-Bxopvkgk.js → capability-presets-api-6z36IfIC.js} +1 -1
  18. package/dist/gateway/static/root/assets/{capability-presets-settings-panel-DfNXDSNd.js → capability-presets-settings-panel-Bqzl2UZ9.js} +1 -1
  19. package/dist/gateway/static/root/assets/{channel-recipient-api-BnHaWUSY.js → channel-recipient-api-DEkm4HRd.js} +1 -1
  20. package/dist/gateway/static/root/assets/{channels-settings-H4S5xOJd.js → channels-settings-DdelF9BQ.js} +1 -1
  21. package/dist/gateway/static/root/assets/channels-status-swr-CBgr61Zt.js +1 -0
  22. package/dist/gateway/static/root/assets/{connector-logo-B-uLLvB8.js → connector-logo-DPriINR1.js} +1 -1
  23. package/dist/gateway/static/root/assets/{connectors-page-CdhnQLcO.js → connectors-page-CO3ASIfE.js} +1 -1
  24. package/dist/gateway/static/root/assets/{desktop-pet-Ex6MK9js.js → desktop-pet-CG91Su8E.js} +1 -1
  25. package/dist/gateway/static/root/assets/{desktop-pet-settings-BOIzaX68.js → desktop-pet-settings-DUzETFxq.js} +1 -1
  26. package/dist/gateway/static/root/assets/{directory-picker-path-field-DqGXYqi0.js → directory-picker-path-field-XNbI2wM7.js} +1 -1
  27. package/dist/gateway/static/root/assets/{dreaming-settings-CxijakYG.js → dreaming-settings-BsLa5Nr8.js} +1 -1
  28. package/dist/gateway/static/root/assets/{extension-debug-page-BvdFiVRk.js → extension-debug-page-C-5Nyrdu.js} +1 -1
  29. package/dist/gateway/static/root/assets/{extension-page-Dh6JVCzg.js → extension-page-BEocT43y.js} +1 -1
  30. package/dist/gateway/static/root/assets/{extension-settings-page-DVj6FCSE.js → extension-settings-page--XOHrL-O.js} +1 -1
  31. package/dist/gateway/static/root/assets/{gateway-config-api-CQm4GutS.js → gateway-config-api-DZrNmiR3.js} +1 -1
  32. package/dist/gateway/static/root/assets/{gateway-settings-ss66lTqH.js → gateway-settings-DfBvlqb2.js} +1 -1
  33. package/dist/gateway/static/root/assets/{gateway-startup-retry-BHJhfrQI.js → gateway-startup-retry-Cc5dxiD_.js} +1 -1
  34. package/dist/gateway/static/root/assets/{goal-create-dialog-DrLfAaIQ.js → goal-create-dialog-BRVB5I7f.js} +1 -1
  35. package/dist/gateway/static/root/assets/{goal-detail-page-CGX9RlwQ.js → goal-detail-page-Drdz_llY.js} +1 -1
  36. package/dist/gateway/static/root/assets/{goals-config-api-qW18xhUI.js → goals-config-api-Cdghd3f3.js} +1 -1
  37. package/dist/gateway/static/root/assets/{goals-page-Dw_HSDwB.js → goals-page-CEh2UTzg.js} +1 -1
  38. package/dist/gateway/static/root/assets/{goals-settings-BIU5W1zl.js → goals-settings-CvOdikU6.js} +1 -1
  39. package/dist/gateway/static/root/assets/{heartbeat-settings-CfqjGaTh.js → heartbeat-settings-CvaxjdV_.js} +1 -1
  40. package/dist/gateway/static/root/assets/{index-DEFW3c5N.js → index-C4HpPu1y.js} +7 -7
  41. package/dist/gateway/static/root/assets/index-DjvInkv6.css +1 -0
  42. package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-cCBoXp7P.js → keyboard-shortcuts-settings-BVt0deH6.js} +1 -1
  43. package/dist/gateway/static/root/assets/{local-app-workbench-page-D2eb_Y9l.js → local-app-workbench-page-Dcmb1Ruc.js} +1 -1
  44. package/dist/gateway/static/root/assets/{local-apps-page-DO2x_rcy.js → local-apps-page-C0HGfwao.js} +1 -1
  45. package/dist/gateway/static/root/assets/{locale-store-D7eqlIJ9.js → locale-store-Dt0pSudQ.js} +1 -1
  46. package/dist/gateway/static/root/assets/{logs-page-CGWbln8I.js → logs-page-BWdV-HsP.js} +1 -1
  47. package/dist/gateway/static/root/assets/{markdown-split-BZXNhOwW.js → markdown-split-CjVg43Kl.js} +1 -1
  48. package/dist/gateway/static/root/assets/{media-plugins-DCetbXqB.js → media-plugins-D-LkrsY6.js} +1 -1
  49. package/dist/gateway/static/root/assets/{messages-CJ9O8gs2.js → messages-CqXpNawC.js} +2 -2
  50. package/dist/gateway/static/root/assets/{models-hub-panel-CgPuYUSc.js → models-hub-panel-Du41WFC6.js} +1 -1
  51. package/dist/gateway/static/root/assets/{notes-page-BimdI125.js → notes-page-BsoNcBQ3.js} +1 -1
  52. package/dist/gateway/static/root/assets/{notes-workbench-CJgcA6rb.js → notes-workbench-VeU2xG2r.js} +2 -2
  53. package/dist/gateway/static/root/assets/{page-tabs-U1pk4NrV.js → page-tabs-C9OfBAT6.js} +1 -1
  54. package/dist/gateway/static/root/assets/{preview-open-alternatives-Fxwf5YPD.js → preview-open-alternatives-BCrigyTS.js} +1 -1
  55. package/dist/gateway/static/root/assets/{project-detail-page-VxBEkOCK.js → project-detail-page-B9QsnXWV.js} +1 -1
  56. package/dist/gateway/static/root/assets/{projects-page-aaYIPefA.js → projects-page-BbplZbzF.js} +1 -1
  57. package/dist/gateway/static/root/assets/{remote-access-hub-DsoA6Lgj.js → remote-access-hub-CfbuqKDd.js} +1 -1
  58. package/dist/gateway/static/root/assets/{save-bar-controls-Dn4L4DG1.js → save-bar-controls-CnyZMYdJ.js} +1 -1
  59. package/dist/gateway/static/root/assets/{schedule-field-RyKxT9K9.js → schedule-field-Bez97_Ou.js} +1 -1
  60. package/dist/gateway/static/root/assets/{schema-form-C1vggaSD.js → schema-form-DbKY5jSv.js} +1 -1
  61. package/dist/gateway/static/root/assets/{sessions-page-D6Izw2Lf.js → sessions-page-CSQLpHd4.js} +1 -1
  62. package/dist/gateway/static/root/assets/settings-advanced-gate-C25HTTPK.js +1 -0
  63. package/dist/gateway/static/root/assets/{settings-collapsible-section-nlLe8F2O.js → settings-collapsible-section-4f60Dgw-.js} +1 -1
  64. package/dist/gateway/static/root/assets/{settings-form-section-D_ZiLpm2.js → settings-form-section-CCQ7MjdZ.js} +1 -1
  65. package/dist/gateway/static/root/assets/{settings-loading-skeleton-B5N97pZa.js → settings-loading-skeleton-CQhjhb0F.js} +1 -1
  66. package/dist/gateway/static/root/assets/{settings-page-DPyCrjUe.js → settings-page-BZb-E5vI.js} +1 -1
  67. package/dist/gateway/static/root/assets/{settings-page-layout-DIvXTz_k.js → settings-page-layout-C7sfPFaM.js} +1 -1
  68. package/dist/gateway/static/root/assets/{setup-status-panel-DrJTD2wb.js → setup-status-panel-B1FSxWQ3.js} +1 -1
  69. package/dist/gateway/static/root/assets/{share-preview-page-Us8Qsjnv.js → share-preview-page-DeErzPeg.js} +1 -1
  70. package/dist/gateway/static/root/assets/{shares-settings-wKE-xvx5.js → shares-settings-DDg5dL3k.js} +1 -1
  71. package/dist/gateway/static/root/assets/skill-reload-api-B-ocgAT-.js +1 -0
  72. package/dist/gateway/static/root/assets/{skills-page-DLUejhxZ.js → skills-page-CtO4i9ds.js} +1 -1
  73. package/dist/gateway/static/root/assets/{system-settings-panel-5lTZWRTB.js → system-settings-panel-Dk1ZhfpM.js} +1 -1
  74. package/dist/gateway/static/root/assets/{theme-store-BpYvZAYm.js → theme-store-Cd_gY2Cb.js} +1 -1
  75. package/dist/gateway/static/root/assets/{typed-models-lib-BkK8sFRf.js → typed-models-lib-fe1xAgdw.js} +1 -1
  76. package/dist/gateway/static/root/assets/{use-channel-catalog-CyWgVZUn.js → use-channel-catalog-Cbo3s1uh.js} +1 -1
  77. package/dist/gateway/static/root/assets/{user-context-page-CI0uYsYu.js → user-context-page-CqtVqiYz.js} +1 -1
  78. package/dist/gateway/static/root/assets/{user-profile-fields-editor-DHORj_-E.js → user-profile-fields-editor-DcnCOHwp.js} +1 -1
  79. package/dist/gateway/static/root/assets/{user-profile-settings-panel-C0cBmeSQ.js → user-profile-settings-panel-CTWZR6nV.js} +1 -1
  80. package/dist/gateway/static/root/assets/{utils-D_hszPJs.js → utils-BDzZMJls.js} +1 -1
  81. package/dist/gateway/static/root/assets/{voice-api-key-field-C8A5XTpx.js → voice-api-key-field-C9Psto-d.js} +1 -1
  82. package/dist/gateway/static/root/assets/{work-discovery-page-QyGK7xcU.js → work-discovery-page-CNVeagdJ.js} +1 -1
  83. package/dist/gateway/static/root/assets/{work-item-detail-page-DtM6dJcm.js → work-item-detail-page-DKSNc1SH.js} +1 -1
  84. package/dist/gateway/static/root/assets/work-page-Bwbg1Ht-.js +1 -0
  85. package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DxO26B4k.js → workflow-run-setup-panel-ZKbrdYmp.js} +1 -1
  86. package/dist/gateway/static/root/assets/{workflows-page-CzHTzaGu.js → workflows-page-DBHqpZ76.js} +1 -1
  87. package/dist/gateway/static/root/index.html +7 -7
  88. package/dist/package.js +1 -1
  89. package/dist/src/agent/embedded/run-turn.js +2 -2
  90. package/dist/src/agent/embedded/session-runner.js +3 -3
  91. package/dist/src/agent/embedded/xopc-stream-bridge.d.ts +1 -1
  92. package/dist/src/agent/embedded/xopc-stream-bridge.js +1 -1
  93. package/package.json +5 -5
  94. package/dist/gateway/static/root/assets/channels-status-swr-CCNusXn-.js +0 -1
  95. package/dist/gateway/static/root/assets/index-C74vxaN3.css +0 -1
  96. package/dist/gateway/static/root/assets/settings-advanced-gate-2xdJe22X.js +0 -1
  97. package/dist/gateway/static/root/assets/skill-reload-api-DKFt8QcO.js +0 -1
  98. package/dist/gateway/static/root/assets/work-page-BkWtyIkX.js +0 -1
@@ -1 +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{l as i,t as a}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as o}from"./cn-BQ_8x0bT.js";import{t as s}from"./check-BODqo66o.js";import{t as c}from"./circle-alert-RzVebuX2.js";import{t as l}from"./messages-CJ9O8gs2.js";import{n as u,r as d,s as f}from"./locale-store-D7eqlIJ9.js";import{n as p}from"./activity-store-CzdG0bk4.js";import{Bc as m,Bo as h,Cl as g,Cs as _,Fo as v,Fs as y,Io as b,Lo as x,No as S,Po as C,Ps as w,R as T,Ro as E,Tu as D,Uc as O,Wl as k,Ys as A,ac as j,et as M,jl as N,lo as P,ol as ee,ou as te,qa as ne,ru as re,tu as F,yc as ie,ys as I,yu as L,za as ae,zo as oe}from"./index-DEFW3c5N.js";import{t as se}from"./sliding-segmented-uWmrxE3P.js";var R=n(),z=e(t(),1),B=r(),V=3,H={info:{Icon:ee,className:`text-accent-fg bg-accent-soft`},success:{Icon:F,className:`text-success bg-success-soft`},warning:{Icon:w,className:`text-warning bg-warning-soft`},error:{Icon:c,className:`text-danger bg-danger-soft`}};function U(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 W(e){let t=(0,R.c)(52),{item:n}=e,r=u(K),i;t[0]===r?i=t[1]:(i=l(r),t[0]=r,t[1]=i);let s=i.projectsPage.workHome,c=p(G),{Icon:d,className:f}=H[n.tone],m;t[2]===f?m=t[3]:(m=o(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,f),t[2]=f,t[3]=m);let h;t[4]!==d||t[5]!==n.status?(h=n.status===`running`?(0,B.jsx)(O,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,B.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),t[4]=d,t[5]=n.status,t[6]=h):h=t[6];let g;t[7]!==m||t[8]!==h?(g=(0,B.jsx)(`div`,{className:m,children:h}),t[7]=m,t[8]=h,t[9]=g):g=t[9];let v;t[10]===n.title?v=t[11]:(v=(0,B.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]=v);let y;t[12]!==s.activityUnread||t[13]!==n.read?(y=n.read?null:(0,B.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]=y):y=t[14];let b;t[15]!==v||t[16]!==y?(b=(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[v,y]}),t[15]=v,t[16]=y,t[17]=b):b=t[17];let x;t[18]===n.message?x=t[19]:(x=n.message?(0,B.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]=x);let S;t[20]===n.source?S=t[21]:(S=n.source?(0,B.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=S);let C;t[22]!==n.updatedAt||t[23]!==r?(C=U(n.updatedAt,r),t[22]=n.updatedAt,t[23]=r,t[24]=C):C=t[24];let w;t[25]===C?w=t[26]:(w=(0,B.jsx)(`span`,{children:C}),t[25]=C,t[26]=w);let T;t[27]===n.occurrences?T=t[28]:(T=n.occurrences>1?(0,B.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=T);let E;t[29]!==s.activityViewRelated||t[30]!==n.href?(E=n.href?(0,B.jsxs)(a,{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,B.jsx)(re,{className:`size-3`,"aria-hidden":!0})]}):null,t[29]=s.activityViewRelated,t[30]=n.href,t[31]=E):E=t[31];let D;t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==S?(D=(0,B.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[S,w,T,E]}),t[32]=w,t[33]=T,t[34]=E,t[35]=S,t[36]=D):D=t[36];let k;t[37]!==D||t[38]!==b||t[39]!==x?(k=(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[b,x,D]}),t[37]=D,t[38]=b,t[39]=x,t[40]=k):k=t[40];let A;t[41]!==n.id||t[42]!==c?(A=()=>c(n.id),t[41]=n.id,t[42]=c,t[43]=A):A=t[43];let j;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,B.jsx)(_,{className:`size-3.5`,"aria-hidden":!0}),t[44]=j):j=t[44];let M;t[45]!==s.activityRemove||t[46]!==A?(M=(0,B.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:A,children:j}),t[45]=s.activityRemove,t[46]=A,t[47]=M):M=t[47];let N;return t[48]!==k||t[49]!==M||t[50]!==g?(N=(0,B.jsxs)(`article`,{className:`group flex items-start gap-3 border-t border-edge-subtle px-1 py-3 first:border-t-0`,children:[g,k,M]}),t[48]=k,t[49]=M,t[50]=g,t[51]=N):N=t[51],N}function G(e){return e.remove}function K(e){return e.language}function ce(){let e=(0,R.c)(8),t=l(u(de)).projectsPage.workHome,n=p(Q),r=p(ue),i=p(Z),[a,o]=(0,z.useState)(!1),c;e[0]===n?c=e[1]:(c=n.filter(le),e[0]=n,e[1]=c);let d=c.length,f;e[2]===n?f=e[3]:(f=n.filter(X),e[2]=n,e[3]=f);let m=f.length,h;e[4]!==a||e[5]!==n?(h=a?n:n.slice(0,V),e[4]=a,e[5]=n,e[6]=h):h=e[6];let g=h,_;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,B.jsx)(D,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[7]=_):_=e[7],(0,B.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,(0,B.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),d>0?(0,B.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,B.jsx)(O,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),d,` `,t.running]}):m>0?(0,B.jsxs)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[m,` `,t.activityNew]}):null]}),n.length>0?(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.activityHint}):null]}),a&&n.length>0?(0,B.jsxs)(`div`,{className:`flex items-center gap-1`,children:[m>0?(0,B.jsxs)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,B.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some(Y)?(0,B.jsxs)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,B.jsx)(y,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,B.jsxs)(`div`,{className:`mt-3 px-1`,children:[g.map(J),n.length>V?(0,B.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,B.jsx)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>o(q),children:a?t.activityShowLess:t.activityShowAll.replace(`{{count}}`,String(n.length))})}):null]}):(0,B.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,B.jsx)(k,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`p`,{children:t.activityEmpty})]})]})}function q(e){return!e}function J(e){return(0,B.jsx)(W,{item:e},e.id)}function Y(e){return e.status===`done`}function X(e){return!e.read}function le(e){return e.status===`running`}function Z(e){return e.clearFinished}function ue(e){return e.markAllRead}function Q(e){return e.items}function de(e){return e.language}function fe(e){return f(d(`/api/home${e?`?locale=${encodeURIComponent(e)}`:``}`))}function pe(e,t){return f(d(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...e,decision:t})})}function $(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function me(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:M(n)}function he(){let e=(0,R.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,B.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,B.jsx)(P,{className:`h-20 rounded-2xl`}),(0,B.jsx)(P,{className:`h-72 rounded-2xl`}),(0,B.jsx)(P,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function ge(e){let t=(0,R.c)(19),{item:n,statusLabel:r}=e,i=`/work-items/${encodeURIComponent(n.id)}`,o;t[0]===n.title?o=t[1]:(o=(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=o);let s;t[2]===n.projectName?s=t[3]:(s=(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.projectName}),t[2]=n.projectName,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,B.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:r}),t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==n.blockedReason||t[13]!==n.nextAction?(d=n.blockedReason||n.nextAction?(0,B.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.blockedReason||n.nextAction}):null,t[12]=n.blockedReason,t[13]=n.nextAction,t[14]=d):d=t[14];let f;return t[15]!==i||t[16]!==u||t[17]!==d?(f=(0,B.jsxs)(a,{to:i,className:`group block rounded-lg px-1 py-2.5 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,d]}),t[15]=i,t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function _e(e){let t=(0,R.c)(27),{item:n,kindLabel:r,reasonLabel:i,approveLabel:o,denyLabel:s,busy:c,onRespond:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=u);let d=n.projectName||r,f;t[2]===d?f=t[3]:(f=(0,B.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:d}),t[2]=d,t[3]=f);let p;t[4]!==u||t[5]!==f?(p=(0,B.jsxs)(`div`,{className:`min-w-0`,children:[u,f]}),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m;t[7]===i?m=t[8]:(m=(0,B.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:i}),t[7]=i,t[8]=m);let h;t[9]!==p||t[10]!==m?(h=(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[p,m]}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]===n.detail?g=t[13]:(g=n.detail?(0,B.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]=g);let _;t[14]!==n.href||t[15]!==h||t[16]!==g?(_=(0,B.jsxs)(a,{to:n.href,className:`group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g]}),t[14]=n.href,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==c||t[20]!==s||t[21]!==n.response||t[22]!==l?(v=n.response?(0,B.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,B.jsx)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,B.jsx)(I,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`approve`),children:o})]}):null,t[18]=o,t[19]=c,t[20]=s,t[21]=n.response,t[22]=l,t[23]=v):v=t[23];let y;return t[24]!==_||t[25]!==v?(y=(0,B.jsxs)(`article`,{className:`rounded-xl border border-warning/35 bg-warning-soft/25 p-3.5 transition-colors hover:bg-warning-soft/40`,children:[_,v]}),t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function ve(e){let t=(0,R.c)(19),{project:n,openLabel:r,noDescription:i}=e,o=`/projects/${encodeURIComponent(n.id)}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,B.jsx)(g,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[0]=s):s=t[0];let c;t[1]===n.name?c=t[2]:(c=(0,B.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[s,(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.name})]}),t[1]=n.name,t[2]=c);let l;t[3]===r?l=t[4]:(l=(0,B.jsx)(L,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-label":r}),t[3]=r,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=n.description||n.brief||i,f;t[8]===d?f=t[9]:(f=(0,B.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-5 text-fg-muted`,children:d}),t[8]=d,t[9]=f);let p=n.lastActiveAt??n.updatedAt,m;t[10]===p?m=t[11]:(m=me(p,``),t[10]=p,t[11]=m);let h;t[12]===m?h=t[13]:(h=(0,B.jsx)(`p`,{className:`mt-auto pt-3 text-[11px] text-fg-subtle`,children:m}),t[12]=m,t[13]=h);let _;return t[14]!==o||t[15]!==h||t[16]!==u||t[17]!==f?(_=(0,B.jsxs)(a,{to:o,className:`group flex min-h-32 flex-col 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,f,h]}),t[14]=o,t[15]=h,t[16]=u,t[17]=f,t[18]=_):_=t[18],_}function ye(){let e=u(e=>e.language),t=l(e),n=t.projectsPage,r=i(),o=h(e=>e.setPageHeader),s=h(e=>e.clearPageHeader),[d,f]=(0,z.useState)(null),[p,g]=(0,z.useState)([]),[_,y]=(0,z.useState)(!0),[w,D]=(0,z.useState)(null),[O,M]=(0,z.useState)(null),[P,ee]=(0,z.useState)(``),[re,F]=(0,z.useState)(!1),[L,R]=(0,z.useState)(`delegate`),[V,H]=(0,z.useState)(``),[U,W]=(0,z.useState)(!1),[G,K]=(0,z.useState)(null),q=(0,z.useCallback)(async()=>{y(!0),D(null);try{let[t,n]=await Promise.all([fe(e),ne({limit:100,sortBy:`updatedAt`,sortOrder:`desc`})]);f(t),g(n.items)}catch(e){D(e instanceof Error?e.message:String(e))}finally{y(!1)}},[e]);(0,z.useEffect)(()=>{q()},[q]);let J=(0,z.useMemo)(()=>{let e=P.trim().toLocaleLowerCase(),t=p.filter(e=>e.status!==`archived`);return e?t.filter(t=>[t.name,t.description,t.brief].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e))):t.slice(0,6)},[p,P]),Y=(0,z.useMemo)(()=>d?.decisions??[],[d]),X=(0,z.useMemo)(()=>d?.work.current.filter(e=>e.status!==`needs_input`&&e.status!==`in_review`&&e.status!==`blocked`).slice(0,10)??[],[d]),le=(0,z.useCallback)(async t=>{t.preventDefault();let n=V.trim();if(!(!n||U)){if(L===`watch`){let t=e===`zh`?`持续关注以下事项,在发生有意义的变化时通知我:\n${n}`:`Keep watching the following and notify me when something meaningfully changes:\n${n}`;H(``),F(!1),r(`/automations?draft=${encodeURIComponent(t)}&autogenerate=1`);return}W(!0),M(null);try{let t=await ae({outcome:n,uiLocale:e});H(``),F(!1),r(`/projects/${encodeURIComponent(t.project.id)}`)}catch(e){M(e instanceof Error?e.message:String(e))}finally{W(!1)}}},[L,U,e,r,V]),Z=(0,z.useMemo)(()=>(0,B.jsxs)(I,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>{R(`delegate`),F(!0)},children:[(0,B.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),n.workHome.newWork]}),[n.workHome.newWork]),ue=(0,z.useMemo)(()=>[{value:`delegate`,label:n.workHome.delegateMode,icon:A},{value:`watch`,label:n.workHome.watchMode,icon:N}],[n.workHome.delegateMode,n.workHome.watchMode]),Q=(0,z.useCallback)(async(e,t)=>{if(e.response){K(e.id),D(null);try{await pe(e.response,t),await q()}catch(e){D(e instanceof Error?e.message:String(e))}finally{K(null)}}},[q]);return(0,z.useLayoutEffect)(()=>(o({startExtra:null,main:(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),(0,B.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:n.workHome.subtitle})]}),end:Z}),()=>s()),[s,Z,o,n.title,n.workHome.subtitle]),(0,B.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,B.jsx)(S,{open:re,onOpenChange:e=>{F(e),e||M(null)},children:(0,B.jsxs)(E,{children:[(0,B.jsx)(x,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,B.jsxs)(v,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(26rem,calc(100vh-2rem))] w-[min(36rem,calc(100vw-2rem))] -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,B.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,B.jsx)(oe,{className:`text-base font-semibold text-fg`,children:n.workHome.newWorkTitle}),(0,B.jsx)(b,{className:`mt-1 text-sm text-fg-muted`,children:n.workHome.newWorkDescription})]}),(0,B.jsxs)(`form`,{onSubmit:le,className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:[(0,B.jsx)(se,{value:L,onChange:R,options:ue,"aria-label":n.workHome.createModeLabel,className:`mb-4`,buttonClassName:`h-9`}),(0,B.jsxs)(`label`,{className:`grid gap-2 text-sm font-medium text-fg`,children:[L===`watch`?n.workHome.watchLabel:n.workHome.outcomeLabel,(0,B.jsx)(`textarea`,{className:`min-h-40 w-full 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:V,onChange:e=>H(e.target.value),placeholder:L===`watch`?n.workHome.watchPlaceholder:n.workHome.outcomePlaceholder,maxLength:12e3,disabled:U})]}),O?(0,B.jsx)(`p`,{className:`mt-3 rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:O}):null]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-t border-edge px-5 py-4`,children:[(0,B.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:L===`watch`?n.workHome.watchSetupHint:n.workHome.autoSetupHint}),(0,B.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,B.jsx)(C,{asChild:!0,children:(0,B.jsx)(I,{type:`button`,variant:`ghost`,children:n.cancel})}),(0,B.jsxs)(I,{type:`submit`,variant:`primary`,disabled:U||!V.trim(),children:[(0,B.jsx)(A,{className:`size-4`,"aria-hidden":!0}),U?n.workHome.delegating:L===`watch`?n.workHome.designWatch:n.workHome.delegate]})]})]})]})]})]})}),w?(0,B.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,B.jsx)(`span`,{children:w}),(0,B.jsx)(I,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void q(),children:n.workHome.retry})]}):null,_?(0,B.jsx)(he,{}):d?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.workHome.briefingTitle}),(0,B.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:d.decisions.length>0?$(n.workHome.todaySummary,{attention:d.decisions.length,moving:d.briefing.progress.movingCount}):$(n.workHome.todaySummaryClear,{moving:d.briefing.progress.movingCount})}),d.briefing.summary?(0,B.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:d.briefing.summary}):null]}),d.work.current.length===0&&d.workflowRuns.active.length===0&&d.decisions.length===0&&d.upcomingAutomations.length===0?(0,B.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,B.jsx)(m,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.workHome.emptyTitle}),(0,B.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:n.workHome.emptyBody}),(0,B.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,B.jsx)(I,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:n.workHome.startChat}),(0,B.jsx)(I,{type:`button`,variant:`secondary`,onClick:()=>{R(`delegate`),F(!0)},children:n.workHome.startLongWork})]})]}):null,(0,B.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[Y.length>0?(0,B.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(c,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.needsYou})]}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.needsYouHint}),(0,B.jsx)(`div`,{className:`mt-4 space-y-2`,children:Y.map(e=>(0,B.jsx)(_e,{item:e,kindLabel:n.workHome.decisionKinds[e.kind],reasonLabel:n.workHome.decisionReasons[e.reason],approveLabel:n.workHome.approve,denyLabel:n.workHome.deny,busy:G===e.id,onRespond:t=>void Q(e,t)},e.id))})]}):(0,B.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,B.jsx)(`span`,{className:`flex size-5 items-center justify-center rounded-full bg-success-soft text-xs text-success`,"aria-hidden":!0,children:`✓`}),n.workHome.nothingNeedsYou]}),(0,B.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(k,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.continueTitle})]}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.continueHint}),(0,B.jsxs)(`div`,{className:`mt-4 divide-y divide-edge-subtle px-1`,children:[d.workflowRuns.active.map(e=>(0,B.jsxs)(a,{to:T(e.id),className:`flex items-center justify-between gap-3 rounded-lg px-2 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,"aria-hidden":!0}),(0,B.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.title})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.workHome.running})]},e.id)),X.map(e=>(0,B.jsx)(`div`,{className:`py-1`,children:(0,B.jsx)(ge,{item:e,statusLabel:t.projectDetailPage.workItems.statuses[e.status]})},e.id)),d.workflowRuns.active.length===0&&X.length===0?(0,B.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.workHome.noCurrentWork}):null]})]})]}),(0,B.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":n.workHome.nowTitle,children:[(0,B.jsxs)(`div`,{className:`px-1`,children:[(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.nowTitle}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.nowHint})]}),d.upcomingAutomations.length>0?(0,B.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(te,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.workHome.scheduled})]}),(0,B.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:d.upcomingAutomations.slice(0,3).map(e=>(0,B.jsxs)(a,{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,B.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,B.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:me(e.nextRunAt,n.never)})]},e.id))})]}):null,(0,B.jsx)(ce,{}),d.briefing.wins.length>0?(0,B.jsxs)(a,{to:d.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,B.jsx)(`span`,{children:$(n.workHome.completedSummary,{count:d.briefing.wins.length})}),(0,B.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[n.workHome.viewLatestResult,` →`]})]}):null]})]})]}):null,(0,B.jsxs)(`section`,{className:`border-t border-edge-subtle pt-7`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.workHome.spacesTitle}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.spacesHint})]}),(0,B.jsx)(a,{to:`/projects`,className:`text-xs font-medium text-accent hover:underline`,children:n.management.viewAll})]}),p.filter(e=>e.status!==`archived`).length>6?(0,B.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,B.jsxs)(`label`,{className:`relative block min-w-0`,children:[(0,B.jsx)(j,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`input`,{className:`h-9 w-52 rounded-lg border border-edge bg-surface-panel pl-9 pr-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:P,onChange:e=>ee(e.target.value),placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder})]})}):null,(0,B.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:J.map(e=>(0,B.jsx)(ve,{project:e,openLabel:n.workHome.openSpace,noDescription:n.noDescription},e.id))}),!_&&J.length===0?(0,B.jsx)(`p`,{className:`py-8 text-center text-sm text-fg-muted`,children:n.workHome.noSpaces}):null]})]})}export{ye as WorkPage};