@xopcai/xopc 0.0.361 → 0.0.362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-tpFInIoh.js → activity-store-_2aJ4ozN.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DUhFW_Go.js → agent-avatar-dicebear-CSIn4ghK.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BNILmgey.js → agent-defaults-settings-panel-DBNFaHYa.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-CnWci4JJ.js → agent-plugin-dialog-DJkGbMVg.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CKS5LUUs.js → agents-CuQayYYr.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CiAjB2iQ.js → agents-admin-api-Dl0V7UQq.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DEig00YU.js → app-management-settings-panel-CSczq9QV.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CccnRRrL.js → appearance-settings-W0vc1J1Q.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CkT6UNZW.js → apps-page-esnvb3hh.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CIlmZBe5.js → archive-plugin-CBR91gHK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-8kZugDcf.js → automations-page-B9RdzKUS.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-3V54ShL0.js → automations-workspace-U9TEZd_t.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-BuQiee_b.js → binary-plugins-C9KIjPph.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BFFRbsKX.js → block-editor-C0bammwh.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CWujpdCx.js → browser-automation-inputs-D2E0co_S.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-HVXiBKXE.js → browser-automations-page-8kqdhAOz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DpxAXNvM.js → browser-settings-page-Dl4idi13.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CngwB2JU.js → capabilities-Bfktn_7E.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-RMlKKfGF.js → capabilities-BmMMlNmY.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-BBi4ef3u.js → capabilities-page-3ImhKPBx.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-IxszGl-Q.js → capabilities-settings-panel-4VDEB_ob.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-BLOIJvIZ.js → capability-header-actions-D1gxCGi8.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-Ced5nFBc.js → channels-Drbr2JR-.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BskUzDCS.js → chat-terminal-dock-CSkksCaa.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-De-pjlvn.js → computer-settings-page-BIXpOJAk.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Qc1mVfp9.js → connector-service-page-CTnlVEE1.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CPqeY1x5.js → connectors-page-BluT2l4d.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-7ppMIGfQ.js → date-picker-Bw-CydDe.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-CgHzhtAc.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-GKEfqHDF.js → desktop-pet-YahEnyfd.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-qoFZBKe9.js → desktop-pet-settings-47Z4bqJr.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-D8sTDd5s.js → device-pairing-wizard-C3aPEEaM.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BC87CZa2.js → directory-picker-path-field-DH_ok92y.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-VxCq29jC.js → extension-debug-page-t1TiLQrR.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DypBVBTt.js → extension-page-BeV-7G1h.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-wlvxPese.js → extension-provider-CFCxzqna.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DzzkBN9y.js → extension-settings-page-DCODJHOu.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-s4qTRcPJ.js → fallback-models-CJzvASNV.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-ZM72jovc.js → gateway-config-swr-B3LfyXpc.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-B-hrykag.js → gateway-realtime-CWxXXAe_.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DS4WzQyF.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings--M7ZH_37.js → gateway-settings-Q5NFzAJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DjWuTj8B.js → gateway-startup-retry-BzQP02wp.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-KFs5suD1.js → home-page-DndTkAw8.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-C9cwrqCr.js → image-generation-api-BO-Xs__S.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BKy0ImXk.js → imports-page-Bb6Gm30L.js} +1 -1
- package/dist/gateway/static/root/assets/index-Byk2QKIS.css +1 -0
- package/dist/gateway/static/root/assets/{index-C0JT9Ja4.js → index-qOHWhsEK.js} +6 -6
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CexiL-Ey.js → keyboard-shortcuts-settings-D2u6sk5l.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CcU1OLWQ.js → local-app-workbench-page-CHeMfXrB.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-BcLijQx4.js → local-apps-page-BanU1SLr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-C7QjBMNp.js → local-session-drafts-DLZQBcZY.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-5sV3dDRG.js → locale-store-BbwWB0ra.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-48nrZNQe.js → logs-page-CQdHKCL0.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-B_gzl_Vh.js → management-settings-D0V5kCx0.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-V0f5NW7D.js → markdown-view-DIBLXsPm.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-_obxSZmT.js → media-plugins-XPzvDZPz.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-CaURu8bb.js → messages-B4AhAW4B.js} +2 -2
- package/dist/gateway/static/root/assets/models-hub-cache-DN5MnhL8.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-B9AeX98W.js → note-detail-panel-CodeKI_W.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-CBnMq6Nc.js → notes-api-CLn4r03Z.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CKTTfxw-.js → notes-page-liRQoHbF.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-Bu2RoLF2.js → oauth-api-D9zkd42J.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BsxBAWD_.js → page-context-capture-button-DO6DB9pi.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-Cfl1FR3i.js → personal-page-DdfdwOv5.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-D1ARqS3r.js → product-open-page-C9a3sm6Z.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-Cro1OE8P.js → project-detail-page-BVe5R-Nj.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CdEmmBCz.js → projects-page-D_rCwi7w.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-j1rNFkP2.js → registry-api-BFxQTbXQ.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-C9_ea_4p.js → remote-access-hub-B3imt2du.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DtmQbC72.js → runtime-tools-settings-panel-C9WC8hJM.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-DeFdMf2q.js → scenes-page-DL95V1UP.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-ByEHHW6n.js → schema-form-CDgGmgrq.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-CO_vUCb8.js → send-session-input-tkAQXGBG.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CYPGi01d.js → session-api-9X7qep91.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BdJThQQ6.js → session-manager-Dy22bbJT.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-CV0JlaXS.js → sessions-page-CeeKIVsM.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DuvJrDU2.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CHKsZFAN.js → settings-page-xmUGYSOG.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CC58OVOe.js → setup-status-panel-CmjT9Q4P.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-ZOdnHkmb.js → share-link-dialog-DeOe9qfQ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BPDWUuH_.js → share-preview-page-Ck27gozJ.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-T5gR8yqz.js → shares-api-D-GuMkPu.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DaXvdH8c.js → shares-settings-DpvM2OyO.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CHCLMcfO.js → skill-api-BpD02td8.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-C-RoiUJi.js → skill-reload-api-CezAwYxM.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-a9UQQnqn.js → skills-page-BCgbVI-P.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Dho_dlBS.js → system-settings-panel-UODcpzsP.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BbqQnNes.js +2 -0
- package/dist/gateway/static/root/assets/{theme-store-CEl74p7l.js → theme-store-6IK2Ik2J.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BDqCyf8G.js → tunnel-api-Eey2aZIz.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DKwKfszc.js → usage-page-BrWj5mk3.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-D09eZTLp.js → use-autosave-B-3BJbnn.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-CkvJM8Km.js → use-composer-attachments-ByAHuR8v.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-J3HnG8OH.js → use-file-preview-expanded-CXVwWJeP.js} +2 -2
- package/dist/gateway/static/root/assets/{user-model-page-BsgADrGL.js → user-model-page-Cg-oM8nY.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DH-to9Rd.js → voice-api-key-field-BtffIKZD.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CmCfVy3H.js → voice-config-api-BMm9dSKX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-x1vZDBhu.js → work-discovery-overlay-ByHhF_4r.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DGatvmK1.js → workflow-run-setup-panel-DfNn5VTy.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-DgNy6mBQ.js → workflows-page-B67D-7Wt.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-DzPw92Kx.js → workspace-api-TAD7LYsc.js} +2 -2
- package/dist/gateway/static/root/connector-icons/README.md +5 -2
- package/dist/gateway/static/root/connector-icons/SOURCES.md +15 -1
- package/dist/gateway/static/root/connector-icons/amap.ico +0 -0
- package/dist/gateway/static/root/connector-icons/antv-chart.png +0 -0
- package/dist/gateway/static/root/connector-icons/bailian.png +0 -0
- package/dist/gateway/static/root/connector-icons/dida365.png +0 -0
- package/dist/gateway/static/root/connector-icons/flomo.png +0 -0
- package/dist/gateway/static/root/connector-icons/gmail.svg +1 -3
- package/dist/gateway/static/root/connector-icons/jira.svg +3 -14
- package/dist/gateway/static/root/connector-icons/railway-12306.jpg +0 -0
- package/dist/gateway/static/root/connector-icons/railway-query.svg +1 -0
- package/dist/gateway/static/root/connector-icons/tencent-docs.ico +0 -0
- package/dist/gateway/static/root/connector-icons/yuque.png +0 -0
- package/dist/gateway/static/root/index.html +28 -28
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/task-result-delivery.js +2 -2
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/connectors/china-catalog.js +572 -0
- package/dist/src/connectors/cli/authorization.js +3 -2
- package/dist/src/connectors/cli/installer.js +3 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/side-chat/manager.js +3 -2
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/tasks/task-result-delivery-repository.js +4 -5
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/dependency-picker-DfYC22si.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B6B1fw_K.js +0 -1
- package/dist/gateway/static/root/assets/index-B7AHDHSO.css +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-Cs3E5pEA.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-D9sW0hKa.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-B5JyH4z7.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./locale-store-5sV3dDRG.js";import{o as t}from"./vendor-swr-BIWyz7Rc.js";import{n}from"./gateway-config-swr-ZM72jovc.js";import{r}from"./registry-api-j1rNFkP2.js";var i=`models-json-config`,a=`model-catalog`,o=`capability-readiness`;async function s(){await Promise.all([n(),t(e(`/api/providers/meta`)),t(i),t(a),t(o),r()])}export{s as i,i as n,a as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{hn as e}from"./index-C0JT9Ja4.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{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,t as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as c,r as l}from"./popover-select-BgSdSbCL.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./ellipsis-0k4rZLoy.js";import{t as f}from"./external-link-DjqjBmc3.js";import{C as p,D as m,N as h,g,h as _,j as v,k as y,v as ee}from"./use-composer-attachments-CkvJM8Km.js";import{b as te,f as b,m as ne,t as x,v as S}from"./markdown-view-V0f5NW7D.js";import{t as re}from"./folder-open-CyzJ19I9.js";import{t as C}from"./message-square-fVE7Ghj1.js";import{t as w}from"./pause-DuPxgSxk.js";import{t as T}from"./play-kxZvpBg8.js";import{t as ie}from"./x-B_N4OPjy.js";import{t as E}from"./cn-JdwAhgNB.js";import{a as D,c as O,n as ae,r as k}from"./locale-store-5sV3dDRG.js";import{i as oe,n as se,o as ce,r as le,s as ue,t as A}from"./dist-BGTk37IG.js";import{u as j}from"./tasks-CH6KoBeY.js";import{i as de}from"./vendor-swr-BIWyz7Rc.js";import{t as M}from"./button-CS04eWY9.js";import{t as N}from"./activity-store-tpFInIoh.js";import{t as P}from"./skeleton-BwbyijEw.js";import{m as fe,o as pe}from"./shares-api-T5gR8yqz.js";import{An as me,Dn as he,Gs as ge,Ic as _e,Js as ve,Mn as ye,Nn as be,On as xe,Sc as Se,Tr as Ce,Vt as we,Wi as Te,Xa as Ee,Xr as F,Yi as De,Za as Oe,Zr as ke,bi as Ae,ci as je,hc as Me,ii as Ne,jn as Pe,kn as Fe,l as Ie,mc as Le,n as Re}from"./index-C0JT9Ja4.js";import{t as ze}from"./page-context-capture-button-BsxBAWD_.js";import{t as I}from"./date-picker-7ppMIGfQ.js";import{t as Be}from"./dependency-picker-DfYC22si.js";var L=n(),R=e(t(),1),z=r();function Ve({wait:e,detail:t,zh:n,onUpdated:r}){let[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(!1),f=(0,R.useRef)(null),p=e.kind===`approval`,m=Array.isArray(e.condition.choices)?e.condition.choices.filter(e=>typeof e==`string`):[];async function h(a){if(!p&&!i.trim()||p&&!a||o)return;let c=JSON.stringify([t.task.version,i.trim(),a]);f.current?.signature!==c&&(f.current={signature:c,key:crypto.randomUUID()}),s(!0),l(``);try{let o=await g(t.task.id,{type:`resolve_wait`,waitId:e.id,resolution:p?{kind:`task_approval`,decision:a}:{kind:`user_answer`,answer:i.trim()}},t.task.version,f.current.key);d(!0),r(o),N({tone:`success`,title:p?n?`决定已保存`:`Decision saved`:n?`补充信息已保存`:`Answer saved`,message:o.waits.length?n?`仍有其他等待条件,任务尚未恢复执行。`:`Other waiting conditions remain.`:n?`等待已解除,请在任务状态中查看后续执行进展。`:`The wait is resolved. Follow progress in the task status.`,source:n?`任务`:`Task`})}catch{l(n?`提交未确认,内容已保留。可重试;若问题已变化,请刷新。`:`Submission not confirmed. Your answer is saved here; retry or refresh if the question changed.`)}finally{s(!1)}}return(0,z.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,onSubmit:e=>{e.preventDefault(),h()},children:[p?(0,z.jsxs)(`div`,{className:`text-sm text-fg`,children:[(0,z.jsx)(`p`,{children:e.reason}),(0,z.jsxs)(`p`,{className:`mt-2`,children:[n?`授权范围:`:`Permission: `,String(e.condition.capability)]}),(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,z.jsx)(M,{type:`button`,variant:`primary`,disabled:o||u,onClick:()=>void h(`approve`),children:n?`批准`:`Approve`}),(0,z.jsx)(M,{type:`button`,disabled:o||u,onClick:()=>void h(`deny`),children:n?`拒绝并暂停`:`Deny and pause`})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[typeof e.condition.question==`string`?e.condition.question:e.reason,(0,z.jsx)(`textarea`,{className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel p-3`,rows:3,maxLength:12e3,value:i,disabled:o||u,onChange:e=>a(e.target.value)})]}),m.length>0&&(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:m.map(e=>(0,z.jsx)(M,{type:`button`,disabled:o||u,variant:`secondary`,"aria-pressed":i===e,onClick:()=>a(e),children:e},e))}),(0,z.jsx)(M,{type:`submit`,variant:`primary`,disabled:o||u||!i.trim(),children:o?n?`正在提交`:`Submitting`:n?`提交补充信息`:`Submit answer`})]}),(0,z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`保存到任务上下文;其他等待条件满足后继续执行。`:`Saved to task context. Work continues once all waiting conditions are met.`}),c&&(0,z.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c})]})}function He(e,t){let n;try{n=new URL(e)}catch{return}return t.find(e=>[e.shareUrl,e.lanUrl].some(e=>{if(!e)return!1;try{let t=new URL(e);return t.origin===n.origin&&t.pathname.replace(/\/$/,``)===n.pathname.replace(/\/$/,``)}catch{return!1}}))}function B({uri:e,zh:t}){let[n,r]=(0,R.useState)(),[i,a]=(0,R.useState)(!1),[o,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``);async function p(){a(!0),u(``);try{let n=He(e,(await fe()).payload.shares);r(n),c(!0),n?n.kind!==`file`&&n.kind!==`directory`?u(t?`这是文档快照,请从原笔记或对话的分享面板重新发布。`:`This is a document snapshot. Republish it from the original note or conversation.`):n.revoked?u(t?`分享已被撤销,不能自动恢复。请从原任务重新生成并分享。`:`This share was revoked. Generate and share a new artifact from the task.`):n.maxViews!==null&&n.downloadCount>=n.maxViews?u(t?`已达到访问次数上限,请在分享设置中调整后重试。`:`The access limit was reached. Adjust it in share settings.`):n.expired||(f(n.shareUrl),u(t?`链接仍在有效期内;若打不开,请检查网关连接。`:`The link has not expired. If it cannot open, check gateway connectivity.`)):u(t?`未找到本机管理的分享记录。外部链接或已清理的记录无法在这里续期,请从原任务重新生成产物。`:`No locally managed share matches this link. Regenerate the artifact from its task.`)}catch{u(t?`检查失败,请重试。`:`Check failed. Please retry.`)}finally{a(!1)}}async function m(){if(!(!n||i)){a(!0),u(``);try{let e=await pe(n.id,864e5);f(e.payload.shareUrl),r({...n,expired:!1,expiresAt:e.payload.expiresAt}),u(t?`已续期 24 小时,访问范围与次数限制保持不变。`:`Renewed for 24 hours. Access scope and view limits are unchanged.`)}catch(e){u(`${t?`恢复失败:`:`Recovery failed: `}${e instanceof Error?e.message:String(e)}`)}finally{a(!1)}}}return(0,z.jsxs)(`details`,{className:`mt-2 text-xs text-fg-muted`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer py-2`,children:t?`链接打不开?`:`Trouble opening the link?`}),(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void p(),children:t?`检查链接状态`:`Check link`}),o&&n?.expired&&(n.kind===`file`||n.kind===`directory`)&&!n.revoked&&(n.maxViews===null||n.downloadCount<n.maxViews)&&(0,z.jsx)(M,{type:`button`,disabled:i,onClick:()=>void m(),children:t?`恢复链接 · 续期 24 小时`:`Restore link for 24 hours`}),l&&(0,z.jsx)(`p`,{role:`status`,className:`break-words leading-5`,children:l}),d&&(0,z.jsx)(`a`,{className:`block py-2 text-accent`,href:d,target:`_blank`,rel:`noopener noreferrer`,children:t?`打开产物`:`Open artifact`}),o&&(0,z.jsx)(s,{className:`block py-2 text-accent`,to:`/settings/shares`,children:t?`管理分享记录`:`Manage shares`})]})]})}function Ue(e){let t=(0,L.c)(14),{evidence:n,projectId:r,conversationId:i,language:a}=e,o=F(We);if(!n.length)return null;let s=a===`zh`?`交付物与验证依据`:`Deliverables and evidence`,c;if(t[0]!==i||t[1]!==n||t[2]!==a||t[3]!==r||t[4]!==o){let e;t[6]!==i||t[7]!==a||t[8]!==r||t[9]!==o?(e=(e,t)=>{let n=e.uri?.trim(),s=n&&/^https?:\/\//i.test(n),c=n&&!s&&e.kind===`artifact`&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(`//`),l=e.title||(a===`zh`?`查看产物`:`Open artifact`);return(0,z.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-edge-subtle p-3`,children:[s?(0,z.jsxs)(`a`,{className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline`,href:n,target:`_blank`,rel:`noopener noreferrer`,children:[(0,z.jsx)(f,{className:`size-4 shrink-0`}),l]}):c&&(r||i)?(0,z.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline`,onClick:()=>o(n,null,r,i),children:[(0,z.jsx)(ve,{className:`size-4 shrink-0`}),l]}):(0,z.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:l}),s&&e.kind===`artifact`&&(0,z.jsx)(B,{uri:n,zh:a===`zh`},n),e.summary?(0,z.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:e.summary}):null,(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e.strength===`verified`?a===`zh`?`已验证`:`Verified`:a===`zh`?`已记录,待验证`:`Observed, not verified`})]},`${e.title}-${t}`)},t[6]=i,t[7]=a,t[8]=r,t[9]=o,t[10]=e):e=t[10],c=n.map(e),t[0]=i,t[1]=n,t[2]=a,t[3]=r,t[4]=o,t[5]=c}else c=t[5];let l;return t[11]!==s||t[12]!==c?(l=(0,z.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,"aria-label":s,children:c}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function We(e){return e.setPath}function Ge({taskId:e}){let t=O(e=>e.conversationId),n=ae(e=>e.language),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)([]),[p,m]=(0,R.useState)(null),h=k(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:g,error:_,mutate:v}=de([`task-collaboration`,e,t],()=>D(`${h}?recent=1`),{revalidateOnFocus:!0}),y=[...new Map([...d,...g?.items??[]].map(e=>[e.id,e])).values()].sort((e,t)=>e.sequence-t.sequence),ee=async()=>{let e=y[0];if(!(!e||l)){u(!0);try{let t=await D(`${h}?recent=1&beforeSequence=${e.sequence}`);f(e=>[...t.items,...e])}catch(e){m(e instanceof Error?e.message:String(e))}finally{u(!1)}}};(0,R.useEffect)(()=>{let t=t=>{let n=t.detail;(!n?.taskId||n.taskId===e)&&v()};return window.addEventListener(`task-collaboration-entry-added`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.removeEventListener(`task-collaboration-entry-added`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[v,e]);let te=async()=>{if(!(!r.trim()||s)){c(!0),m(null);try{await D(h,{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({kind:a?`answer`:`instruction`,body:r.trim(),...a?{causationId:a}:{}})}),i(``),o(null),await v()}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}}};return(0,z.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,z.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!g&&!_?(0,z.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,z.jsx)(P,{className:`h-14 w-full`}),(0,z.jsx)(P,{className:`h-14 w-4/5`})]}):null,_?(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,y[0]&&y[0].sequence>1?(0,z.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>void ee(),className:`text-xs text-accent hover:underline disabled:opacity-50`,children:n===`zh`?`查看更早留言`:`Earlier updates`}):null,y.map(e=>(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,z.jsx)(`span`,{children:e.authorKind===`worker_agent`?n===`zh`?`执行 Agent`:`Worker`:e.authorKind===`main_agent`?n===`zh`?`主 Agent`:`Main Agent`:e.authorKind===`system`?n===`zh`?`系统`:`System`:n===`zh`?`用户`:`You`}),(0,z.jsxs)(`span`,{children:[`· `,e.kind]}),e.deliveryStatus?(0,z.jsxs)(`span`,{children:[`· `,e.deliveryStatus]}):null]}),(0,z.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,z.jsx)(x,{content:e.body,compact:!0,breaks:!0})}),e.kind===`question`&&e.authorKind===`worker_agent`?(0,z.jsx)(`button`,{type:`button`,className:`mt-2 text-xs text-accent hover:underline`,onClick:()=>o(e.id),children:n===`zh`?`回复问题`:`Reply`}):null]},e.id)),g&&!y.length?(0,z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,z.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,z.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,z.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),rows:2,"aria-label":n===`zh`?`任务留言`:`Task message`,placeholder:n===`zh`?`给执行 Agent 留言`:`Message the worker`,className:`mt-3 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),p?(0,z.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:p}):null,(0,z.jsx)(`button`,{type:`button`,disabled:!r.trim()||s,onClick:()=>void te(),className:`mt-2 rounded-lg bg-accent px-3 py-2 text-xs font-medium text-white disabled:opacity-50`,children:s?n===`zh`?`发送中`:`Sending`:n===`zh`?`发送`:`Send`})]})}function Ke(e){let t=e.task.contract?.acceptanceCriteria??[],n=new Map(e.runs.map(e=>[e.id,e])),r=e.receipts.filter(t=>n.get(t.runId)?.contractVersion===e.task.latestContractVersion).sort((e,t)=>t.finalizedAt-e.finalizedAt);return t.map((t,n)=>{let i=e.criterionReviews.find(r=>r.criterionIndex===n&&r.contractVersion===e.task.latestContractVersion&&r.criterionText===t),a={text:t,status:`unverified`,evidence:[]};for(let e of r){let n=e.verification.checks.find(e=>e.criterion===t);if(!n||n.status===`unverified`)continue;let r=e.evidence.filter(e=>n.evidenceTitles.includes(e.title)),i=n.status===`passed`&&j(e).has(t)?`passed`:n.status===`failed`?`failed`:`unverified`;if(i!==`unverified`){a={text:t,status:i,evidence:r,runId:e.runId};break}}return i&&e.task.contract?.acceptancePolicy!==`verified_auto`?{...a,status:i.status,review:i}:e.task.contract?.acceptancePolicy===`manual`?{...a,status:`unverified`}:a})}function qe(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function Je(e,t){let n={...e.task};t.title!==void 0&&(n.title=t.title),t.priority!==void 0&&(n.priority=t.priority);for(let e of[`body`,`projectId`,`milestoneId`,`parentTaskId`,`dueAt`,`ownerId`]){let r=t[e];r!==void 0&&(r===null?delete n[e]:Object.assign(n,{[e]:r}))}return n.version+=1,n.updatedAt=Date.now(),{...e,task:n}}function Ye(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已完成`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Completed`})[e]}function Xe(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,z.jsx)(P,{className:`h-32 rounded-2xl`}),(0,z.jsx)(P,{className:`h-52 rounded-2xl`}),(0,z.jsx)(P,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Ze(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function Qe(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var $e=[`backlog`,`ready`,`active`,`review`,`closed`],et=[`low`,`normal`,`high`,`critical`],tt=(0,R.memo)(function(e){let t=(0,L.c)(20),{value:n,disabled:r,canMove:i,canApprove:a,canReopen:o,language:s,label:u,onChange:d}=e,f;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==n?(f=e=>e!==n&&(e===`closed`?!a:n===`closed`?!o:!i),t[0]=a,t[1]=i,t[2]=o,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]===u?m=t[6]:(m=(0,z.jsx)(`span`,{children:u}),t[5]=u,t[6]=m);let h;t[7]===d?h=t[8]:(h=e=>d(e.target.value),t[7]=d,t[8]=h);let g;t[9]!==s||t[10]!==p?(g=$e.map(e=>(0,z.jsx)(l,{value:e,disabled:p(e),children:Ye(e,s)},e)),t[9]=s,t[10]=p,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==h||t[14]!==g||t[15]!==n?(_=(0,z.jsx)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:h,children:g}),t[12]=r,t[13]=h,t[14]=g,t[15]=n,t[16]=_):_=t[16];let v;return t[17]!==m||t[18]!==_?(v=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[m,_]}),t[17]=m,t[18]=_,t[19]=v):v=t[19],v}),nt=(0,R.memo)(function(e){let t=(0,L.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=s);let u;t[2]===o?u=t[3]:(u=e=>o(e.target.value),t[2]=o,t[3]=u);let d;t[4]===a?d=t[5]:(d=et.map(e=>(0,z.jsx)(l,{value:e,children:a[e]},e)),t[4]=a,t[5]=d);let f;t[6]!==r||t[7]!==u||t[8]!==d||t[9]!==n?(f=(0,z.jsx)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:u,children:d}),t[6]=r,t[7]=u,t[8]=d,t[9]=n,t[10]=f):f=t[10];let p;return t[11]!==s||t[12]!==f?(p=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[s,f]}),t[11]=s,t[12]=f,t[13]=p):p=t[13],p}),rt=(0,R.memo)(function(e){let t=(0,L.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==a||t[5]!==n?(s=(0,z.jsx)(I,{disabled:r,value:n,onChange:a,ariaLabel:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==s?(c=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}),it=(0,R.memo)(function(e){let t=(0,L.c)(17),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,onChange:s}=e,u;t[0]===i?u=t[1]:(u=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e.target.value),t[2]=s,t[3]=d);let f;t[4]===a?f=t[5]:(f=(0,z.jsx)(l,{value:``,disabled:!0,children:a}),t[4]=a,t[5]=f);let p;t[6]===o?p=t[7]:(p=o.map(Ct),t[6]=o,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==f||t[11]!==p||t[12]!==n?(m=(0,z.jsxs)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:d,children:[f,p]}),t[8]=r,t[9]=d,t[10]=f,t[11]=p,t[12]=n,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}),at=(0,R.memo)(function(e){let t=(0,L.c)(9),{candidates:n,selected:r,disabled:i,labels:a,getTaskHref:o,onChange:s}=e,c;t[0]===r?c=t[1]:(c=r.map(wt),t[0]=r,t[1]=c);let l;return t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==a||t[6]!==s||t[7]!==c?(l=(0,z.jsx)(Be,{borderless:!0,candidates:n,selectedIds:c,disabled:i,getTaskHref:o,onChange:s,labels:a}),t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l):l=t[8],l},(e,t)=>e.disabled===t.disabled&&e.labels===t.labels&&e.getTaskHref===t.getTaskHref&&e.onChange===t.onChange&&e.candidates.length===t.candidates.length&&e.candidates.every((e,n)=>e.id===t.candidates[n]?.id&&e.title===t.candidates[n]?.title)&&e.selected.length===t.selected.length&&e.selected.every((e,n)=>e.id===t.selected[n]?.id&&e.title===t.selected[n]?.title)),ot=`xopc.taskDetail.chatPanelPercent`,st=42;function ct(e,t){let n=Math.max(30,352/Math.max(t,1)*100),r=Math.min(60,(t-480)/Math.max(t,1)*100);return r<n?st:Math.min(r,Math.max(n,e))}function lt(){try{let e=Number(window.localStorage.getItem(ot));return Number.isFinite(e)&&e>=30&&e<=60?e:st}catch{return st}}function ut(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.waits.some(e=>e.kind===`paused`)?`paused`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`ready`:e.operationalState}function dt(e){return e===`failed`?`bg-danger/10 text-danger`:e===`needsUser`||e===`blocked`?`bg-warning/10 text-warning`:e===`completed`?`bg-success-soft text-success`:e===`running`||e===`verifying`||e===`review`?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`}function ft(e){let t=(0,L.c)(6),{items:n,empty:r}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,z.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let i;t[2]===n?i=t[3]:(i=n.map(pt),t[2]=n,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,z.jsx)(`ul`,{className:`space-y-2`,children:i}),t[4]=i,t[5]=a),a}function pt(e){return(0,z.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,z.jsx)(Le,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,z.jsx)(`span`,{children:e})]},e)}function mt({taskId:e,presentation:t,backgroundPath:n,onDeleted:r}){let[o]=a(),c=i(),l=ae(e=>e.language),ie=O(e=>e.conversationId),D=(0,R.useMemo)(()=>Oe(l),[l]),k=De(e=>e.setPageHeader),oe=De(e=>e.clearPageHeader),se=ke(e=>e.open),ce=ke(e=>e.conversationIdOverride),le=ke(e=>e.openForSession),ue=be(e=>e.setOpen),{data:A,error:j,mutate:N,lastChange:P,conversationLoading:fe,conversationError:pe}=Ee(e),{data:ve}=de(e?`task-detail-automations`:null,()=>Ie.list()),[we,F]=(0,R.useState)(null),[I,Be]=(0,R.useState)(()=>new Set),[L,He]=(0,R.useState)([]),[B,We]=(0,R.useState)(null),[Ye,$e]=(0,R.useState)([]),[et,pt]=(0,R.useState)(!1),[mt,ht]=(0,R.useState)(``),[gt,V]=(0,R.useState)(!1),[_t,vt]=(0,R.useState)(``),[yt,bt]=(0,R.useState)(!1),[H,xt]=(0,R.useState)(lt),[St,Ct]=(0,R.useState)(!1),wt=(0,R.useRef)(null),Tt=(0,R.useRef)(!1),Et=(0,R.useRef)(!1),Dt=(0,R.useRef)(``),Ot=(0,R.useRef)(null),kt=(0,R.useRef)(null),At=(0,R.useRef)(null),U=(0,R.useRef)(A),[jt,W]=(0,R.useState)(null),[Mt,Nt]=(0,R.useState)(null),[Pt,Ft]=(0,R.useState)(!1),It=(0,R.useMemo)(()=>({link:D.linkDependencies,linked:D.linkedDependencies,searchPlaceholder:D.dependencySearchPlaceholder,noMatches:D.noDependencyMatches,noCandidates:D.noDependencyCandidates,remove:D.removeDependency}),[D.dependencySearchPlaceholder,D.linkDependencies,D.linkedDependencies,D.noDependencyCandidates,D.noDependencyMatches,D.removeDependency]),Lt=A?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,Rt=(0,R.useMemo)(()=>b(o.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[o]),zt=(0,R.useCallback)(e=>t===`modal`&&n?te(n,e):ne(`/tasks/${encodeURIComponent(e)}`,Rt),[n,t,Rt]);U.current=A;let G=(0,R.useCallback)((e,t)=>{Be(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,R.useEffect)(()=>{F(null),W(null),pt(!1),Ot.current=null,V(!1),bt(!1),Nt(null),Ft(!1)},[e]),(0,R.useEffect)(()=>{let e=!0;return je().then(t=>{e&&$e(t.items)}).catch(()=>void 0),()=>{e=!1}},[ie]),(0,R.useEffect)(()=>{if(!P||P.source===`user`)return;Nt(P);let e=window.setTimeout(()=>Nt(null),3500);return()=>window.clearTimeout(e)},[P]),(0,R.useEffect)(()=>{let t=A?.task.projectId,n=A?.dependencies??[];if(!t){At.current=null,We(null),He(n);return}At.current!==t&&(At.current=t,We(null));let r=!0;return Ae(t).then(t=>{if(!r)return;We(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});He([...i.values()])}).catch(()=>{r&&He(n)}),()=>{r=!1}},[Lt,A?.task.projectId,e]);let K=(0,R.useCallback)(async(t,n=`command`)=>{let r=U.current;if(r){G(n,!0),F(null);try{await N(await g(e,t,r.task.version),{revalidate:!1})}catch{F(D.actionFailed)}finally{G(n,!1)}}},[D.actionFailed,N,G,e]),q=(0,R.useCallback)(async(t,n)=>{let r=U.current;if(!r)return!1;n&&G(n,!0),F(null);try{return await N(v(e,t,r.task.version),{optimisticData:Je(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return F(D.actionFailed),!1}finally{n&&G(n,!1)}},[D.actionFailed,N,G,e]),Bt=()=>{A&&(Ot.current={value:A.task.title,version:A.task.version},W(null),ht(A.task.title),pt(!0))},Vt=()=>{Tt.current=!0,ht(U.current?.task.title??``),Ot.current=null,W(null),pt(!1),queueMicrotask(()=>{Tt.current=!1})},Ht=async(e=!1)=>{if(Tt.current){Tt.current=!1;return}let t=U.current;if(!t||I.has(`title`))return;let n=mt.trim();if(!n){Vt();return}let r=Ot.current;if(!e&&qe(r,t.task.version,t.task.title,n)){W(`title`);return}if(n===t.task.title){Vt();return}await q({title:n},`title`)&&(Ot.current=null,W(null),pt(!1))},Ut=async()=>{if(!A)return;if(Et.current){Et.current=!1;return}let e=_t.trim(),t=kt.current;if(qe(t,A.task.version,A.task.body??``,e)){W(`description`);return}if(_t===Dt.current||e===(A.task.body??``).trim()){V(!1);return}await q({body:e||null})&&(W(null),V(!1))},Wt=(0,R.useCallback)(async e=>{let t=U.current;if(!(!t||e===t.task.phase)){if(t.task.phase===`closed`){await K({type:`reopen`,phase:e===`closed`?`ready`:e},`phase`);return}if(e===`closed`){await K({type:`close`,resolution:`done`},`phase`);return}await K({type:`move`,phase:e},`phase`)}},[K]),Gt=(0,R.useCallback)(e=>{q({priority:e},`priority`)},[q]),Kt=(0,R.useCallback)(e=>{q({dueAt:Qe(e)},`dueAt`)},[q]),qt=(0,R.useCallback)(e=>{xt(e);try{window.localStorage.setItem(ot,String(e))}catch{}},[]),Jt=(0,R.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=wt.current?.clientWidth??0;qt(ct(e.key===`Home`?st:H+(e.key===`ArrowLeft`?2:-2),t))},[H,qt]),Yt=(0,R.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=wt.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),Ct(!0);let i=H,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=ct((n.right-e.clientX)/n.width*100,n.width),a===0&&(a=window.requestAnimationFrame(o))},c=()=>{a!==0&&(window.cancelAnimationFrame(a),o());try{n.releasePointerCapture(r)}catch{}Ct(!1),qt(i),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[H,qt]),Xt=(0,R.useCallback)(async t=>{let n=U.current;if(n){G(`dependencies`,!0),F(null);try{await N(await h(e,t,n.task.version),{revalidate:!1})}catch{F(D.dependencyUpdateFailed)}finally{G(`dependencies`,!1)}}},[D.dependencyUpdateFailed,N,G,e]),Zt=(0,R.useCallback)(async t=>{let n=U.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){G(`delegateAgentId`,!0),F(null);try{await N(await p(e,t,n.task.version),{revalidate:!1})}catch{F(D.actionFailed)}finally{G(`delegateAgentId`,!1)}}},[D.actionFailed,N,G,e]),Qt=(0,R.useCallback)(async()=>{G(`delete`,!0),F(null);try{await ee(e),r?r():c(Rt,{replace:!0})}catch(e){F(e instanceof Error?e.message:D.actionFailed)}finally{G(`delete`,!1)}},[D.actionFailed,c,r,Rt,G,e]),$t=(0,R.useCallback)(async(t,n)=>{let r=U.current;if(r){G(`acceptance`,!0),F(null);try{await N(await m(e,t,n,r.task.version,r.task.latestContractVersion),{revalidate:!1})}catch{F(D.actionFailed),await N()}finally{G(`acceptance`,!1)}}},[D.actionFailed,N,G,e]);if((0,R.useLayoutEffect)(()=>{if(t!==`modal`)return k({startExtra:(0,z.jsx)(s,{to:Rt,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":D.backToWork,children:(0,z.jsx)(_e,{className:`size-4`})}),main:A?(0,z.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:B?`${B} / ${D.taskLabel}`:D.taskLabel}):null,end:null}),oe},[oe,D.backToWork,D.taskLabel,A,t,B,Rt,k]),j&&!A)return(0,z.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:D.taskNotFound});if(!A)return(0,z.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,z.jsx)(Xe,{})});let en=A.waits[0],J=Ke(A),tn=J.length>0&&J.every(e=>e.status===`passed`),nn=A.waits.find(e=>e.kind===`paused`),Y=A.receipts[0],rn=ut(A),an=D.detailStatuses[rn],on=A.task.body?.trim()||A.task.contract?.objective.trim(),sn=A.allowedCommands.includes(`mark_ready`),cn=A.allowedCommands.includes(`start`),ln=A.allowedCommands.includes(`add_wait`),un=!en&&tn&&A.task.phase===`review`&&A.allowedCommands.includes(`close`),dn=A.allowedCommands.includes(`reopen`),X=A.conversation.activeConversationId,fn=A.conversation.currentExecutorAgentId??A.task.delegateAgentId??A.task.ownerId,pn=Ye.find(e=>e.id===fn),mn=!!(X&&se&&ce===X),hn=A.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`),gn=J.filter(e=>e.status===`passed`).length,_n=A.context.filter(e=>e.role===`deliverable`),vn=new Set(A.runs.filter(e=>e.contractVersion===A.task.latestContractVersion).map(e=>e.id)),yn=[...new Map(A.receipts.filter(e=>vn.has(e.runId)).flatMap(e=>e.evidence.filter(e=>e.kind===`artifact`)).map(e=>[e.uri??e.title,e])).values()],bn=A.context.filter(e=>e.role!==`deliverable`),xn=A.runs.filter(e=>e.executorKind===`workflow`&&!e.parentRunId),Sn=[...new Set(xn.map(e=>e.executorRef.workflowId).filter(e=>typeof e==`string`))],Cn=ve?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],Z=A.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),wn=A.task.contract?.expectedOutputs??[],Tn=A.task.contract?.constraints??[],En=A.task.contract?.approvalRequired??[],Dn=A.task.contract?.assumptions??[],On=A.task.contract?.risks??[],kn=Tn.length>0||En.length>0||Dn.length>0||On.length>0,Q=(...e)=>!!Mt?.changedFields.some(t=>e.includes(t)),An=A.allowedCommands.includes(`move`),$=I.has(`command`),jn=I.has(`delete`),Mn=A.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),Nn=Mn!==void 0,Pn=`/automations?action=create&taskId=${encodeURIComponent(A.task.id)}${A.task.projectId?`&projectId=${encodeURIComponent(A.task.projectId)}`:``}`,Fn=(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[sn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`mark_ready`}),children:[(0,z.jsx)(T,{className:`size-4`}),D.scheduleTask]}):null,nn&&A.allowedCommands.includes(`resolve_wait`)?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`resolve_wait`,waitId:nn.id}),children:[(0,z.jsx)(T,{className:`size-4`}),D.resumeTask]}):null,!en&&cn&&fn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`start`,executor:{kind:`agent`,agentId:fn}}),children:[(0,z.jsx)(T,{className:`size-4`}),D.runTask]}):null,un?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`close`,resolution:`done`}),children:[(0,z.jsx)(u,{className:`size-4`}),D.approveTask]}):null,dn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`reopen`,phase:`ready`}),children:[(0,z.jsx)(T,{className:`size-4`}),D.reopenTask]}):null,!nn&&ln?(0,z.jsxs)(M,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:$,onClick:()=>void K({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,z.jsx)(w,{className:`size-4`}),D.pauseTask]}):null,A.task.phase===`closed`?null:(0,z.jsx)(M,{asChild:!0,variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,children:(0,z.jsxs)(s,{to:Pn,children:[(0,z.jsx)(Se,{className:`size-4`}),D.scheduleRecurringTask]})}),(0,z.jsxs)(me,{children:[(0,z.jsx)(ye,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:$||jn,"aria-label":D.moreActions,children:(0,z.jsx)(d,{className:`size-4`,"aria-hidden":!0})})}),(0,z.jsx)(Fe,{children:(0,z.jsxs)(he,{align:`end`,sideOffset:6,className:`z-[100] min-w-44 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[Mn?(0,z.jsx)(xe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{G(`command`,!0),F(null),N(_(e,Mn.id,Mn.version),{revalidate:!1}).catch(()=>F(D.actionFailed)).finally(()=>G(`command`,!1))},children:D.cancelActiveRun}):null,Mn?(0,z.jsx)(Pe,{className:`my-1 h-px bg-edge`}):null,A.task.phase===`closed`?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(xe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void K({type:`close`,resolution:`cancelled`}),children:D.cancelTask}),(0,z.jsx)(Pe,{className:`my-1 h-px bg-edge`})]}),(0,z.jsx)(xe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{if(Nn){F(D.deleteActiveTaskBlocked);return}Ft(!0)},children:D.deleteTask})]})})]})]});return(0,z.jsxs)(`div`,{ref:wt,className:`flex h-full min-h-0 flex-col overflow-hidden ${St?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${H}%`},children:[(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`task-detail-scroll flex min-w-0 shrink-0 flex-col lg:min-h-0 lg:flex-1 lg:shrink lg:overflow-y-auto lg:overscroll-contain`,children:[(0,z.jsxs)(`header`,{className:E(`shrink-0 border-b border-edge-subtle bg-surface-panel px-5 py-4 sm:px-6`,Q(`title`)&&`task-detail-live-update`),children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[B?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,z.jsx)(ge,{className:`size-3.5`,"aria-hidden":!0}),B]}):null,B?(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,z.jsx)(`span`,{children:D.taskLabel}),Mt?(0,z.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:Mt.source===`agent`?l===`zh`?`Agent 刚刚更新`:`Updated by Agent`:l===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),et?(0,z.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":l===`zh`?`任务标题`:`Task title`,rows:2,value:mt,onFocus:e=>{Ot.current?.value===mt&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>ht(e.target.value),onBlur:()=>void Ht(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),Vt()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.currentTarget.blur()))},className:`mt-2 block max-h-56 min-h-14 w-full max-w-3xl resize-none overflow-y-auto bg-transparent p-0 text-xl font-semibold leading-7 text-fg outline-none [field-sizing:content]`}):(0,z.jsx)(`h1`,{className:`mt-2 max-w-3xl break-words text-xl font-semibold leading-7 text-fg`,children:(0,z.jsx)(`button`,{type:`button`,className:`line-clamp-2 max-w-full rounded-sm text-left outline-none hover:bg-surface-hover/60 focus-visible:ring-2 focus-visible:ring-accent/40`,title:A.task.title,onClick:Bt,children:A.task.title})}),jt===`title`?(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:Vt,children:l===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:I.has(`title`),onClick:()=>void Ht(!0),children:l===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,z.jsx)(`span`,{className:E(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,dt(rn)),children:an})]}),(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[fn?(0,z.jsx)(Te,{agentId:fn,avatar:pn?.avatar,size:20,className:`shrink-0`}):null,(0,z.jsxs)(`span`,{className:`truncate`,children:[D.executorLabel,` · `,pn?.name??fn??D.unassigned]})]}),(0,z.jsx)(`span`,{className:`text-fg-subtle`,children:D.updatedAt.replace(`{{date}}`,Ce(A.task.updatedAt,l))})]}),(0,z.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:Fn}),we?(0,z.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:we}):null]}),(0,z.jsxs)(`section`,{className:`min-w-0 p-5 sm:p-6`,children:[(0,z.jsxs)(`section`,{className:`mb-4 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`目标与验收`:`Goal and acceptance`}),J.length>0?(0,z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:D.criteriaProgress.replace(`{{verified}}`,String(gn)).replace(`{{total}}`,String(J.length))}):null]}),(0,z.jsx)(`p`,{className:E(`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-fg`,!yt&&(A.task.contract?.objective||A.task.title).length>280&&`line-clamp-3`),children:A.task.contract?.objective||A.task.title}),(A.task.contract?.objective||A.task.title).length>280?(0,z.jsx)(`button`,{type:`button`,className:`mt-2 text-xs font-medium text-accent hover:underline`,"aria-expanded":yt,onClick:()=>bt(e=>!e),children:l===`zh`?yt?`收起目标`:`展开完整目标`:yt?`Show less`:`Show full goal`}):null]}),(0,z.jsxs)(`div`,{className:`p-5`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.successDefinition}),J.length>0?(0,z.jsx)(`ul`,{className:`mt-3 space-y-3`,children:J.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm leading-5 text-fg`,children:[(0,z.jsx)(e.status===`passed`?u:e.status===`failed`?Me:Le,{className:E(`mt-0.5 size-4 shrink-0`,e.status===`passed`?`text-success`:e.status===`failed`?`text-danger`:`text-fg-subtle`),"aria-hidden":!0}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{children:e.text}),e.evidence.length>0?(0,z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 text-xs leading-5 text-fg-muted`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`依据:`:`Evidence:`}),e.evidence.map(e=>e.uri&&/^https?:\/\//.test(e.uri)?(0,z.jsx)(`a`,{className:`text-accent hover:underline`,href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.title},e.title):(0,z.jsx)(`span`,{children:e.title},e.title))]}):null,e.review?(0,z.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[l===`zh`?`人工判定`:`Reviewed by user`,` · `,Ce(e.review.reviewedAt,l)]}):null]}),A.task.phase!==`closed`&&A.task.contract?.acceptancePolicy!==`verified_auto`?(0,z.jsxs)(me,{children:[(0,z.jsx)(ye,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`h-7 shrink-0 px-2 text-xs`,disabled:I.has(`acceptance`),children:l===`zh`?`判定`:`Review`})}),(0,z.jsx)(Fe,{children:(0,z.jsxs)(he,{align:`end`,sideOffset:4,className:`z-[100] min-w-32 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,z.jsx)(xe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void $t(t,`passed`),children:l===`zh`?`确认通过`:`Mark passed`}),(0,z.jsx)(xe,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void $t(t,`failed`),children:l===`zh`?`标记未通过`:`Mark failed`})]})})]}):null]},`${t}-${e.text}`))}):(0,z.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:D.noDefinition})]})]}),A.attention.length>0?(0,z.jsxs)(`section`,{className:E(`mb-4 rounded-xl border border-warning/20 bg-warning/10 p-4`,Q(`attention`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:hn?D.needsAttention:D.waitingStatus}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-sm leading-6 text-fg-muted`,children:A.attention.map((t,n)=>(0,z.jsxs)(`li`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1`,children:t.summary}),t.kind===`input_required`||t.kind===`approval_required`?(0,z.jsx)(s,{className:`inline-flex min-h-11 items-center rounded-lg bg-surface-panel px-3 text-sm font-medium text-accent`,to:S(e),children:l===`zh`?t.kind===`approval_required`?`查看并决定`:`补充信息`:t.kind===`approval_required`?`Review decision`:`Provide information`}):null]},`${t.kind}-${n}`))})]}):null,A.task.phase!==`closed`&&!nn&&A.waits.filter(e=>(e.kind===`user_input`||e.kind===`approval`&&typeof e.condition.capability==`string`)&&e.condition.type!==`connection`).map(e=>(0,z.jsx)(Ve,{wait:e,detail:A,zh:l===`zh`,onUpdated:e=>{N(e,{revalidate:!1})}},e.id)),(0,z.jsx)(`div`,{className:`mb-4`,children:(0,z.jsx)(Ge,{taskId:e},e)}),_n.length>0||yn.length>0||wn.length>0?(0,z.jsxs)(`section`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`交付物`:`Deliverables`}),_n.length>0||yn.length>0?(0,z.jsxs)(`ul`,{className:`mt-3 space-y-2`,children:[_n.map(e=>(0,z.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:D.contextKindLabels[e.targetKind]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,z.jsx)(`span`,{className:`mt-1 block break-words text-fg`,children:e.title??e.targetId})]},e.id)),yn.map(e=>(0,z.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:l===`zh`?`执行产物`:`Run artifact`}),e.uri&&/^https?:\/\//.test(e.uri)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-accent hover:underline`,href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.title}):(0,z.jsx)(`span`,{className:`mt-1 block break-words text-fg`,children:e.title})]},e.uri??e.title))]}):(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:l===`zh`?`尚未关联交付物`:`No deliverables linked yet`}),wn.length>0?(0,z.jsxs)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.expectedOutputs}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(ft,{items:wn,empty:D.noDefinition})})]}):null]}):null,(0,z.jsxs)(`section`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`关联内容`:`Related work`}),Z.length>0||A.runs.length>0||Cn.length>0||A.dependencies.length>0||A.dependents.length>0?(0,z.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[Z.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`对话 · ${Z.length}`:`Conversations · ${Z.length}`}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.slice(0,3).map(t=>(0,z.jsx)(`li`,{children:(0,z.jsx)(s,{className:`block truncate text-sm text-accent hover:underline`,to:t.conversationId===X?S(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===X?l===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?l===`zh`?`关联讨论`:`Linked discussion`:l===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,A.runs.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`执行 · ${A.runs.length}`:`Runs · ${A.runs.length}`}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm text-fg`,children:[l===`zh`?`最近执行:`:`Latest run: `,Y?D.receiptStatuses[Y.status]:an]}),xn.length>0?(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:l===`zh`?`含 ${xn.length} 次工作流执行`:`${xn.length} workflow runs`}):null,Sn.map(e=>(0,z.jsxs)(s,{className:`mt-1 block truncate text-xs text-accent hover:underline`,to:`/workflows/${encodeURIComponent(e)}`,children:[l===`zh`?`工作流:`:`Workflow: `,e]},e))]}):null,Cn.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`自动化 · ${Cn.length}`:`Automations · ${Cn.length}`}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Cn.slice(0,3).map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(s,{className:`block truncate text-sm text-accent hover:underline`,to:`/automations?automation=${encodeURIComponent(e.id)}`,children:e.name})},e.id))})]}):null,A.dependencies.length>0||A.dependents.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.taskRelations}),(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:l===`zh`?`${A.dependencies.length} 个前置任务 · ${A.dependents.length} 个后续任务`:`${A.dependencies.length} prerequisites · ${A.dependents.length} dependents`})]}):null]}):(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:l===`zh`?`还没有关联内容`:`No related work yet`}),(0,z.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,z.jsx)(ze,{resource:{kind:`task`,id:A.task.id,revision:String(A.task.version)},disabled:et||gt||I.size>0})})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`main`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`body`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskDescription}),gt?(0,z.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:_t,onChange:e=>vt(e.target.value),onBlur:()=>void Ut(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Et.current=!0,vt(A.task.body??A.task.contract?.objective??``),V(!1),queueMicrotask(()=>{Et.current=!1}))},className:`mt-3 w-full resize-y rounded-lg bg-surface-hover px-3 py-2 text-sm leading-6 text-fg outline-none ring-2 ring-accent/20 focus:ring-accent/50`}):(0,z.jsxs)(`div`,{className:`mt-2`,children:[on&&on!==A.task.title?(0,z.jsx)(x,{content:on,compact:!0,className:`break-words text-sm leading-6 text-fg-muted`}):(0,z.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:D.noTaskDescription}),(0,z.jsx)(`button`,{type:`button`,className:`mt-2 rounded-md px-2 py-1 text-xs text-accent hover:bg-surface-hover focus-visible:bg-surface-hover`,onClick:()=>{let e=A.task.body??A.task.contract?.objective??``;Dt.current=e,kt.current={value:A.task.body??``,version:A.task.version},W(null),vt(e),V(!0)},children:l===`zh`?`编辑说明`:`Edit description`})]}),jt===`description`?(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{vt(A.task.body??``),W(null),V(!1)},children:l===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void q({body:_t.trim()||null}).then(e=>{e&&(W(null),V(!1))}),children:l===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),kn?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`contract`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskDefinition}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:l===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),Tn.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.constraints}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:Tn,empty:D.noDefinition})})]}):null,En.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.approvalRequired}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:En,empty:D.noDefinition})})]}):null,Dn.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.contextAssumptions}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:Dn,empty:D.noDefinition})})]}):null,On.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.contextRisks}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:On,empty:D.noDefinition})})]}):null]}):null,Y?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`runs`,`receipts`)&&`task-detail-live-update`),children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.latestResult}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:l===`zh`?Y.completionVerdict===`achieved`?`本次执行报告目标已达成,请结合下方验证依据验收。`:`这是阶段性结果,尚不能代表任务全部完成。`:Y.completionVerdict===`achieved`?`The run reports the goal achieved. Review the evidence below.`:`This is a partial result; the task is not yet fully complete.`}),(0,z.jsx)(x,{content:Y.summary,compact:!0,className:`mt-2 text-sm leading-6 text-fg`})]}),(0,z.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[D.receiptStatuses[Y.status],` · `,D.verificationStatuses[Y.verification.status]]})]}),Y.remainingWork.length>0?(0,z.jsxs)(`div`,{className:`mt-4`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.remainingWork}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(ft,{items:Y.remainingWork,empty:D.noRemainingWork})})]}):null,Y.nextAction?(0,z.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:D.nextAction}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:Y.nextAction})]}):null,(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(M,{className:`border-0 bg-surface-hover px-2 py-1 text-xs shadow-none`,variant:`secondary`,onClick:()=>void y(Y.runId,`helpful`),children:D.doneWell}),(0,z.jsx)(M,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void y(Y.runId,`not_helpful`),children:D.needsFix})]}),(0,z.jsx)(Ue,{evidence:Y.evidence,projectId:A.task.projectId,conversationId:X??void 0,language:l}),A.receipts.length>1?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.executionHistory.replace(`{{count}}`,String(A.receipts.length-1))}),(0,z.jsx)(`div`,{className:`mt-3 space-y-3`,children:A.receipts.slice(1).map(e=>(0,z.jsx)(`article`,{className:`rounded-lg bg-surface-hover p-3`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,z.jsx)(`p`,{className:`text-sm text-fg`,children:e.summary}),(0,z.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:D.receiptStatuses[e.status]})]})},e.runId))})]}):null]}):null,bn.length>0?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`context`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.contextUsed}),(0,z.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:bn.map(e=>(0,z.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,z.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[D.contextRoleLabels[e.role],` · `,D.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,z.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,z.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskProperties}),(0,z.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,z.jsx)(tt,{value:A.task.phase,disabled:I.has(`phase`),canMove:An,canApprove:un,canReopen:dn,language:l,label:D.taskPhase,onChange:Wt}),(0,z.jsx)(nt,{value:A.task.priority,disabled:I.has(`priority`),label:D.priority,labels:D.priorityLabels,onChange:Gt}),(0,z.jsx)(rt,{value:Ze(A.task.dueAt),disabled:I.has(`dueAt`),label:D.dueDate,onChange:Kt}),(0,z.jsx)(it,{value:A.conversation.currentExecutorAgentId??``,disabled:I.has(`delegateAgentId`),label:D.executorLabel,unassignedLabel:D.unassigned,agents:Ye,onChange:Zt})]})]}),(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`dependencies`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskRelations}),(0,z.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:D.dependencies}),(0,z.jsx)(at,{candidates:L,selected:A.dependencies,disabled:I.has(`dependencies`),labels:It,getTaskHref:zt,onChange:Xt})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:D.dependents}),A.dependents.length>0?(0,z.jsx)(`div`,{className:`space-y-1.5`,children:A.dependents.map(e=>(0,z.jsx)(s,{to:zt(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-fg-muted transition-colors hover:text-fg`,children:e.title},e.id))}):(0,z.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:D.noDependents})]})]})]})]})]})]})]}),(0,z.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":l===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(H),tabIndex:0,onPointerDown:Yt,onKeyDown:Jt,onDoubleClick:()=>qt(st),className:`group hidden w-2 shrink-0 cursor-col-resize touch-none items-stretch justify-center bg-surface-panel outline-none transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover lg:flex ${St?`bg-surface-hover`:``}`,children:(0,z.jsx)(`div`,{className:`w-px bg-edge-strong/70 transition-colors group-hover:bg-accent group-focus-visible:bg-accent`})}),(0,z.jsxs)(`aside`,{className:`flex min-h-[34rem] min-w-0 shrink-0 flex-col border-t border-edge-subtle bg-surface-panel lg:min-h-0 lg:w-[var(--task-chat-panel-width)] lg:border-t-0`,children:[(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:l===`zh`?`执行对话`:`Execution chat`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Z.length>1?(0,z.jsxs)(me,{children:[(0,z.jsx)(ye,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:l===`zh`?`${Z.length} 段对话`:`${Z.length} conversations`})}),(0,z.jsx)(Fe,{children:(0,z.jsx)(he,{align:`end`,sideOffset:6,className:`z-[100] min-w-52 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:Z.map(t=>(0,z.jsx)(xe,{asChild:!0,children:(0,z.jsx)(s,{className:`block rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,to:t.conversationId===X?S(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===X?l===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?l===`zh`?`关联讨论`:`Linked discussion`:l===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,X?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:E(`size-8 p-0`,mn&&`bg-surface-hover text-fg`),"aria-label":l===`zh`?`项目文件`:`Project files`,"aria-pressed":mn,onClick:()=>{ue(X,!1),le(X)},children:(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(M,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,z.jsx)(s,{to:S(e),"aria-label":l===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,z.jsx)(f,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),X?(0,z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,z.jsx)(Re,{embedded:!0,conversationId:X,taskId:e})}):fe?(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):pe?(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 text-danger`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:pe instanceof Error?pe.message:String(pe)})]})}):(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 text-fg-subtle`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:l===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),(0,z.jsx)(Ne,{open:Pt,title:D.deleteTaskTitle,description:D.deleteTaskDescription.replace(`{{title}}`,A.task.title),confirmLabel:D.confirmDeleteTask,cancelLabel:D.keepTask,destructive:!0,onConfirm:()=>{Ft(!1),Qt()},onCancel:()=>Ft(!1)})]})}function ht(){let e=(0,L.c)(2),{taskId:t}=o(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,z.jsx)(mt,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function gt(e){let t=(0,L.c)(47),{taskId:n,backgroundPath:r,onClose:i}=e,a=ae(St),o=ke(xt),s=ke(H),c=ke(bt),l=F(yt),u=F(vt),d=o?s:0,f;t[0]!==i||t[1]!==u?(f=e=>{e||(u(null),i())},t[0]=i,t[1]=u,t[2]=f):f=t[2];let p=a===`zh`?`关闭任务详情`:`Close task details`,m;t[3]!==i||t[4]!==u?(m=()=>{u(null),i()},t[3]=i,t[4]=u,t[5]=m):m=t[5];let h;t[6]!==p||t[7]!==m?(h=(0,z.jsx)(`button`,{type:`button`,tabIndex:-1,"data-task-modal-backdrop":!0,className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`,"aria-label":p,onClick:m}),t[6]=p,t[7]=m,t[8]=h):h=t[8];let g=o?`true`:`false`,_=`${d/2}px`,v=`${d}px`,y;t[9]!==_||t[10]!==v?(y={"--task-detail-workspace-offset":_,"--task-detail-workspace-width":v},t[9]=_,t[10]=v,t[11]=y):y=t[11];let ee=y,te=a===`zh`?`任务详情`:`Task details`,b;t[12]===te?b=t[13]:(b=(0,z.jsx)(ue,{className:`font-medium text-fg`,children:te}),t[12]=te,t[13]=b);let ne=a===`zh`?`查看并操作任务详情`:`View and manage task details`,x;t[14]===ne?x=t[15]:(x=(0,z.jsx)(oe,{className:`sr-only`,children:ne}),t[14]=ne,t[15]=x);let S=a===`zh`?`关闭任务详情`:`Close task details`,re;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,z.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),t[16]=re):re=t[16];let C;t[17]===S?C=t[18]:(C=(0,z.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,z.jsx)(se,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":S,children:re})}),t[17]=S,t[18]=C);let w;t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,z.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 bg-surface-panel px-5 py-3.5`,children:[b,x,C]}),t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T;t[23]!==i||t[24]!==u?(T=()=>{u(null),i()},t[23]=i,t[24]=u,t[25]=T):T=t[25];let E;t[26]!==r||t[27]!==T||t[28]!==n?(E=(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,z.jsx)(mt,{taskId:n,presentation:`modal`,backgroundPath:r,onDeleted:T})}),t[26]=r,t[27]=T,t[28]=n,t[29]=E):E=t[29];let D;t[30]!==w||t[31]!==E||t[32]!==g||t[33]!==ee?(D=(0,z.jsxs)(le,{className:`xopc-dialog-content task-detail-modal-content fixed top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay focus:outline-none`,"data-workspace-panel-open":g,style:ee,onEscapeKeyDown:_t,onInteractOutside:V,children:[w,E]}),t[30]=w,t[31]=E,t[32]=g,t[33]=ee,t[34]=D):D=t[34];let O;t[35]!==l||t[36]!==c||t[37]!==o||t[38]!==s?(O=l?(0,z.jsx)(`div`,{className:`fixed inset-y-0 left-0 z-[100] flex min-h-0 min-w-0 overflow-hidden bg-surface-panel transition-[right] duration-200 ease-out motion-reduce:transition-none`,style:{right:o?s:0},children:(0,z.jsx)(we,{allowOutsideChat:!0,conversationId:c??void 0})}):null,t[35]=l,t[36]=c,t[37]=o,t[38]=s,t[39]=O):O=t[39];let k;t[40]!==D||t[41]!==O||t[42]!==h?(k=(0,z.jsxs)(ce,{children:[h,D,O]}),t[40]=D,t[41]=O,t[42]=h,t[43]=k):k=t[43];let j;return t[44]!==f||t[45]!==k?(j=(0,z.jsx)(A,{modal:!1,open:!0,onOpenChange:f,children:k}),t[44]=f,t[45]=k,t[46]=j):j=t[46],j}function V(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function _t(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function vt(e){return e.setPath}function yt(e){return e.path}function bt(e){return e.conversationIdOverride}function H(e){return e.widthPx}function xt(e){return e.open}function St(e){return e.language}function Ct(e){return(0,z.jsx)(l,{value:e.id,children:e.name||e.id},e.id)}function wt(e){return e.id}export{gt as TaskDetailModal,ht as TaskDetailPage};
|