@xopcai/xopc 0.0.159 → 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-CaRK2vIy.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-BeVf03hx.js → agent-avatar-dicebear-9R3szLMc.js} +1 -1
- package/dist/gateway/static/root/assets/agents-_qbUaYbs.js +2 -0
- package/dist/gateway/static/root/assets/{api-BjcBIV2O.js → api-jSTqFMq9.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BG2ulMYw.js → app-management-settings-panel-D81cyE76.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-0Kjenr2T.js → appearance-settings-Ct6bZQCV.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-0sPqD0FK.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-ChiNnH1e.js → archive-plugin-CfD7AZKn.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-pbBlQR-g.js → attachment-load-CP_Gaxt3.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-CTZDOyDy.js → automation-suggestion-card-BGKM_NDZ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BxWBuBsE.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BeZGzpGF.js → binary-plugins-IPr2EVnS.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BnDmhN5Z.js → block-editor-B6aHEGA6.js} +3 -3
- package/dist/gateway/static/root/assets/browser-settings-page-C499b9AH.js +8 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-Ii36j_7v.js → capability-presets-api-CCX9-LjU.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-Cl3dw4yh.js → capability-presets-settings-panel-Dva9SiPK.js} +2 -2
- package/dist/gateway/static/root/assets/{channel-recipient-api-CFqrSi5K.js → channel-recipient-api-MmLMLDWf.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DNAU7u9o.js +1 -0
- 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-CiLxuZ8S.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-CYH5ZSXy.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-DQLqGLc0.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-sprite-DTqXSpqf.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-CC2VL5Mc.js → directory-picker-path-field-ClsiXhmz.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-KY7ZfVsy.js → dreaming-settings-CjMPPdzg.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-C8KBeucs.js → extension-debug-page-57eizjhB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CV-5Kcyk.js → extension-page-CsbSb3u1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DvUtDrAu.js → extension-settings-page-DKA9-lyP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DXfVeJLc.js → gateway-config-api-DIPJuzBZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CDLqAQY7.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-cxQ94qMm.js → gateway-startup-retry-DrfSJtvT.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-Q3B0E-0s.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-C5VAK04G.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-P8VhLqYF.js → goals-config-api-lGC10UkU.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BJb-5IYw.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-DHXyaH_O.js → goals-settings-BWq0pdrA.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CNckP_Dv.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-jXmv1RVX.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-Cs5LKjtc.js → local-apps-page-DCjg2K9f.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-C_M71MK9.js → locale-store-Dar-xqQr.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CyYCBqym.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-BFqeSNte.js → markdown-split-rt1XO43g.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Cc8379gq.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-DObxxjc9.js +2 -0
- package/dist/gateway/static/root/assets/{notes-page-DlGU4ipo.js → notes-page-Dp-pkX7d.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CCb4RXcZ.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-kFOswGlG.js → page-tabs-CzZ4iKOb.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CvjuvABg.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-BvEcriRC.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B_e79MRJ.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DGcqnYfR.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-DwrD7ODx.js → save-bar-controls-CkeKasGm.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Ba4WzTmE.js → schedule-field-TkqUL3wm.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DvydL8eF.js → schema-form-DC-iU5IG.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DQZhrDJ8.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BkdeN99Y.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-LaQqGGej.js → settings-collapsible-section-Dpqth3oA.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-DruI__qO.js → settings-form-section-CNqF6IwY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-UvA-eDhF.js → settings-loading-skeleton-DkvwitK_.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DG-XMIPu.js → settings-page-layout-DWvNgISx.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-5oCGSebm.js → settings-page-qPG7I2zd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-lwRAh9aw.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-FLVeTrRt.js → share-preview-page-DGpSPW-n.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BGj9IVUr.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-B2UBAs5U.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DdjzFZ8I.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CeK93xVi.js → system-settings-panel-8TxxSbUw.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-C8ohIHhw.js → theme-store-B5FzMWOx.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-D1Lr2gG0.js → typed-models-lib-DEGtSA5h.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-BWzou5ar.js → use-channel-catalog-BDU6FneG.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BTTZpAGV.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-DuDQd-WU.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-BUVkVCsW.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-DeEPPu4n.js +1 -0
- package/dist/gateway/static/root/assets/work-page-DQNUyTUq.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Bynqe4kV.js → workflow-run-setup-panel-Cwi8Pz7n.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BIy4wrzO.js +11 -0
- package/dist/gateway/static/root/index.html +12 -10
- package/dist/package.js +1 -1
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.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/chat-stream/mapper.d.ts +1 -0
- package/dist/src/gateway/chat-stream/mapper.js +43 -7
- package/dist/src/gateway/hono/routes/home.js +15 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +451 -0
- 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/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +27 -2
- package/dist/src/local-apps/preview-runtime-bridge.d.ts +1 -1
- package/dist/src/local-apps/preview-runtime-bridge.js +14 -11
- package/dist/src/mobile/notification-service.js +1 -0
- package/dist/src/pets/factory.js +23 -26
- package/dist/src/pets/manifest.d.ts +2 -1
- package/dist/src/pets/manifest.js +15 -8
- package/dist/src/pets/validator.js +8 -3
- package/dist/src/proactive/calendar-signals.d.ts +4 -0
- package/dist/src/proactive/calendar-signals.js +120 -0
- package/dist/src/proactive/focus-service.d.ts +62 -0
- package/dist/src/proactive/focus-service.js +173 -0
- package/dist/src/proactive/index.d.ts +7 -0
- package/dist/src/proactive/index.js +7 -0
- package/dist/src/proactive/insight-repository.d.ts +19 -0
- package/dist/src/proactive/insight-repository.js +106 -0
- package/dist/src/proactive/run-processor.d.ts +19 -0
- package/dist/src/proactive/run-processor.js +125 -0
- package/dist/src/proactive/trial-expiry-reconciler.d.ts +5 -0
- package/dist/src/proactive/trial-expiry-reconciler.js +30 -0
- package/dist/src/proactive/types.d.ts +64 -0
- package/dist/src/proactive/types.js +1 -0
- package/dist/src/proactive/watch-repository.d.ts +28 -0
- package/dist/src/proactive/watch-repository.js +129 -0
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +4 -0
- package/dist/src/storage/sqlite/migrations/047_work_discovery_sources.sql +16 -0
- package/dist/src/storage/sqlite/migrations/048_work_understanding_investigations.sql +40 -0
- package/dist/src/storage/sqlite/migrations/049_work_understanding_threads.sql +52 -0
- package/dist/src/storage/sqlite/migrations/050_work_discovery_source_refreshes.sql +15 -0
- package/dist/src/storage/sqlite/migrations/051_focus_watches.sql +26 -0
- package/dist/src/storage/sqlite/migrations/052_proactive_insights.sql +25 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/work-discovery/analyzer.d.ts +12 -1
- package/dist/src/work-discovery/analyzer.js +126 -7
- package/dist/src/work-discovery/candidate-discovery.d.ts +17 -0
- package/dist/src/work-discovery/candidate-discovery.js +279 -0
- package/dist/src/work-discovery/evaluation.d.ts +11 -0
- package/dist/src/work-discovery/evaluation.js +17 -0
- package/dist/src/work-discovery/governance.d.ts +25 -0
- package/dist/src/work-discovery/governance.js +96 -0
- package/dist/src/work-discovery/incremental-repository.d.ts +13 -0
- package/dist/src/work-discovery/incremental-repository.js +55 -0
- package/dist/src/work-discovery/incremental.d.ts +2 -0
- package/dist/src/work-discovery/incremental.js +7 -0
- package/dist/src/work-discovery/index.d.ts +10 -0
- package/dist/src/work-discovery/index.js +13 -3
- package/dist/src/work-discovery/investigation-repository.d.ts +16 -0
- package/dist/src/work-discovery/investigation-repository.js +122 -0
- package/dist/src/work-discovery/investigator.d.ts +55 -0
- package/dist/src/work-discovery/investigator.js +358 -0
- package/dist/src/work-discovery/probe.d.ts +22 -0
- package/dist/src/work-discovery/probe.js +88 -1
- package/dist/src/work-discovery/service.d.ts +110 -1
- package/dist/src/work-discovery/service.js +578 -8
- package/dist/src/work-discovery/source-repository.d.ts +13 -0
- package/dist/src/work-discovery/source-repository.js +72 -0
- package/dist/src/work-discovery/thread-repository.d.ts +34 -0
- package/dist/src/work-discovery/thread-repository.js +112 -0
- package/dist/src/work-discovery/thread-service.d.ts +8 -0
- package/dist/src/work-discovery/thread-service.js +104 -0
- package/dist/src/work-discovery/types.d.ts +145 -0
- package/package.json +1 -1
- package/skills/creative/hatch-pet/SKILL.md +2 -2
- package/dist/gateway/static/root/assets/activity-store-C-57rvkX.js +0 -1
- package/dist/gateway/static/root/assets/agents-P05C4A-3.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-DANGrBpN.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BXfGL_cm.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-534luV0B.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-M91zFJVi.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-vooEF4lG.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-CV5UulW6.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-Cil2eSpW.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DwsC6l5F.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-sprite-DqZ6fbIj.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BpJ0v56l.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-lMHD-2CX.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-yPmF-G7b.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BHTCKobG.js +0 -2
- package/dist/gateway/static/root/assets/index-BgZhEOkN.css +0 -1
- package/dist/gateway/static/root/assets/index-BuqGh2SW.js +0 -193
- package/dist/gateway/static/root/assets/local-app-workbench-page-zpp_wciE.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-B4CRYqYR.js +0 -7
- package/dist/gateway/static/root/assets/messages-BuT0SR1R.js +0 -5
- package/dist/gateway/static/root/assets/models-hub-panel-1hdoAoB_.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-DQEAZTA5.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-Bp9bC7A6.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-RNorFXTw.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BqRTcM_6.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B2EfW1cm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CklL85T4.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D3my1HgB.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DVxgjrsP.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Bcu58ZaF.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CDd-84FE.js +0 -2
- package/dist/gateway/static/root/assets/sliding-segmented-uWmrxE3P.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-1OyJnTyR.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-B2ncRwHS.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BZlY4PZL.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DPXMrneY.js +0 -1
- package/dist/gateway/static/root/assets/work-page-CTERoqyv.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CLgsnqFQ.js +0 -11
|
@@ -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,u as o}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as s}from"./cn-BQ_8x0bT.js";import{t as c}from"./messages-BuT0SR1R.js";import{n as ee}from"./locale-store-C_M71MK9.js";import{Fs as l,Go as te,Io as u,La as ne,Ol as re,Pc as d,Sl as f,Xl as ie,a as ae,cc as oe,et as p,f as se,hc as ce,hu as m,jl as h,js as le,l as g,m as ue,ml as de,ms as _,o as fe,p as pe,qo as v,ru as y,s as me,sc as he,u as b,wc as x,yt as S}from"./index-BuqGh2SW.js";var C=n(),w=e(t(),1),T=r();function ge(e){return e===`done`||e===`in_review`?`bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`blocked`||e===`needs_input`?`bg-red-500/10 text-red-700 dark:text-red-300`:e===`in_progress`?`bg-accent-soft text-accent-fg`:e===`backlog`||e===`todo`?`bg-amber-500/10 text-amber-700 dark:text-amber-300`:`bg-surface-muted text-fg-subtle`}function E(e){return e?p(new Date(e)):``}function _e(e){return!Number.isFinite(e)||e<=0?`0 B`:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(+(e<10*1024))} KB`:`${(e/(1024*1024)).toFixed(+(e<10*1024*1024))} MB`}function ve(e){return e.kind===`chat`?`/chat/${encodeURIComponent(e.targetId)}`:e.kind===`goal`?`/goals/${encodeURIComponent(e.targetId)}`:e.kind===`workflow_run`?`/workflows?run=${encodeURIComponent(e.targetId)}`:e.kind===`automation`?`/automations?automationId=${encodeURIComponent(e.targetId)}`:e.kind===`note`?`/notes/${encodeURIComponent(e.targetId)}`:`#`}function D(e){let t=(0,C.c)(7),{label:n,value:r}=e,i;t[0]===n?i=t[1]:(i=(0,T.jsx)(`dt`,{className:`text-xs font-medium text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a=r||`-`,o;t[2]===a?o=t[3]:(o=(0,T.jsx)(`dd`,{className:`min-w-0 break-words text-sm text-fg`,children:a}),t[2]=a,t[3]=o);let s;return t[4]!==i||t[5]!==o?(s=(0,T.jsxs)(`div`,{className:`grid gap-1`,children:[i,o]}),t[4]=i,t[5]=o,t[6]=s):s=t[6],s}function ye(e){let t=(0,C.c)(9),{events:n,t:r}=e;if(!n.length){let e;return t[0]===r.detail.noActivity?e=t[1]:(e=(0,T.jsx)(`div`,{className:`rounded-lg bg-surface-panel px-4 py-8 text-center text-sm text-fg-muted shadow-surface`,children:r.detail.noActivity}),t[0]=r.detail.noActivity,t[1]=e),e}let i;if(t[2]!==n||t[3]!==r){let e;t[5]===r?e=t[6]:(e=e=>(0,T.jsx)(`article`,{className:`rounded-lg bg-surface-panel px-4 py-3 shadow-surface`,children:(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,T.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:r.eventTypes[e.type]??e.type}),(0,T.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:E(e.createdAt)})]})},e.id),t[5]=r,t[6]=e),i=n.map(e),t[2]=n,t[3]=r,t[4]=i}else i=t[4];let a;return t[7]===i?a=t[8]:(a=(0,T.jsx)(`div`,{className:`grid gap-3`,children:i}),t[7]=i,t[8]=a),a}function O(e){return new Set(e.toLowerCase().split(/[^a-z0-9\u4e00-\u9fff]+/).filter(e=>e.length>=2))}function k(e,t,n){let r=t?.projectKind,i=[e.title,e.description,e.nextAction,e.blockedReason,e.status,e.priority,t?.name,t?.description,r].filter(Boolean).join(` `),a=[n.title,n.description,n.metadata.whenToUse,...n.metadata.tags??[]].filter(Boolean).join(` `),o=O(i),s=0;for(let e of O(a))o.has(e)&&(s+=3);let c=a.toLowerCase();return(e.status===`blocked`||e.status===`needs_input`)&&/debug|diagnos|review|audit|fix|检查|排查|修复/.test(c)&&(s+=8),e.status===`in_review`&&/review|audit|check|验收|评审|检查/.test(c)&&(s+=6),e.attachments?.length&&/analy|extract|summar|review|整理|分析|总结/.test(c)&&(s+=5),r===`coding`&&/code|repo|test|pr|review|代码|仓库|测试/.test(c)&&(s+=5),s}function A(e,t,n){return[...n].sort((n,r)=>k(e,t,r)-k(e,t,n)||n.title.localeCompare(r.title))}function j(){let{workItemId:e=``}=o(),t=i(),n=c(ee(e=>e.language)).projectDetailPage.workItems,[r,p]=(0,w.useState)(null),[C,O]=(0,w.useState)(null),[j,M]=(0,w.useState)([]),[N,be]=(0,w.useState)([]),[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(``),[R,z]=(0,w.useState)(!0),[B,V]=(0,w.useState)(!1),[H,U]=(0,w.useState)(null),W=(0,w.useRef)(null),G=u(e=>e.setPageHeader),K=u(e=>e.clearPageHeader),q=(0,w.useMemo)(()=>r?`/projects/${encodeURIComponent(r.projectId)}/work-items`:`/projects`,[r]),J=(0,w.useCallback)(async()=>{if(e){z(!0),U(null);try{let[t,n]=await Promise.all([g(e),b(e).catch(()=>({events:[]}))]);p(t.item),L(t.item.nextAction||t.item.title),M(n.events);let[r,i]=await Promise.all([ne(t.item.projectId).catch(()=>null),S().catch(()=>[])]),a=A(t.item,r,i);O(r),be(a),F(e=>e||a[0]?.id||``)}catch(e){U(e instanceof Error?e.message:String(e))}finally{z(!1)}}},[e]);(0,w.useEffect)(()=>{J()},[J]);let Y=(0,w.useCallback)(async()=>{if(r){V(!0),U(null);try{let e=await se(r.id);p(e.item),t(`/chat/${encodeURIComponent(e.session.key)}`)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}}},[r,t]),X=(0,w.useCallback)(async()=>{if(r){V(!0),U(null);try{let e=await ae(r.id);p(e.item),t(`/goals/${encodeURIComponent(e.goal.id)}`)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}}},[r,t]),Z=(0,w.useCallback)(async e=>{M((await b(e).catch(()=>({events:[]}))).events)},[]),xe=(0,w.useCallback)(async()=>{if(!(!r||!P)){V(!0),U(null);try{let e=await pe(r.id,{definitionId:P,goal:I.trim()||r.nextAction||r.title});p(e.item),await Z(e.item.id),t(`/workflows?run=${encodeURIComponent(e.runId)}`)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}}},[r,t,Z,P,I]),Se=(0,w.useCallback)(async e=>{if(!(!r||!e.length)){V(!0),U(null);try{let t=await ue(r.id,e);p(t.item),await Z(t.item.id)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}}},[r,Z]),Ce=(0,w.useCallback)(async e=>{if(r){V(!0),U(null);try{let t=await fe(r.id,e.id);p(t.item),await Z(t.item.id)}catch(e){U(e instanceof Error?e.message:String(e))}finally{V(!1)}}},[r,Z]),we=(0,w.useCallback)(async e=>{if(r){U(null);try{await me(r.id,e)}catch(e){U(e instanceof Error?e.message:String(e))}}},[r]),Q=(0,w.useMemo)(()=>r?N.filter(e=>k(r,C,e)>0).slice(0,3):[],[r,C,N]),$=(0,w.useMemo)(()=>(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(_,{type:`button`,variant:`ghost`,className:`h-8 rounded-lg px-2.5 text-xs`,onClick:()=>void J(),children:[(0,T.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`hidden sm:inline`,children:n.refreshShort})]}),r?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(_,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:B,onClick:Y,children:[(0,T.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`hidden md:inline`,children:n.detail.startChat})]}),(0,T.jsxs)(_,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:B,onClick:X,children:[(0,T.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`hidden md:inline`,children:n.detail.createGoal})]})]}):null]}),[B,X,Y,r,J,n.detail.createGoal,n.detail.startChat,n.refreshShort]);return(0,w.useLayoutEffect)(()=>(G({startExtra:(0,T.jsx)(a,{to:q,className:`inline-flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":C?.name?n.detail.backToProject.replace(`{{name}}`,C.name):n.detail.backToProjects,children:(0,T.jsx)(m,{className:`size-4`,"aria-hidden":!0})}),main:(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(y,{className:`size-3.5 shrink-0 text-accent-fg`,"aria-hidden":!0}),(0,T.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:r?.title??(R?n.detail.loading:n.detail.notFound)})]}),r?(0,T.jsxs)(`p`,{className:`truncate text-xs text-fg-muted`,children:[n.statuses[r.status],` · `,n.priorities[r.priority],` · `,C?.name||r.projectId,` · `,n.updated,`: `,E(r.updatedAt)]}):null]}),end:$}),()=>K()),[K,$,r,R,C?.name,q,G,n,C]),R?(0,T.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[var(--max-width-app-main)] flex-1 flex-col px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,T.jsx)(`div`,{className:`h-8 w-40 animate-pulse rounded-md bg-surface-hover`}),(0,T.jsx)(`div`,{className:`mt-5 h-44 animate-pulse rounded-xl bg-surface-hover`})]}):H||!r?(0,T.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[var(--max-width-app-main)] flex-1 flex-col px-3 py-6 sm:px-5 xl:px-6`,children:[(0,T.jsxs)(a,{to:`/projects`,className:`inline-flex items-center gap-1 text-sm font-medium text-accent hover:text-accent-fg`,children:[(0,T.jsx)(m,{className:`size-4`,"aria-hidden":!0}),n.detail.backToProjects]}),(0,T.jsx)(`div`,{className:`mt-5 rounded-lg border border-danger/30 bg-danger-soft px-4 py-3 text-sm text-danger`,children:H||n.detail.notFound})]}):(0,T.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[var(--max-width-app-main)] flex-1 flex-col px-3 py-5 sm:px-5 xl:px-6`,children:[(0,T.jsxs)(`section`,{className:`rounded-lg bg-surface-panel p-4 shadow-surface sm:px-5`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(y,{className:`size-4 shrink-0 text-accent-fg`,"aria-hidden":!0}),(0,T.jsx)(`h1`,{className:`min-w-0 break-words text-lg font-semibold leading-7 text-fg`,children:r.title})]}),(0,T.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs`,children:[(0,T.jsx)(`span`,{className:s(`rounded-full px-2 py-0.5 font-medium`,ge(r.status)),children:n.statuses[r.status]}),(0,T.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-fg-muted`,children:n.priorities[r.priority]}),r.archivedAt?(0,T.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-fg-muted`,children:n.detail.archived}):null]})]}),(0,T.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[(0,T.jsxs)(_,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:B,onClick:Y,children:[(0,T.jsx)(d,{className:`size-3.5`,"aria-hidden":!0}),n.detail.startChat]}),(0,T.jsxs)(_,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:B,onClick:X,children:[(0,T.jsx)(l,{className:`size-3.5`,"aria-hidden":!0}),n.detail.createGoal]})]})]}),(0,T.jsxs)(`dl`,{className:`mt-5 grid gap-4 border-t border-edge pt-4 sm:grid-cols-2`,children:[(0,T.jsx)(D,{label:n.create.descriptionLabel,value:r.description||n.detail.noDescription}),(0,T.jsx)(D,{label:n.nextAction,value:r.nextAction||n.noNextAction}),(0,T.jsx)(D,{label:n.blockedReason,value:r.blockedReason||n.detail.noBlockedReason}),(0,T.jsx)(D,{label:n.updated,value:E(r.updatedAt)})]})]}),(0,T.jsxs)(`div`,{className:`mt-4 grid min-h-0 gap-4 lg:grid-cols-[minmax(0,1fr)_18rem]`,children:[(0,T.jsxs)(`section`,{className:`min-w-0`,children:[(0,T.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,T.jsx)(f,{className:`size-4 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.detail.activity})]}),(0,T.jsx)(ye,{events:j,t:n})]}),(0,T.jsxs)(`aside`,{className:`grid content-start gap-4`,children:[(0,T.jsxs)(`section`,{className:`rounded-lg bg-surface-panel px-4 py-3 shadow-surface`,children:[(0,T.jsx)(`div`,{className:`flex items-center justify-between gap-3`,children:(0,T.jsxs)(`h2`,{className:`inline-flex min-w-0 items-center gap-2 text-sm font-semibold text-fg`,children:[(0,T.jsx)(de,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:n.detail.workflowTitle})]})}),(0,T.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.detail.workflowHint}),(0,T.jsxs)(`div`,{className:`mt-3 grid gap-2`,children:[(0,T.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-fg-subtle`,children:[n.detail.workflowTemplate,(0,T.jsxs)(te,{className:`h-9 rounded-md border border-edge bg-surface-base px-2 text-sm font-normal text-fg outline-none focus:border-accent`,value:P,disabled:B||N.length===0,onChange:e=>F(e.target.value),children:[N.length===0?(0,T.jsx)(v,{value:``,children:n.detail.noWorkflowTemplates}):null,N.map(e=>(0,T.jsx)(v,{value:e.id,children:e.title},e.id))]})]}),Q.length?(0,T.jsxs)(`div`,{className:`grid gap-1`,children:[(0,T.jsx)(`div`,{className:`text-xs font-medium text-fg-subtle`,children:n.detail.recommendedWorkflows}),(0,T.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:Q.map(e=>(0,T.jsx)(`button`,{type:`button`,className:s(`min-w-0 rounded-md border px-2 py-1 text-left text-xs transition-colors`,P===e.id?`border-accent bg-accent-soft text-accent-fg`:`border-edge bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg`),disabled:B,onClick:()=>F(e.id),children:(0,T.jsx)(`span`,{className:`block max-w-48 truncate`,children:e.title})},e.id))})]}):null,(0,T.jsxs)(`label`,{className:`grid gap-1 text-xs font-medium text-fg-subtle`,children:[n.detail.workflowGoal,(0,T.jsx)(`textarea`,{className:`min-h-20 resize-y rounded-md border border-edge bg-surface-base p-2 text-sm font-normal text-fg outline-none focus:border-accent`,value:I,disabled:B,onChange:e=>L(e.target.value)})]}),(0,T.jsxs)(_,{type:`button`,variant:`primary`,className:`h-9 rounded-lg px-3 text-xs`,disabled:B||!P,onClick:xe,children:[(0,T.jsx)(he,{className:`size-3.5`,"aria-hidden":!0}),n.detail.startWorkflow]}),N.length?null:(0,T.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n.detail.noWorkflowTemplates})]})]}),(0,T.jsxs)(`section`,{className:`rounded-lg bg-surface-panel px-4 py-3 shadow-surface`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,T.jsxs)(`h2`,{className:`inline-flex min-w-0 items-center gap-2 text-sm font-semibold text-fg`,children:[(0,T.jsx)(x,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`truncate`,children:n.attachments.title})]}),(0,T.jsxs)(_,{type:`button`,variant:`secondary`,className:`h-8 rounded-lg px-2.5 text-xs`,disabled:B,onClick:()=>W.current?.click(),children:[(0,T.jsx)(ce,{className:`size-3.5`,"aria-hidden":!0}),n.attachments.add]}),(0,T.jsx)(`input`,{ref:W,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{Se(Array.from(e.target.files??[])),e.currentTarget.value=``}})]}),(0,T.jsx)(`div`,{className:`mt-3 grid gap-2`,children:r.attachments?.length?r.attachments.map(e=>(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 rounded-md border border-edge bg-surface-base p-2 text-sm`,children:[(0,T.jsx)(f,{className:`size-4 shrink-0 text-fg-muted`,"aria-hidden":!0}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsx)(`div`,{className:`truncate font-medium text-fg`,children:e.fileName}),(0,T.jsxs)(`div`,{className:`truncate text-xs text-fg-subtle`,children:[e.mimeType,` · `,_e(e.size)]})]}),(0,T.jsx)(`button`,{type:`button`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-fg`,title:n.attachments.download,"aria-label":n.attachments.download,disabled:B,onClick:()=>void we(e),children:(0,T.jsx)(h,{className:`size-3.5`,"aria-hidden":!0})}),(0,T.jsx)(`button`,{type:`button`,className:`inline-flex size-7 shrink-0 items-center justify-center rounded-md text-fg-muted hover:bg-surface-hover hover:text-danger`,title:n.attachments.remove,"aria-label":n.attachments.remove,disabled:B,onClick:()=>void Ce(e),children:(0,T.jsx)(le,{className:`size-3.5`,"aria-hidden":!0})})]},e.id)):(0,T.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.attachments.empty})})]}),(0,T.jsxs)(`section`,{className:`rounded-lg bg-surface-panel px-4 py-3 shadow-surface`,children:[(0,T.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.detail.links}),(0,T.jsx)(`div`,{className:`mt-3 grid gap-1 text-sm`,children:r.links?.length?r.links.map(e=>(0,T.jsxs)(a,{to:ve(e),className:`flex min-w-0 items-center justify-between gap-3 rounded-md px-2 py-1.5 hover:bg-surface-hover`,children:[(0,T.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.title||e.targetId}),(0,T.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 text-xs text-fg-muted`,children:[n.linkKinds[e.kind],(0,T.jsx)(re,{className:`size-3.5`,"aria-hidden":!0})]})]},e.id)):(0,T.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n.detail.noLinks})})]}),(0,T.jsxs)(`section`,{className:`rounded-lg bg-surface-panel px-4 py-3 shadow-surface`,children:[(0,T.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.detail.project}),(0,T.jsxs)(a,{to:q,className:`mt-2 inline-flex min-w-0 items-center gap-2 text-sm font-medium text-accent hover:text-accent-fg`,children:[(0,T.jsx)(ie,{className:`size-4 shrink-0`,"aria-hidden":!0}),(0,T.jsx)(`span`,{className:`min-w-0 truncate`,children:C?.name||r.projectId})]})]})]})]})]})}export{j as WorkItemDetailPage};
|
|
@@ -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-BuT0SR1R.js";import{n as u,r as d,s as f}from"./locale-store-C_M71MK9.js";import{n as p}from"./activity-store-C-57rvkX.js";import{Ao as m,As as h,Bl as g,Dl as _,Fa as v,Fo as y,Gs as b,Ic as x,Io as S,Mo as C,No as w,Po as T,Ql as E,R as D,Ua as O,Xl as k,ao as A,bu as j,et as M,hc as ee,jo as te,js as N,ko as ne,ms as P,mu as F,nl as re,tc as ie,tu as ae,vs as oe,yl as se,zc as I}from"./index-BuqGh2SW.js";import{t as ce}from"./sliding-segmented-uWmrxE3P.js";var L=n(),R=e(t(),1),z=r(),B=3,V={info:{Icon:re,className:`text-accent-fg bg-accent-soft`},success:{Icon:k,className:`text-success bg-success-soft`},warning:{Icon:h,className:`text-warning bg-warning-soft`},error:{Icon:c,className:`text-danger bg-danger-soft`}};function H(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 U(e){let t=(0,L.c)(52),{item:n}=e,r=u(G),i;t[0]===r?i=t[1]:(i=l(r),t[0]=r,t[1]=i);let s=i.projectsPage.workHome,c=p(W),{Icon:d,className:f}=V[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,z.jsx)(I,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,z.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,z.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,z.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,z.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 y;t[15]!==_||t[16]!==v?(y=(0,z.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[_,v]}),t[15]=_,t[16]=v,t[17]=y):y=t[17];let b;t[18]===n.message?b=t[19]:(b=n.message?(0,z.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]=b);let x;t[20]===n.source?x=t[21]:(x=n.source?(0,z.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=x);let S;t[22]!==n.updatedAt||t[23]!==r?(S=H(n.updatedAt,r),t[22]=n.updatedAt,t[23]=r,t[24]=S):S=t[24];let C;t[25]===S?C=t[26]:(C=(0,z.jsx)(`span`,{children:S}),t[25]=S,t[26]=C);let w;t[27]===n.occurrences?w=t[28]:(w=n.occurrences>1?(0,z.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=w);let T;t[29]!==s.activityViewRelated||t[30]!==n.href?(T=n.href?(0,z.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,z.jsx)(E,{className:`size-3`,"aria-hidden":!0})]}):null,t[29]=s.activityViewRelated,t[30]=n.href,t[31]=T):T=t[31];let D;t[32]!==C||t[33]!==w||t[34]!==T||t[35]!==x?(D=(0,z.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[x,C,w,T]}),t[32]=C,t[33]=w,t[34]=T,t[35]=x,t[36]=D):D=t[36];let O;t[37]!==D||t[38]!==y||t[39]!==b?(O=(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[y,b,D]}),t[37]=D,t[38]=y,t[39]=b,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,z.jsx)(oe,{className:`size-3.5`,"aria-hidden":!0}),t[44]=A):A=t[44];let j;t[45]!==s.activityRemove||t[46]!==k?(j=(0,z.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,z.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 W(e){return e.remove}function G(e){return e.language}function le(){let e=(0,L.c)(8),t=l(u(de)).projectsPage.workHome,n=p(Q),r=p(Z),i=p(ue),[a,o]=(0,R.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,h;e[4]!==a||e[5]!==n?(h=a?n:n.slice(0,B),e[4]=a,e[5]=n,e[6]=h):h=e[6];let _=h,v;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,z.jsx)(j,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[7]=v):v=e[7],(0,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[v,(0,z.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),d>0?(0,z.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,z.jsx)(I,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),d,` `,t.running]}):m>0?(0,z.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,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:t.activityHint}):null]}),a&&n.length>0?(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[m>0?(0,z.jsxs)(P,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,z.jsx)(s,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some(J)?(0,z.jsxs)(P,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,z.jsx)(N,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,z.jsxs)(`div`,{className:`mt-3 px-1`,children:[_.map(q),n.length>B?(0,z.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,z.jsx)(P,{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,z.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,z.jsx)(g,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`p`,{children:t.activityEmpty})]})]})}function K(e){return!e}function q(e){return(0,z.jsx)(U,{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 ue(e){return e.clearFinished}function Z(e){return e.markAllRead}function Q(e){return e.items}function de(e){return e.language}function fe(e){return f(d(`/api/home${e?`?locale=${encodeURIComponent(e)}`:``}`))}function pe(e,t){return f(d(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...e,decision:t})})}function $(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function me(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:M(n)}function he(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,z.jsx)(A,{className:`h-20 rounded-2xl`}),(0,z.jsx)(A,{className:`h-72 rounded-2xl`}),(0,z.jsx)(A,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function ge(e){let t=(0,L.c)(19),{item:n,statusLabel:r}=e,i=`/work-items/${encodeURIComponent(n.id)}`,o;t[0]===n.title?o=t[1]:(o=(0,z.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,z.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,z.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,z.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,z.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,z.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,z.jsxs)(a,{to:i,className:`group block rounded-lg px-1 py-2.5 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,d]}),t[15]=i,t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function _e(e){let t=(0,L.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,z.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,z.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,z.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,z.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,z.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,z.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,z.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,z.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,z.jsx)(P,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,z.jsx)(P,{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,z.jsxs)(`article`,{className:`rounded-xl border border-warning/35 bg-warning-soft/25 p-3.5 transition-colors hover:bg-warning-soft/40`,children:[_,v]}),t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function ve(e){let t=(0,L.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,z.jsx)(se,{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,z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[s,(0,z.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,z.jsx)(F,{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,z.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,z.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-5 text-fg-muted`,children:d}),t[8]=d,t[9]=f);let p=n.lastActiveAt??n.updatedAt,m;t[10]===p?m=t[11]:(m=me(p,``),t[10]=p,t[11]=m);let h;t[12]===m?h=t[13]:(h=(0,z.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,z.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 ye(){let e=u(e=>e.language),t=l(e),n=t.projectsPage,r=i(),o=S(e=>e.setPageHeader),s=S(e=>e.clearPageHeader),[d,f]=(0,R.useState)(null),[p,h]=(0,R.useState)([]),[E,k]=(0,R.useState)(!0),[A,j]=(0,R.useState)(null),[M,N]=(0,R.useState)(null),[F,re]=(0,R.useState)(``),[se,I]=(0,R.useState)(!1),[L,B]=(0,R.useState)(`delegate`),[V,H]=(0,R.useState)(``),[U,W]=(0,R.useState)(!1),[G,K]=(0,R.useState)(null),q=(0,R.useCallback)(async()=>{k(!0),j(null);try{let[t,n]=await Promise.all([fe(e),O({limit:100,sortBy:`updatedAt`,sortOrder:`desc`})]);f(t),h(n.items)}catch(e){j(e instanceof Error?e.message:String(e))}finally{k(!1)}},[e]);(0,R.useEffect)(()=>{q()},[q]);let J=(0,R.useMemo)(()=>{let e=F.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,F]),Y=(0,R.useMemo)(()=>d?.decisions??[],[d]),X=(0,R.useMemo)(()=>d?.work.current.filter(e=>e.status!==`needs_input`&&e.status!==`in_review`&&e.status!==`blocked`).slice(0,10)??[],[d]),ue=(0,R.useCallback)(async t=>{t.preventDefault();let n=V.trim();if(!(!n||U)){if(L===`watch`){let t=e===`zh`?`持续关注以下事项,在发生有意义的变化时通知我:\n${n}`:`Keep watching the following and notify me when something meaningfully changes:\n${n}`;H(``),I(!1),r(`/automations?draft=${encodeURIComponent(t)}&autogenerate=1`);return}W(!0),N(null);try{let t=await v({outcome:n,uiLocale:e});H(``),I(!1),r(`/projects/${encodeURIComponent(t.project.id)}`)}catch(e){N(e instanceof Error?e.message:String(e))}finally{W(!1)}}},[L,U,e,r,V]),Z=(0,R.useMemo)(()=>(0,z.jsxs)(P,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>{B(`delegate`),I(!0)},children:[(0,z.jsx)(ee,{className:`size-4`,"aria-hidden":!0}),n.workHome.newWork]}),[n.workHome.newWork]),Q=(0,R.useMemo)(()=>[{value:`delegate`,label:n.workHome.delegateMode,icon:b},{value:`watch`,label:n.workHome.watchMode,icon:_}],[n.workHome.delegateMode,n.workHome.watchMode]),de=(0,R.useCallback)(async(e,t)=>{if(e.response){K(e.id),j(null);try{await pe(e.response,t),await q()}catch(e){j(e instanceof Error?e.message:String(e))}finally{K(null)}}},[q]);return(0,R.useLayoutEffect)(()=>(o({startExtra:null,main:(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),(0,z.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:n.workHome.subtitle})]}),end:Z}),()=>s()),[s,Z,o,n.title,n.workHome.subtitle]),(0,z.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,z.jsx)(ne,{open:se,onOpenChange:e=>{!e&&U||(I(e),e||N(null))},children:(0,z.jsxs)(T,{children:[(0,z.jsx)(w,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,z.jsxs)(te,{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,z.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(y,{className:`text-base font-semibold text-fg`,children:L===`watch`?n.workHome.watchTitle:n.workHome.delegateTitle}),(0,z.jsx)(C,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:L===`watch`?n.workHome.watchDescription:n.workHome.delegateDescription})]}),(0,z.jsx)(m,{asChild:!0,children:(0,z.jsx)(P,{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:U,children:(0,z.jsx)(oe,{className:`size-4`,"aria-hidden":!0})})})]}),(0,z.jsxs)(`form`,{onSubmit:ue,className:`flex min-h-0 flex-1 flex-col`,children:[(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,z.jsx)(ce,{value:L,onChange:e=>{B(e),N(null)},options:Q,"aria-label":n.workHome.createModeLabel,className:`mb-4 shrink-0`,buttonClassName:`h-9`}),(0,z.jsx)(`label`,{htmlFor:`new-work-outcome`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:L===`watch`?n.workHome.watchLabel:n.workHome.outcomeLabel}),(0,z.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:V,onChange:e=>H(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},placeholder:L===`watch`?n.workHome.watchPlaceholder:n.workHome.outcomePlaceholder,maxLength:12e3,disabled:U,autoFocus:!0}),(0,z.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,z.jsx)(`span`,{children:n.workHome.submitShortcut}),(0,z.jsxs)(`span`,{className:`tabular-nums`,children:[V.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),M?(0,z.jsx)(`p`,{className:`mt-3 rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:M}):null]}),(0,z.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,z.jsx)(`p`,{className:`text-xs leading-5 text-fg-subtle`,children:L===`watch`?n.workHome.watchSetupHint:n.workHome.autoSetupHint}),(0,z.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2`,children:[(0,z.jsx)(m,{asChild:!0,children:(0,z.jsx)(P,{type:`button`,variant:`ghost`,disabled:U,children:n.cancel})}),(0,z.jsxs)(P,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:U||!V.trim(),children:[(0,z.jsx)(b,{className:`size-4`,"aria-hidden":!0}),U?n.workHome.delegating:L===`watch`?n.workHome.designWatch:n.workHome.delegate]})]})]})]})]})]})}),A?(0,z.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,z.jsx)(`span`,{children:A}),(0,z.jsx)(P,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void q(),children:n.workHome.retry})]}):null,E?(0,z.jsx)(he,{}):d?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,z.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.workHome.briefingTitle}),(0,z.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:d.decisions.length>0?$(n.workHome.todaySummary,{attention:d.decisions.length,moving:d.briefing.progress.movingCount}):$(n.workHome.todaySummaryClear,{moving:d.briefing.progress.movingCount})}),d.briefing.summary?(0,z.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:d.briefing.summary}):null]}),d.work.current.length===0&&d.workflowRuns.active.length===0&&d.decisions.length===0&&d.upcomingAutomations.length===0?(0,z.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,z.jsx)(x,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,z.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.workHome.emptyTitle}),(0,z.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:n.workHome.emptyBody}),(0,z.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,z.jsx)(P,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:n.workHome.startChat}),(0,z.jsx)(P,{type:`button`,variant:`secondary`,onClick:()=>{B(`delegate`),I(!0)},children:n.workHome.startLongWork})]})]}):null,(0,z.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[Y.length>0?(0,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(c,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,z.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.needsYou})]}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.needsYouHint}),(0,z.jsx)(`div`,{className:`mt-4 space-y-2`,children:Y.map(e=>(0,z.jsx)(_e,{item:e,kindLabel:n.workHome.decisionKinds[e.kind],reasonLabel:n.workHome.decisionReasons[e.reason],approveLabel:n.workHome.approve,denyLabel:n.workHome.deny,busy:G===e.id,onRespond:t=>void de(e,t)},e.id))})]}):(0,z.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,z.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,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(g,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.continueTitle})]}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.continueHint}),(0,z.jsxs)(`div`,{className:`mt-4 divide-y divide-edge-subtle px-1`,children:[d.workflowRuns.active.map(e=>(0,z.jsxs)(a,{to:D(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,z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,"aria-hidden":!0}),(0,z.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.title})]}),(0,z.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.workHome.running})]},e.id)),X.map(e=>(0,z.jsx)(`div`,{className:`py-1`,children:(0,z.jsx)(ge,{item:e,statusLabel:t.projectDetailPage.workItems.statuses[e.status]})},e.id)),d.workflowRuns.active.length===0&&X.length===0?(0,z.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.workHome.noCurrentWork}):null]})]})]}),(0,z.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":n.workHome.nowTitle,children:[(0,z.jsxs)(`div`,{className:`px-1`,children:[(0,z.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.nowTitle}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.nowHint})]}),d.upcomingAutomations.length>0?(0,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(ae,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.workHome.scheduled})]}),(0,z.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:d.upcomingAutomations.slice(0,3).map(e=>(0,z.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,z.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,z.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:me(e.nextRunAt,n.never)})]},e.id))})]}):null,(0,z.jsx)(le,{}),d.briefing.wins.length>0?(0,z.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,z.jsx)(`span`,{children:$(n.workHome.completedSummary,{count:d.briefing.wins.length})}),(0,z.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[n.workHome.viewLatestResult,` →`]})]}):null]})]})]}):null,(0,z.jsxs)(`section`,{className:`border-t border-edge-subtle pt-7`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.workHome.spacesTitle}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n.workHome.spacesHint})]}),(0,z.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,z.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,z.jsxs)(`label`,{className:`relative block min-w-0`,children:[(0,z.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,z.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:F,onChange:e=>re(e.target.value),placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder})]})}):null,(0,z.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:J.map(e=>(0,z.jsx)(ve,{project:e,openLabel:n.workHome.openSpace,noDescription:n.noDescription},e.id))}),!E&&J.length===0?(0,z.jsx)(`p`,{className:`py-8 text-center text-sm text-fg-muted`,children:n.workHome.noSpaces}):null]})]})}export{ye as WorkPage};
|