@xopcai/xopc 0.0.282 → 0.0.284
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-iPtG94qr.js → activity-store-CwbIMGLY.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cny5rATT.js → agent-avatar-dicebear-DjiOld-S.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-OyQ8OVZv.js → agent-defaults-settings-panel-D9qP10BK.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DJeh_Ewo.js → agents-D-bkOuAl.js} +1 -1
- package/dist/gateway/static/root/assets/{api-KMJzMqvZ.js → api-3lphBVuY.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-ZqQKaZEI.js → app-management-settings-panel-B2nwCXxE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CfXsQkKO.js → appearance-settings-BXO4Ej88.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-k-QnVhKW.js → apps-page-BKwBBwJN.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-BrW53Hap.js → archive-plugin-6ZRqNjla.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DkfFWHiS.js → attachment-load-CmPZalcW.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CfEDFYPE.js → attachment-preview-renderer-wzIchDSv.js} +4 -4
- package/dist/gateway/static/root/assets/attachment-process-heavy-Db4nTY5N.js +5 -0
- package/dist/gateway/static/root/assets/{automations-page-e-5we6kD.js → automations-page-Bc3WbK5n.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DPnlkws1.js → automations-workspace-B2-f9qZu.js} +1 -1
- package/dist/gateway/static/root/assets/binary-plugins-OWR6cxpc.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-CfeF1OmA.js → block-editor-Ca-tDQXm.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-BTIufVbM.js → browser-automation-inputs-Dxy2_p3U.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DnsuWKRu.js → browser-automations-page-CibQIxpi.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-C8xyhnxx.js → browser-settings-page-Dtn4rMeq.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CBllOLTT.js → capabilities-settings-panel-DiwtR9MD.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-settings-C-A-VUE2.js → channels-settings-pTdR1q1K.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-status-swr-DMYQNs-J.js → channels-status-swr-Bh-G9mdZ.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C_Fw1R3A.js → chat-terminal-dock-lbzbSpV3.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CtsMo3H4.js → connectors-page-BSQ7Hs2w.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CPFxjTrN.js → date-picker-tYvbTfZT.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-C_5KqzjI.js → dependency-picker-B8yo7-7V.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DLJsC5D6.js → desktop-pet-BUGkGB4-.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BdI1iSgz.js → desktop-pet-settings-DNeVGZNp.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BnvPLhc9.js → device-pairing-wizard-CYkT7ecp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BNS_TkZQ.js → extension-debug-page-CiK0QI2p.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DMSDZ7Mb.js → extension-page-CirPNHJd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CeGCWMt0.js → extension-settings-page-Baua1_Le.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Cpmyrr6j.js → gateway-config-swr-Co4hHe0i.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DKOTYUma.js → gateway-settings-CzpSYWex.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DoiPeb65.js → gateway-startup-retry-DBPNJG-e.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-gsdL_Yij.js → heartbeat-settings-DTM_kYpE.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CbeAdS1T.js → home-page-CSSJvdd6.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-CqjHWl2T.js → image-generation-api-D0rMTumD.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-XqVVYbAp.js +1 -0
- package/dist/gateway/static/root/assets/{index-enFXJJCU.js → index-C9aQA4Dr.js} +10 -10
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CCLtJ8s8.js → keyboard-shortcuts-settings-CMUaF61L.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DzC6SrXj.js → local-app-workbench-page-CZSgTYuI.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-3LdgP3NO.js → local-apps-page-CHxyT09t.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-1urrBBCQ.js → locale-store-DO6JJ1l2.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DHClKtm6.js → logs-page-z5ktnEzX.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BaCo9Nuo.js → management-settings-jXbA2S54.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BZmcFIWa.js → markdown-view-CKInRsDh.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BMjJppvG.js → media-plugins-BaPkSvW7.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BgZRsCkG.js +3 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-hYO2jNhL.js → note-detail-panel-DSaZfkna.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-BT66x22W.js → notes-page-CePEyv_C.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-BCszXX_F.js → page-tabs-CdYemUOu.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +2 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-B4E34YdZ.js +48 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-CyM0sanh.js → preview-open-alternatives-DzgF1yYO.js} +1 -1
- package/dist/gateway/static/root/assets/{proactive-page-CVDGA5sB.js → proactive-page-Cy2Gm2f8.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-lXAbj85Z.js → product-open-page-iQ-eW6Aj.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-Bp6TAMPM.js → project-detail-page-BliwYpns.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-UhOIiDcg.js → projects-page-Dm-BqnQn.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CxQstD00.js → registry-api-DMNudT60.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DJIkMFT4.js → remote-access-hub-C_XuQ9XR.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BUFCgRdZ.js → runtime-tools-settings-panel-u_wVepf7.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-B01ksA8M.js → schema-form-YdZj2xdI.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-CQOAwPDt.js → sessions-page-Drt1aS2G.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BAUd06_9.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DvnjZBa3.js → settings-form-section-Bw6xKOX5.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DZRkpbCh.js → settings-page-CV8kVdnE.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DVaEiAVY.js → setup-status-panel-BHI9e5Tw.js} +1 -1
- package/dist/gateway/static/root/assets/share-preview-page-BHwjHlrV.js +2 -0
- package/dist/gateway/static/root/assets/{shares-settings-XiCqMDAe.js → shares-settings-DOAOjZBQ.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DU0VQpHj.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DRKdb6O5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BryVNYll.js → skills-page.utils-DYfaLtts.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-mKFDe6aZ.js → system-settings-panel-CWrWpKV-.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-Cb0RZNcJ.js → task-detail-page-DiPgMmBM.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-Dc5s20V3.js → theme-store-CDc7Wqy5.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-FcI3wKy3.js → tunnel-api-Bmsy-5Fs.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CDgdtjTC.js → use-autosave-D-FRib85.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Cnshc-Un.js → user-model-page-DxRaRdA0.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-Ce8cb5mN.js → voice-api-key-field-iQ7EBzII.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Mk78BrpP.js → voice-config-api-DNMWA2tx.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CacFTtXe.js → work-discovery-overlay-BesuhDlH.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-V-5HuEUq.js → workflow-run-setup-panel-Du81FoCy.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-1OJimIfo.js → workflows-page-CZikdgNw.js} +1 -1
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/import.d.ts +2 -0
- package/dist/src/cli/commands/import.js +30 -0
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/platform.js +1 -1
- package/dist/src/cli/commands/profile.js +1 -1
- package/dist/src/cli/commands/tunnel.js +1 -1
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/imports.d.ts +3 -0
- package/dist/src/gateway/hono/routes/imports.js +44 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +9 -7
- package/dist/src/imports/compatibility.d.ts +7 -0
- package/dist/src/imports/compatibility.js +174 -0
- package/dist/src/imports/contextImport.d.ts +3 -0
- package/dist/src/imports/contextImport.js +56 -0
- package/dist/src/imports/files.d.ts +13 -0
- package/dist/src/imports/files.js +77 -0
- package/dist/src/imports/importService.d.ts +45 -0
- package/dist/src/imports/importService.js +417 -0
- package/dist/src/imports/planner.d.ts +11 -0
- package/dist/src/imports/planner.js +98 -0
- package/dist/src/imports/productImport.d.ts +10 -0
- package/dist/src/imports/productImport.js +148 -0
- package/dist/src/imports/runtime.d.ts +5 -0
- package/dist/src/imports/runtime.js +56 -0
- package/dist/src/imports/scanner.d.ts +14 -0
- package/dist/src/imports/scanner.js +159 -0
- package/dist/src/imports/secrets.d.ts +2 -0
- package/dist/src/imports/secrets.js +9 -0
- package/dist/src/imports/sources.d.ts +37 -0
- package/dist/src/imports/sources.js +75 -0
- package/dist/src/imports/types.d.ts +91 -0
- package/dist/src/imports/types.js +11 -0
- package/dist/src/knowledge-memory/repository.js +4 -2
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/storage/sqlite/import-repository.d.ts +19 -0
- package/dist/src/storage/sqlite/import-repository.js +35 -0
- package/dist/src/storage/sqlite/migrations/174_capability_imports.sql +11 -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/tasks/home-query-service.js +2 -2
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/package.json +4 -3
- package/dist/gateway/static/root/assets/attachment-process-heavy-C5CqLCsX.js +0 -5
- package/dist/gateway/static/root/assets/binary-plugins-CWIswfXA.js +0 -2
- package/dist/gateway/static/root/assets/excel-worksheet-utils-DpdB-DjU.js +0 -1
- package/dist/gateway/static/root/assets/messages-DYFcjtmG.js +0 -3
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +0 -29
- package/dist/gateway/static/root/assets/settings-advanced-gate-CFuqbGI-.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-vz0UK56q.js +0 -2
- package/dist/gateway/static/root/assets/skill-reload-api-C3D8WanU.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CxMWwR6A.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./electron-env-DH5wF8X8.js";import{vs as o}from"./index-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./download-Dk-ZjtO6.js";import{t as r}from"./external-link-DjqjBmc3.js";import{t as i}from"./cn-JdwAhgNB.js";import{t as a}from"./electron-env-DH5wF8X8.js";import{vs as o}from"./index-C9aQA4Dr.js";var s=e(),c=t();function l(e){let t=(0,s.c)(31),{message:l,downloadLabel:u,onDownload:d,openSystemLabel:f,onOpenWithSystemApp:p,chooseAppLabel:m,onChooseOpenWithApp:h,canOpenWithSystemApp:g,canChooseOpenWithApp:_}=e,v=g===void 0?!0:g,y=_===void 0?!0:_,b;t[0]!==v||t[1]!==p||t[2]!==f?(b=a()&&v&&typeof p==`function`&&typeof f==`string`&&f.length>0,t[0]=v,t[1]=p,t[2]=f,t[3]=b):b=t[3];let x=b,S;t[4]!==y||t[5]!==m||t[6]!==h?(S=a()&&y&&typeof h==`function`&&typeof m==`string`&&m.length>0,t[4]=y,t[5]=m,t[6]=h,t[7]=S):S=t[7];let C=S,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=i(`flex flex-col gap-2 rounded-lg border border-edge-subtle bg-surface-hover/60 p-3 sm:flex-row sm:items-center sm:justify-between dark:border-edge`),t[8]=w):w=t[8];let T;t[9]===l?T=t[10]:(T=(0,c.jsx)(`p`,{className:`min-w-0 text-xs leading-relaxed text-fg-muted`,children:l}),t[9]=l,t[10]=T);let E;t[11]!==p||t[12]!==f||t[13]!==x?(E=x?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void p?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),f]}):null,t[11]=p,t[12]=f,t[13]=x,t[14]=E):E=t[14];let D;t[15]!==m||t[16]!==h||t[17]!==C?(D=C?(0,c.jsxs)(`button`,{type:`button`,className:i(`inline-flex items-center gap-1.5 rounded-md border border-edge bg-surface-panel px-3 py-1.5 text-xs font-medium text-fg shadow-sm dark:border-edge`,o.transition,o.press,o.focusRingPanel),onClick:()=>void h?.(),children:[(0,c.jsx)(r,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),m]}):null,t[15]=m,t[16]=h,t[17]=C,t[18]=D):D=t[18];let O;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(O=i(`inline-flex items-center gap-1.5 rounded-md border border-accent bg-accent px-3 py-1.5 text-xs font-medium text-white shadow-sm`,o.transition,o.press,o.focusRingPanel),t[19]=O):O=t[19];let k;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,c.jsx)(n,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[20]=k):k=t[20];let A;t[21]!==u||t[22]!==d?(A=(0,c.jsxs)(`button`,{type:`button`,className:O,onClick:d,children:[k,u]}),t[21]=u,t[22]=d,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==E||t[26]!==D?(j=(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[E,D,A]}),t[24]=A,t[25]=E,t[26]=D,t[27]=j):j=t[27];let M;return t[28]!==j||t[29]!==T?(M=(0,c.jsxs)(`div`,{className:w,children:[T,j]}),t[28]=j,t[29]=T,t[30]=M):M=t[30],M}export{l as t};
|
package/dist/gateway/static/root/assets/{proactive-page-CVDGA5sB.js → proactive-page-Cy2Gm2f8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{h as i,t as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as o,r as s}from"./popover-select-DGmMQt4t.js";import{t as c}from"./markdown-view-BZmcFIWa.js";import{n as l}from"./locale-store-1urrBBCQ.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{t as d}from"./button-BA45yciM.js";import{t as f}from"./skeleton-BwbyijEw.js";import{t as p}from"./electron-env-DH5wF8X8.js";import{Bu as m,Jt as h,Kt as g,Wa as _,Yt as v,ca as y,go as b,qt as x}from"./index-enFXJJCU.js";var S=n(),C=e(t(),1),w=r();function T({zh:e}){let[t,n]=(0,C.useState)(g),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(``),s=u(t?`/api/proactive/web-push/probes`:null,h,{refreshInterval:1e4});async function c(){i(!0),o(``);try{let e=localStorage.getItem(x());if(!e)throw Error(`Enable this browser first`);await v(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}/test`,`POST`,{}),await s.mutate()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}let l=!p()&&window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;async function f(){i(!0),o(``);try{if(t){let e=localStorage.getItem(x());e&&await v(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}`,`DELETE`,{}),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe(),localStorage.removeItem(x()),n(!1);return}if(await Notification.requestPermission()!==`granted`)throw Error(e?`浏览器未允许通知。`:`Browser notification permission was not granted.`);let{publicKey:r}=await v(`/api/proactive/web-push/prepare`,`POST`,{});await navigator.serviceWorker.register(`/notification-sw.js`);let i=await navigator.serviceWorker.ready,{id:a}=await v(`/api/proactive/web-push/subscriptions`,`POST`,{subscription:(await i.pushManager.getSubscription()??await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})).toJSON(),language:e?`zh`:`en`});localStorage.setItem(x(),a),n(!0)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}return(0,w.jsxs)(`section`,{className:`max-w-2xl rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-medium`,children:e?`网页关闭后也接收提醒`:`Receive alerts when this page is closed`}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`应用在线时可将重要变化送到这台设备。锁屏只显示通用提示,详情在应用内查看。`:`When the app is online, important changes can reach this device. Lock-screen alerts stay generic; open the app for details.`}),(0,w.jsx)(d,{className:`mt-4`,disabled:r||!l,onClick:()=>void f(),children:l?t?e?`关闭这台设备的提醒`:`Disable alerts on this device`:e?`在这台设备上提醒我`:`Notify me on this device`:e?`当前设备不支持系统提醒`:`System notifications are unavailable here`}),t&&(0,w.jsx)(d,{className:`ml-2 mt-4`,disabled:r,onClick:()=>void c(),children:e?`向此浏览器发送测试通知`:`Send a test to this browser`}),s.data?.probes.slice(0,3).map(t=>(0,w.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[new Date(t.createdAt).toLocaleString(),` · `,t.status===`opened`?e?`已点击打开`:`Opened`:t.status===`accepted`?e?`提供方已接受,等待点击确认`:`Provider accepted; awaiting open confirmation`:t.status,t.error&&` · ${t.error}`]},t.id)),a&&(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:a})]})}function E(e){return e?{locale:`zh`,levels:{off:`关闭`,quiet:`尽量安静`,balanced:`重要时找我`,active:`及时跟进`},save:`保存`,saved:`已保存`,level:`什么时候找你`,quietStart:`免打扰开始(小时)`,quietEnd:`免打扰结束(小时)`,timezone:`时区`,limit:`每日通知上限`,pause:`暂停一小时`,resume:`结束暂停`,privacy:`提醒频率不会改变助理可以查看或执行的范围;这些范围仍按每件事的授权执行。`,whyNow:`为什么现在`,evidence:`依据`,snooze:`一小时后`,retry:`重试`,kinds:{briefing:`简报`,reminder:`提醒`,risk:`风险`,recommendation:`建议`,decision:`待决定`,receipt:`执行回执`}}:{locale:`en`,levels:{off:`Off`,quiet:`Keep it quiet`,balanced:`When it matters`,active:`Keep me updated`},save:`Save`,saved:`Saved`,level:`When should the assistant notify you?`,quietStart:`Quiet hours start`,quietEnd:`Quiet hours end`,timezone:`Timezone`,limit:`Daily notification limit`,pause:`Pause for one hour`,resume:`Resume`,privacy:`Notification frequency does not change what the assistant can read or do. Each delegated item keeps its own permissions.`,whyNow:`Why now`,evidence:`Evidence`,snooze:`In one hour`,retry:`Retry`,kinds:{briefing:`Briefing`,reminder:`Reminder`,risk:`Risk`,recommendation:`Recommendation`,decision:`Decision`,receipt:`Receipt`}}}function D(e,t,n){if(n!==`zh`)return t;let r={communication_follow_up:[`邮件跟进`,`关注已委托的邮件往来,准备跟进草稿并持续等待回复。`],meeting_preparation:[`会议准备`,`在会议前检查议程与资料,提示需要提前准备的事项。`],project_delivery_risk:[`项目交付风险`,`关注项目任务、依赖与承诺,发现可能影响交付的变化。`],automation_failure_impact:[`自动化失败影响`,`分析自动化故障的实际影响,提醒需要你处理的问题。`],blocked_work:[`工作阻塞`,`检查受阻任务及依赖,指出下一步可以推进的工作。`],discussion_follow_up:[`讨论后续`,`关注讨论中的结论与未完成事项,提示需要跟进的行动。`]}[e];return r?{title:r[0],description:r[1]}:t}function O(e,t){return(t===`zh`?{unread:`待查看`,read:`已查看`,snoozed:`稍后提醒`,resolved:`已收起`,expired:`已过期`,withdrawn:`来源已撤回`}:{unread:`Ready to review`,read:`Reviewed`,snoozed:`Remind later`,resolved:`Dismissed`,expired:`Expired`,withdrawn:`Source withdrawn`})[e]??e}function k(e,t){return e.project?.name??D(e.scenarioKey,{title:e.scenarioKey.replaceAll(`_`,` `),description:``},t?`zh`:`en`).title}function A(e){return e.completedAt?`completed`:e.effectiveEnabled?`active`:`paused`}function j(e){return e.status===`completed`?`completed`:e.status===`watching`&&e.enabled?`active`:`paused`}function M(e,t,n){return e.completedAt?t?`这件事已结束`:`This work has ended`:e.effectiveEnabled?e.checking?t?`助理正在查看最新情况`:`Your assistant is reviewing the latest context`:n?.decision?t?`有一项决定等你处理`:`A decision needs your attention`:n?.artifact?t?`助理准备好了新内容`:`Your assistant prepared something new`:n?t?`有一项变化值得你看`:`A change is worth your attention`:t?`已记住,等待相关变化`:`Remembered and waiting for a relevant change`:t?`已暂停,恢复后继续跟进`:`Paused until you resume it`}function N(e,t){return e.completedAt?t?`不会再跟进`:`No more follow-up`:e.effectiveEnabled?e.scopeKind===`project`?t?`项目出现重要变化时回来`:`Returns when the project meaningfully changes`:e.scenarioKey===`meeting_preparation`?t?`相关会议临近或资料变化时回来`:`Returns when a meeting approaches or its context changes`:t?`相关沟通需要下一步时回来`:`Returns when the conversation needs a next step`:t?`恢复后继续`:`Continues when resumed`}function P(e,t){return e.filter(e=>e.subscriptionId===t).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))[0]}function F(e,t){return e?e.decision?`${t?`等你决定`:`Waiting for your decision`}:${e.title}`:e.artifact?`${t?`最新成果`:`Latest result`}:${e.artifact.title}`:`${t?`最新变化`:`Latest update`}:${e.title}`:t?`还没有需要交付的新成果`:`No new result needs delivery yet`}function I(e,t){return e.status===`completed`?t?`这件事已结束`:`This work has ended`:e.status===`paused`||!e.enabled?t?`已暂停,恢复后继续跟进`:`Paused until you resume it`:e.sourceAvailable?e.syncFailed?t?`最近一次邮箱同步未完成`:`The latest email sync did not finish`:e.latestDirection===`sent`?t?`已同步发件,继续等待回复`:`Sent message found; waiting for a reply`:t?`正在等待回复或约定时间`:`Waiting for a reply or the agreed time`:t?`需要重新连接邮箱`:`Reconnect the email account`}function L(e,t){return new Date(e).toLocaleString(t?`zh-CN`:`en-US`)}function R({card:e,copy:t,refresh:n,detail:r=!1}){let i=t.locale===`zh`,o=(0,C.useRef)(null),[s,l]=(0,C.useState)(null),[u,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(``),[h,g]=(0,C.useState)(!1),[_,b]=(0,C.useState)(``),[x,S]=(0,C.useState)(``),[T,E]=(0,C.useState)(e.artifact?.content??``),[D,k]=(0,C.useState)(e.taskDraft),[A,j]=(0,C.useState)(e.id),[M,N]=(0,C.useState)(e.revision),P=A!==e.id||M!==e.revision,F=s!==`${e.id}:${e.revision}`&&![`withdrawn`,`expired`,`resolved`].includes(e.status),I=`${e.communication?i?`继续办理这件事。请读取最新卡片、成果和邮件往来,展示完整草稿与收件人让我确认后再发送:`:`Read the latest card, artifact and email thread. Show the full draft and recipients for my approval before sending: `:i?`继续讨论这件事,请先读取最新卡片和成果:`:`Continue this work. First read the latest card and artifact: `}xopc_use mode=proactive command=${e.communication?`continue_card`:`get_card`} args={"id":"${e.id}"}`,L=e.communication?.sessionKey?`/chat/${encodeURIComponent(e.communication.sessionKey)}?${new URLSearchParams({draft:I,autoSend:`1`})}`:y(I,void 0,{projectScope:`none`}),R=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;async function z(t,r={}){if(u||P)return;let i=JSON.stringify([e.id,e.revision,t,r]);o.current?.signature!==i&&(o.current={signature:i,key:crypto.randomUUID()}),f(!0),m(``);try{let i=await v(`/api/inbox/judgments/${encodeURIComponent(e.id)}/actions`,`POST`,{...r,actionId:t,expectedRevision:e.revision,idempotencyKey:o.current.key});i.card&&(j(i.card.id),N(i.card.revision),k(i.card.taskDraft),E(i.card.artifact?.content??``)),o.current=null,t===`decide`&&l(`${e.id}:${e.revision}`),(t===`useful`||t===`not_useful`)&&b(t),t===`refine`&&(b(`refined`),S(``)),g(!1),n()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex flex-wrap justify-between gap-2 text-xs text-fg-muted`,children:[(0,w.jsx)(`span`,{children:e.artifact?i?`已为你准备`:`Prepared for you`:t.kinds[e.kind]}),(0,w.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleString()})]}),(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.title}),(0,w.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary}),!r&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm font-medium text-accent`,to:`/assistant-work?item=${encodeURIComponent(e.id)}`,children:e.decision?i?`查看并决定`:`Review decision`:e.artifact?i?`打开准备好的成果`:`Open prepared work`:i?`查看变化`:`View update`}),r&&e.artifact&&(0,w.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,w.jsx)(`h3`,{className:`mb-3 font-medium text-fg`,children:e.artifact.title}),h?(0,w.jsxs)(`label`,{className:`text-sm`,children:[i?`编辑成果`:`Edit prepared work`,(0,w.jsx)(`textarea`,{rows:12,maxLength:12e3,className:R,value:T,onChange:e=>E(e.target.value)})]}):(0,w.jsx)(c,{content:e.artifact.content}),F&&!h&&(0,w.jsx)(d,{className:`mt-3`,variant:`ghost`,onClick:()=>{navigator.clipboard.writeText(e.artifact.content).catch(e=>m(String(e)))},children:i?`复制成果`:`Copy`}),F&&(0,w.jsx)(`div`,{className:`mt-3 flex gap-2`,children:h?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{disabled:u||P||!T.trim(),onClick:()=>void z(`edit_artifact`,{artifact:{...e.artifact,content:T}}),children:t.save}),(0,w.jsx)(d,{variant:`ghost`,onClick:()=>{g(!1),E(e.artifact.content)},children:i?`取消`:`Cancel`})]}):(0,w.jsx)(d,{variant:`ghost`,onClick:()=>g(!0),children:i?`修改成果`:`Edit`})})]}),e.decision&&F&&(0,w.jsxs)(`section`,{className:`mt-5 rounded-xl border border-edge p-4`,children:[(0,w.jsx)(`h3`,{className:`text-sm font-medium`,children:e.decision.question}),D&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i?`确认后创建项目待办,不会自动启动执行。`:`Creates a project task without starting execution.`}),(0,w.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[i?`待办标题`:`Task title`,(0,w.jsx)(`input`,{className:R,maxLength:160,value:D.title,onChange:e=>k({...D,title:e.target.value})})]}),(0,w.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[i?`具体内容`:`Task objective`,(0,w.jsx)(`textarea`,{className:R,maxLength:1200,rows:4,value:D.objective,onChange:e=>k({...D,objective:e.target.value})})]})]}),(0,w.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.decision.options.map((e,t)=>(0,w.jsx)(d,{variant:t===0?`primary`:`ghost`,disabled:u||P||e.id===`approve`&&D!==void 0&&(!D.title.trim()||!D.objective.trim()),onClick:()=>void z(`decide`,{choice:e.id,...e.id===`approve`&&D?{taskDraft:D}:{}}),children:e.label},e.id))})]}),e.followUp&&(0,w.jsxs)(`div`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm`,children:[(0,w.jsx)(a,{className:`text-accent`,to:`/tasks/${encodeURIComponent(e.followUp.taskId)}`,children:e.followUp.title}),(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:e.followUp.phase===`closed`?i?`任务已结束:${e.followUp.resolution??`—`}`:`Task closed: ${e.followUp.resolution??`—`}`:i?`待办已创建,仍在跟进实际进展。`:`Task created; following its progress.`})]}),e.actionStatus===`failed`&&![`expired`,`withdrawn`].includes(e.status)&&(0,w.jsxs)(`div`,{className:`mt-3 text-sm text-danger`,children:[e.actionError,(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`retry`),children:t.retry})]}),r&&(0,w.jsxs)(`details`,{className:`mt-4 text-sm text-fg-muted`,children:[(0,w.jsxs)(`summary`,{className:`cursor-pointer`,children:[t.whyNow,` · `,t.evidence]}),(0,w.jsx)(`p`,{className:`mt-2`,children:e.whyNow}),(0,w.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.evidence.map(e=>(0,w.jsxs)(`li`,{children:[e.route?(0,w.jsx)(a,{className:`text-accent`,to:e.route,children:e.label}):e.label,e.excerpt&&(0,w.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.excerpt})]},e.id))})]}),r&&F&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:L,children:e.communication?i?`审阅草稿并继续办理`:`Review draft and continue`:i?`接着聊这件事`:`Continue in chat`}),r&&![`withdrawn`,`expired`].includes(e.status)&&(0,w.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i?`这次帮助合适吗?`:`Was this help right for you?`}),(0,w.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{variant:`ghost`,disabled:u||!!_,onClick:()=>void z(`useful`),children:i?`有帮助`:`Helpful`}),(0,w.jsx)(d,{variant:`ghost`,disabled:u||!!_,onClick:()=>void z(`not_useful`),children:i?`不适合这个场景`:`Not right for this scene`})]}),_&&(0,w.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-fg-muted`,children:_===`refined`?i?`助理会把这条要求用于这个场景。`:`The assistant will use this instruction for this scene.`:i?`已记下,会用于调整这个场景。`:`Saved to improve this scene.`}),(0,w.jsxs)(`details`,{className:`mt-3`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-sm text-fg-muted`,children:i?`告诉助理下次怎么做`:`Tell the assistant what to do next time`}),(0,w.jsx)(`label`,{className:`mt-3 block text-sm`,children:(0,w.jsx)(`textarea`,{rows:3,maxLength:2e3,className:R,value:x,onChange:e=>S(e.target.value),placeholder:i?`例如:下次先给结论,技术细节放到最后。`:`For example: lead with the conclusion and put technical detail last.`})}),(0,w.jsx)(d,{className:`mt-2`,disabled:u||!x.trim(),onClick:()=>void z(`refine`,{instruction:x}),children:i?`用于这个场景`:`Use for this scene`})]})]}),r&&F&&(0,w.jsxs)(`details`,{className:`mt-4 text-sm`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:i?`调整或收起`:`Adjust or dismiss`}),(0,w.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`handled`),children:i?`我已处理`:`Already handled`}),(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`resolve`),children:i?`这条不用`:`Dismiss`}),(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`snooze`),children:t.snooze}),(0,w.jsx)(a,{className:`p-2 text-accent`,to:e.communication?`/assistant-work?follow-up=${encodeURIComponent(e.communication.id)}`:`/assistant-work?delegation=${encodeURIComponent(e.subscriptionId)}`,children:i?`修改关注要求`:`Adjust instructions`})]})]}),!F&&(0,w.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e.status===`resolved`?i?`已收起;事项进度以实际结果为准。`:`Dismissed; work progress is tracked separately.`:e.status===`expired`?i?`资料已变化或有效期已过,旧成果仅供参考。`:`Sources changed or this work expired. Review current context before acting.`:O(e.status,t.locale)}),s===`${e.id}:${e.revision}`&&(0,w.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-fg-muted`,children:i?`决定已提交,正在同步处理结果。`:`Decision submitted. Updating the result.`}),P&&s!==`${e.id}:${e.revision}`&&(0,w.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-warning`,children:[i?`卡片已更新。请载入最新版本再决定;重新载入会替换未提交的编辑。`:`This card changed. Load the latest version before deciding; this replaces unsaved edits.`,(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>{j(e.id),N(e.revision),k(e.taskDraft),E(e.artifact?.content??``),l(null),m(``)},children:i?`载入最新版本`:`Load latest version`})]}),p&&(0,w.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:[p,(0,w.jsx)(d,{variant:`ghost`,onClick:n,children:i?`刷新最新内容`:`Refresh latest version`})]})]})}var z=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;function ee(e){let t=(0,S.c)(33),{sub:n,card:r,zh:i}=e,o;t[0]!==n||t[1]!==i?(o=k(n,i),t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s=(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:o}),t[3]=o,t[4]=s);let c;t[5]===n.userInstructions?c=t[6]:(c=(0,w.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.userInstructions}),t[5]=n.userInstructions,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=`/assistant-work?delegation=${encodeURIComponent(n.id)}`,d=i?`调整`:`Adjust`,f;t[10]!==u||t[11]!==d?(f=(0,w.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:u,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==l||t[14]!==f?(p=(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==r||t[17]!==n||t[18]!==i?(m=M(n,i,r),t[16]=r,t[17]=n,t[18]=i,t[19]=m):m=t[19];let h;t[20]===m?h=t[21]:(h=(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:m}),t[20]=m,t[21]=h);let g;t[22]!==r||t[23]!==i?(g=F(r,i),t[22]=r,t[23]=i,t[24]=g):g=t[24];let _;t[25]===g?_=t[26]:(_=(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:g}),t[25]=g,t[26]=_);let v;t[27]!==h||t[28]!==_?(v=(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-hover px-4 py-3 text-sm`,children:[h,_]}),t[27]=h,t[28]=_,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==p?(y=(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[p,v]}),t[30]=v,t[31]=p,t[32]=y):y=t[32],y}function te({sub:e,card:t,zh:n,refresh:r}){let[i,c]=(0,C.useState)(e.userInstructions),[l,u]=(0,C.useState)(e.delivery),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(!1),[g,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,T]=(0,C.useState)(!1);async function D(t,i=!1){if(!m){h(!0),y(``),x(``);try{await v(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}${i?`/check`:``}`,i?`POST`:`PATCH`,i?{}:{...t,expectedRevision:e.revision}),p(!1),x(i?n?`助理正在重新看看这个项目。`:`Your assistant is checking the project again.`:n?`助理跟进已更新。`:`Assistant follow-up updated.`),r()}catch(e){y(String(e)),r()}finally{h(!1)}}}async function O(t){if(!(S||!e.project)){T(!0),y(``),x(``);try{await _(e.scopeId,{mode:t,allowedActions:t===`auto_low_risk`?[`create_project_task`]:[]}),x(n?`行动边界已更新。`:`Action boundary updated.`),r()}catch(e){y(String(e)),r()}finally{T(!1)}}}let A=e.scopeKind===`project`?n?`项目目标、承诺或交付风险出现有意义的变化时`:`When the project goal, commitments, or delivery risk meaningfully changes`:e.scenarioKey===`meeting_preparation`?n?`相关会议临近,或会议资料发生变化时`:`When a relevant meeting approaches or its context changes`:n?`相关沟通出现值得你接手的变化时`:`When a conversation changes in a way that needs you`;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:k(e,n)}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:M(e,n,t)})]}),!e.completedAt&&(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{disabled:m,onClick:()=>void D({enabled:!e.enabled}),children:e.enabled?n?`暂停`:`Pause`:n?`恢复`:`Resume`}),e.scopeKind===`project`&&(0,w.jsx)(d,{variant:`ghost`,disabled:m||e.checking||!e.effectiveEnabled,onClick:()=>void D({},!0),children:n?`现在再看看`:`Check again now`})]}),b&&(0,w.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:b}),t&&(0,w.jsx)(R,{card:t,copy:E(n),refresh:r,detail:!0}),(0,w.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:n?`跟进要求`:`What your assistant remembers`}),(0,w.jsxs)(`dl`,{className:`mt-4 space-y-4 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`要帮你守住什么`:`What to protect`}),(0,w.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-fg`,children:e.userInstructions})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`什么时候回来找你`:`When to come back`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:A})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`接下来`:`Next`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:N(e,n)})]})]}),e.projectMonitoring&&!e.completedAt&&(0,w.jsxs)(`label`,{className:`mt-5 block border-t border-edge pt-5 text-sm`,children:[(0,w.jsx)(`span`,{className:`font-medium text-fg`,children:n?`助理可以做到哪里`:`How far the assistant can go`}),(0,w.jsxs)(o,{disabled:S,value:e.projectMonitoring.mode,onChange:e=>void O(e.target.value),children:[(0,w.jsx)(s,{value:`observe`,children:n?`只观察和整理`:`Observe and organize only`}),(0,w.jsx)(s,{value:`ask_before_action`,children:n?`先准备,行动前问我`:`Prepare first, ask before acting`}),(0,w.jsx)(s,{value:`auto_low_risk`,children:n?`自动完成明确的低风险动作`:`Complete explicit low-risk actions`})]}),(0,w.jsx)(`span`,{className:`mt-2 block text-xs text-fg-muted`,children:e.projectMonitoring.mode===`auto_low_risk`?n?`目前只包括在当前项目中创建可撤销的待办。`:`Currently limited to creating reversible tasks in this project.`:n?`涉及外部发送或不可逆操作时仍会询问你。`:`External sends and irreversible actions still require you.`})]}),f&&(0,w.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,w.jsxs)(`label`,{className:`block text-sm`,children:[n?`希望助理关注什么,忽略什么?`:`What should the assistant follow or ignore?`,(0,w.jsx)(`textarea`,{rows:5,maxLength:12e3,className:z,value:i,onChange:e=>c(e.target.value)})]}),(0,w.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[n?`什么时候提醒我`:`When to notify me`,(0,w.jsxs)(o,{value:l,onChange:e=>u(e.target.value),children:[(0,w.jsx)(s,{value:`inbox`,children:n?`回到工作台时告诉我`:`Tell me in the Workbench`}),(0,w.jsx)(s,{value:`important`,children:n?`重要变化立即告诉我`:`Tell me right away for important changes`}),(0,w.jsx)(s,{value:`digest`,children:n?`放进每日汇总`:`Include it in my daily digest`})]})]})]}),!e.completedAt&&(0,w.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[f?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{disabled:m||!i.trim(),onClick:()=>void D({userInstructions:i,delivery:l}),children:n?`保存安排`:`Save arrangement`}),(0,w.jsx)(d,{variant:`ghost`,onClick:()=>p(!1),children:n?`取消`:`Cancel`})]}):(0,w.jsx)(d,{variant:`ghost`,onClick:()=>p(!0),children:n?`调整安排`:`Adjust arrangement`}),(0,w.jsx)(d,{variant:`ghost`,disabled:m,onClick:()=>void D({enabled:!1,completedAt:new Date().toISOString()}),children:n?`结束安排`:`End arrangement`})]}),e.project&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:`/projects/${encodeURIComponent(e.scopeId)}`,children:n?`回到项目`:`Back to project`})]}),g&&(0,w.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:g})]})}var B=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`,ne=e=>{let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)};function re(e){let t=(0,S.c)(30),{follow:n,zh:r}=e,i=n.subject??(r?`邮件跟进`:`Email follow-up`),o;t[0]===i?o=t[1]:(o=(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n.instructions?s=t[3]:(s=(0,w.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.instructions}),t[2]=n.instructions,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`/assistant-work?follow-up=${encodeURIComponent(n.id)}`,u=r?`调整`:`Adjust`,d;t[7]!==l||t[8]!==u?(d=(0,w.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:l,children:u}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==c||t[11]!==d?(f=(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[c,d]}),t[10]=c,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==n||t[14]!==r?(p=I(n,r),t[13]=n,t[14]=r,t[15]=p):p=t[15];let m;t[16]===p?m=t[17]:(m=(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:p}),t[16]=p,t[17]=m);let h;t[18]!==n.dueAt||t[19]!==n.status||t[20]!==r?(h=n.status===`completed`?r?`这项安排已经结束`:`This arrangement has ended`:`${r?`约定时间`:`Follow up by`} ${L(n.dueAt,r)}`,t[18]=n.dueAt,t[19]=n.status,t[20]=r,t[21]=h):h=t[21];let g;t[22]===h?g=t[23]:(g=(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:h}),t[22]=h,t[23]=g);let _;t[24]!==m||t[25]!==g?(_=(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-hover px-4 py-3 text-sm`,children:[m,g]}),t[24]=m,t[25]=g,t[26]=_):_=t[26];let v;return t[27]!==_||t[28]!==f?(v=(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[f,_]}),t[27]=_,t[28]=f,t[29]=v):v=t[29],v}function ie({follow:e,zh:t,refresh:n}){let[r,i]=(0,C.useState)(!1),[o,s]=(0,C.useState)(e.instructions),[c,l]=(0,C.useState)(ne(e.dueAt)),[u,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(``);async function h(t){f(!0),m(``);try{await v(`/api/proactive/follow-ups/${encodeURIComponent(e.id)}`,`PATCH`,{expectedRevision:e.revision,...t}),i(!1),n()}catch(e){m(String(e))}finally{f(!1)}}return(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-medium`,children:e.subject??(t?`邮件跟进`:`Email follow-up`)}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:I(e,t)}),(0,w.jsxs)(`dl`,{className:`mt-4 space-y-4 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t?`助理在等什么`:`What the assistant is waiting for`}),(0,w.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-fg`,children:e.instructions})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t?`什么时候回来找你`:`When to come back`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:L(e.dueAt,t)})]})]}),e.syncFailed&&(0,w.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:t?`助理暂时看不到最新回复,请检查邮箱连接。`:`The assistant cannot see the latest replies right now. Check the email connection.`}),!e.sourceAvailable&&(0,w.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/connectors`,children:t?`检查邮箱连接`:`Check email connection`}),e.sessionKey&&(0,w.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/chat/${encodeURIComponent(e.sessionKey)}`,children:t?`继续原来的对话`:`Continue the conversation`}),r&&(0,w.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,w.jsx)(`textarea`,{"aria-label":t?`跟进要求`:`Instructions`,className:B,rows:3,maxLength:12e3,value:o,onChange:e=>s(e.target.value)}),(0,w.jsx)(`input`,{"aria-label":t?`跟进时间`:`Follow-up time`,type:`datetime-local`,className:B,value:c,onChange:e=>l(e.target.value)}),(0,w.jsx)(d,{disabled:u||!o.trim()||!c,onClick:()=>void h({instructions:o,...ne(e.dueAt)===c?{}:{dueAt:new Date(c).toISOString()}}),children:t?`保存安排`:`Save arrangement`})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>i(!r),children:r?t?`取消修改`:`Cancel edit`:t?`调整安排`:`Adjust arrangement`}),(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>void h({status:e.status===`watching`?`paused`:`watching`}),children:e.status===`watching`?t?`暂停`:`Pause`:t?`恢复`:`Resume`}),e.status!==`completed`&&(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>void h({status:`completed`}),children:t?`结束安排`:`End arrangement`})]}),p&&(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:p})]})}var V=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function H(e){let t=(0,S.c)(58),{value:n,onChange:r,zh:i}=e,a;t[0]===i?a=t[1]:(a=i?{all:`所有已启用设备`,auto:`自动选择一台设备`,browser:`浏览器 / 桌面`,mobile:`手机`,telegram:`Telegram`}:{all:`All enabled devices`,auto:`Choose one device`,browser:`Browser / desktop`,mobile:`Mobile`,telegram:`Telegram`},t[0]=i,t[1]=a);let s=a,c;t[2]!==r||t[3]!==n?(c=e=>r({...n,digestEnabled:e.target.checked}),t[2]=r,t[3]=n,t[4]=c):c=t[4];let l;t[5]!==c||t[6]!==n.digestEnabled?(l=(0,w.jsx)(`input`,{type:`checkbox`,checked:n.digestEnabled,onChange:c}),t[5]=c,t[6]=n.digestEnabled,t[7]=l):l=t[7];let u=i?`将提醒合并为每日摘要`:`Combine alerts into a daily digest`,d;t[8]!==l||t[9]!==u?(d=(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f=i?`摘要时间(使用上方时区)`:`Digest time (in your selected timezone)`,p=String(n.digestHour),m;t[11]===p?m=t[12]:(m=p.padStart(2,`0`),t[11]=p,t[12]=m);let h=String(n.digestMinute),g;t[13]===h?g=t[14]:(g=h.padStart(2,`0`),t[13]=h,t[14]=g);let _=`${m}:${g}`,v;t[15]!==r||t[16]!==n?(v=e=>{let[t,i]=e.target.value.split(`:`).map(Number);r({...n,digestHour:t,digestMinute:i})},t[15]=r,t[16]=n,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,w.jsx)(`input`,{className:V,type:`time`,required:!0,value:_,onChange:v}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==y||t[22]!==f?(b=(0,w.jsxs)(`label`,{className:`block text-sm`,children:[f,y]}),t[21]=y,t[22]=f,t[23]=b):b=t[23];let x=i?`提醒渠道`:`Notification channel`,C=n.preferredChannel,T;t[24]!==r||t[25]!==n?(T=e=>r({...n,preferredChannel:e.target.value}),t[24]=r,t[25]=n,t[26]=T):T=t[26];let E;t[27]===s?E=t[28]:(E=Object.entries(s).map(U),t[27]=s,t[28]=E);let D;t[29]!==T||t[30]!==E||t[31]!==n.preferredChannel?(D=(0,w.jsx)(o,{value:C,onChange:T,children:E}),t[29]=T,t[30]=E,t[31]=n.preferredChannel,t[32]=D):D=t[32];let O;t[33]!==x||t[34]!==D?(O=(0,w.jsxs)(`label`,{className:`block text-sm`,children:[x,D]}),t[33]=x,t[34]=D,t[35]=O):O=t[35];let k=i?`自动选择优先使用最近注册的浏览器,否则选择一台手机。免打扰期间的重要提醒会合并为一份摘要。`:`Automatic selection prefers the most recently registered browser, then one mobile device. Important alerts during quiet hours are combined into one digest.`,A;t[36]===k?A=t[37]:(A=(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:k}),t[36]=k,t[37]=A);let j;t[38]!==r||t[39]!==n?(j=e=>r({...n,suppressWhileViewing:e.target.checked}),t[38]=r,t[39]=n,t[40]=j):j=t[40];let M;t[41]!==j||t[42]!==n.suppressWhileViewing?(M=(0,w.jsx)(`input`,{type:`checkbox`,checked:n.suppressWhileViewing,onChange:j}),t[41]=j,t[42]=n.suppressWhileViewing,t[43]=M):M=t[43];let N=i?`正在查看卡片时不再发送系统提醒`:`Skip system alerts while viewing cards`,P;t[44]!==M||t[45]!==N?(P=(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[M,N]}),t[44]=M,t[45]=N,t[46]=P):P=t[46];let F;t[47]!==r||t[48]!==n||t[49]!==i?(F=n.preferredChannel===`telegram`&&(0,w.jsxs)(`fieldset`,{className:`space-y-3 rounded-xl border border-edge p-3`,children:[(0,w.jsx)(`legend`,{className:`px-1 text-sm`,children:`Telegram`}),[`chatId`,`accountId`,`publicUrl`].map(e=>(0,w.jsxs)(`label`,{className:`block text-sm`,children:[e===`chatId`?i?`接收对话 ID`:`Destination chat ID`:e===`accountId`?i?`账号 ID(可选)`:`Account ID (optional)`:i?`可从外部访问的控制台 HTTPS 地址`:`Public HTTPS console URL`,(0,w.jsx)(`input`,{className:V,required:e!==`accountId`,value:n.telegram?.[e]??``,onChange:t=>r({...n,telegram:{chatId:n.telegram?.chatId??``,publicUrl:n.telegram?.publicUrl??``,...n.telegram?.accountId?{accountId:n.telegram.accountId}:{},[e]:e===`accountId`?t.target.value||void 0:t.target.value}})})]},e)),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`需要已连接 Telegram 渠道。发送通用摘要和卡片链接;链接中不要填写访问令牌。`:`Connect the Telegram channel first. Alerts contain a generic summary and a card link. Do not put access tokens in the URL.`})]}),t[47]=r,t[48]=n,t[49]=i,t[50]=F):F=t[50];let I;return t[51]!==b||t[52]!==O||t[53]!==A||t[54]!==P||t[55]!==F||t[56]!==d?(I=(0,w.jsxs)(`div`,{className:`space-y-4 border-t border-edge pt-4`,children:[d,b,O,A,P,F]}),t[51]=b,t[52]=O,t[53]=A,t[54]=P,t[55]=F,t[56]=d,t[57]=I):I=t[57],I}function U(e){let[t,n]=e;return(0,w.jsx)(s,{value:t,children:n},t)}var W=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function ae({preferences:e,copy:t,refresh:n}){let[r,i]=(0,C.useState)(e),[a,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(``);async function f(i=r){c(!0),u(``);try{let{revision:a,...o}={...r,...i};await v(`/api/proactive/preferences`,`PATCH`,{...o,expectedRevision:e.revision}),u(t.saved),n()}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}return(0,w.jsxs)(`form`,{className:`max-w-2xl space-y-5 rounded-2xl border border-edge bg-surface-panel p-5`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,w.jsxs)(`label`,{className:`block text-sm`,children:[t.level,(0,w.jsx)(o,{value:r.level,onChange:e=>i({...r,level:e.target.value}),children:Object.entries(t.levels).map(([e,t])=>(0,w.jsx)(s,{value:e,children:t},e))})]}),(0,w.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.timezone,(0,w.jsx)(`input`,{required:!0,className:W,value:r.timezone,onChange:e=>i({...r,timezone:e.target.value})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.limit,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:30,className:W,value:r.dailyNotificationLimit,onChange:e=>i({...r,dailyNotificationLimit:Number(e.target.value)})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.quietStart,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietStartHour,onChange:e=>i({...r,quietStartHour:Number(e.target.value)})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.quietEnd,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietEndHour,onChange:e=>i({...r,quietEndHour:Number(e.target.value)})})]})]}),(0,w.jsx)(H,{value:r,onChange:i,zh:t.locale===`zh`}),(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.privacy}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{type:`submit`,variant:`primary`,disabled:a,children:t.save}),(0,w.jsx)(d,{disabled:a,onClick:()=>void f({pausedUntil:new Date(Date.now()+36e5).toISOString()}),children:t.pause}),e.pausedUntil&&(0,w.jsx)(d,{disabled:a,onClick:()=>void f({pausedUntil:null}),children:t.resume})]}),l&&(0,w.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}function G(){let e=(0,S.c)(44),t=l(de)===`zh`,n;e[0]===t?n=e[1]:(n=E(t),e[0]=t,e[1]=n);let r=n,o=b(ue),s=b(le),[c,p]=i(),g;e[2]===c?g=e[3]:(g=c.get(`view`),e[2]=c,e[3]=g);let _=g,y=_===`settings`?_:`list`,x;e[4]===c?x=e[5]:(x=c.get(`state`),e[4]=c,e[5]=x);let D=x,O=D===`paused`||D===`completed`?D:`active`,k;e[6]===c?k=e[7]:(k=c.get(`item`),e[6]=c,e[7]=k);let M=k,N;e[8]===c?N=e[9]:(N=c.get(`digest`),e[8]=c,e[9]=N);let F=N,I;e[10]===c?I=e[11]:(I=c.get(`delegation`),e[10]=c,e[11]=I);let L=I,z;e[12]===c?z=e[13]:(z=c.get(`follow-up`),e[12]=c,e[13]=z);let B=z,ne=y===`list`||!!(L||B),V=u(y===`settings`?`/api/proactive/preferences`:null,h),H;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(H={refreshInterval:15e3},e[14]=H):H=e[14];let U=u(ne?`/api/proactive/overview`:null,h,H),W;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[15]=W):W=e[15];let G=u(M?`/api/inbox/judgments/${encodeURIComponent(M)}`:null,h,W),K=u(F?`/api/proactive/digests/${encodeURIComponent(F)}`:null,h),q;e[16]===c?q=e[17]:(q=c.get(`probe`),e[16]=c,e[17]=q);let J=q,Y,fe;e[18]===J?(Y=e[19],fe=e[20]):(Y=()=>{J&&v(`/api/proactive/web-push/probes/${encodeURIComponent(J)}/opened`,`POST`,{}).catch(ce)},fe=[J],e[18]=J,e[19]=Y,e[20]=fe),(0,C.useEffect)(Y,fe);let pe=G.error??U.error??V.error??K.error,me=G.isLoading||U.isLoading||V.isLoading||K.isLoading,he=U.data?.scenes.flatMap(se)??[],ge=U.data?.delegations.filter(oe)??[],_e;e[21]===O?_e=e[22]:(_e=e=>A(e)===O,e[21]=O,e[22]=_e);let ve=ge.filter(_e),ye=U.data?.followUps.filter(e=>j(e)===O)??[],X;e[23]===L?X=e[24]:(X=e=>e.id===L,e[23]=L,e[24]=X);let be=ge.find(X),xe;e[25]!==B||e[26]!==U.data?.followUps?(xe=U.data?.followUps.find(e=>e.id===B),e[25]=B,e[26]=U.data?.followUps,e[27]=xe):xe=e[27];let Se=xe,Ce=e=>p(e),Z=!!(M||F||L||B),we=M?t?`跟进动态`:`Follow-up update`:F?t?`跟进摘要`:`Follow-up summary`:Z?t?`跟进详情`:`Follow-up details`:y===`settings`?t?`提醒偏好`:`Notification preferences`:t?`助理跟进`:`Assistant follow-ups`,Te=M||F?`/`:`/assistant-work`,Q=M||F?t?`返回工作台`:`Back to Workbench`:t?`返回助理跟进`:`Back to assistant follow-ups`,Ee,De;if(e[28]!==Q||e[29]!==Te||e[30]!==s||e[31]!==Z||e[32]!==o||e[33]!==we||e[34]!==y||e[35]!==t?(Ee=()=>(o({startExtra:Z||y===`settings`?(0,w.jsx)(d,{asChild:!0,variant:`ghost`,className:`size-8 rounded-lg p-0`,children:(0,w.jsx)(a,{to:Te,"aria-label":Q,title:Q,children:(0,w.jsx)(m,{className:`size-4`,"aria-hidden":!0})})}):null,main:(0,w.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:we}),end:!Z&&y===`list`?(0,w.jsx)(d,{asChild:!0,variant:`ghost`,className:`h-9 rounded-lg`,children:(0,w.jsx)(a,{to:`/assistant-work?view=settings`,children:t?`提醒偏好`:`Notification preferences`})}):null}),()=>s()),De=[Q,Te,s,Z,o,we,y,t],e[28]=Q,e[29]=Te,e[30]=s,e[31]=Z,e[32]=o,e[33]=we,e[34]=y,e[35]=t,e[36]=Ee,e[37]=De):(Ee=e[36],De=e[37]),(0,C.useLayoutEffect)(Ee,De),me){let t;return e[38]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,w.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5 px-4 py-7 sm:px-6`,children:[(0,w.jsx)(f,{className:`h-8 w-48`}),(0,w.jsx)(f,{className:`h-56 rounded-2xl`}),(0,w.jsx)(f,{className:`h-40 rounded-2xl`})]})}),e[38]=t):t=e[38],t}let $;e[39]===pe?$=e[40]:($=pe&&(0,w.jsx)(`p`,{role:`alert`,className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:String(pe)}),e[39]=pe,e[40]=$);let Oe=M?(0,w.jsx)(w.Fragment,{children:G.data&&(0,w.jsx)(R,{card:G.data.card,copy:r,refresh:()=>void G.mutate(),detail:!0},`${G.data.card.id}:${G.data.card.revision}`)}):F?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`h2`,{className:`text-xl font-semibold text-fg`,children:t?`助理为你整理的变化`:`Updates prepared by your assistant`}),K.data?.cards.map(e=>(0,w.jsx)(R,{card:e,copy:r,refresh:()=>void K.mutate()},e.id)),K.data?.cards.length===0&&(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`这些事项已处理或不再需要关注。`:`These items have been handled or are no longer relevant.`})]}):be?(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(te,{sub:be,card:P(he,be.id),zh:t,refresh:()=>void U.mutate()},be.id)}):Se?(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(ie,{follow:Se,zh:t,refresh:()=>void U.mutate()})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:y===`settings`?t?`决定助理什么时候提醒你,以及通过什么方式送达。`:`Choose when and how your assistant should notify you.`:t?`查看和管理交给助理持续跟进的事项。可以从项目、会议或对话中发起新的跟进。`:`Review and manage work your assistant is following. Start a follow-up from a project, meeting, or conversation.`}),y===`settings`&&V.data?(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(ae,{preferences:V.data.preferences,copy:r,refresh:()=>void V.mutate()},V.data.preferences.revision),(0,w.jsx)(T,{zh:t})]}):(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(`nav`,{className:`flex gap-2`,"aria-label":t?`跟进状态`:`Follow-up status`,children:[[`active`,t?`跟进中`:`Active`],[`paused`,t?`已暂停`:`Paused`],[`completed`,t?`已结束`:`Ended`]].map(e=>{let[t,n]=e;return(0,w.jsx)(d,{variant:O===t?`secondary`:`ghost`,onClick:()=>Ce(t===`active`?{}:{state:t}),children:n},t)})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[ve.map(e=>(0,w.jsx)(ee,{sub:e,card:P(he,e.id),zh:t},`${e.id}:${e.revision}`)),ye.map(e=>(0,w.jsx)(re,{follow:e,zh:t},`${e.id}:${e.revision}`)),ve.length+ye.length===0&&(0,w.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,w.jsx)(`h2`,{className:`font-medium text-fg`,children:O===`active`?t?`还没有正在跟进的事项`:`No active follow-ups`:O===`paused`?t?`没有已暂停的跟进`:`No paused follow-ups`:t?`没有已结束的跟进`:`No ended follow-ups`}),O===`active`&&(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t?`打开一个项目,或在会议和沟通场景中告诉助理,需要它持续帮你守住什么。`:`Open a project, meeting, or conversation and tell the assistant what it should keep watching for you.`})]})]})]})]}),ke;return e[41]!==$||e[42]!==Oe?(ke=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,w.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-6 px-4 py-7 sm:px-6`,children:[$,Oe]})}),e[41]=$,e[42]=Oe,e[43]=ke):ke=e[43],ke}function oe(e){return e.scenarioKey!==`communication_follow_up`}function se(e){return e.card?[e.card]:[]}function ce(){}function le(e){return e.clearPageHeader}function ue(e){return e.setPageHeader}function de(e){return e.language}export{G as ProactivePage};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{h as i,t as a}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as o,r as s}from"./popover-select-DGmMQt4t.js";import{t as c}from"./markdown-view-CKInRsDh.js";import{n as l}from"./locale-store-DO6JJ1l2.js";import{i as u}from"./vendor-swr-BIWyz7Rc.js";import{t as d}from"./button-BA45yciM.js";import{t as f}from"./skeleton-BwbyijEw.js";import{t as p}from"./electron-env-DH5wF8X8.js";import{Bu as m,Jt as h,Kt as g,Wa as _,Yt as v,ca as y,go as b,qt as x}from"./index-C9aQA4Dr.js";var S=n(),C=e(t(),1),w=r();function T({zh:e}){let[t,n]=(0,C.useState)(g),[r,i]=(0,C.useState)(!1),[a,o]=(0,C.useState)(``),s=u(t?`/api/proactive/web-push/probes`:null,h,{refreshInterval:1e4});async function c(){i(!0),o(``);try{let e=localStorage.getItem(x());if(!e)throw Error(`Enable this browser first`);await v(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}/test`,`POST`,{}),await s.mutate()}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}let l=!p()&&window.isSecureContext&&`serviceWorker`in navigator&&`PushManager`in window&&`Notification`in window;async function f(){i(!0),o(``);try{if(t){let e=localStorage.getItem(x());e&&await v(`/api/proactive/web-push/subscriptions/${encodeURIComponent(e)}`,`DELETE`,{}),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe(),localStorage.removeItem(x()),n(!1);return}if(await Notification.requestPermission()!==`granted`)throw Error(e?`浏览器未允许通知。`:`Browser notification permission was not granted.`);let{publicKey:r}=await v(`/api/proactive/web-push/prepare`,`POST`,{});await navigator.serviceWorker.register(`/notification-sw.js`);let i=await navigator.serviceWorker.ready,{id:a}=await v(`/api/proactive/web-push/subscriptions`,`POST`,{subscription:(await i.pushManager.getSubscription()??await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:r})).toJSON(),language:e?`zh`:`en`});localStorage.setItem(x(),a),n(!0)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}return(0,w.jsxs)(`section`,{className:`max-w-2xl rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-medium`,children:e?`网页关闭后也接收提醒`:`Receive alerts when this page is closed`}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e?`应用在线时可将重要变化送到这台设备。锁屏只显示通用提示,详情在应用内查看。`:`When the app is online, important changes can reach this device. Lock-screen alerts stay generic; open the app for details.`}),(0,w.jsx)(d,{className:`mt-4`,disabled:r||!l,onClick:()=>void f(),children:l?t?e?`关闭这台设备的提醒`:`Disable alerts on this device`:e?`在这台设备上提醒我`:`Notify me on this device`:e?`当前设备不支持系统提醒`:`System notifications are unavailable here`}),t&&(0,w.jsx)(d,{className:`ml-2 mt-4`,disabled:r,onClick:()=>void c(),children:e?`向此浏览器发送测试通知`:`Send a test to this browser`}),s.data?.probes.slice(0,3).map(t=>(0,w.jsxs)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:[new Date(t.createdAt).toLocaleString(),` · `,t.status===`opened`?e?`已点击打开`:`Opened`:t.status===`accepted`?e?`提供方已接受,等待点击确认`:`Provider accepted; awaiting open confirmation`:t.status,t.error&&` · ${t.error}`]},t.id)),a&&(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:a})]})}function E(e){return e?{locale:`zh`,levels:{off:`关闭`,quiet:`尽量安静`,balanced:`重要时找我`,active:`及时跟进`},save:`保存`,saved:`已保存`,level:`什么时候找你`,quietStart:`免打扰开始(小时)`,quietEnd:`免打扰结束(小时)`,timezone:`时区`,limit:`每日通知上限`,pause:`暂停一小时`,resume:`结束暂停`,privacy:`提醒频率不会改变助理可以查看或执行的范围;这些范围仍按每件事的授权执行。`,whyNow:`为什么现在`,evidence:`依据`,snooze:`一小时后`,retry:`重试`,kinds:{briefing:`简报`,reminder:`提醒`,risk:`风险`,recommendation:`建议`,decision:`待决定`,receipt:`执行回执`}}:{locale:`en`,levels:{off:`Off`,quiet:`Keep it quiet`,balanced:`When it matters`,active:`Keep me updated`},save:`Save`,saved:`Saved`,level:`When should the assistant notify you?`,quietStart:`Quiet hours start`,quietEnd:`Quiet hours end`,timezone:`Timezone`,limit:`Daily notification limit`,pause:`Pause for one hour`,resume:`Resume`,privacy:`Notification frequency does not change what the assistant can read or do. Each delegated item keeps its own permissions.`,whyNow:`Why now`,evidence:`Evidence`,snooze:`In one hour`,retry:`Retry`,kinds:{briefing:`Briefing`,reminder:`Reminder`,risk:`Risk`,recommendation:`Recommendation`,decision:`Decision`,receipt:`Receipt`}}}function D(e,t,n){if(n!==`zh`)return t;let r={communication_follow_up:[`邮件跟进`,`关注已委托的邮件往来,准备跟进草稿并持续等待回复。`],meeting_preparation:[`会议准备`,`在会议前检查议程与资料,提示需要提前准备的事项。`],project_delivery_risk:[`项目交付风险`,`关注项目任务、依赖与承诺,发现可能影响交付的变化。`],automation_failure_impact:[`自动化失败影响`,`分析自动化故障的实际影响,提醒需要你处理的问题。`],blocked_work:[`工作阻塞`,`检查受阻任务及依赖,指出下一步可以推进的工作。`],discussion_follow_up:[`讨论后续`,`关注讨论中的结论与未完成事项,提示需要跟进的行动。`]}[e];return r?{title:r[0],description:r[1]}:t}function O(e,t){return(t===`zh`?{unread:`待查看`,read:`已查看`,snoozed:`稍后提醒`,resolved:`已收起`,expired:`已过期`,withdrawn:`来源已撤回`}:{unread:`Ready to review`,read:`Reviewed`,snoozed:`Remind later`,resolved:`Dismissed`,expired:`Expired`,withdrawn:`Source withdrawn`})[e]??e}function k(e,t){return e.project?.name??D(e.scenarioKey,{title:e.scenarioKey.replaceAll(`_`,` `),description:``},t?`zh`:`en`).title}function A(e){return e.completedAt?`completed`:e.effectiveEnabled?`active`:`paused`}function j(e){return e.status===`completed`?`completed`:e.status===`watching`&&e.enabled?`active`:`paused`}function M(e,t,n){return e.completedAt?t?`这件事已结束`:`This work has ended`:e.effectiveEnabled?e.checking?t?`助理正在查看最新情况`:`Your assistant is reviewing the latest context`:n?.decision?t?`有一项决定等你处理`:`A decision needs your attention`:n?.artifact?t?`助理准备好了新内容`:`Your assistant prepared something new`:n?t?`有一项变化值得你看`:`A change is worth your attention`:t?`已记住,等待相关变化`:`Remembered and waiting for a relevant change`:t?`已暂停,恢复后继续跟进`:`Paused until you resume it`}function N(e,t){return e.completedAt?t?`不会再跟进`:`No more follow-up`:e.effectiveEnabled?e.scopeKind===`project`?t?`项目出现重要变化时回来`:`Returns when the project meaningfully changes`:e.scenarioKey===`meeting_preparation`?t?`相关会议临近或资料变化时回来`:`Returns when a meeting approaches or its context changes`:t?`相关沟通需要下一步时回来`:`Returns when the conversation needs a next step`:t?`恢复后继续`:`Continues when resumed`}function P(e,t){return e.filter(e=>e.subscriptionId===t).sort((e,t)=>Date.parse(t.updatedAt)-Date.parse(e.updatedAt))[0]}function F(e,t){return e?e.decision?`${t?`等你决定`:`Waiting for your decision`}:${e.title}`:e.artifact?`${t?`最新成果`:`Latest result`}:${e.artifact.title}`:`${t?`最新变化`:`Latest update`}:${e.title}`:t?`还没有需要交付的新成果`:`No new result needs delivery yet`}function I(e,t){return e.status===`completed`?t?`这件事已结束`:`This work has ended`:e.status===`paused`||!e.enabled?t?`已暂停,恢复后继续跟进`:`Paused until you resume it`:e.sourceAvailable?e.syncFailed?t?`最近一次邮箱同步未完成`:`The latest email sync did not finish`:e.latestDirection===`sent`?t?`已同步发件,继续等待回复`:`Sent message found; waiting for a reply`:t?`正在等待回复或约定时间`:`Waiting for a reply or the agreed time`:t?`需要重新连接邮箱`:`Reconnect the email account`}function L(e,t){return new Date(e).toLocaleString(t?`zh-CN`:`en-US`)}function R({card:e,copy:t,refresh:n,detail:r=!1}){let i=t.locale===`zh`,o=(0,C.useRef)(null),[s,l]=(0,C.useState)(null),[u,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(``),[h,g]=(0,C.useState)(!1),[_,b]=(0,C.useState)(``),[x,S]=(0,C.useState)(``),[T,E]=(0,C.useState)(e.artifact?.content??``),[D,k]=(0,C.useState)(e.taskDraft),[A,j]=(0,C.useState)(e.id),[M,N]=(0,C.useState)(e.revision),P=A!==e.id||M!==e.revision,F=s!==`${e.id}:${e.revision}`&&![`withdrawn`,`expired`,`resolved`].includes(e.status),I=`${e.communication?i?`继续办理这件事。请读取最新卡片、成果和邮件往来,展示完整草稿与收件人让我确认后再发送:`:`Read the latest card, artifact and email thread. Show the full draft and recipients for my approval before sending: `:i?`继续讨论这件事,请先读取最新卡片和成果:`:`Continue this work. First read the latest card and artifact: `}xopc_use mode=proactive command=${e.communication?`continue_card`:`get_card`} args={"id":"${e.id}"}`,L=e.communication?.sessionKey?`/chat/${encodeURIComponent(e.communication.sessionKey)}?${new URLSearchParams({draft:I,autoSend:`1`})}`:y(I,void 0,{projectScope:`none`}),R=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;async function z(t,r={}){if(u||P)return;let i=JSON.stringify([e.id,e.revision,t,r]);o.current?.signature!==i&&(o.current={signature:i,key:crypto.randomUUID()}),f(!0),m(``);try{let i=await v(`/api/inbox/judgments/${encodeURIComponent(e.id)}/actions`,`POST`,{...r,actionId:t,expectedRevision:e.revision,idempotencyKey:o.current.key});i.card&&(j(i.card.id),N(i.card.revision),k(i.card.taskDraft),E(i.card.artifact?.content??``)),o.current=null,t===`decide`&&l(`${e.id}:${e.revision}`),(t===`useful`||t===`not_useful`)&&b(t),t===`refine`&&(b(`refined`),S(``)),g(!1),n()}catch(e){m(e instanceof Error?e.message:String(e))}finally{f(!1)}}return(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex flex-wrap justify-between gap-2 text-xs text-fg-muted`,children:[(0,w.jsx)(`span`,{children:e.artifact?i?`已为你准备`:`Prepared for you`:t.kinds[e.kind]}),(0,w.jsx)(`time`,{dateTime:e.updatedAt,children:new Date(e.updatedAt).toLocaleString()})]}),(0,w.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:e.title}),(0,w.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm text-fg-muted`,children:e.summary}),!r&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm font-medium text-accent`,to:`/assistant-work?item=${encodeURIComponent(e.id)}`,children:e.decision?i?`查看并决定`:`Review decision`:e.artifact?i?`打开准备好的成果`:`Open prepared work`:i?`查看变化`:`View update`}),r&&e.artifact&&(0,w.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,w.jsx)(`h3`,{className:`mb-3 font-medium text-fg`,children:e.artifact.title}),h?(0,w.jsxs)(`label`,{className:`text-sm`,children:[i?`编辑成果`:`Edit prepared work`,(0,w.jsx)(`textarea`,{rows:12,maxLength:12e3,className:R,value:T,onChange:e=>E(e.target.value)})]}):(0,w.jsx)(c,{content:e.artifact.content}),F&&!h&&(0,w.jsx)(d,{className:`mt-3`,variant:`ghost`,onClick:()=>{navigator.clipboard.writeText(e.artifact.content).catch(e=>m(String(e)))},children:i?`复制成果`:`Copy`}),F&&(0,w.jsx)(`div`,{className:`mt-3 flex gap-2`,children:h?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{disabled:u||P||!T.trim(),onClick:()=>void z(`edit_artifact`,{artifact:{...e.artifact,content:T}}),children:t.save}),(0,w.jsx)(d,{variant:`ghost`,onClick:()=>{g(!1),E(e.artifact.content)},children:i?`取消`:`Cancel`})]}):(0,w.jsx)(d,{variant:`ghost`,onClick:()=>g(!0),children:i?`修改成果`:`Edit`})})]}),e.decision&&F&&(0,w.jsxs)(`section`,{className:`mt-5 rounded-xl border border-edge p-4`,children:[(0,w.jsx)(`h3`,{className:`text-sm font-medium`,children:e.decision.question}),D&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{className:`mt-2 text-xs text-fg-muted`,children:i?`确认后创建项目待办,不会自动启动执行。`:`Creates a project task without starting execution.`}),(0,w.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[i?`待办标题`:`Task title`,(0,w.jsx)(`input`,{className:R,maxLength:160,value:D.title,onChange:e=>k({...D,title:e.target.value})})]}),(0,w.jsxs)(`label`,{className:`mt-3 block text-sm`,children:[i?`具体内容`:`Task objective`,(0,w.jsx)(`textarea`,{className:R,maxLength:1200,rows:4,value:D.objective,onChange:e=>k({...D,objective:e.target.value})})]})]}),(0,w.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.decision.options.map((e,t)=>(0,w.jsx)(d,{variant:t===0?`primary`:`ghost`,disabled:u||P||e.id===`approve`&&D!==void 0&&(!D.title.trim()||!D.objective.trim()),onClick:()=>void z(`decide`,{choice:e.id,...e.id===`approve`&&D?{taskDraft:D}:{}}),children:e.label},e.id))})]}),e.followUp&&(0,w.jsxs)(`div`,{className:`mt-4 rounded-lg border border-edge p-3 text-sm`,children:[(0,w.jsx)(a,{className:`text-accent`,to:`/tasks/${encodeURIComponent(e.followUp.taskId)}`,children:e.followUp.title}),(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:e.followUp.phase===`closed`?i?`任务已结束:${e.followUp.resolution??`—`}`:`Task closed: ${e.followUp.resolution??`—`}`:i?`待办已创建,仍在跟进实际进展。`:`Task created; following its progress.`})]}),e.actionStatus===`failed`&&![`expired`,`withdrawn`].includes(e.status)&&(0,w.jsxs)(`div`,{className:`mt-3 text-sm text-danger`,children:[e.actionError,(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`retry`),children:t.retry})]}),r&&(0,w.jsxs)(`details`,{className:`mt-4 text-sm text-fg-muted`,children:[(0,w.jsxs)(`summary`,{className:`cursor-pointer`,children:[t.whyNow,` · `,t.evidence]}),(0,w.jsx)(`p`,{className:`mt-2`,children:e.whyNow}),(0,w.jsx)(`ul`,{className:`mt-2 space-y-2`,children:e.evidence.map(e=>(0,w.jsxs)(`li`,{children:[e.route?(0,w.jsx)(a,{className:`text-accent`,to:e.route,children:e.label}):e.label,e.excerpt&&(0,w.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.excerpt})]},e.id))})]}),r&&F&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:L,children:e.communication?i?`审阅草稿并继续办理`:`Review draft and continue`:i?`接着聊这件事`:`Continue in chat`}),r&&![`withdrawn`,`expired`].includes(e.status)&&(0,w.jsxs)(`section`,{className:`mt-5 border-t border-edge pt-4`,children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:i?`这次帮助合适吗?`:`Was this help right for you?`}),(0,w.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{variant:`ghost`,disabled:u||!!_,onClick:()=>void z(`useful`),children:i?`有帮助`:`Helpful`}),(0,w.jsx)(d,{variant:`ghost`,disabled:u||!!_,onClick:()=>void z(`not_useful`),children:i?`不适合这个场景`:`Not right for this scene`})]}),_&&(0,w.jsx)(`p`,{role:`status`,className:`mt-2 text-xs text-fg-muted`,children:_===`refined`?i?`助理会把这条要求用于这个场景。`:`The assistant will use this instruction for this scene.`:i?`已记下,会用于调整这个场景。`:`Saved to improve this scene.`}),(0,w.jsxs)(`details`,{className:`mt-3`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-sm text-fg-muted`,children:i?`告诉助理下次怎么做`:`Tell the assistant what to do next time`}),(0,w.jsx)(`label`,{className:`mt-3 block text-sm`,children:(0,w.jsx)(`textarea`,{rows:3,maxLength:2e3,className:R,value:x,onChange:e=>S(e.target.value),placeholder:i?`例如:下次先给结论,技术细节放到最后。`:`For example: lead with the conclusion and put technical detail last.`})}),(0,w.jsx)(d,{className:`mt-2`,disabled:u||!x.trim(),onClick:()=>void z(`refine`,{instruction:x}),children:i?`用于这个场景`:`Use for this scene`})]})]}),r&&F&&(0,w.jsxs)(`details`,{className:`mt-4 text-sm`,children:[(0,w.jsx)(`summary`,{className:`cursor-pointer text-fg-muted`,children:i?`调整或收起`:`Adjust or dismiss`}),(0,w.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`handled`),children:i?`我已处理`:`Already handled`}),(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`resolve`),children:i?`这条不用`:`Dismiss`}),(0,w.jsx)(d,{disabled:u||P,onClick:()=>void z(`snooze`),children:t.snooze}),(0,w.jsx)(a,{className:`p-2 text-accent`,to:e.communication?`/assistant-work?follow-up=${encodeURIComponent(e.communication.id)}`:`/assistant-work?delegation=${encodeURIComponent(e.subscriptionId)}`,children:i?`修改关注要求`:`Adjust instructions`})]})]}),!F&&(0,w.jsx)(`p`,{className:`mt-3 text-xs text-fg-muted`,children:e.status===`resolved`?i?`已收起;事项进度以实际结果为准。`:`Dismissed; work progress is tracked separately.`:e.status===`expired`?i?`资料已变化或有效期已过,旧成果仅供参考。`:`Sources changed or this work expired. Review current context before acting.`:O(e.status,t.locale)}),s===`${e.id}:${e.revision}`&&(0,w.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-fg-muted`,children:i?`决定已提交,正在同步处理结果。`:`Decision submitted. Updating the result.`}),P&&s!==`${e.id}:${e.revision}`&&(0,w.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-warning`,children:[i?`卡片已更新。请载入最新版本再决定;重新载入会替换未提交的编辑。`:`This card changed. Load the latest version before deciding; this replaces unsaved edits.`,(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>{j(e.id),N(e.revision),k(e.taskDraft),E(e.artifact?.content??``),l(null),m(``)},children:i?`载入最新版本`:`Load latest version`})]}),p&&(0,w.jsxs)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:[p,(0,w.jsx)(d,{variant:`ghost`,onClick:n,children:i?`刷新最新内容`:`Refresh latest version`})]})]})}var z=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`;function ee(e){let t=(0,S.c)(33),{sub:n,card:r,zh:i}=e,o;t[0]!==n||t[1]!==i?(o=k(n,i),t[0]=n,t[1]=i,t[2]=o):o=t[2];let s;t[3]===o?s=t[4]:(s=(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:o}),t[3]=o,t[4]=s);let c;t[5]===n.userInstructions?c=t[6]:(c=(0,w.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.userInstructions}),t[5]=n.userInstructions,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u=`/assistant-work?delegation=${encodeURIComponent(n.id)}`,d=i?`调整`:`Adjust`,f;t[10]!==u||t[11]!==d?(f=(0,w.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:u,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==l||t[14]!==f?(p=(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[l,f]}),t[13]=l,t[14]=f,t[15]=p):p=t[15];let m;t[16]!==r||t[17]!==n||t[18]!==i?(m=M(n,i,r),t[16]=r,t[17]=n,t[18]=i,t[19]=m):m=t[19];let h;t[20]===m?h=t[21]:(h=(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:m}),t[20]=m,t[21]=h);let g;t[22]!==r||t[23]!==i?(g=F(r,i),t[22]=r,t[23]=i,t[24]=g):g=t[24];let _;t[25]===g?_=t[26]:(_=(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:g}),t[25]=g,t[26]=_);let v;t[27]!==h||t[28]!==_?(v=(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-hover px-4 py-3 text-sm`,children:[h,_]}),t[27]=h,t[28]=_,t[29]=v):v=t[29];let y;return t[30]!==v||t[31]!==p?(y=(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[p,v]}),t[30]=v,t[31]=p,t[32]=y):y=t[32],y}function te({sub:e,card:t,zh:n,refresh:r}){let[i,c]=(0,C.useState)(e.userInstructions),[l,u]=(0,C.useState)(e.delivery),[f,p]=(0,C.useState)(!1),[m,h]=(0,C.useState)(!1),[g,y]=(0,C.useState)(``),[b,x]=(0,C.useState)(``),[S,T]=(0,C.useState)(!1);async function D(t,i=!1){if(!m){h(!0),y(``),x(``);try{await v(`/api/proactive/subscriptions/${encodeURIComponent(e.id)}${i?`/check`:``}`,i?`POST`:`PATCH`,i?{}:{...t,expectedRevision:e.revision}),p(!1),x(i?n?`助理正在重新看看这个项目。`:`Your assistant is checking the project again.`:n?`助理跟进已更新。`:`Assistant follow-up updated.`),r()}catch(e){y(String(e)),r()}finally{h(!1)}}}async function O(t){if(!(S||!e.project)){T(!0),y(``),x(``);try{await _(e.scopeId,{mode:t,allowedActions:t===`auto_low_risk`?[`create_project_task`]:[]}),x(n?`行动边界已更新。`:`Action boundary updated.`),r()}catch(e){y(String(e)),r()}finally{T(!1)}}}let A=e.scopeKind===`project`?n?`项目目标、承诺或交付风险出现有意义的变化时`:`When the project goal, commitments, or delivery risk meaningfully changes`:e.scenarioKey===`meeting_preparation`?n?`相关会议临近,或会议资料发生变化时`:`When a relevant meeting approaches or its context changes`:n?`相关沟通出现值得你接手的变化时`:`When a conversation changes in a way that needs you`;return(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`h1`,{className:`text-2xl font-semibold text-fg`,children:k(e,n)}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:M(e,n,t)})]}),!e.completedAt&&(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{disabled:m,onClick:()=>void D({enabled:!e.enabled}),children:e.enabled?n?`暂停`:`Pause`:n?`恢复`:`Resume`}),e.scopeKind===`project`&&(0,w.jsx)(d,{variant:`ghost`,disabled:m||e.checking||!e.effectiveEnabled,onClick:()=>void D({},!0),children:n?`现在再看看`:`Check again now`})]}),b&&(0,w.jsx)(`p`,{role:`status`,className:`text-sm text-fg-muted`,children:b}),t&&(0,w.jsx)(R,{card:t,copy:E(n),refresh:r,detail:!0}),(0,w.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:n?`跟进要求`:`What your assistant remembers`}),(0,w.jsxs)(`dl`,{className:`mt-4 space-y-4 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`要帮你守住什么`:`What to protect`}),(0,w.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-fg`,children:e.userInstructions})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`什么时候回来找你`:`When to come back`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:A})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:n?`接下来`:`Next`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:N(e,n)})]})]}),e.projectMonitoring&&!e.completedAt&&(0,w.jsxs)(`label`,{className:`mt-5 block border-t border-edge pt-5 text-sm`,children:[(0,w.jsx)(`span`,{className:`font-medium text-fg`,children:n?`助理可以做到哪里`:`How far the assistant can go`}),(0,w.jsxs)(o,{disabled:S,value:e.projectMonitoring.mode,onChange:e=>void O(e.target.value),children:[(0,w.jsx)(s,{value:`observe`,children:n?`只观察和整理`:`Observe and organize only`}),(0,w.jsx)(s,{value:`ask_before_action`,children:n?`先准备,行动前问我`:`Prepare first, ask before acting`}),(0,w.jsx)(s,{value:`auto_low_risk`,children:n?`自动完成明确的低风险动作`:`Complete explicit low-risk actions`})]}),(0,w.jsx)(`span`,{className:`mt-2 block text-xs text-fg-muted`,children:e.projectMonitoring.mode===`auto_low_risk`?n?`目前只包括在当前项目中创建可撤销的待办。`:`Currently limited to creating reversible tasks in this project.`:n?`涉及外部发送或不可逆操作时仍会询问你。`:`External sends and irreversible actions still require you.`})]}),f&&(0,w.jsxs)(`div`,{className:`mt-5 border-t border-edge pt-5`,children:[(0,w.jsxs)(`label`,{className:`block text-sm`,children:[n?`希望助理关注什么,忽略什么?`:`What should the assistant follow or ignore?`,(0,w.jsx)(`textarea`,{rows:5,maxLength:12e3,className:z,value:i,onChange:e=>c(e.target.value)})]}),(0,w.jsxs)(`label`,{className:`mt-4 block text-sm`,children:[n?`什么时候提醒我`:`When to notify me`,(0,w.jsxs)(o,{value:l,onChange:e=>u(e.target.value),children:[(0,w.jsx)(s,{value:`inbox`,children:n?`回到工作台时告诉我`:`Tell me in the Workbench`}),(0,w.jsx)(s,{value:`important`,children:n?`重要变化立即告诉我`:`Tell me right away for important changes`}),(0,w.jsx)(s,{value:`digest`,children:n?`放进每日汇总`:`Include it in my daily digest`})]})]})]}),!e.completedAt&&(0,w.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[f?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(d,{disabled:m||!i.trim(),onClick:()=>void D({userInstructions:i,delivery:l}),children:n?`保存安排`:`Save arrangement`}),(0,w.jsx)(d,{variant:`ghost`,onClick:()=>p(!1),children:n?`取消`:`Cancel`})]}):(0,w.jsx)(d,{variant:`ghost`,onClick:()=>p(!0),children:n?`调整安排`:`Adjust arrangement`}),(0,w.jsx)(d,{variant:`ghost`,disabled:m,onClick:()=>void D({enabled:!1,completedAt:new Date().toISOString()}),children:n?`结束安排`:`End arrangement`})]}),e.project&&(0,w.jsx)(a,{className:`mt-4 inline-block text-sm text-accent`,to:`/projects/${encodeURIComponent(e.scopeId)}`,children:n?`回到项目`:`Back to project`})]}),g&&(0,w.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:g})]})}var B=`mt-2 w-full rounded-lg border border-edge bg-surface-base p-3 text-sm text-fg`,ne=e=>{let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16)};function re(e){let t=(0,S.c)(30),{follow:n,zh:r}=e,i=n.subject??(r?`邮件跟进`:`Email follow-up`),o;t[0]===i?o=t[1]:(o=(0,w.jsx)(`h2`,{className:`font-semibold text-fg`,children:i}),t[0]=i,t[1]=o);let s;t[2]===n.instructions?s=t[3]:(s=(0,w.jsx)(`p`,{className:`mt-1 line-clamp-2 whitespace-pre-wrap text-sm text-fg-muted`,children:n.instructions}),t[2]=n.instructions,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,w.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l=`/assistant-work?follow-up=${encodeURIComponent(n.id)}`,u=r?`调整`:`Adjust`,d;t[7]!==l||t[8]!==u?(d=(0,w.jsx)(a,{className:`shrink-0 text-sm font-medium text-accent`,to:l,children:u}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==c||t[11]!==d?(f=(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[c,d]}),t[10]=c,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==n||t[14]!==r?(p=I(n,r),t[13]=n,t[14]=r,t[15]=p):p=t[15];let m;t[16]===p?m=t[17]:(m=(0,w.jsx)(`p`,{className:`font-medium text-fg`,children:p}),t[16]=p,t[17]=m);let h;t[18]!==n.dueAt||t[19]!==n.status||t[20]!==r?(h=n.status===`completed`?r?`这项安排已经结束`:`This arrangement has ended`:`${r?`约定时间`:`Follow up by`} ${L(n.dueAt,r)}`,t[18]=n.dueAt,t[19]=n.status,t[20]=r,t[21]=h):h=t[21];let g;t[22]===h?g=t[23]:(g=(0,w.jsx)(`p`,{className:`mt-1 text-fg-muted`,children:h}),t[22]=h,t[23]=g);let _;t[24]!==m||t[25]!==g?(_=(0,w.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-hover px-4 py-3 text-sm`,children:[m,g]}),t[24]=m,t[25]=g,t[26]=_):_=t[26];let v;return t[27]!==_||t[28]!==f?(v=(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[f,_]}),t[27]=_,t[28]=f,t[29]=v):v=t[29],v}function ie({follow:e,zh:t,refresh:n}){let[r,i]=(0,C.useState)(!1),[o,s]=(0,C.useState)(e.instructions),[c,l]=(0,C.useState)(ne(e.dueAt)),[u,f]=(0,C.useState)(!1),[p,m]=(0,C.useState)(``);async function h(t){f(!0),m(``);try{await v(`/api/proactive/follow-ups/${encodeURIComponent(e.id)}`,`PATCH`,{expectedRevision:e.revision,...t}),i(!1),n()}catch(e){m(String(e))}finally{f(!1)}}return(0,w.jsxs)(`article`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,w.jsx)(`h2`,{className:`font-medium`,children:e.subject??(t?`邮件跟进`:`Email follow-up`)}),(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:I(e,t)}),(0,w.jsxs)(`dl`,{className:`mt-4 space-y-4 text-sm`,children:[(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t?`助理在等什么`:`What the assistant is waiting for`}),(0,w.jsx)(`dd`,{className:`mt-1 whitespace-pre-wrap text-fg`,children:e.instructions})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`dt`,{className:`text-xs text-fg-subtle`,children:t?`什么时候回来找你`:`When to come back`}),(0,w.jsx)(`dd`,{className:`mt-1 text-fg`,children:L(e.dueAt,t)})]})]}),e.syncFailed&&(0,w.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:t?`助理暂时看不到最新回复,请检查邮箱连接。`:`The assistant cannot see the latest replies right now. Check the email connection.`}),!e.sourceAvailable&&(0,w.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/connectors`,children:t?`检查邮箱连接`:`Check email connection`}),e.sessionKey&&(0,w.jsx)(a,{className:`mt-3 block text-sm text-accent`,to:`/chat/${encodeURIComponent(e.sessionKey)}`,children:t?`继续原来的对话`:`Continue the conversation`}),r&&(0,w.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,w.jsx)(`textarea`,{"aria-label":t?`跟进要求`:`Instructions`,className:B,rows:3,maxLength:12e3,value:o,onChange:e=>s(e.target.value)}),(0,w.jsx)(`input`,{"aria-label":t?`跟进时间`:`Follow-up time`,type:`datetime-local`,className:B,value:c,onChange:e=>l(e.target.value)}),(0,w.jsx)(d,{disabled:u||!o.trim()||!c,onClick:()=>void h({instructions:o,...ne(e.dueAt)===c?{}:{dueAt:new Date(c).toISOString()}}),children:t?`保存安排`:`Save arrangement`})]}),(0,w.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>i(!r),children:r?t?`取消修改`:`Cancel edit`:t?`调整安排`:`Adjust arrangement`}),(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>void h({status:e.status===`watching`?`paused`:`watching`}),children:e.status===`watching`?t?`暂停`:`Pause`:t?`恢复`:`Resume`}),e.status!==`completed`&&(0,w.jsx)(d,{variant:`ghost`,disabled:u,onClick:()=>void h({status:`completed`}),children:t?`结束安排`:`End arrangement`})]}),p&&(0,w.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:p})]})}var V=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function H(e){let t=(0,S.c)(58),{value:n,onChange:r,zh:i}=e,a;t[0]===i?a=t[1]:(a=i?{all:`所有已启用设备`,auto:`自动选择一台设备`,browser:`浏览器 / 桌面`,mobile:`手机`,telegram:`Telegram`}:{all:`All enabled devices`,auto:`Choose one device`,browser:`Browser / desktop`,mobile:`Mobile`,telegram:`Telegram`},t[0]=i,t[1]=a);let s=a,c;t[2]!==r||t[3]!==n?(c=e=>r({...n,digestEnabled:e.target.checked}),t[2]=r,t[3]=n,t[4]=c):c=t[4];let l;t[5]!==c||t[6]!==n.digestEnabled?(l=(0,w.jsx)(`input`,{type:`checkbox`,checked:n.digestEnabled,onChange:c}),t[5]=c,t[6]=n.digestEnabled,t[7]=l):l=t[7];let u=i?`将提醒合并为每日摘要`:`Combine alerts into a daily digest`,d;t[8]!==l||t[9]!==u?(d=(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[l,u]}),t[8]=l,t[9]=u,t[10]=d):d=t[10];let f=i?`摘要时间(使用上方时区)`:`Digest time (in your selected timezone)`,p=String(n.digestHour),m;t[11]===p?m=t[12]:(m=p.padStart(2,`0`),t[11]=p,t[12]=m);let h=String(n.digestMinute),g;t[13]===h?g=t[14]:(g=h.padStart(2,`0`),t[13]=h,t[14]=g);let _=`${m}:${g}`,v;t[15]!==r||t[16]!==n?(v=e=>{let[t,i]=e.target.value.split(`:`).map(Number);r({...n,digestHour:t,digestMinute:i})},t[15]=r,t[16]=n,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,w.jsx)(`input`,{className:V,type:`time`,required:!0,value:_,onChange:v}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;t[21]!==y||t[22]!==f?(b=(0,w.jsxs)(`label`,{className:`block text-sm`,children:[f,y]}),t[21]=y,t[22]=f,t[23]=b):b=t[23];let x=i?`提醒渠道`:`Notification channel`,C=n.preferredChannel,T;t[24]!==r||t[25]!==n?(T=e=>r({...n,preferredChannel:e.target.value}),t[24]=r,t[25]=n,t[26]=T):T=t[26];let E;t[27]===s?E=t[28]:(E=Object.entries(s).map(U),t[27]=s,t[28]=E);let D;t[29]!==T||t[30]!==E||t[31]!==n.preferredChannel?(D=(0,w.jsx)(o,{value:C,onChange:T,children:E}),t[29]=T,t[30]=E,t[31]=n.preferredChannel,t[32]=D):D=t[32];let O;t[33]!==x||t[34]!==D?(O=(0,w.jsxs)(`label`,{className:`block text-sm`,children:[x,D]}),t[33]=x,t[34]=D,t[35]=O):O=t[35];let k=i?`自动选择优先使用最近注册的浏览器,否则选择一台手机。免打扰期间的重要提醒会合并为一份摘要。`:`Automatic selection prefers the most recently registered browser, then one mobile device. Important alerts during quiet hours are combined into one digest.`,A;t[36]===k?A=t[37]:(A=(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:k}),t[36]=k,t[37]=A);let j;t[38]!==r||t[39]!==n?(j=e=>r({...n,suppressWhileViewing:e.target.checked}),t[38]=r,t[39]=n,t[40]=j):j=t[40];let M;t[41]!==j||t[42]!==n.suppressWhileViewing?(M=(0,w.jsx)(`input`,{type:`checkbox`,checked:n.suppressWhileViewing,onChange:j}),t[41]=j,t[42]=n.suppressWhileViewing,t[43]=M):M=t[43];let N=i?`正在查看卡片时不再发送系统提醒`:`Skip system alerts while viewing cards`,P;t[44]!==M||t[45]!==N?(P=(0,w.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[M,N]}),t[44]=M,t[45]=N,t[46]=P):P=t[46];let F;t[47]!==r||t[48]!==n||t[49]!==i?(F=n.preferredChannel===`telegram`&&(0,w.jsxs)(`fieldset`,{className:`space-y-3 rounded-xl border border-edge p-3`,children:[(0,w.jsx)(`legend`,{className:`px-1 text-sm`,children:`Telegram`}),[`chatId`,`accountId`,`publicUrl`].map(e=>(0,w.jsxs)(`label`,{className:`block text-sm`,children:[e===`chatId`?i?`接收对话 ID`:`Destination chat ID`:e===`accountId`?i?`账号 ID(可选)`:`Account ID (optional)`:i?`可从外部访问的控制台 HTTPS 地址`:`Public HTTPS console URL`,(0,w.jsx)(`input`,{className:V,required:e!==`accountId`,value:n.telegram?.[e]??``,onChange:t=>r({...n,telegram:{chatId:n.telegram?.chatId??``,publicUrl:n.telegram?.publicUrl??``,...n.telegram?.accountId?{accountId:n.telegram.accountId}:{},[e]:e===`accountId`?t.target.value||void 0:t.target.value}})})]},e)),(0,w.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`需要已连接 Telegram 渠道。发送通用摘要和卡片链接;链接中不要填写访问令牌。`:`Connect the Telegram channel first. Alerts contain a generic summary and a card link. Do not put access tokens in the URL.`})]}),t[47]=r,t[48]=n,t[49]=i,t[50]=F):F=t[50];let I;return t[51]!==b||t[52]!==O||t[53]!==A||t[54]!==P||t[55]!==F||t[56]!==d?(I=(0,w.jsxs)(`div`,{className:`space-y-4 border-t border-edge pt-4`,children:[d,b,O,A,P,F]}),t[51]=b,t[52]=O,t[53]=A,t[54]=P,t[55]=F,t[56]=d,t[57]=I):I=t[57],I}function U(e){let[t,n]=e;return(0,w.jsx)(s,{value:t,children:n},t)}var W=`mt-1 w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`;function ae({preferences:e,copy:t,refresh:n}){let[r,i]=(0,C.useState)(e),[a,c]=(0,C.useState)(!1),[l,u]=(0,C.useState)(``);async function f(i=r){c(!0),u(``);try{let{revision:a,...o}={...r,...i};await v(`/api/proactive/preferences`,`PATCH`,{...o,expectedRevision:e.revision}),u(t.saved),n()}catch(e){u(e instanceof Error?e.message:String(e))}finally{c(!1)}}return(0,w.jsxs)(`form`,{className:`max-w-2xl space-y-5 rounded-2xl border border-edge bg-surface-panel p-5`,onSubmit:e=>{e.preventDefault(),f()},children:[(0,w.jsxs)(`label`,{className:`block text-sm`,children:[t.level,(0,w.jsx)(o,{value:r.level,onChange:e=>i({...r,level:e.target.value}),children:Object.entries(t.levels).map(([e,t])=>(0,w.jsx)(s,{value:e,children:t},e))})]}),(0,w.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.timezone,(0,w.jsx)(`input`,{required:!0,className:W,value:r.timezone,onChange:e=>i({...r,timezone:e.target.value})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.limit,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:30,className:W,value:r.dailyNotificationLimit,onChange:e=>i({...r,dailyNotificationLimit:Number(e.target.value)})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.quietStart,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietStartHour,onChange:e=>i({...r,quietStartHour:Number(e.target.value)})})]}),(0,w.jsxs)(`label`,{className:`text-sm`,children:[t.quietEnd,(0,w.jsx)(`input`,{required:!0,type:`number`,min:0,max:23,className:W,value:r.quietEndHour,onChange:e=>i({...r,quietEndHour:Number(e.target.value)})})]})]}),(0,w.jsx)(H,{value:r,onChange:i,zh:t.locale===`zh`}),(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t.privacy}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,w.jsx)(d,{type:`submit`,variant:`primary`,disabled:a,children:t.save}),(0,w.jsx)(d,{disabled:a,onClick:()=>void f({pausedUntil:new Date(Date.now()+36e5).toISOString()}),children:t.pause}),e.pausedUntil&&(0,w.jsx)(d,{disabled:a,onClick:()=>void f({pausedUntil:null}),children:t.resume})]}),l&&(0,w.jsx)(`p`,{role:`status`,className:`text-sm`,children:l})]})}function G(){let e=(0,S.c)(44),t=l(de)===`zh`,n;e[0]===t?n=e[1]:(n=E(t),e[0]=t,e[1]=n);let r=n,o=b(ue),s=b(le),[c,p]=i(),g;e[2]===c?g=e[3]:(g=c.get(`view`),e[2]=c,e[3]=g);let _=g,y=_===`settings`?_:`list`,x;e[4]===c?x=e[5]:(x=c.get(`state`),e[4]=c,e[5]=x);let D=x,O=D===`paused`||D===`completed`?D:`active`,k;e[6]===c?k=e[7]:(k=c.get(`item`),e[6]=c,e[7]=k);let M=k,N;e[8]===c?N=e[9]:(N=c.get(`digest`),e[8]=c,e[9]=N);let F=N,I;e[10]===c?I=e[11]:(I=c.get(`delegation`),e[10]=c,e[11]=I);let L=I,z;e[12]===c?z=e[13]:(z=c.get(`follow-up`),e[12]=c,e[13]=z);let B=z,ne=y===`list`||!!(L||B),V=u(y===`settings`?`/api/proactive/preferences`:null,h),H;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(H={refreshInterval:15e3},e[14]=H):H=e[14];let U=u(ne?`/api/proactive/overview`:null,h,H),W;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(W={revalidateOnFocus:!1},e[15]=W):W=e[15];let G=u(M?`/api/inbox/judgments/${encodeURIComponent(M)}`:null,h,W),K=u(F?`/api/proactive/digests/${encodeURIComponent(F)}`:null,h),q;e[16]===c?q=e[17]:(q=c.get(`probe`),e[16]=c,e[17]=q);let J=q,Y,fe;e[18]===J?(Y=e[19],fe=e[20]):(Y=()=>{J&&v(`/api/proactive/web-push/probes/${encodeURIComponent(J)}/opened`,`POST`,{}).catch(ce)},fe=[J],e[18]=J,e[19]=Y,e[20]=fe),(0,C.useEffect)(Y,fe);let pe=G.error??U.error??V.error??K.error,me=G.isLoading||U.isLoading||V.isLoading||K.isLoading,he=U.data?.scenes.flatMap(se)??[],ge=U.data?.delegations.filter(oe)??[],_e;e[21]===O?_e=e[22]:(_e=e=>A(e)===O,e[21]=O,e[22]=_e);let ve=ge.filter(_e),ye=U.data?.followUps.filter(e=>j(e)===O)??[],X;e[23]===L?X=e[24]:(X=e=>e.id===L,e[23]=L,e[24]=X);let be=ge.find(X),xe;e[25]!==B||e[26]!==U.data?.followUps?(xe=U.data?.followUps.find(e=>e.id===B),e[25]=B,e[26]=U.data?.followUps,e[27]=xe):xe=e[27];let Se=xe,Ce=e=>p(e),Z=!!(M||F||L||B),we=M?t?`跟进动态`:`Follow-up update`:F?t?`跟进摘要`:`Follow-up summary`:Z?t?`跟进详情`:`Follow-up details`:y===`settings`?t?`提醒偏好`:`Notification preferences`:t?`助理跟进`:`Assistant follow-ups`,Te=M||F?`/`:`/assistant-work`,Q=M||F?t?`返回工作台`:`Back to Workbench`:t?`返回助理跟进`:`Back to assistant follow-ups`,Ee,De;if(e[28]!==Q||e[29]!==Te||e[30]!==s||e[31]!==Z||e[32]!==o||e[33]!==we||e[34]!==y||e[35]!==t?(Ee=()=>(o({startExtra:Z||y===`settings`?(0,w.jsx)(d,{asChild:!0,variant:`ghost`,className:`size-8 rounded-lg p-0`,children:(0,w.jsx)(a,{to:Te,"aria-label":Q,title:Q,children:(0,w.jsx)(m,{className:`size-4`,"aria-hidden":!0})})}):null,main:(0,w.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:we}),end:!Z&&y===`list`?(0,w.jsx)(d,{asChild:!0,variant:`ghost`,className:`h-9 rounded-lg`,children:(0,w.jsx)(a,{to:`/assistant-work?view=settings`,children:t?`提醒偏好`:`Notification preferences`})}):null}),()=>s()),De=[Q,Te,s,Z,o,we,y,t],e[28]=Q,e[29]=Te,e[30]=s,e[31]=Z,e[32]=o,e[33]=we,e[34]=y,e[35]=t,e[36]=Ee,e[37]=De):(Ee=e[36],De=e[37]),(0,C.useLayoutEffect)(Ee,De),me){let t;return e[38]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,w.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-5 px-4 py-7 sm:px-6`,children:[(0,w.jsx)(f,{className:`h-8 w-48`}),(0,w.jsx)(f,{className:`h-56 rounded-2xl`}),(0,w.jsx)(f,{className:`h-40 rounded-2xl`})]})}),e[38]=t):t=e[38],t}let $;e[39]===pe?$=e[40]:($=pe&&(0,w.jsx)(`p`,{role:`alert`,className:`rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:String(pe)}),e[39]=pe,e[40]=$);let Oe=M?(0,w.jsx)(w.Fragment,{children:G.data&&(0,w.jsx)(R,{card:G.data.card,copy:r,refresh:()=>void G.mutate(),detail:!0},`${G.data.card.id}:${G.data.card.revision}`)}):F?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`h2`,{className:`text-xl font-semibold text-fg`,children:t?`助理为你整理的变化`:`Updates prepared by your assistant`}),K.data?.cards.map(e=>(0,w.jsx)(R,{card:e,copy:r,refresh:()=>void K.mutate()},e.id)),K.data?.cards.length===0&&(0,w.jsx)(`p`,{className:`text-sm text-fg-muted`,children:t?`这些事项已处理或不再需要关注。`:`These items have been handled or are no longer relevant.`})]}):be?(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(te,{sub:be,card:P(he,be.id),zh:t,refresh:()=>void U.mutate()},be.id)}):Se?(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(ie,{follow:Se,zh:t,refresh:()=>void U.mutate()})}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:y===`settings`?t?`决定助理什么时候提醒你,以及通过什么方式送达。`:`Choose when and how your assistant should notify you.`:t?`查看和管理交给助理持续跟进的事项。可以从项目、会议或对话中发起新的跟进。`:`Review and manage work your assistant is following. Start a follow-up from a project, meeting, or conversation.`}),y===`settings`&&V.data?(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(ae,{preferences:V.data.preferences,copy:r,refresh:()=>void V.mutate()},V.data.preferences.revision),(0,w.jsx)(T,{zh:t})]}):(0,w.jsxs)(`div`,{className:`space-y-5`,children:[(0,w.jsx)(`nav`,{className:`flex gap-2`,"aria-label":t?`跟进状态`:`Follow-up status`,children:[[`active`,t?`跟进中`:`Active`],[`paused`,t?`已暂停`:`Paused`],[`completed`,t?`已结束`:`Ended`]].map(e=>{let[t,n]=e;return(0,w.jsx)(d,{variant:O===t?`secondary`:`ghost`,onClick:()=>Ce(t===`active`?{}:{state:t}),children:n},t)})}),(0,w.jsxs)(`div`,{className:`space-y-3`,children:[ve.map(e=>(0,w.jsx)(ee,{sub:e,card:P(he,e.id),zh:t},`${e.id}:${e.revision}`)),ye.map(e=>(0,w.jsx)(re,{follow:e,zh:t},`${e.id}:${e.revision}`)),ve.length+ye.length===0&&(0,w.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-6`,children:[(0,w.jsx)(`h2`,{className:`font-medium text-fg`,children:O===`active`?t?`还没有正在跟进的事项`:`No active follow-ups`:O===`paused`?t?`没有已暂停的跟进`:`No paused follow-ups`:t?`没有已结束的跟进`:`No ended follow-ups`}),O===`active`&&(0,w.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:t?`打开一个项目,或在会议和沟通场景中告诉助理,需要它持续帮你守住什么。`:`Open a project, meeting, or conversation and tell the assistant what it should keep watching for you.`})]})]})]})]}),ke;return e[41]!==$||e[42]!==Oe?(ke=(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto bg-surface-base`,children:(0,w.jsxs)(`div`,{className:`mx-auto max-w-4xl space-y-6 px-4 py-7 sm:px-6`,children:[$,Oe]})}),e[41]=$,e[42]=Oe,e[43]=ke):ke=e[43],ke}function oe(e){return e.scenarioKey!==`communication_follow_up`}function se(e){return e.card?[e.card]:[]}function ce(){}function le(e){return e.clearPageHeader}function ue(e){return e.setPageHeader}function de(e){return e.language}export{G as ProactivePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as a}from"./locale-store-
|
|
1
|
+
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{r as n,t as r,u as i}from"./chunk-KS7C4IRE-Cq1tE_3b.js";import{n as a}from"./locale-store-DO6JJ1l2.js";import{a as o,r as s}from"./product-delivery-CCC4FJ3Y.js";import{i as c}from"./vendor-swr-BIWyz7Rc.js";import{t as l}from"./skeleton-BwbyijEw.js";import{n as u}from"./api-3lphBVuY.js";var d=e();function f(e){return e.installationState===`installed`&&e.enabled&&e.status===`installed`?`/extensions/${encodeURIComponent(e.extensionId)}`:`/local-apps/${encodeURIComponent(e.id)}`}var p=t();function m(){let e=(0,d.c)(14),t=i(),r=a(h)===`zh`,m=s(`xopc://open${t.search}`),_=m?.kind===`local_app`?m.id:null,{data:v,error:y}=c(_?[`local-app-open`,_]:null,()=>u(_));if(!m){let t=r?`这个打开链接无效。`:`This open link is invalid.`,n;return e[0]!==t||e[1]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[0]=t,e[1]=r,e[2]=n):n=e[2],n}if(m.kind!==`local_app`){let t=o({...m,title:m.id,capabilities:[`open`]}),i;return e[3]!==t||e[4]!==r?(i=t?(0,p.jsx)(n,{to:t,replace:!0}):(0,p.jsx)(g,{message:r?`这个内容无法在应用中打开。`:`This content cannot be opened in the app.`,zh:r}),e[3]=t,e[4]=r,e[5]=i):i=e[5],i}if(y){let t=typeof y==`object`&&y&&`status`in y&&y.status===404?r?`找不到这个本地应用,它可能已被删除。`:`This local app was not found and may have been deleted.`:y instanceof Error?y.message:r?`无法打开这个本地应用。`:`Unable to open this local app.`,n;return e[6]!==t||e[7]!==r?(n=(0,p.jsx)(g,{message:t,zh:r}),e[6]=t,e[7]=r,e[8]=n):n=e[8],n}if(v){let t;e[9]===v?t=e[10]:(t=f(v),e[9]=v,e[10]=t);let r;return e[11]===t?r=e[12]:(r=(0,p.jsx)(n,{to:t,replace:!0}),e[11]=t,e[12]=r),r}let b;return e[13]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,p.jsxs)(`div`,{className:`flex w-full flex-col gap-4 px-3 py-6 sm:px-5 xl:px-6`,"aria-busy":!0,children:[(0,p.jsx)(l,{className:`h-6 w-48`}),(0,p.jsx)(l,{className:`h-32 rounded-xl`})]}),e[13]=b):b=e[13],b}function h(e){return e.language}function g(e){let t=(0,d.c)(7),{message:n,zh:i}=e,a;t[0]===n?a=t[1]:(a=(0,p.jsx)(`p`,{children:n}),t[0]=n,t[1]=a);let o=i?`查看本地应用`:`View local apps`,s;t[2]===o?s=t[3]:(s=(0,p.jsx)(r,{className:`mt-3 inline-flex font-medium text-accent hover:underline`,to:`/local-apps`,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,p.jsxs)(`div`,{className:`m-6 rounded-xl border border-danger/30 bg-danger-soft p-4 text-sm text-danger`,role:`alert`,children:[a,s]}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}export{m as ProductOpenPage};
|