@xopcai/xopc 0.0.160 → 0.0.161
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/{action-boundary-settings-panel-CY3sizqC.js → action-boundary-settings-panel-BIVBUiNT.js} +1 -1
- package/dist/gateway/static/root/assets/activity-store-o7GRljfD.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B_27aaZQ.js → agent-avatar-dicebear-9R3szLMc.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B1l3iii6.js → agents-_qbUaYbs.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BbzB57CJ.js → api-jSTqFMq9.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DfmyWcyh.js → app-management-settings-panel-D81cyE76.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B2v0c-K-.js → appearance-settings-Ct6bZQCV.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DaNFLsp0.js → apps-page-0sPqD0FK.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-DL5Lnx0C.js → archive-plugin-CfD7AZKn.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-InuP-ZjQ.js → attachment-load-CP_Gaxt3.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-CahGuh7B.js → automation-suggestion-card-BGKM_NDZ.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Cd0gMx6p.js → automations-page-BxWBuBsE.js} +3 -3
- package/dist/gateway/static/root/assets/{binary-plugins-CdOTGYVu.js → binary-plugins-IPr2EVnS.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D6ShK1S-.js → block-editor-B6aHEGA6.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BmUYDL2Z.js → browser-settings-page-C499b9AH.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-api-BzoLm52Z.js → capability-presets-api-CCX9-LjU.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-CE7mrWtS.js → capability-presets-settings-panel-Dva9SiPK.js} +1 -1
- package/dist/gateway/static/root/assets/{channel-recipient-api-DbgydMjl.js → channel-recipient-api-MmLMLDWf.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-D1_gcAHK.js → channels-settings-DNAU7u9o.js} +1 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CIOH7tgn.js +1 -0
- package/dist/gateway/static/root/assets/check-DUBLcKHA.js +1 -0
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
- package/dist/gateway/static/root/assets/cn-JdwAhgNB.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-C3bJC9nt.js → connector-logo-BbjzIs87.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-TwiBp8vY.js +2 -0
- package/dist/gateway/static/root/assets/createLucideIcon-DPHK1VkS.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-wacrnJJ1.js → desktop-pet-CYH5ZSXy.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BrHVvbBw.js → desktop-pet-settings-DQLqGLc0.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-sprite-CFd1jGLJ.js → desktop-pet-sprite-DTqXSpqf.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BPI969w-.js → directory-picker-path-field-ClsiXhmz.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-iw6QXD45.js → dreaming-settings-CjMPPdzg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-rCHyhEr6.js → extension-debug-page-57eizjhB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C4gQsAPt.js → extension-page-CsbSb3u1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DB_3eik7.js → extension-settings-page-DKA9-lyP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Cdt38iF2.js → gateway-config-api-DIPJuzBZ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DM4BgyGw.js → gateway-settings-CDLqAQY7.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-ChRFNjj_.js → gateway-startup-retry-DrfSJtvT.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-BQamcEmF.js → goal-create-dialog-Q3B0E-0s.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-detail-page-DZUQ0Lf1.js → goal-detail-page-C5VAK04G.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-config-api-RvljeEm6.js → goals-config-api-lGC10UkU.js} +1 -1
- package/dist/gateway/static/root/assets/{goals-page-BtxVD27C.js → goals-page-BJb-5IYw.js} +2 -2
- package/dist/gateway/static/root/assets/{goals-settings-DMGV4S4L.js → goals-settings-BWq0pdrA.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-B8r5EXc5.js → heartbeat-settings-D4o8BJVv.js} +1 -1
- package/dist/gateway/static/root/assets/index-CkUHH170.css +1 -0
- package/dist/gateway/static/root/assets/index-vq_cJZJC.js +199 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-1-LYibQ4.js → keyboard-shortcuts-settings-6T2QYehS.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-euH17Kvb.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CC4vtUUI.js → local-apps-page-DCjg2K9f.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CPbGB_6l.js → locale-store-Dar-xqQr.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Bn_taxBV.js → logs-page-CyYCBqym.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-CprEIf8A.js → markdown-split-rt1XO43g.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BXt_Sj2O.js → media-plugins-Bwo8CJuh.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CxySDn9d.js +5 -0
- package/dist/gateway/static/root/assets/{models-hub-panel-DJReXRP9.js → models-hub-panel-DObxxjc9.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-Wf5-eyyM.js → notes-page-Dp-pkX7d.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-workbench-BbdjzYzs.js → notes-workbench-CCb4RXcZ.js} +2 -2
- package/dist/gateway/static/root/assets/{page-tabs-dtpK_4Fs.js → page-tabs-CzZ4iKOb.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DijtEVxG.js → preview-open-alternatives-3E_Qa-58.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-BTRT9kCS.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-B2T48Sbt.js +1 -0
- package/dist/gateway/static/root/assets/{project-detail-page-BwG8SOzI.js → project-detail-page-BvEcriRC.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-nUlyUtxh.js → projects-page-B_e79MRJ.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-rf7bjije.js → remote-access-hub-DGcqnYfR.js} +1 -1
- package/dist/gateway/static/root/assets/{save-bar-controls-qhDisdqY.js → save-bar-controls-CkeKasGm.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-AhJ50NoT.js → schedule-field-TkqUL3wm.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-AuJg2CXU.js → schema-form-DC-iU5IG.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CSoHUe38.js → sessions-page-DQZhrDJ8.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BkdeN99Y.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-D5ganr_X.js → settings-collapsible-section-Dpqth3oA.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-Db3cKRsg.js → settings-form-section-CNqF6IwY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-D05YKT2x.js → settings-loading-skeleton-DkvwitK_.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-Cv_Cu4I5.js → settings-page-layout-DWvNgISx.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DYfXmfTx.js → settings-page-qPG7I2zd.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-wBWOFpvw.js → setup-status-panel-lwRAh9aw.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CYkZVuse.js → share-preview-page-DGpSPW-n.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BAMma1-P.js → shares-settings-BGj9IVUr.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B2UBAs5U.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Ca2RA29R.js → skills-page-DdjzFZ8I.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C1Ng5bXh.js → system-settings-panel-8TxxSbUw.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-LMHIDR9n.js → theme-store-B5FzMWOx.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-Ch2Bdm_5.js → typed-models-lib-DEGtSA5h.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CZnaMOeL.js → use-channel-catalog-BDU6FneG.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-CTumZa0y.js → user-context-page-BTTZpAGV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DdlMxeqO.js → voice-api-key-field-DuDQd-WU.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BUVkVCsW.js +1 -0
- package/dist/gateway/static/root/assets/{work-item-detail-page--wxLw1p_.js → work-item-detail-page-DeEPPu4n.js} +1 -1
- package/dist/gateway/static/root/assets/work-page-DQNUyTUq.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BFk8TvTw.js → workflow-run-setup-panel-Cwi8Pz7n.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CVVJd4gy.js → workflows-page-BIy4wrzO.js} +3 -3
- package/dist/gateway/static/root/index.html +12 -10
- package/dist/package.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/sse.d.ts +2 -0
- package/dist/src/gateway/hono/sse.js +10 -3
- package/dist/src/gateway/run-loop.js +17 -7
- package/dist/src/gateway/server.d.ts +1 -0
- package/dist/src/gateway/server.js +9 -0
- package/dist/src/local-apps/preview-runtime-bridge.d.ts +1 -1
- package/dist/src/local-apps/preview-runtime-bridge.js +14 -11
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/activity-store-3Cso_2qm.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Cqfqv59m.js +0 -1
- package/dist/gateway/static/root/assets/check-BODqo66o.js +0 -1
- package/dist/gateway/static/root/assets/circle-alert-RzVebuX2.js +0 -1
- package/dist/gateway/static/root/assets/cn-BQ_8x0bT.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CaLBi6Na.js +0 -2
- package/dist/gateway/static/root/assets/index-CHKe7nwC.js +0 -197
- package/dist/gateway/static/root/assets/index-CXhfUIjh.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CTTfyFe3.js +0 -2
- package/dist/gateway/static/root/assets/messages-DDsiqdJS.js +0 -5
- package/dist/gateway/static/root/assets/settings-advanced-gate-Db976IEa.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-TWxFFWxM.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CcfZhdBi.js +0 -1
- package/dist/gateway/static/root/assets/work-page-DyS0XBpV.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Jr as e}from"./index-CHKe7nwC.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-CPbGB_6l.js";import{Kr as r}from"./index-CHKe7nwC.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,t as n}from"./vendor-react-BOUWij0V.js";import{d as r,l as i}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as a}from"./check-BODqo66o.js";import{t as o}from"./messages-DDsiqdJS.js";import{n as ee}from"./locale-store-CPbGB_6l.js";import{Ao as s,At as c,Co as te,Cs as ne,Do as l,Eo as re,Fo as u,Io as d,Kc as f,Lo as p,Mo as m,No as ie,Oo as ae,Pl as h,Po as oe,Pt as se,So as ce,Ss as g,Tl as _,Ts as v,Xa as y,au as b,jo as le,kl as ue,nc as x,ql as de,su as fe,wo as pe,xl as me,xo as S}from"./index-CHKe7nwC.js";var C=e(t(),1),w=n(),T=[`folder_structure`,`recent_progress`,`next_steps`];function E(e){return e instanceof Error?e.message:String(e)}function D(){let e=ee(e=>e.language),t=o(e).onboarding.workDiscovery,n=o(e).chat.workingDirectory,D=i(),[he]=r(),O=he.get(`new`)===`1`,[k,A]=(0,C.useState)(`loading`),[j,M]=(0,C.useState)(null),[N,P]=(0,C.useState)(null),[F,I]=(0,C.useState)(!1),[L,R]=(0,C.useState)(null),[ge,z]=(0,C.useState)(!1),[B,V]=(0,C.useState)(``),[H,_e]=(0,C.useState)(!1),[U,W]=(0,C.useState)(()=>new Set),[G,ve]=(0,C.useState)(!1),K=(0,C.useCallback)(e=>{S.getState().updateDirectoryRun(e),P(e),e.status===`completed`?(W(new Set(e.result?.profileCandidates?.filter(e=>e.status===`pending`).map(e=>e.id)??[])),A(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`)):e.status===`failed`||e.status===`canceled`?A(`error`):A(`running`)},[]),ye=async()=>{I(!0),R(null);try{let e=await ie();K(e),S.getState().scanPersonalContext(e.id)}catch(e){R(E(e))}finally{I(!1)}},q=se({onPicked:(0,C.useCallback)(async e=>{I(!0),R(null);try{M(await s(e)),A(`consent`)}catch(e){R(E(e)),A(`intro`)}finally{I(!1)}},[])});(0,C.useEffect)(()=>{let e=!1;return re().then(async({enabled:t,state:n})=>{if(!e){if(!t){D(`/chat`,{replace:!0});return}if(!O&&n.activeRunId)try{let t=await l(n.activeRunId);e||K(t);return}catch{}e||A(`intro`)}}).catch(t=>{e||(R(E(t)),A(`intro`))}),()=>{e=!0}},[K,D,O]),(0,C.useEffect)(()=>{if(!N||k!==`running`)return;let e=!1,t=async()=>{try{let t=await l(N.id);e||K(t)}catch{}},n=window.setInterval(()=>void t(),1200),r=e=>{let n=e.detail;(!n?.runId||n.runId===N.id)&&t()};for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.addEventListener(e,r);return()=>{e=!0,window.clearInterval(n);for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.removeEventListener(e,r)}},[K,k,N]);let J=async()=>{I(!0);try{await pe()}finally{D(`/chat`,{replace:!0})}},be=async()=>{if(j){I(!0),R(null);try{await ae(j.canonicalRootPath);let e=await oe(j.canonicalRootPath);K(e),S.getState().scanPersonalContext(e.id)}catch(e){R(E(e)),A(`consent`)}finally{I(!1)}}},Y=(e,t)=>{let n=t?`?draft=${encodeURIComponent(t)}`:``;D(`/chat/${encodeURIComponent(e)}${n}`)},X=async(t,n)=>{if(!N)return;await m(N.id,t.id).catch(()=>{});let r=n?`${e===`zh`?`先帮我评估这个方向,不要修改文件:`:`First assess this direction without changing files:`}\n\n${t.actionPrompt}`:t.actionPrompt;Y(N.sessionKey,r)},xe=async()=>{if(N){I(!0),R(null);try{let e=N.result?.profileCandidates??[],t=e.length>0?await d(N.id,e.map(e=>({id:e.id,status:U.has(e.id)?`accepted`:`rejected`}))):N;await Promise.all((t.result?.workThreads??[]).filter(e=>e.userStatus===`unreviewed`).map(e=>p(e.id,{decision:`confirmed`}))),P(await u(t.id,`confirmed`)),A(`recommendation`)}catch(e){R(E(e))}finally{I(!1)}}},Z=async e=>{if(!(!N||!B.trim())){I(!0),R(null);try{let t=N.result?.workThreads?.find(e=>e.horizon===`current`)??N.result?.workThreads?.[0];t&&await p(t.id,{decision:`corrected`,correctedSummary:B.trim()});let n=await u(N.id,e,B.trim());P(n),Y(n.sessionKey,B.trim())}catch(e){R(E(e)),I(!1)}}},Se=async()=>{if(N){I(!0);try{Y((await u(N.id,`dismissed`)).sessionKey)}catch(e){R(E(e)),I(!1)}}},Ce=async()=>{let e=N?.result?.workThreads?.find(e=>e.horizon===`current`)??N?.result?.workThreads?.[0];if(e){I(!0),R(null);try{await ce(e.id),ve(!0)}catch(e){R(E(e))}finally{I(!1)}}},Q=N?.result?.suggestions.find(e=>e.id===N.result?.primarySuggestionId)??N?.result?.suggestions[0],$=N?.result?.suggestions.filter(e=>e.id!==Q?.id)??[];return(0,w.jsxs)(`div`,{className:`flex min-h-full flex-1 flex-col bg-surface-base`,children:[(0,w.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-5 py-10 sm:px-8 sm:py-16`,children:[(0,w.jsx)(`div`,{className:`mb-10 flex items-center justify-center`,children:(0,w.jsx)(ne,{className:`size-11`})}),k===`loading`?(0,w.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,w.jsx)(y,{className:`mx-auto h-8 w-64`}),(0,w.jsx)(y,{className:`mx-auto h-4 w-full max-w-lg`}),(0,w.jsx)(y,{className:`mx-auto size-4/5 max-w-md`}),(0,w.jsx)(y,{className:`mt-8 h-12 w-full rounded-xl`})]}):null,k===`intro`?(0,w.jsxs)(`section`,{className:`flex flex-1 flex-col text-center`,"aria-labelledby":`work-discovery-title`,children:[(0,w.jsxs)(`div`,{className:`mx-auto max-w-[36rem]`,children:[(0,w.jsx)(`h1`,{id:`work-discovery-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:t.title}),(0,w.jsx)(`p`,{className:`mx-auto mt-3 max-w-[34rem] text-[0.95rem] leading-7 text-fg-muted`,children:t.subtitle})]}),(0,w.jsxs)(`div`,{className:`mx-auto mt-9 w-full max-w-md`,children:[(0,w.jsxs)(g,{type:`button`,className:`h-12 w-full gap-2 bg-accent text-white hover:bg-accent-hover`,onClick:()=>void ye(),disabled:F||q.picking,children:[F?(0,w.jsx)(f,{className:`size-4 animate-spin`}):(0,w.jsx)(x,{className:`size-4`}),t.quickScan]}),(0,w.jsxs)(g,{type:`button`,variant:`secondary`,className:`mt-3 h-11 w-full gap-2`,onClick:q.pick,disabled:F||q.picking,children:[q.picking?(0,w.jsx)(f,{className:`size-4 animate-spin`}):(0,w.jsx)(_,{className:`size-4`}),t.chooseFolderManually]}),(0,w.jsxs)(`div`,{className:`mt-4 flex items-start justify-center gap-2 text-xs leading-5 text-fg-muted`,children:[(0,w.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,w.jsx)(`span`,{children:t.quickScanNote})]}),L?(0,w.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:L}):null]}),(0,w.jsx)(`button`,{type:`button`,className:`mx-auto mt-auto pt-10 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void J(),disabled:F,children:t.skip})]}):null,k===`consent`&&j?(0,w.jsxs)(`section`,{"aria-labelledby":`work-discovery-consent-title`,children:[(0,w.jsxs)(`div`,{className:`text-center`,children:[(0,w.jsx)(`h1`,{id:`work-discovery-consent-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:t.selectedTitle}),(0,w.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:t.selectedSubtitle})]}),(0,w.jsxs)(`div`,{className:`mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-edge-subtle px-4 py-3.5`,children:[(0,w.jsx)(_,{className:`size-5 shrink-0 text-accent-fg`}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:j.displayName}),(0,w.jsx)(`p`,{className:`truncate font-mono text-xs text-fg-muted`,children:j.canonicalRootPath})]}),(0,w.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:j.projectKind===`coding`?t.codingProject:j.projectKind===`general`?t.generalProject:t.unknownProject})]}),(0,w.jsxs)(`div`,{className:`grid gap-3 border-b border-edge-subtle bg-surface-base/60 p-4 sm:grid-cols-2`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:t.localFingerprint}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:j.fingerprint.branch?t.branchValue.replace(`{{branch}}`,j.fingerprint.branch):t.noGitBranch})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:t.recentActivity}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:t.changedFiles.replace(`{{count}}`,String(j.fingerprint.changedFileCount))})]}),j.fingerprint.recentAreas.length>0?(0,w.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:t.recentAreas}),(0,w.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:j.fingerprint.recentAreas.map(e=>(0,w.jsx)(`code`,{className:`rounded-md bg-surface-muted px-2 py-1 text-xs text-fg`,children:e},e))})]}):null]}),(0,w.jsxs)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:[(0,w.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,w.jsx)(ue,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.willRead}),(0,w.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.willReadValue})]})]}),(0,w.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,w.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.willIgnore}),(0,w.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:t.willIgnoreValue})]})]}),(0,w.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,w.jsx)(x,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,w.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:j.remoteModel?t.providerDisclosure.replace(`{{provider}}`,j.provider):t.localDisclosure})]})]})]}),L?(0,w.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:L}):null,(0,w.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,w.jsxs)(g,{type:`button`,className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,disabled:F,onClick:()=>void be(),children:[F?(0,w.jsx)(f,{className:`mr-2 size-4 animate-spin`}):null,t.startAnalysis]}),(0,w.jsx)(g,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:F,onClick:q.pick,children:t.changeFolder})]}),(0,w.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void J(),children:t.skip})]}):null,k===`running`&&N?(0,w.jsxs)(`section`,{"aria-labelledby":`work-discovery-running-title`,"aria-live":`polite`,children:[(0,w.jsxs)(`div`,{className:`text-center`,children:[(0,w.jsx)(`h1`,{id:`work-discovery-running-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:t.analyzingTitle}),(0,w.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:t.analyzingSubtitle})]}),(0,w.jsx)(`div`,{className:`mt-9 rounded-xl border border-edge bg-surface-panel px-5 py-2`,children:T.map((e,n)=>{let r=Math.max(0,T.indexOf(N.stage??`folder_structure`)),i=n<r,o=n===r;return(0,w.jsxs)(`div`,{className:`flex items-center gap-4 border-b border-edge-subtle py-4 last:border-b-0`,children:[(0,w.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full ${i?`bg-accent text-white`:o?`bg-accent-soft text-accent-fg`:`bg-surface-muted text-fg-subtle`}`,children:i?(0,w.jsx)(a,{className:`size-4`}):o?(0,w.jsx)(f,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,w.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`})}),(0,w.jsx)(`span`,{className:o||i?`text-sm font-medium text-fg`:`text-sm text-fg-muted`,children:t.stages[e]})]},e)})}),(0,w.jsx)(`p`,{className:`mt-4 truncate text-center font-mono text-xs text-fg-muted`,children:N.rootPath}),(0,w.jsx)(`button`,{type:`button`,className:`mx-auto mt-7 block text-sm text-fg-muted hover:text-danger hover:underline`,onClick:()=>void te(N.id).then(K),children:t.cancelAnalysis})]}):null,k===`recognition`&&N?.result?(0,w.jsxs)(`section`,{"aria-labelledby":`work-discovery-recognition-title`,children:[(0,w.jsxs)(`div`,{className:`text-center`,children:[(0,w.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:t.recognitionEyebrow}),(0,w.jsx)(`h1`,{id:`work-discovery-recognition-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:N.result.lowConfidence?t.lowConfidenceTitle:t.recognitionTitle})]}),(0,w.jsxs)(`div`,{className:`mt-7 rounded-2xl border border-accent/25 bg-gradient-to-br from-accent-soft/45 via-surface-panel to-surface-panel p-5 sm:p-6`,children:[(0,w.jsx)(`p`,{className:`text-base font-medium leading-7 text-fg`,children:N.result.projectSummary}),(0,w.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-fg-muted`,children:N.result.currentState}),!N.result.lowConfidence&&Q?.evidence.length?(0,w.jsx)(`ul`,{className:`mt-5 space-y-2 border-t border-edge-subtle pt-4`,children:Q.evidence.slice(0,3).map((e,t)=>(0,w.jsxs)(`li`,{className:`flex gap-2 text-xs leading-5 text-fg-muted`,children:[(0,w.jsx)(me,{className:`mt-0.5 size-3.5 shrink-0 text-accent-fg`}),(0,w.jsxs)(`span`,{children:[e.path?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`code`,{className:`font-mono text-fg`,children:e.path}),`: `]}):null,e.observation]})]},`${Q.id}-recognition-${t}`))}):null]}),N.result.workThreads?.length?(0,w.jsxs)(`div`,{className:`mt-5 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.workThreadsTitle}),(0,w.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.workThreadsSubtitle}),(0,w.jsx)(`div`,{className:`mt-3 divide-y divide-edge-subtle`,children:N.result.workThreads.map(e=>(0,w.jsxs)(`div`,{className:`py-3 first:pt-0 last:pb-0`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[0.7rem] font-medium text-accent-fg`,children:e.horizon===`current`?t.workThreadCurrent:e.horizon===`ongoing`?t.workThreadOngoing:t.workThreadLongTerm}),(0,w.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.title})]}),(0,w.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-fg-muted`,children:e.summary})]},e.id))})]}):null,N.result.profileCandidates?.length?(0,w.jsxs)(`div`,{className:`mt-5 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.profileCandidatesTitle}),(0,w.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:t.profileCandidatesSubtitle}),(0,w.jsx)(`div`,{className:`mt-3 space-y-2`,children:N.result.profileCandidates.map(e=>(0,w.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg px-2 py-2 hover:bg-surface-muted`,children:[(0,w.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 size-4 rounded border-edge accent-accent`,checked:U.has(e.id),onChange:()=>W(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}),(0,w.jsx)(`span`,{className:`text-sm leading-5 text-fg`,children:e.statement})]},e.id))})]}):null,N.result.lowConfidence?(0,w.jsxs)(`div`,{className:`mt-5`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium leading-6 text-fg`,children:N.result.contextQuestion}),(0,w.jsx)(`textarea`,{value:B,onChange:e=>V(e.target.value),placeholder:t.correctionPlaceholder,className:`mt-3 min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,w.jsx)(g,{className:`mt-3 w-full bg-accent text-white hover:bg-accent-hover`,disabled:F||!B.trim(),onClick:()=>void Z(`different_goal`),children:t.continueWithCorrection})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,w.jsxs)(g,{className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,disabled:F,onClick:()=>void xe(),children:[F?(0,w.jsx)(f,{className:`size-4 animate-spin`}):(0,w.jsx)(a,{className:`size-4`}),t.confirmUnderstanding]}),(0,w.jsx)(g,{variant:`secondary`,className:`h-11 flex-1`,disabled:F,onClick:()=>z(e=>!e),children:t.notQuiteRight})]}),ge?(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,w.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`work-discovery-correction`,children:t.correctionLabel}),(0,w.jsx)(`textarea`,{id:`work-discovery-correction`,value:B,onChange:e=>V(e.target.value),placeholder:t.correctionPlaceholder,className:`mt-2 min-h-24 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,w.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2`,children:[(0,w.jsx)(g,{variant:`ghost`,disabled:F||!B.trim(),onClick:()=>void Z(`different_goal`),children:t.differentGoal}),(0,w.jsx)(g,{variant:`primary`,disabled:F||!B.trim(),onClick:()=>void Z(`corrected`),children:t.useCorrection})]})]}):null]}),L?(0,w.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:L}):null,(0,w.jsx)(`button`,{type:`button`,disabled:F,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline disabled:opacity-60`,onClick:()=>void Se(),children:t.openConversation})]}):null,k===`recommendation`&&N?.result&&Q?(0,w.jsxs)(`section`,{"aria-labelledby":`work-discovery-recommendation-title`,children:[(0,w.jsxs)(`div`,{className:`text-center`,children:[(0,w.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:t.understandingConfirmed}),(0,w.jsx)(`h1`,{id:`work-discovery-recommendation-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:t.primaryRecommendationTitle})]}),(0,w.jsx)(`article`,{className:`mt-7 rounded-2xl border border-accent/30 bg-surface-panel p-5 sm:p-6`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,w.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,w.jsx)(b,{className:`size-5`})}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:Q.title}),(0,w.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:Q.rationale}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs`,children:[(0,w.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-fg-muted`,children:[(0,w.jsx)(de,{className:`size-3.5`}),t.estimatedMinutes.replace(`{{count}}`,String(Q.estimatedMinutes))]}),(0,w.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2.5 py-1 text-fg-muted`,children:(e=>e===`command`?t.riskCommand:e===`file_write`?t.riskFileWrite:t.riskAnalysis)(Q.risk)})]}),(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base px-4 py-3`,children:[(0,w.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:t.expectedOutcome}),(0,w.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg`,children:Q.expectedOutcome})]}),(0,w.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,w.jsx)(g,{className:`h-10 bg-accent px-4 text-white hover:bg-accent-hover`,onClick:()=>void X(Q,!1),children:t.startRecommendedAction}),(0,w.jsx)(g,{className:`h-10 px-4`,variant:`secondary`,onClick:()=>void X(Q,!0),children:t.explainFirst})]})]})]})}),N.result.workThreads?.length?(0,w.jsx)(`div`,{className:`mt-5 rounded-xl border border-edge bg-surface-panel p-4`,children:(0,w.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,w.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:G?(0,w.jsx)(a,{className:`size-4`}):(0,w.jsx)(h,{className:`size-4`})}),(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:G?t.focusTrialActive:t.focusTrialTitle}),(0,w.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:G?t.focusTrialActiveDescription:t.focusTrialDescription}),G?null:(0,w.jsxs)(g,{className:`mt-3 h-9`,variant:`secondary`,disabled:F,onClick:()=>void Ce(),children:[F?(0,w.jsx)(f,{className:`size-4 animate-spin`}):(0,w.jsx)(h,{className:`size-4`}),t.activateFocusTrial]})]})]})}):null,$.length>0?(0,w.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,w.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between py-2 text-sm font-medium text-fg-muted hover:text-fg`,onClick:()=>_e(e=>!e),children:[t.otherDirections,(0,w.jsx)(fe,{className:`size-4 transition-transform ${H?`rotate-180`:``}`})]}),H?(0,w.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle rounded-xl border border-edge bg-surface-panel px-4`,children:$.map(e=>(0,w.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-3 py-4 text-left`,onClick:()=>void X(e,!0),children:[(0,w.jsx)(b,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),(0,w.jsxs)(`span`,{children:[(0,w.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title}),(0,w.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e.expectedOutcome})]})]},e.id))}):null]}):null,(0,w.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-3`,children:[(0,w.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Y(N.sessionKey),children:t.doSomethingElse}),(0,w.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>{z(!0),A(`recognition`)},children:t.correctUnderstanding})]})]}):null,k===`error`&&N?(0,w.jsxs)(`section`,{className:`text-center`,"aria-labelledby":`work-discovery-error-title`,children:[(0,w.jsx)(`div`,{className:`mx-auto flex size-11 items-center justify-center rounded-xl bg-danger-soft text-danger`,children:(0,w.jsx)(v,{className:`size-5`})}),(0,w.jsx)(`h1`,{id:`work-discovery-error-title`,className:`mt-5 text-2xl font-semibold tracking-tight text-fg`,children:t.errorTitle}),(0,w.jsx)(`p`,{className:`mx-auto mt-3 max-w-lg text-sm leading-6 text-fg-muted`,children:N.errorMessage}),(0,w.jsxs)(`div`,{className:`mx-auto mt-7 flex max-w-md flex-col gap-3 sm:flex-row-reverse`,children:[(0,w.jsx)(g,{className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,onClick:()=>void le(N.id).then(K),children:t.retry}),(0,w.jsx)(g,{variant:`secondary`,className:`h-11 flex-1`,onClick:()=>{P(null),M(null),A(`intro`)},children:t.chooseDifferent})]}),(0,w.jsx)(`button`,{type:`button`,className:`mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Y(N.sessionKey),children:t.openConversation})]}):null]}),q.hasNativePicker?null:(0,w.jsx)(c,{open:q.modalOpen,onOpenChange:q.setModalOpen,initialAbsolutePath:j?.canonicalRootPath,onConfirm:q.confirmPick,wd:n})]})}export{D as WorkDiscoveryPage};
|
|
@@ -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-DDsiqdJS.js";import{n as u,r as d,s as f}from"./locale-store-CPbGB_6l.js";import{n as p}from"./activity-store-3Cso_2qm.js";import{Bo as m,Du as h,Ea as g,El as _,Ho as v,Kc as y,Ls as b,Pa as x,Pl as S,Qs as C,R as w,Ro as T,Rs as E,Sc as D,So as O,Ss as k,To as A,Ts as ee,Uc as j,Uo as M,Vo as te,Wo as ne,Xa as N,au as P,bo as re,cc as ie,cu as ae,et as F,ko as oe,ll as I,ql as se,ru as L,xu as ce,zo as le}from"./index-CHKe7nwC.js";var R=n(),z=e(t(),1),B=r(),V=3,H={info:{Icon:I,className:`text-accent-fg bg-accent-soft`},success:{Icon:L,className:`text-success bg-success-soft`},warning:{Icon:b,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(ue),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)(y,{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 _;t[10]===n.title?_=t[11]:(_=(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]=_);let v;t[12]!==s.activityUnread||t[13]!==n.read?(v=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]=v):v=t[14];let b;t[15]!==_||t[16]!==v?(b=(0,B.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[_,v]}),t[15]=_,t[16]=v,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)(P,{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 O;t[37]!==D||t[38]!==b||t[39]!==x?(O=(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]=O):O=t[40];let k;t[41]!==n.id||t[42]!==c?(k=()=>c(n.id),t[41]=n.id,t[42]=c,t[43]=k):k=t[43];let A;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,B.jsx)(ee,{className:`size-3.5`,"aria-hidden":!0}),t[44]=A):A=t[44];let j;t[45]!==s.activityRemove||t[46]!==k?(j=(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:k,children:A}),t[45]=s.activityRemove,t[46]=k,t[47]=j):j=t[47];let M;return t[48]!==O||t[49]!==j||t[50]!==g?(M=(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,O,j]}),t[48]=O,t[49]=j,t[50]=g,t[51]=M):M=t[51],M}function G(e){return e.remove}function ue(e){return e.language}function de(){let e=(0,R.c)(8),t=l(u(fe)).projectsPage.workHome,n=p($),r=p(Q),i=p(Z),[a,o]=(0,z.useState)(!1),c;e[0]===n?c=e[1]:(c=n.filter(X),e[0]=n,e[1]=c);let d=c.length,f;e[2]===n?f=e[3]:(f=n.filter(Y),e[2]=n,e[3]=f);let m=f.length,g;e[4]!==a||e[5]!==n?(g=a?n:n.slice(0,V),e[4]=a,e[5]=n,e[6]=g):g=e[6];let _=g,v;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,B.jsx)(h,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[7]=v):v=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:[v,(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)(y,{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)(k,{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(J)?(0,B.jsxs)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,B.jsx)(E,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,B.jsxs)(`div`,{className:`mt-3 px-1`,children:[_.map(q),n.length>V?(0,B.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>o(K),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)(se,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,B.jsx)(`p`,{children:t.activityEmpty})]})]})}function K(e){return!e}function q(e){return(0,B.jsx)(W,{item:e},e.id)}function J(e){return e.status===`done`}function Y(e){return!e.read}function X(e){return e.status===`running`}function Z(e){return e.clearFinished}function Q(e){return e.markAllRead}function $(e){return e.items}function fe(e){return e.language}function pe(e){return f(d(`/api/home${e?`?locale=${encodeURIComponent(e)}`:``}`))}function me(e,t){return f(d(`/api/proactive/insights/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({status:t})})}function he(e){return f(d(`/api/proactive/insights/${encodeURIComponent(e)}/approve`),{method:`POST`})}function ge(e,t){return f(d(`/api/focuses/${encodeURIComponent(e)}/calendar/${encodeURIComponent(t)}/prepare`),{method:`POST`})}function _e(e,t){return f(d(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...e,decision:t})})}function ve(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function ye(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:F(n)}function be(){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)(N,{className:`h-20 rounded-2xl`}),(0,B.jsx)(N,{className:`h-72 rounded-2xl`}),(0,B.jsx)(N,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function xe(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 Se(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)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,B.jsx)(k,{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 Ce(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)(_,{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)(ce,{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=ye(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 g;return t[14]!==o||t[15]!==h||t[16]!==u||t[17]!==f?(g=(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]=g):g=t[18],g}function we(){let e=u(e=>e.language),t=l(e),n=t.projectsPage,r=i(),o=re(e=>e.setPageHeader),s=re(e=>e.clearPageHeader),[d,f]=(0,z.useState)(null),[p,h]=(0,z.useState)([]),[_,y]=(0,z.useState)([]),[b,E]=(0,z.useState)(!0),[N,P]=(0,z.useState)(null),[F,I]=(0,z.useState)(null),[L,ce]=(0,z.useState)(``),[R,V]=(0,z.useState)(!1),[H,U]=(0,z.useState)(``),[W,G]=(0,z.useState)(!1),[ue,K]=(0,z.useState)(null),[q,J]=(0,z.useState)(null),[Y,X]=(0,z.useState)(null),Z=(0,z.useCallback)(async()=>{E(!0),P(null);try{let[t,n,r]=await Promise.all([pe(e),x({limit:100,sortBy:`updatedAt`,sortOrder:`desc`}),A()]);f(t),h(n.items),y(r)}catch(e){P(e instanceof Error?e.message:String(e))}finally{E(!1)}},[e]);(0,z.useEffect)(()=>{Z()},[Z]);let Q=(0,z.useMemo)(()=>{let e=L.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,L]),$=(0,z.useMemo)(()=>d?.decisions??[],[d]),fe=(0,z.useMemo)(()=>d?.work.current.filter(e=>e.status!==`needs_input`&&e.status!==`in_review`&&e.status!==`blocked`).slice(0,10)??[],[d]),we=(0,z.useCallback)(async t=>{t.preventDefault();let n=H.trim();if(!(!n||W)){G(!0),I(null);try{let t=await g({outcome:n,uiLocale:e});U(``),V(!1),r(`/projects/${encodeURIComponent(t.project.id)}`)}catch(e){I(e instanceof Error?e.message:String(e))}finally{G(!1)}}},[W,e,r,H]),Te=(0,z.useMemo)(()=>(0,B.jsxs)(k,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>V(!0),children:[(0,B.jsx)(D,{className:`size-4`,"aria-hidden":!0}),n.workHome.newWork]}),[n.workHome.newWork]),Ee=(0,z.useCallback)(async(e,t)=>{if(e.response){K(e.id),P(null);try{await _e(e.response,t),await Z()}catch(e){P(e instanceof Error?e.message:String(e))}finally{K(null)}}},[Z]),De=(0,z.useCallback)(async(e,t)=>{J(e.id),P(null);try{let n=e.watches.find(e=>e.kind===t&&e.status===`active`);n?await oe(e.id,n.id):await O(e.id,t),y(await A())}catch(e){P(e instanceof Error?e.message:String(e))}finally{J(null)}},[]),Oe=(0,z.useCallback)(async(e,t)=>{X(e),P(null);try{t===`approved`?await he(e):await me(e,`dismissed`),f(t=>t&&{...t,proactiveInsights:t.proactiveInsights.filter(t=>t.id!==e)})}catch(e){P(e instanceof Error?e.message:String(e))}finally{X(null)}},[]),ke=(0,z.useCallback)(async(e,t)=>{J(e),P(null);try{await ge(e,t),y(await A())}catch(e){P(e instanceof Error?e.message:String(e))}finally{J(null)}},[]);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:Te}),()=>s()),[s,Te,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)(T,{open:R,onOpenChange:e=>{!e&&W||(V(e),e||I(null))},children:(0,B.jsxs)(M,{children:[(0,B.jsx)(v,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,B.jsxs)(m,{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,B.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(ne,{className:`text-base font-semibold text-fg`,children:n.workHome.delegateTitle}),(0,B.jsx)(te,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:n.workHome.delegateDescription})]}),(0,B.jsx)(le,{asChild:!0,children:(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,disabled:W,children:(0,B.jsx)(ee,{className:`size-4`,"aria-hidden":!0})})})]}),(0,B.jsxs)(`form`,{onSubmit:we,className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,B.jsx)(`label`,{htmlFor:`new-work-outcome`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:n.workHome.outcomeLabel}),(0,B.jsx)(`textarea`,{id:`new-work-outcome`,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:H,onChange:e=>U(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},placeholder:n.workHome.outcomePlaceholder,maxLength:12e3,disabled:W,autoFocus:!0}),(0,B.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,B.jsx)(`span`,{children:n.workHome.submitShortcut}),(0,B.jsxs)(`span`,{className:`tabular-nums`,children:[H.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),F?(0,B.jsx)(`p`,{className:`mt-3 rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:F}):null]}),(0,B.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 border-t border-edge px-5 py-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:n.workHome.autoSetupHint}),(0,B.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2`,children:[(0,B.jsx)(le,{asChild:!0,children:(0,B.jsx)(k,{type:`button`,variant:`ghost`,disabled:W,children:n.cancel})}),(0,B.jsxs)(k,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:W||!H.trim(),children:[(0,B.jsx)(C,{className:`size-4`,"aria-hidden":!0}),W?n.workHome.delegating:n.workHome.delegate]})]})]})]})]})]})}),N?(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:N}),(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void Z(),children:n.workHome.retry})]}):null,b?(0,B.jsx)(be,{}):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?ve(n.workHome.todaySummary,{attention:d.decisions.length,moving:d.briefing.progress.movingCount}):ve(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.proactiveInsights.length>0?(0,B.jsxs)(`section`,{className:`rounded-2xl border border-accent/20 bg-accent-soft/20 p-5`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(C,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.insightsTitle})]}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.insightsHint}),(0,B.jsx)(`div`,{className:`mt-4 space-y-3`,children:d.proactiveInsights.map(e=>(0,B.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,B.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,B.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary}),(0,B.jsxs)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,B.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.whyItMatters,`: `]}),e.whyItMatters]}),(0,B.jsxs)(`p`,{className:`mt-2 rounded-lg bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:[(0,B.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.suggestedNext,`: `]}),e.nextAction]}),(0,B.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.evidence.map((e,t)=>(0,B.jsxs)(`span`,{className:`rounded-full border border-edge-subtle px-2 py-1 text-[11px] text-fg-subtle`,children:[e.label,e.source?` · ${e.source}`:``]},`${e.label}-${t}`))}),(0,B.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-edge-subtle pt-3`,children:[(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:Y===e.id,onClick:()=>void Oe(e.id,`dismissed`),children:n.workHome.dismissInsight}),(0,B.jsx)(k,{type:`button`,variant:`primary`,className:`h-8 px-2 text-xs`,disabled:Y===e.id,onClick:()=>void Oe(e.id,`approved`),children:n.workHome.investigateInsight})]})]},e.id))})]}):null,d.calendarSignals.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)(ae,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.relatedCalendarTitle})]}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.relatedCalendarHint}),(0,B.jsx)(`div`,{className:`mt-4 divide-y divide-edge-subtle`,children:d.calendarSignals.map(e=>(0,B.jsxs)(`article`,{className:`flex flex-col gap-3 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,B.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.focusTitle,` · `,ye(e.startsAt,``)]})]}),(0,B.jsx)(k,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-2 text-xs`,disabled:q===e.focusId,onClick:()=>void ke(e.focusId,e.id),children:q===e.focusId?n.workHome.focusWatchUpdating:n.workHome.prepareForEvent})]},e.id))})]}):null,_.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)(S,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,B.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.focusesTitle})]}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.focusesHint}),(0,B.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2`,children:_.slice(0,6).map(e=>{let t=e.watches.some(e=>e.kind===`progress`&&e.status===`active`),r=e.watches.some(e=>e.kind===`intelligence`&&e.status===`active`),i=t||r;return(0,B.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,B.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.summary})]}),(0,B.jsx)(`span`,{className:`mt-0.5 size-2 shrink-0 rounded-full ${i?`bg-success`:`bg-fg-subtle/40`}`,"aria-hidden":!0})]}),e.blockedReason||e.nextAction?(0,B.jsx)(`p`,{className:`mt-3 line-clamp-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.blockedReason||e.nextAction}):null,(0,B.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:i?n.workHome.focusWatchActive:n.workHome.focusWatchInactive}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:q===e.id,onClick:()=>void De(e,`progress`),children:q===e.id?n.workHome.focusWatchUpdating:t?n.workHome.pauseProgressWatch:n.workHome.startFocusWatch}),(0,B.jsx)(k,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:q===e.id,onClick:()=>void De(e,`intelligence`),children:q===e.id?n.workHome.focusWatchUpdating:r?n.workHome.pauseNewsWatch:n.workHome.startNewsWatch})]})]})]},e.id)})})]}):null,d.work.current.length===0&&d.workflowRuns.active.length===0&&d.decisions.length===0&&d.upcomingAutomations.length===0&&_.length===0?(0,B.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,B.jsx)(j,{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)(k,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:n.workHome.startChat}),(0,B.jsx)(k,{type:`button`,variant:`secondary`,onClick:()=>V(!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:[$.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:$.map(e=>(0,B.jsx)(Se,{item:e,kindLabel:n.workHome.decisionKinds[e.kind],reasonLabel:n.workHome.decisionReasons[e.reason],approveLabel:n.workHome.approve,denyLabel:n.workHome.deny,busy:ue===e.id,onRespond:t=>void Ee(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)(se,{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:w(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)),fe.map(e=>(0,B.jsx)(`div`,{className:`py-1`,children:(0,B.jsx)(xe,{item:e,statusLabel:t.projectDetailPage.workItems.statuses[e.status]})},e.id)),d.workflowRuns.active.length===0&&fe.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)(ae,{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:ye(e.nextRunAt,n.never)})]},e.id))})]}):null,(0,B.jsx)(de,{}),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:ve(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)(ie,{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:L,onChange:e=>ce(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:Q.map(e=>(0,B.jsx)(Ce,{project:e,openLabel:n.workHome.openSpace,noDescription:n.noDescription},e.id))}),!b&&Q.length===0?(0,B.jsx)(`p`,{className:`py-8 text-center text-sm text-fg-muted`,children:n.workHome.noSpaces}):null]})]})}export{we as WorkPage};
|