@xopcai/xopc 0.0.190 → 0.0.191
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/{agent-avatar-dicebear-9vAbkroX.js → agent-avatar-dicebear-DvEkT222.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-D1t4SfMQ.js → agents-CXyivfqY.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DkFeIdBf.js → app-management-settings-panel-COpP_pKN.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Bxs8Fpaj.js → appearance-settings-DTVNUEDq.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Cgrgu5OW.js → apps-page-DsE67BSO.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Ch2RmLCC.js → archive-plugin-IpX6VA0o.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BhMQM_Ky.js → attachment-load-CKVFNUi1.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CtJxstKh.js → automations-page-D0TVev47.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-D6CqlymH.js → binary-plugins-BrfvfOS4.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-ClL6HEg9.js → block-editor-D9sEfg32.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DW99iDmD.js → browser-settings-page-DpZzq8j2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BYy48VhN.js → browser-workflow-inputs-BixZ5lCR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-zgLibuMH.js → browser-workflows-page-YEFuodJI.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CHUrT9EB.js → capabilities-settings-panel-B9Cmcuff.js} +2 -2
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Cycrv0YV.js → capability-presets-settings-panel-C_EpuQtk.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-V96gPUAU.js → channels-settings-CvzD5qSv.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-DS9ED-EL.js → connectors-api-BMMqC0_9.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BhlyQoQI.js → connectors-page-BKrm7tJ9.js} +1 -1
- package/dist/gateway/static/root/assets/{cron-expression-CkgsvhtW.js → cron-expression-Bm8koRoD.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Cv8rGhYW.js → desktop-pet-CMG3mcaJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CIeJdwfV.js → desktop-pet-settings-D8aaPb0x.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D8jXEiAY.js → directory-picker-path-field-C95yW03b.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CCZ9u6TZ.js → extension-debug-page-DsG7Z9lV.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CV36ILRG.js → extension-page-CUAXEbAt.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-IyQrSILY.js → extension-settings-page-CsR7QOJo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-D4_r5iJM.js → gateway-config-api-DL70Nakc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CYlntpBH.js → gateway-settings-BgDxQ08c.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-D4SyWob8.js → heartbeat-settings-BX7q55uZ.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-B2Kagoh8.js → home-page-C08Nen5T.js} +1 -1
- package/dist/gateway/static/root/assets/{index-CYT5DOzr.js → index-B-_CEvIX.js} +7 -7
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BMhCuVBZ.js → keyboard-shortcuts-settings-Dt6wS5zW.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BHYbFjqy.js → local-app-workbench-page-BQVC0tWq.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-ijIe7_y2.js → local-apps-page-DcD3-N00.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-IIn8Tess.js → logs-page-D6yvW-E4.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings--V_fovKD.js → management-settings-B6EVkJQy.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-Dt9-in6W.js → markdown-split-CHUjCnBh.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B3pj_iO0.js → media-plugins-DRrtI2O0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DZ366lIT.js → notes-page-fermYvpI.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-S2sBVOLw.js → notes-workbench-BVCwabjq.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-C5ge434C.js → page-tabs-BO262zuu.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BFa9DgSV.js → preview-open-alternatives-yZYTy-2e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dc9CcWdu.js → product-open-page-Dgy8XWhR.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-BilzoCJ7.js → project-detail-page-CS4Ujor7.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BoQUyacP.js → projects-page-DMtPC8c4.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DUyUaCRF.js → remote-access-hub-BpfHZT88.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-B84DckWe.js → schema-form-DdE4gtw_.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-Dzxlq1F0.js → sessions-page-BZkyrJBM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlK0A4l.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Dp9itvdy.js → settings-form-section-CiYU8AvV.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-CCtlhoy7.js → settings-loading-skeleton-Bv03cWib.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DQmMKf8r.js → settings-page-C-LdINFj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-EQIOJa_L.js → settings-page-layout-t_Ox1slk.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cwi-SPja.js → setup-status-panel-HRG_lK4_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C4_B2jvf.js → share-preview-page-DF8gW6bo.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CkyuGlZK.js → shares-settings-v_iLhxxa.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BJCePQK5.js → skill-reload-api-S-bjtsXX.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-BYWLfmJi.js → skills-page-BiNBfaX5.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-Jhm24i4h.js → skills-page.utils-DlnGtvAH.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Dpx2ags2.js → system-settings-panel-Bv7GXFc6.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-DLAdxI6e.js → task-detail-page-BhQcOpnx.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-DULmTHUB.js → typed-models-lib-4XBsLEuv.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BrjVk5VH.js → use-autosave-BN2QgFGn.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-9AAFpGAL.js → user-context-page-PtcY7BoJ.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BISTPfq_.js → voice-api-key-field-DnhJtC5l.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Wr-uF7VA.js → work-discovery-overlay-nmEAafFl.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BWds95sL.js → work-discovery-page-C5Kwe_bc.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DHqHP8_6.js → workflow-run-setup-panel-BnNWBDwz.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-0b4_DFHr.js → workflows-page-Z_qzaohv.js} +1 -1
- package/dist/gateway/static/root/index.html +1 -1
- package/dist/package.js +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/provider-registry.d.ts +2 -0
- package/dist/src/agent/image/generation/provider-registry.js +20 -10
- package/dist/src/agent/image/generation/providers/xopc-cloud.d.ts +2 -0
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +74 -0
- package/dist/src/agent/image/generation/types.d.ts +2 -2
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/onboard/model.d.ts +3 -0
- package/dist/src/cli/commands/onboard/model.js +19 -4
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +9 -8
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/providers/model-catalog-store.d.ts +15 -0
- package/dist/src/providers/model-catalog-store.js +14 -1
- package/dist/src/providers/model-catalog-sync-service.js +6 -0
- package/dist/src/providers/model-registry.js +4 -4
- package/dist/src/providers/register-runtime-providers.js +4 -4
- package/dist/src/providers/xopc-cloud-model-source.js +55 -8
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-TzwlZxU6.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
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-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./messages-B4XqB8I6.js";import{n as l,o as u,r as d}from"./locale-store-deR2zRaE.js";import{n as f}from"./activity-store-DstnJCS5.js";import{Ba as p,Co as m,Do as h,Ds as g,Eo as _,Fl as v,Jl as y,Kl as b,Nc as x,Oo as S,Os as C,Ql as w,So as T,St as E,To as D,Vs as O,Xa as k,Xc as A,Yl as j,_t as M,_u as N,bt as P,ds as F,gt as ee,jc as te,lc as ne,ms as re,mt as ie,pt as ae,rt as I,vt as oe,wo as se,wt as ce,xt as le}from"./index-
|
|
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-BMhrPKJC.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./cn-JdwAhgNB.js";import{t as c}from"./messages-B4XqB8I6.js";import{n as l,o as u,r as d}from"./locale-store-deR2zRaE.js";import{n as f}from"./activity-store-DstnJCS5.js";import{Ba as p,Co as m,Do as h,Ds as g,Eo as _,Fl as v,Jl as y,Kl as b,Nc as x,Oo as S,Os as C,Ql as w,So as T,St as E,To as D,Vs as O,Xa as k,Xc as A,Yl as j,_t as M,_u as N,bt as P,ds as F,gt as ee,jc as te,lc as ne,ms as re,mt as ie,pt as ae,rt as I,vt as oe,wo as se,wt as ce,xt as le}from"./index-B-_CEvIX.js";var L=e(t(),1),R=n();function z(e){try{return decodeURIComponent(e).trim()||null}catch{return null}}function B(e){if(!e)return null;let t=e.split(/[?#]/,1)[0],n=/^\/chat\/([^/]+)\/?$/.exec(t);if(n){let e=z(n[1]);return!e||e===`new`?null:{kind:`session`,id:e}}return null}async function V(e,t){let n=`/api/sessions/${encodeURIComponent(e.id)}?limit=1`;try{return(await u(d(n),{signal:t})).status===404?`missing`:`available`}catch(e){if(t?.aborted)throw e;return`available`}}var H=r(),U=3,W={info:{Icon:A,className:`text-accent-fg bg-accent-soft`},success:{Icon:b,className:`text-success bg-success-soft`},warning:{Icon:g,className:`text-warning bg-warning-soft`},error:{Icon:y,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 G(e){let t=(0,R.c)(55),{item:n,targetAvailability:r}=e,i=l(q),o;t[0]===i?o=t[1]:(o=c(i),t[0]=i,t[1]=o);let u=o.projectsPage.home,d=f(K),{Icon:m,className:h}=W[n.tone],g;t[2]===h?g=t[3]:(g=s(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,h),t[2]=h,t[3]=g);let _;t[4]!==m||t[5]!==n.status?(_=n.status===`running`?(0,H.jsx)(x,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,H.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),t[4]=m,t[5]=n.status,t[6]=_):_=t[6];let v;t[7]!==g||t[8]!==_?(v=(0,H.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,H.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]!==u.activityUnread||t[13]!==n.read?(b=n.read?null:(0,H.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-accent`,"aria-label":u.activityUnread}),t[12]=u.activityUnread,t[13]=n.read,t[14]=b):b=t[14];let S;t[15]!==y||t[16]!==b?(S=(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[y,b]}),t[15]=y,t[16]=b,t[17]=S):S=t[17];let C;t[18]===n.message?C=t[19]:(C=n.message?(0,H.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]=C);let w;t[20]===n.source?w=t[21]:(w=n.source?(0,H.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=w);let T;t[22]!==n.updatedAt||t[23]!==i?(T=ue(n.updatedAt,i),t[22]=n.updatedAt,t[23]=i,t[24]=T):T=t[24];let E;t[25]===T?E=t[26]:(E=(0,H.jsx)(`span`,{children:T}),t[25]=T,t[26]=E);let D;t[27]===n.occurrences?D=t[28]:(D=n.occurrences>1?(0,H.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=D);let O;t[29]!==u.activityCheckingRelated||t[30]!==u.activityRelatedMissing||t[31]!==u.activityViewRelated||t[32]!==n.href||t[33]!==r?(O=n.href&&r===`available`?(0,H.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:[u.activityViewRelated,(0,H.jsx)(j,{className:`size-3`,"aria-hidden":!0})]}):n.href&&r===`checking`?(0,H.jsx)(p,{className:`h-3 w-20 rounded`,"aria-label":u.activityCheckingRelated}):n.href&&r===`missing`?(0,H.jsx)(`span`,{className:`font-medium text-fg-subtle`,role:`status`,children:u.activityRelatedMissing}):null,t[29]=u.activityCheckingRelated,t[30]=u.activityRelatedMissing,t[31]=u.activityViewRelated,t[32]=n.href,t[33]=r,t[34]=O):O=t[34];let k;t[35]!==E||t[36]!==D||t[37]!==O||t[38]!==w?(k=(0,H.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[w,E,D,O]}),t[35]=E,t[36]=D,t[37]=O,t[38]=w,t[39]=k):k=t[39];let A;t[40]!==k||t[41]!==S||t[42]!==C?(A=(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[S,C,k]}),t[40]=k,t[41]=S,t[42]=C,t[43]=A):A=t[43];let M;t[44]!==n.id||t[45]!==d?(M=()=>d(n.id),t[44]=n.id,t[45]=d,t[46]=M):M=t[46];let N;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,H.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),t[47]=N):N=t[47];let P;t[48]!==u.activityRemove||t[49]!==M?(P=(0,H.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":u.activityRemove,onClick:M,children:N}),t[48]=u.activityRemove,t[49]=M,t[50]=P):P=t[50];let F;return t[51]!==A||t[52]!==P||t[53]!==v?(F=(0,H.jsxs)(`article`,{className:`group flex items-start gap-3 border-t border-edge-subtle px-1 py-3 first:border-t-0`,children:[v,A,P]}),t[51]=A,t[52]=P,t[53]=v,t[54]=F):F=t[54],F}function K(e){return e.remove}function q(e){return e.language}function de(){let e=(0,R.c)(14),t=c(l(ye)).projectsPage.home,n=f(ve),r=f(_e),i=f(ge),[a,s]=(0,L.useState)(!1),u;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={},e[0]=u):u=e[0];let[d,p]=(0,L.useState)(u),m;e[1]===n?m=e[2]:(m=n.filter(he),e[1]=n,e[2]=m);let h=m.length,g;e[3]===n?g=e[4]:(g=n.filter(me),e[3]=n,e[4]=g);let _=g.length,y;e[5]!==a||e[6]!==n?(y=a?n:n.slice(0,U),e[5]=a,e[6]=n,e[7]=y):y=e[7];let b=y,S;e[8]===n?S=e[9]:(S=[...new Set(n.flatMap(Z))].sort().join(`
|
|
2
2
|
`),e[8]=n,e[9]=S);let w=S,T,E;e[10]===w?(T=e[11],E=e[12]):(T=()=>{let e=new AbortController,t=new Map((w?w.split(`
|
|
3
3
|
`):[]).flatMap(X));return p(Object.fromEntries([...t.keys()].map(pe))),Promise.all([...t].map(async t=>{let[n,r]=t,i=await V(r,e.signal);e.signal.aborted||p(e=>({...e,[n]:i}))})).catch(Y),()=>e.abort()},E=[w],e[10]=w,e[11]=T,e[12]=E),(0,L.useEffect)(T,E);let D;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,H.jsx)(N,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[13]=D):D=e[13],(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,H.jsx)(`div`,{children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[D,(0,H.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),h>0?(0,H.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,H.jsx)(x,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),h,` `,t.running]}):_>0?(0,H.jsxs)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[_,` `,t.activityNew]}):null]})}),a&&n.length>0?(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[_>0?(0,H.jsxs)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,H.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some(fe)?(0,H.jsxs)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,H.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,H.jsxs)(`div`,{className:`mt-3 px-1`,children:[b.map(e=>(0,H.jsx)(G,{item:e,targetAvailability:e.href&&B(e.href)?d[e.href]??`checking`:`available`},e.id)),n.length>U?(0,H.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>s(J),children:a?t.activityShowLess:t.activityShowAll.replace(`{{count}}`,String(n.length))})}):null]}):(0,H.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,H.jsx)(v,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`p`,{children:t.activityEmpty})]})]})}function J(e){return!e}function fe(e){return e.status===`done`}function Y(){}function pe(e){return[e,`checking`]}function X(e){let t=B(e);return t?[[e,t]]:[]}function Z(e){return e.href&&B(e.href)?[e.href]:[]}function me(e){return!e.read}function he(e){return e.status===`running`}function ge(e){return e.clearFinished}function _e(e){return e.markAllRead}function ve(e){return e.items}function ye(e){return e.language}function Q(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function $(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:I(n)}function be(e){let t=(0,R.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,H.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 xe(e){let t=(0,R.c)(15),{task:n,statusLabel:r}=e,i=`/tasks/${encodeURIComponent(n.id)}`,o;t[0]===n.title?o=t[1]:(o=(0,H.jsx)(`h3`,{className:`line-clamp-2 text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=o);let s;t[2]===n.updatedAt?s=t[3]:(s=$(n.updatedAt,``),t[2]=n.updatedAt,t[3]=s);let c;t[4]===s?c=t[5]:(c=(0,H.jsx)(`p`,{className:`mt-2 text-xs text-fg-subtle`,children:s}),t[4]=s,t[5]=c);let l;t[6]!==o||t[7]!==c?(l=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[o,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8];let u;t[9]===r?u=t[10]:(u=(0,H.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[9]=r,t[10]=u);let d;return t[11]!==i||t[12]!==l||t[13]!==u?(d=(0,H.jsxs)(a,{to:i,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:[l,u]}),t[11]=i,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function Se(e){let t=(0,R.c)(12),{receipt:n,evidenceLabel:r,remainingLabel:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,H.jsx)(b,{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,H.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:n.summary}),s=(0,H.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,H.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,H.jsx)(`div`,{className:`block rounded-xl border border-edge-subtle px-3 py-3`,children:(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[a,(0,H.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 Ce(){let e=(0,R.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,H.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,H.jsx)(p,{className:`h-20 rounded-2xl`}),(0,H.jsx)(p,{className:`h-72 rounded-2xl`}),(0,H.jsx)(p,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function we(e){let t=(0,R.c)(15),{chat:n,statusLabel:r}=e,i=`/chat/${encodeURIComponent(n.key)}`,o;t[0]===n.name?o=t[1]:(o=(0,H.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:n.name}),t[0]=n.name,t[1]=o);let s;t[2]===r?s=t[3]:(s=(0,H.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]!==o||t[5]!==s?(c=(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===n.updatedAt?l=t[8]:(l=$(n.updatedAt,``),t[7]=n.updatedAt,t[8]=l);let u;t[9]===l?u=t[10]:(u=(0,H.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,H.jsxs)(a,{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 Te(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,H.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,H.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,H.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,H.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,H.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,H.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,H.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,H.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,H.jsx)(F,{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,H.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 Ee(e){let t=(0,R.c)(65),{item:n,labels:r,busy:i,onDecide:a,onSnooze:o,onDismiss:s,onInstruct:c}=e,[l,u]=(0,L.useState)(``),d=n.judgment,f;t[0]===n.title?f=t[1]:(f=(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=f);let p;t[2]===n.detail?p=t[3]:(p=(0,H.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n.detail}),t[2]=n.detail,t[3]=p);let m;t[4]!==f||t[5]!==p?(m=(0,H.jsxs)(`div`,{className:`min-w-0`,children:[f,p]}),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,H.jsx)(O,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=h):h=t[7];let g;t[8]===m?g=t[9]:(g=(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[m,h]}),t[8]=m,t[9]=g);let _;t[10]!==d.whyNow||t[11]!==r.whyNow?(_=[r.whyNow,d.whyNow],t[10]=d.whyNow,t[11]=r.whyNow,t[12]=_):_=t[12];let v;t[13]!==d.impact||t[14]!==r.impact?(v=[r.impact,d.impact],t[13]=d.impact,t[14]=r.impact,t[15]=v):v=t[15];let y;t[16]!==d.workDone||t[17]!==r.workDone?(y=[r.workDone,d.workDone],t[16]=d.workDone,t[17]=r.workDone,t[18]=y):y=t[18];let b;t[19]!==d.recommendation||t[20]!==r.recommendation?(b=[r.recommendation,d.recommendation],t[19]=d.recommendation,t[20]=r.recommendation,t[21]=b):b=t[21];let x;t[22]!==_||t[23]!==v||t[24]!==y||t[25]!==b?(x=(0,H.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[_,v,y,b].map(De)}),t[22]=_,t[23]=v,t[24]=y,t[25]=b,t[26]=x):x=t[26];let S;t[27]!==i||t[28]!==d.decision||t[29]!==a?(S=d.decision?(0,H.jsxs)(`div`,{className:`mt-4`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:d.decision.question}),(0,H.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:d.decision.options.map(e=>(0,H.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,H.jsx)(`span`,{children:e.label}),(0,H.jsx)(`span`,{className:`text-[10px] font-normal text-fg-muted`,children:e.consequence})]},e.id))})]}):null,t[27]=i,t[28]=d.decision,t[29]=a,t[30]=S):S=t[30];let C;t[31]!==i||t[32]!==r.snooze||t[33]!==o?(C=(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:i,onClick:o,children:r.snooze}),t[31]=i,t[32]=r.snooze,t[33]=o,t[34]=C):C=t[34];let w;t[35]!==i||t[36]!==r.dismiss||t[37]!==s?(w=(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:i,onClick:s,children:r.dismiss}),t[35]=i,t[36]=r.dismiss,t[37]=s,t[38]=w):w=t[38];let T;t[39]!==C||t[40]!==w?(T=(0,H.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 border-t border-edge-subtle pt-3`,children:[C,w]}),t[39]=C,t[40]=w,t[41]=T):T=t[41];let E;t[42]!==l||t[43]!==c?(E=e=>{e.preventDefault();let t=l.trim();t&&(c(t),u(``))},t[42]=l,t[43]=c,t[44]=E):E=t[44];let D;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>u(e.target.value),t[45]=D):D=t[45];let k;t[46]!==l||t[47]!==r.feedbackPlaceholder?(k=(0,H.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:D,placeholder:r.feedbackPlaceholder}),t[46]=l,t[47]=r.feedbackPlaceholder,t[48]=k):k=t[48];let A;t[49]!==i||t[50]!==l?(A=i||!l.trim(),t[49]=i,t[50]=l,t[51]=A):A=t[51];let j;t[52]!==r.applyFeedback||t[53]!==A?(j=(0,H.jsx)(F,{type:`submit`,variant:`secondary`,className:`h-9 px-3`,disabled:A,children:r.applyFeedback}),t[52]=r.applyFeedback,t[53]=A,t[54]=j):j=t[54];let M;t[55]!==E||t[56]!==k||t[57]!==j?(M=(0,H.jsxs)(`form`,{className:`mt-3 flex gap-2`,onSubmit:E,children:[k,j]}),t[55]=E,t[56]=k,t[57]=j,t[58]=M):M=t[58];let N;return t[59]!==x||t[60]!==S||t[61]!==T||t[62]!==M||t[63]!==g?(N=(0,H.jsxs)(`article`,{className:`rounded-xl border border-accent/25 bg-accent-soft/15 p-4`,children:[g,x,S,T,M]}),t[59]=x,t[60]=S,t[61]=T,t[62]=M,t[63]=g,t[64]=N):N=t[64],N}function De(e){let[t,n]=e;return(0,H.jsxs)(`div`,{className:`rounded-lg bg-surface-panel/80 p-3`,children:[(0,H.jsx)(`p`,{className:`text-[11px] font-medium text-fg-subtle`,children:t}),(0,H.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg`,children:n})]},t)}function Oe(e){let t=(0,R.c)(32),{item:n,statusLabel:r,retryLabel:i,viewLabel:o,acknowledgeLabel:s,busy:c,onView:l,onRetry:u,onAcknowledge:d}=e,f;t[0]===n.title?f=t[1]:(f=(0,H.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=f);let p;t[2]===r?p=t[3]:(p=(0,H.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-danger`,children:r}),t[2]=r,t[3]=p);let m;t[4]!==f||t[5]!==p?(m=(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[f,p]}),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h;t[7]===n.detail?h=t[8]:(h=(0,H.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:n.detail}),t[7]=n.detail,t[8]=h);let g;t[9]!==n.href||t[10]!==m||t[11]!==h?(g=(0,H.jsxs)(a,{to:n.href,className:`block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[m,h]}),t[9]=n.href,t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]!==s||t[14]!==c||t[15]!==d?(_=(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:d,children:s}),t[13]=s,t[14]=c,t[15]=d,t[16]=_):_=t[16];let v;t[17]!==c||t[18]!==l||t[19]!==o?(v=(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:l,children:o}),t[17]=c,t[18]=l,t[19]=o,t[20]=v):v=t[20];let y;t[21]!==c||t[22]!==u||t[23]!==i?(y=(0,H.jsx)(F,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:c,onClick:u,children:i}),t[21]=c,t[22]=u,t[23]=i,t[24]=y):y=t[24];let b;t[25]!==_||t[26]!==v||t[27]!==y?(b=(0,H.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2 border-t border-danger/15 pt-3`,children:[_,v,y]}),t[25]=_,t[26]=v,t[27]=y,t[28]=b):b=t[28];let x;return t[29]!==g||t[30]!==b?(x=(0,H.jsxs)(`article`,{className:`rounded-xl border border-danger/25 bg-danger-soft/35 p-3.5`,children:[g,b]}),t[29]=g,t[30]=b,t[31]=x):x=t[31],x}function ke(){let e=l(e=>e.language),t=c(e).projectsPage,n=ae(e),r=i(),o=k(e=>e.setPageHeader),s=k(e=>e.clearPageHeader),[u,d]=(0,L.useState)(null),[f,p]=(0,L.useState)(!0),[g,v]=(0,L.useState)(null),[x,C]=(0,L.useState)(!1),[A,j]=(0,L.useState)(``),[N,I]=(0,L.useState)(()=>crypto.randomUUID()),[R,z]=(0,L.useState)(!1),[B,V]=(0,L.useState)(null),[U,W]=(0,L.useState)(null),[ue,G]=(0,L.useState)(null),K=(0,L.useCallback)(async(t=!1)=>{t&&p(!0),v(null);try{d(await oe(e))}catch(e){v(e instanceof Error?e.message:String(e))}finally{p(!1)}},[e]);(0,L.useEffect)(()=>{K(!0)},[K]),(0,L.useEffect)(()=>{let e,t=t=>{e!==void 0&&window.clearTimeout(e),e=window.setTimeout(()=>{e=void 0,K()},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)}},[K]);let q=(0,L.useMemo)(()=>u?.decisions??[],[u]),J=(0,L.useMemo)(()=>u?.attention??[],[u]),fe=(0,L.useCallback)(async t=>{t.preventDefault();let n=A.trim();if(!(!n||R)){z(!0),V(null);try{let t=await ee({idempotencyKey:N,title:n,locale:e,priority:`normal`,contract:{objective:n,expectedOutputs:[],acceptanceCriteria:[],constraints:[],approvalRequired:[],assumptions:[],risks:[],acceptancePolicy:`manual`,outputDestinations:[]},dependencies:[],context:[],authorityGrants:[],activation:{mode:`start`,executor:{kind:`agent`,agentId:`main`}}});C(!1),j(``),I(crypto.randomUUID()),r(`/tasks/${encodeURIComponent(t.task.id)}`)}catch(e){V(e instanceof Error?e.message:String(e))}finally{z(!1)}}},[N,R,e,r,A]),Y=(0,L.useMemo)(()=>(0,H.jsxs)(F,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>C(!0),children:[(0,H.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),n.newWork]}),[n.newWork]),pe=(0,L.useCallback)(async(e,t)=>{if(e.response){W(e.id),v(null);try{await le(e.response,t),await K()}catch(e){v(e instanceof Error?e.message:String(e))}finally{W(null)}}},[K]),X=(0,L.useCallback)(async(e,t)=>{W(e.id),v(null);try{await t(),await K()}catch(e){v(e instanceof Error?e.message:String(e))}finally{W(null)}},[K]),Z=(0,L.useCallback)(async(e,t)=>{G(e.id),v(null);try{await t({kind:e.kind,runId:e.runId}),await K()}catch(e){v(e instanceof Error?e.message:String(e))}finally{G(null)}},[K]);return(0,L.useLayoutEffect)(()=>(o({startExtra:null,main:(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:t.title}),(0,H.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:t.home.subtitle})]}),end:Y}),()=>s()),[s,Y,o,t.title,t.home.subtitle]),(0,H.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,H.jsx)(T,{open:x,onOpenChange:e=>{R||C(e),e&&(V(null),I(crypto.randomUUID()))},children:(0,H.jsxs)(h,{children:[(0,H.jsx)(_,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,H.jsxs)(se,{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,H.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(S,{className:`text-base font-semibold text-fg`,children:n.dialogTitle}),(0,H.jsx)(D,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:n.dialogDescription})]}),(0,H.jsx)(m,{asChild:!0,children:(0,H.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,H.jsx)(re,{className:`size-4`,"aria-hidden":!0})})})]}),(0,H.jsxs)(`form`,{onSubmit:fe,className:`flex min-h-0 flex-1 flex-col`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,H.jsx)(`label`,{htmlFor:`new-work-task`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:n.intentLabel}),(0,H.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:A,onChange:e=>{j(e.target.value),I(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,H.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,H.jsx)(`span`,{children:t.home.submitShortcut}),(0,H.jsxs)(`span`,{className:`tabular-nums`,children:[A.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),B?(0,H.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:B}):null]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,H.jsx)(m,{asChild:!0,children:(0,H.jsx)(F,{type:`button`,variant:`ghost`,disabled:R,children:t.cancel})}),(0,H.jsxs)(F,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:!A.trim()||R,children:[(0,H.jsx)(O,{className:`size-4`,"aria-hidden":!0}),R?n.starting:n.submit]})]})]})]})]})}),g?(0,H.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,H.jsx)(`span`,{children:g}),(0,H.jsx)(F,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void K(),children:t.home.retry})]}):null,f?(0,H.jsx)(Ce,{}):u?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,H.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:t.home.briefingTitle}),(0,H.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:u.decisions.length+u.attention.length>0?Q(t.home.todaySummary,{attention:u.decisions.length+u.attention.length,moving:u.briefing.progress.movingCount+u.chats.running.length}):Q(t.home.todaySummaryClear,{moving:u.briefing.progress.movingCount+u.chats.running.length})}),u.briefing.summary?(0,H.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:u.briefing.summary}):null]}),u.tasks.running.length===0&&u.workflowRuns.active.length===0&&u.decisions.length===0&&u.attention.length===0&&u.chats.running.length===0&&u.chats.recent.length===0&&u.upcomingAutomations.length===0?(0,H.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,H.jsx)(te,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,H.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:t.home.emptyTitle}),(0,H.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:t.home.emptyBody}),(0,H.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,H.jsx)(F,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:t.home.startChat}),(0,H.jsx)(F,{type:`button`,variant:`secondary`,onClick:()=>C(!0),children:n.newWork})]})]}):null,(0,H.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[J.length>0?(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(y,{className:`size-4 text-danger`,"aria-hidden":!0}),(0,H.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.runAttention}),(0,H.jsx)(be,{children:J.length.toLocaleString()})]}),(0,H.jsx)(`div`,{className:`mt-4 space-y-2`,children:J.map(e=>(0,H.jsx)(Oe,{item:e,statusLabel:e.reason===`run_timeout`?t.home.attentionTimeout:t.home.attentionFailed,retryLabel:t.home.attentionRetry,viewLabel:t.home.attentionView,acknowledgeLabel:t.home.attentionAcknowledge,busy:ue===e.id,onView:()=>r(e.href),onRetry:()=>void Z(e,E),onAcknowledge:()=>void Z(e,ie)},e.id))})]}):null,q.length>0?(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(y,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,H.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.needsAttention}),(0,H.jsx)(be,{children:q.length.toLocaleString()})]}),(0,H.jsx)(`div`,{className:`mt-4 space-y-2`,children:q.map(e=>e.kind===`agent_judgment`&&e.judgment?(0,H.jsx)(Ee,{item:e,labels:n,busy:U===e.id,onDecide:t=>void X(e,()=>M(e.judgment.inboxItemId,t)),onSnooze:()=>void X(e,()=>ce(e.judgment.inboxItemId,`snoozed`)),onDismiss:()=>void X(e,()=>ce(e.judgment.inboxItemId,`resolved`)),onInstruct:t=>void X(e,()=>P(e.judgment.inboxItemId,t))},e.id):(0,H.jsx)(Te,{item:e,kindLabel:t.home.decisionKinds[e.kind],reasonLabel:t.home.decisionReasons[e.reason],approveLabel:t.home.approve,denyLabel:t.home.deny,busy:U===e.id,onRespond:t=>void pe(e,t)},e.id))})]}):(0,H.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,H.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,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(O,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,H.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.running}),(0,H.jsx)(be,{children:u.tasks.running.length.toLocaleString()})]}),(0,H.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[u.tasks.running.map(e=>(0,H.jsx)(xe,{task:e,statusLabel:n.taskStatuses.running},e.id)),u.tasks.running.length===0?(0,H.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.emptyRunning}):null]})]}),u.chats.recent.length>0?(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,H.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.recent})}),(0,H.jsx)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:u.chats.recent.slice(0,6).map(e=>(0,H.jsx)(we,{chat:e,statusLabel:n.openChat},e.key))})]}):null]}),(0,H.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":t.home.nowTitle,children:[(0,H.jsx)(`div`,{className:`px-1`,children:(0,H.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:t.home.nowTitle})}),u.upcomingAutomations.length>0?(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(w,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:t.home.scheduled})]}),(0,H.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:u.upcomingAutomations.slice(0,3).map(e=>(0,H.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,H.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,H.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:$(e.nextRunAt,t.never)})]},e.id))})]}):null,u.recentTasks.length>0?(0,H.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(b,{className:`size-4 text-success`,"aria-hidden":!0}),(0,H.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.recentTasks})]}),(0,H.jsx)(`div`,{className:`mt-3 space-y-2`,children:u.recentTasks.slice(0,3).map(e=>(0,H.jsx)(Se,{receipt:e,evidenceLabel:n.evidenceCount,remainingLabel:n.remainingCount},e.runId))})]}):null,(0,H.jsx)(de,{}),u.briefing.wins.length>0?(0,H.jsxs)(a,{to:u.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,H.jsx)(`span`,{children:Q(t.home.completedSummary,{count:u.briefing.wins.length})}),(0,H.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[t.home.viewLatestResult,` →`]})]}):null]})]})]}):null]})}export{ke as HomePage};
|