@xopcai/xopc 0.0.154 → 0.0.156
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.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CzdG0bk4.js → activity-store-Cp7IGk68.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DFWvUDnw.js → agent-avatar-dicebear-H8Kj8Gpi.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-D1VBNTLF.js → agents-D7b7yNXE.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CsyI9oBh.js → api-DtJCVPiu.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DjnqOKBb.js → app-management-settings-panel-DKTEVSpf.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CRqe823O.js → appearance-settings-BQjvBNo5.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BcTujyqO.js → apps-page-DF2hU_jf.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BXq09JWB.js → archive-plugin-BrGMwlAE.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-zlQDh1aZ.js → attachment-load-24BvpEL4.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-gGgpY4-w.js → automation-suggestion-card-CWWKtdDT.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BToFWoa2.js → automations-page-D48WJ6FM.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DCndLyIW.js → binary-plugins-C1E7_cKL.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-msfuLqvE.js → block-editor-BVnHG0U5.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-settings-page-QKmt9rhz.js → browser-settings-page-4oWDtsXg.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-Bxopvkgk.js → capability-presets-api-DyXFKny9.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-DfNXDSNd.js → capability-presets-settings-panel-luTMJl0D.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-BnHaWUSY.js → channel-recipient-api-Bo9KEXO4.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-H4S5xOJd.js → channels-settings-QSUco4Eu.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DsSwOeqP.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B-uLLvB8.js → connector-logo-B7ECwA6W.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CdhnQLcO.js → connectors-page-CNmHHcQy.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Ex6MK9js.js → desktop-pet-C4J-TrDl.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BOIzaX68.js → desktop-pet-settings-CsGZynhi.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DqGXYqi0.js → directory-picker-path-field-DDn1H6qY.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CxijakYG.js → dreaming-settings-jJjiYe0n.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BvdFiVRk.js → extension-debug-page-CQVct2lF.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dh6JVCzg.js → extension-page-sUEY0_Yl.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DVj6FCSE.js → extension-settings-page-zpScIWDQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-CQm4GutS.js → gateway-config-api-B-GwICsA.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-ss66lTqH.js → gateway-settings-C93_Ybce.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BHJhfrQI.js → gateway-startup-retry-CJUiuchE.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-DrLfAaIQ.js → goal-create-dialog-Cvd9nymX.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-CGX9RlwQ.js → goal-detail-page-YH6hr32Q.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-qW18xhUI.js → goals-config-api-DKkSo21W.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-Dw_HSDwB.js → goals-page-BZudny4c.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-settings-BIU5W1zl.js → goals-settings-CtRqc0fv.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CfqjGaTh.js → heartbeat-settings-BT-TLTst.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DEFW3c5N.js → index-Din3Cw4v.js} +7 -7
- package/dist/gateway/static/root/assets/index-hESUzOFP.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-cCBoXp7P.js → keyboard-shortcuts-settings-DJtVjIjb.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D2eb_Y9l.js → local-app-workbench-page-BAUIuHgn.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DO2x_rcy.js → local-apps-page-BgG--iAa.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D7eqlIJ9.js → locale-store-DKx7Iqah.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CGWbln8I.js → logs-page-DsoUv7ZF.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BZXNhOwW.js → markdown-split-CYzbIIru.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DCetbXqB.js → media-plugins-MIPDILS2.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CJ9O8gs2.js → messages-DEhbxGef.js} +2 -2
- package/dist/gateway/static/root/assets/{models-hub-panel-CgPuYUSc.js → models-hub-panel-Be8EL_eL.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BimdI125.js → notes-page-DImgR3qC.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-CJgcA6rb.js → notes-workbench-C-7KD7v9.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-U1pk4NrV.js → page-tabs--KgaLen_.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Fxwf5YPD.js → preview-open-alternatives-C_HbjDSi.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-VxBEkOCK.js → project-detail-page-CZKnDVLl.js} +1 -1
- package/dist/gateway/static/root/assets/projects-page-D9Ic-jH8.js +1 -0
- package/dist/gateway/static/root/assets/{remote-access-hub-DsoA6Lgj.js → remote-access-hub-X8McfeZv.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-Dn4L4DG1.js → save-bar-controls-CjZo14GS.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-RyKxT9K9.js → schedule-field-RXap283_.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-C1vggaSD.js → schema-form-Cxma8ta1.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-D6Izw2Lf.js → sessions-page-DS1ZDVHz.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcD1GwQy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-nlLe8F2O.js → settings-collapsible-section-BCj-CWDz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-D_ZiLpm2.js → settings-form-section-BcNg8gHj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-B5N97pZa.js → settings-loading-skeleton-BdebKuIQ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DPyCrjUe.js → settings-page-D8exfzMK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DIvXTz_k.js → settings-page-layout-CunTdv0L.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DrJTD2wb.js → setup-status-panel-XjT8cddX.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Us8Qsjnv.js → share-preview-page-mr4J9NTO.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-wKE-xvx5.js → shares-settings-BCMbZehJ.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DBJyFDEb.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DLUejhxZ.js → skills-page-DMqHx2h0.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-5lTZWRTB.js → system-settings-panel-DVhTcFLH.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BpYvZAYm.js → theme-store-JwXJZwqx.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-BkK8sFRf.js → typed-models-lib-DRyUSUIv.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CyWgVZUn.js → use-channel-catalog-CNubDrIo.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-CI0uYsYu.js → user-context-page-Dz5_Hxm8.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-fields-editor-DHORj_-E.js → user-profile-fields-editor-Dd9HhS4K.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-C0cBmeSQ.js → user-profile-settings-panel-BESvOafB.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-D_hszPJs.js → utils-BAhKxTKq.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-C8A5XTpx.js → voice-api-key-field-DUGVoBoX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-QyGK7xcU.js → work-discovery-page-B3bY5klN.js} +1 -1
- package/dist/gateway/static/root/assets/{work-item-detail-page-DtM6dJcm.js → work-item-detail-page-zQi6iH0Q.js} +1 -1
- package/dist/gateway/static/root/assets/work-page-y0B5nTmy.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DxO26B4k.js → workflow-run-setup-panel-KZDzIdFk.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CzHTzaGu.js → workflows-page-C95f1Mae.js} +1 -1
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-runner.js +3 -3
- package/dist/src/agent/embedded/xopc-stream-bridge.d.ts +1 -1
- package/dist/src/agent/embedded/xopc-stream-bridge.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/package.json +5 -5
- package/dist/gateway/static/root/assets/channels-status-swr-CCNusXn-.js +0 -1
- package/dist/gateway/static/root/assets/index-C74vxaN3.css +0 -1
- package/dist/gateway/static/root/assets/projects-page-aaYIPefA.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-2xdJe22X.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DKFt8QcO.js +0 -1
- 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{t as i}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as a}from"./cn-BQ_8x0bT.js";import{t as o}from"./messages-CJ9O8gs2.js";import{n as s}from"./locale-store-D7eqlIJ9.js";import{$ as c,Bo as l,Cc as u,Cl as d,Cu as f,Fa as p,Fo as m,Io as h,Ja as g,Lo as _,No as v,Pa as y,Po as b,Qa as x,Ro as S,Ya as C,ac as w,lo as T,qa as E,uc as D,wc as O,yc as k,ys as A,yu as j,zo as M}from"./index-DEFW3c5N.js";var N=n(),P=e(t(),1),F=r();function I(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:c(n)}function L(e){return[...e].sort((e,t)=>{let n=Number(!!t.pinnedAt)-Number(!!e.pinnedAt);return n===0?new Date(t.lastActiveAt??t.updatedAt).getTime()-new Date(e.lastActiveAt??e.updatedAt).getTime():n})}function R(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,"aria-busy":!0,children:Array.from({length:6},z)}),e[0]=t):t=e[0],t}function z(e,t){return(0,F.jsx)(T,{className:`h-40 rounded-xl`},t)}function B(e){let t=(0,N.c)(59),{project:n,busy:r,onTogglePin:a,onToggleArchive:c}=e,l=s(V),p,m,h,g,_,v,y,b;if(t[0]!==l||t[1]!==n.brief||t[2]!==n.description||t[3]!==n.id||t[4]!==n.lastActiveAt||t[5]!==n.name||t[6]!==n.status||t[7]!==n.updatedAt||t[8]!==n.workspaceRoot){let e=o(l).projectsPage;p=e.management,y=`flex h-full flex-col rounded-xl border border-edge-subtle bg-surface-base p-4`;let r;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,F.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:(0,F.jsx)(d,{className:`size-4`,"aria-hidden":!0})}),t[17]=r):r=t[17];let a;t[18]===n.name?a=t[19]:(a=(0,F.jsx)(`h2`,{className:`truncate text-sm font-semibold text-fg`,children:n.name}),t[18]=n.name,t[19]=a);let s=(0,F.jsxs)(`div`,{className:`min-w-0`,children:[a,(0,F.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:e.statuses[n.status]})]}),c;t[20]===s?c=t[21]:(c=(0,F.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[r,s]}),t[20]=s,t[21]=c);let u;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,F.jsx)(j,{className:`mt-2 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":!0}),t[22]=u):u=t[22];let f;t[23]===c?f=t[24]:(f=(0,F.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,u]}),t[23]=c,t[24]=f),b=(0,F.jsxs)(i,{to:`/projects/${encodeURIComponent(n.id)}`,className:`group flex min-w-0 flex-1 flex-col rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[f,(0,F.jsx)(`p`,{className:`mt-3 line-clamp-2 min-h-10 text-xs leading-5 text-fg-muted`,children:n.description||n.brief||e.noDescription})]}),v=`mt-3 flex shrink-0 items-end justify-between gap-3 border-t border-edge-subtle pt-3`,g=`min-w-0 text-[11px] text-fg-subtle`,_=(0,F.jsx)(`p`,{className:`truncate`,children:n.workspaceRoot||e.agentDefault}),m=`mt-1`,h=I(n.lastActiveAt??n.updatedAt,e.never),t[0]=l,t[1]=n.brief,t[2]=n.description,t[3]=n.id,t[4]=n.lastActiveAt,t[5]=n.name,t[6]=n.status,t[7]=n.updatedAt,t[8]=n.workspaceRoot,t[9]=p,t[10]=m,t[11]=h,t[12]=g,t[13]=_,t[14]=v,t[15]=y,t[16]=b}else p=t[9],m=t[10],h=t[11],g=t[12],_=t[13],v=t[14],y=t[15],b=t[16];let x;t[25]!==m||t[26]!==h?(x=(0,F.jsx)(`p`,{className:m,children:h}),t[25]=m,t[26]=h,t[27]=x):x=t[27];let S;t[28]!==g||t[29]!==_||t[30]!==x?(S=(0,F.jsxs)(`div`,{className:g,children:[_,x]}),t[28]=g,t[29]=_,t[30]=x,t[31]=S):S=t[31];let C=n.pinnedAt?p.unpin:p.pin,w=n.pinnedAt?p.unpin:p.pin,T;t[32]===n.pinnedAt?T=t[33]:(T=n.pinnedAt?(0,F.jsx)(u,{className:`size-4`,"aria-hidden":!0}):(0,F.jsx)(O,{className:`size-4`,"aria-hidden":!0}),t[32]=n.pinnedAt,t[33]=T);let E;t[34]!==r||t[35]!==a||t[36]!==C||t[37]!==w||t[38]!==T?(E=(0,F.jsx)(A,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:a,"aria-label":C,title:w,children:T}),t[34]=r,t[35]=a,t[36]=C,t[37]=w,t[38]=T,t[39]=E):E=t[39];let k=n.status===`archived`?p.restore:p.archive,M=n.status===`archived`?p.restore:p.archive,P;t[40]===n.status?P=t[41]:(P=n.status===`archived`?(0,F.jsx)(D,{className:`size-4`,"aria-hidden":!0}):(0,F.jsx)(f,{className:`size-4`,"aria-hidden":!0}),t[40]=n.status,t[41]=P);let L;t[42]!==r||t[43]!==c||t[44]!==k||t[45]!==M||t[46]!==P?(L=(0,F.jsx)(A,{type:`button`,variant:`ghost`,className:`size-8 p-0`,disabled:r,onClick:c,"aria-label":k,title:M,children:P}),t[42]=r,t[43]=c,t[44]=k,t[45]=M,t[46]=P,t[47]=L):L=t[47];let R;t[48]!==E||t[49]!==L?(R=(0,F.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[E,L]}),t[48]=E,t[49]=L,t[50]=R):R=t[50];let z;t[51]!==R||t[52]!==v||t[53]!==S?(z=(0,F.jsxs)(`div`,{className:v,children:[S,R]}),t[51]=R,t[52]=v,t[53]=S,t[54]=z):z=t[54];let B;return t[55]!==z||t[56]!==y||t[57]!==b?(B=(0,F.jsxs)(`article`,{className:y,children:[b,z]}),t[55]=z,t[56]=y,t[57]=b,t[58]=B):B=t[58],B}function V(e){return e.language}function H(){let e=o(s(e=>e.language)).projectsPage,t=e.management,n=l(e=>e.setPageHeader),r=l(e=>e.clearPageHeader),[i,c]=(0,P.useState)([]),[u,f]=(0,P.useState)(!0),[T,D]=(0,P.useState)(null),[O,j]=(0,P.useState)(``),[N,I]=(0,P.useState)(`active`),[z,V]=(0,P.useState)(null),[H,U]=(0,P.useState)(!1),[W,G]=(0,P.useState)(null),[K,q]=(0,P.useState)(!1),[J,Y]=(0,P.useState)(``),[X,Z]=(0,P.useState)(``),[Q,ee]=(0,P.useState)(``),$=(0,P.useCallback)(async()=>{f(!0),D(null);try{c(L((await E({limit:100,sortBy:`updatedAt`,sortOrder:`desc`})).items))}catch(e){D(e instanceof Error?e.message:String(e))}finally{f(!1)}},[]);(0,P.useEffect)(()=>{$()},[$]);let te=(0,P.useMemo)(()=>{let e=O.trim().toLocaleLowerCase();return i.filter(e=>N===`all`||e.status===N).filter(t=>!e||[t.name,t.description,t.brief,t.workspaceRoot].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e)))},[N,i,O]),ne=(0,P.useMemo)(()=>(0,F.jsxs)(A,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>U(!0),children:[(0,F.jsx)(k,{className:`size-4`,"aria-hidden":!0}),e.create]}),[e.create]);(0,P.useLayoutEffect)(()=>(n({startExtra:null,main:(0,F.jsxs)(`div`,{className:`min-w-0`,children:[(0,F.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),(0,F.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:t.subtitle})]}),end:ne}),()=>r()),[r,ne,t.subtitle,t.title,n]);let re=(0,P.useCallback)(async e=>{e.preventDefault();let t=J.trim();if(!(!t||K)){q(!0),G(null);try{let e=await p({name:t,...X.trim()?{description:X.trim()}:{},...Q.trim()?{workspaceRoot:Q.trim()}:{}});c(t=>[e,...t.filter(t=>t.id!==e.id)]),Y(``),Z(``),ee(``),U(!1),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){G(e instanceof Error?e.message:String(e))}finally{q(!1)}}},[K,X,J,Q]),ie=(0,P.useCallback)(async(e,t)=>{V(e.id),D(null);try{let n;n=t===`pin`?e.pinnedAt?await x(e.id):await g(e.id):e.status===`archived`?await C(e.id):await y(e.id),c(e=>e.map(e=>e.id===n.id?n:e)),window.dispatchEvent(new CustomEvent(`project-updated`,{detail:{id:e.id}}))}catch(e){D(e instanceof Error?e.message:String(e))}finally{V(null)}},[]),ae=[{id:`active`,label:e.statuses.active},{id:`paused`,label:e.statuses.paused},{id:`archived`,label:e.statuses.archived},{id:`all`,label:e.all}];return(0,F.jsxs)(`main`,{className:`flex w-full flex-1 flex-col gap-5 px-3 py-6 sm:px-5 xl:px-6`,children:[(0,F.jsx)(v,{open:H,onOpenChange:e=>{U(e),e||G(null)},children:(0,F.jsxs)(S,{children:[(0,F.jsx)(_,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,F.jsxs)(m,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,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,F.jsxs)(`div`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,F.jsx)(M,{className:`text-base font-semibold text-fg`,children:e.createTitle}),(0,F.jsx)(h,{className:`mt-1 text-sm text-fg-muted`,children:e.createDescription})]}),(0,F.jsxs)(`form`,{onSubmit:re,className:`flex min-h-0 flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-5 py-4`,children:[(0,F.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[e.projectName,(0,F.jsx)(`input`,{className:`h-10 rounded-lg border border-edge bg-surface-base px-3 font-normal outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:J,onChange:e=>Y(e.target.value),maxLength:160})]}),(0,F.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[t.descriptionLabel,(0,F.jsx)(`textarea`,{className:`min-h-28 resize-none rounded-lg border border-edge bg-surface-base px-3 py-2 font-normal leading-6 outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:X,onChange:e=>Z(e.target.value),maxLength:2e3,placeholder:t.descriptionPlaceholder})]}),(0,F.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium text-fg`,children:[e.workspaceRoot,(0,F.jsx)(`input`,{className:`h-10 rounded-lg border border-edge bg-surface-base px-3 font-mono text-xs font-normal outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`,value:Q,onChange:e=>ee(e.target.value),placeholder:e.workspacePlaceholder})]}),W?(0,F.jsx)(`p`,{className:`rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:W}):null]}),(0,F.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,F.jsx)(b,{asChild:!0,children:(0,F.jsx)(A,{type:`button`,variant:`ghost`,children:e.cancel})}),(0,F.jsx)(A,{type:`submit`,variant:`primary`,disabled:K||!J.trim(),children:K?e.workHome.creating:e.create})]})]})]})]})}),(0,F.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-xl border border-edge-subtle bg-surface-base p-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1`,"aria-label":t.filterLabel,children:ae.map(e=>(0,F.jsx)(`button`,{type:`button`,className:a(`rounded-lg px-3 py-1.5 text-xs font-medium transition-colors`,N===e.id?`bg-accent-soft text-accent-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`),onClick:()=>I(e.id),children:e.label},e.id))}),(0,F.jsxs)(`label`,{className:`relative block min-w-0 sm:w-64`,children:[(0,F.jsx)(w,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,F.jsx)(`input`,{className:`h-9 w-full 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:O,onChange:e=>j(e.target.value),placeholder:e.searchPlaceholder,"aria-label":e.searchPlaceholder})]})]}),T?(0,F.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`,role:`alert`,children:[(0,F.jsx)(`span`,{children:T}),(0,F.jsx)(A,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void $(),children:e.workHome.retry})]}):null,u?(0,F.jsx)(R,{}):te.length?(0,F.jsx)(`section`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:te.map(e=>(0,F.jsx)(B,{project:e,busy:z===e.id,onTogglePin:()=>void ie(e,`pin`),onToggleArchive:()=>void ie(e,`archive`)},e.id))}):(0,F.jsxs)(`section`,{className:`rounded-xl border border-dashed border-edge p-10 text-center`,children:[(0,F.jsx)(d,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,F.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:t.emptyTitle}),(0,F.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.emptyHint})]})]})}export{H as ProjectsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{si as e}from"./index-DEFW3c5N.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-aKtaBQYM.js";import{o as t,r as n}from"./locale-store-D7eqlIJ9.js";import{ai as r}from"./index-DEFW3c5N.js";var i=e({reloadSkills:()=>a});async function a(){let e=await t(n(`/api/skills/reload`),{method:`POST`});if(!e.ok)throw Error(await r(e))}export{i as n,a as t};
|
|
@@ -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};
|