@xopcai/xopc 0.0.354 → 0.0.356
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/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-X7CG9pzB.js → activity-store-Bj0GuUUk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B8PS1eLP.js → agent-avatar-dicebear-i0dJX4Ag.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CLBSL9hl.js → agent-defaults-settings-panel-C-gsYOIi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-D00xRE50.js +1 -0
- package/dist/gateway/static/root/assets/agents-Bg90PJpR.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-Ck2x78jq.js → agents-admin-api-CYqmO7gb.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-COdQOmdT.js → app-management-settings-panel-LGezxe7p.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CDNjc2yy.js → appearance-settings-By7sj-tH.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C-kvpPj8.js → apps-page-DRX7wRpG.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-QfOaQPL_.js → archive-plugin-BZHSbFiu.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-87DN5nXX.js → automations-page-B5ZRVvra.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CQmwjCm5.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BF2lVwR9.js → binary-plugins-x2-RmzUs.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B04Kv5DU.js → block-editor-C8eM0IQi.js} +39 -39
- package/dist/gateway/static/root/assets/{browser-automation-inputs-FW3bYZ-z.js → browser-automation-inputs-uQ2AGFFU.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Ck6Zb9aU.js → browser-automations-page-DonJaYJ7.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DHlyYItE.js → browser-settings-page-Cku_iTDi.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-CF4-mrIa.js → capabilities-Btku0cS3.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BCF_160Z.js → capabilities-Cl1RErL_.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-gUGN48Ob.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C3pM7xZ1.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-PBPJJsp6.js → capability-header-actions-aXDBY-4S.js} +1 -1
- package/dist/gateway/static/root/assets/channels-BSbO91V4.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DTd7mWyE.js → chat-terminal-dock-Bn_O5W2o.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page--9rh1mvu.js → computer-settings-page-CqzDwqcT.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-v6Is0BOO.js → connector-service-page-BYq8YaSp.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CXVlZmoT.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-DTsMzjoZ.js → date-picker-dIJ4tP-C.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Y1QYCcLp.js → dependency-picker-ktHB4hRk.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D9dfZrOp.js → desktop-pet-BqXL3Ivw.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BHVOHZUL.js → desktop-pet-settings-BspF0vWW.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CnADxQU1.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DeMo9KlE.js → directory-picker-path-field-CyR-4zZC.js} +1 -1
- package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BrGWLJg9.js → extension-debug-page-DPc3vTw0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-AWrvy1Nb.js → extension-page-CWqtFuVa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CUpbXB2k.js → extension-provider-D-0AeFhE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C5KgmhYu.js → extension-settings-page-92wO2TEf.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B31I6Gbq.js → gateway-config-swr-Da3Oob_s.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D6ffOiPe.js → gateway-realtime-BDh3i8n7.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B5Oq6VCQ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-DC-lok0J.js → gateway-settings-CO_50TOx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DVol958v.js → gateway-startup-retry-BEj_bcbm.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Ba20kfpf.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-TVgJfz9r.js → image-generation-api-8jfU8AlD.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BKVKfVMA.js → imports-page-ciLLYJao.js} +1 -1
- package/dist/gateway/static/root/assets/index-DUgsBdV3.css +1 -0
- package/dist/gateway/static/root/assets/index-XgbDpmNc.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DiwE4gKU.js → keyboard-shortcuts-settings-7429mJN3.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Dt3TC64L.js → local-app-workbench-page-CQyP9KBM.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DFPhWkxU.js → local-apps-page-Cht3NkYu.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-wiq_12oN.js → local-session-drafts-jOqfUlwj.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Y1aBayM_.js → locale-store-DodizOrj.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-C4faHZHj.js → logs-page-Bye3bESN.js} +2 -2
- package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +1 -0
- package/dist/gateway/static/root/assets/loopi-Djb8XU3l.js +1 -0
- package/dist/gateway/static/root/assets/{management-settings-pZLdvIiw.js → management-settings-BG2yeKtz.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-7tzqIp_G.js → markdown-view-Bb6ohqHz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-cjgrKnne.js → media-plugins-DIhqKSK5.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D8PmAUB-.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-CaYi043g.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-DA_6YKSN.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-J0yhflxC.js → notes-api-DYfvIxWh.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-kc3CMA5c.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-api-CYe61zfD.js → oauth-api-gSu-iTk5.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CiBUm2Br.js → page-context-capture-button-r0vf-oBH.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CmZzN99O.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-DcsFzD_i.js → popover-select-BNZZDJpO.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B8_w6c3J.js → product-open-page-BdedC52J.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-CDZdKiTz.js → project-detail-page-b23nMTcO.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BvahSrZi.js → projects-page-DCA7oEdB.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DqDOrPQ0.js → registry-api-D0eYNizR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DeK3ATTQ.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BnMS50vK.js → runtime-tools-settings-panel-BqD6oWU5.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-CDR1-q25.js → scenes-page-Ds6trhfL.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-B4Xa8w8S.js → schema-form-D-cjcRAn.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-C7Nqy0sK.js → send-session-input-DstpmO44.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CTN4qwiN.js → session-api-qy4gMa5t.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DsH1DZI_.js → session-manager-CFqOuGy-.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DltxWUQd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bqg7glTa.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CHZdpvkT.js → settings-page-BVfsQrWS.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-HESfALIF.js → setup-status-panel-DqkS3DKy.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-COlX10Dc.js → share-link-dialog-B3Io5mOY.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-NtRLUieq.js → share-preview-page-BpZqXsgR.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DICV5EKH.js → shares-api-BNNaREyB.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CEaRXDeL.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-DYgcO7y0.js → skill-api-1Hp370EM.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CWH3Fmx4.js → skill-reload-api-Dm6GgUYK.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-Cgze-HZy.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-wXCBwYwE.js → system-settings-panel-CFSQ3Qjr.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DEDh0FPJ.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BKgBPLH4.js → theme-store-AXut7b8R.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-C0t8y3Mi.js → tunnel-api-WcqOMVcQ.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-A2DZAidl.js → usage-page-C6cnfavb.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Cn6hqqyM.js → use-autosave-BT3l-ETP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DL61XeSu.js → use-composer-attachments-zfL8zvRu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cl9mU32w.js → use-file-preview-expanded-C4bBXf4j.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-C6_GMD0W.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bw05QB_V.js → voice-api-key-field-BF9hOZ_1.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-D8G4fALX.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-DVvqH1d-.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-rM4U1FXc.js → workflow-run-setup-panel-MDkhjfGm.js} +2 -2
- package/dist/gateway/static/root/assets/{workflows-page-QKC34FzQ.js → workflows-page-Bhu13vVb.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-BbBT75Kg.js → workspace-api-C4q2GwGV.js} +2 -2
- package/dist/gateway/static/root/index.html +32 -30
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice-catalog.js +4 -1
- package/dist/src/agent/agent-manager.js +15 -15
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +6 -5
- package/dist/src/agent/embedded/run-turn.js +24 -6
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/embedded/types.d.ts +1 -0
- package/dist/src/agent/external-tools/cliProvider.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +3 -3
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +2 -2
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/mcp/plugin-http-fetch.js +1 -1
- package/dist/src/agent/memory/context-recovery.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +5 -4
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +6 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +22 -22
- package/dist/src/agent/session/session-config-service.js +1 -1
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/source-context/index.js +2 -2
- package/dist/src/agent/tasks/task-judge-service.js +4 -4
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/dataBatch.js +1 -1
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +16 -16
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +6 -6
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-preference-tool.d.ts +1 -1
- package/dist/src/agent/tools/personal-preference-tool.js +3 -2
- package/dist/src/agent/tools/personal-task-tool.d.ts +2 -1
- package/dist/src/agent/tools/personal-task-tool.js +27 -8
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +2 -2
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +5 -5
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-config/schema.d.ts +20 -1
- package/dist/src/agent-config/schema.js +7 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/index.js +4 -4
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/backup/archive.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +3 -3
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +3 -3
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +4 -4
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +3 -3
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +8 -8
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/cli/runtime.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +3 -3
- package/dist/src/connectors/connection-recovery-service.js +5 -5
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/api.js +4 -4
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +24 -6
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/personal-agent.js +135 -8
- package/dist/src/gateway/hono/routes/projects.js +4 -4
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +4 -4
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -5
- package/dist/src/gateway/hono/routes/voice.js +33 -8
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +3 -3
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +41 -0
- package/dist/src/gateway/service/config-coordinator.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +5 -4
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.js +49 -49
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +11 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +146 -10
- package/dist/src/gateway/xopc-cloud-onboarding.d.ts +3 -0
- package/dist/src/gateway/xopc-cloud-onboarding.js +27 -0
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/personal-agent/onboarding.d.ts +27 -0
- package/dist/src/personal-agent/onboarding.js +48 -0
- package/dist/src/personal-agent/repository.d.ts +6 -1
- package/dist/src/personal-agent/repository.js +7 -2
- package/dist/src/personal-agent/service.d.ts +24 -6
- package/dist/src/personal-agent/service.js +38 -15
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/resources.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +4 -4
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +4 -4
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +8 -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/schema.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-application-service.js +3 -3
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-main-update-delivery.js +5 -2
- package/dist/src/tasks/task-origin-repository.d.ts +4 -1
- package/dist/src/tasks/task-origin-repository.js +3 -3
- package/dist/src/tasks/task-run-coordinator.d.ts +1 -0
- package/dist/src/tasks/task-run-coordinator.js +13 -7
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +6 -4
- package/dist/src/tui/backends/embedded-backend.js +12 -12
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +8 -8
- package/dist/src/tui/tui-oauth-login.js +1 -1
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +4 -4
- package/dist/src/tui/tui.js +7 -7
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/language-profile.js +1 -1
- package/dist/src/voice/metadata/builtin.js +16 -39
- package/dist/src/voice/metadata/types.d.ts +2 -0
- package/dist/src/voice/platform-catalog.d.ts +3 -0
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +19 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +4 -4
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/stt/types.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/alibaba-speech.js +4 -16
- package/dist/src/voice/tts/providers/alibaba-voices.d.ts +3 -0
- package/dist/src/voice/tts/providers/alibaba-voices.js +197 -0
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
- package/dist/src/voice/tts/types.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/service.js +5 -5
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +8 -8
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BninweSg.js +0 -1
- package/dist/gateway/static/root/assets/agents-CcVLP_WP.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BdZ8NO8k.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-page-C-6RLFNh.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CST_HBkR.js +0 -8
- package/dist/gateway/static/root/assets/channels-CM4sIvcP.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CryQzmEZ.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-Cy5YDZ2b.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +0 -1
- package/dist/gateway/static/root/assets/home-page-C29_VFAs.js +0 -1
- package/dist/gateway/static/root/assets/index-BJh5gU04.css +0 -1
- package/dist/gateway/static/root/assets/index-ByFXhQ-T.js +0 -107
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BLnT1tYJ.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BawArJvP.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-Cng583RH.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CU_UdkuI.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Ymyg98G-.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-wMZhxwTM.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CXEBo5YL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-Dx5v64jU.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-hoIyr7tp.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-C1jGTwjK.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BM75K3mR.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-xB0QpOFk.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,g as a,m as o,t as s}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{n as c,r as l}from"./popover-select-DcsFzD_i.js";import{t as u}from"./circle-check-C23XjkUj.js";import{t as d}from"./ellipsis-0k4rZLoy.js";import{t as f}from"./external-link-DjqjBmc3.js";import{C as p,D as m,N as h,g,h as _,j as v,k as y,v as ee}from"./use-composer-attachments-DL61XeSu.js";import{b as te,f as b,m as ne,t as x,v as S}from"./markdown-view-7tzqIp_G.js";import{t as re}from"./folder-open-CyzJ19I9.js";import{t as C}from"./message-square-fVE7Ghj1.js";import{t as w}from"./pause-DuPxgSxk.js";import{t as T}from"./play-kxZvpBg8.js";import{t as ie}from"./x-B_N4OPjy.js";import{t as E}from"./cn-JdwAhgNB.js";import{a as D,c as O,n as ae,r as k}from"./locale-store-Y1aBayM_.js";import{i as oe,n as se,o as ce,r as le,s as ue,t as A}from"./dist-BGTk37IG.js";import{u as j}from"./tasks-Buv1mgPF.js";import{i as de}from"./vendor-swr-BIWyz7Rc.js";import{t as M}from"./button-CS04eWY9.js";import{t as N}from"./activity-store-X7CG9pzB.js";import{t as P}from"./skeleton-BwbyijEw.js";import{m as fe,o as pe}from"./shares-api-DICV5EKH.js";import{An as me,Fn as he,Gs as ge,Hs as _e,In as ve,Ja as ye,Ki as be,L as xe,Mn as Se,Nc as Ce,Nn as we,Or as Te,Pn as Ee,Qr as De,Wt as Oe,Zr as F,ai as ke,dc as Ae,fc as je,jn as Me,l as Ne,li as Pe,n as Fe,qa as Ie,xi as Le,yc as Re}from"./index-ByFXhQ-T.js";import{t as ze}from"./page-context-capture-button-CiBUm2Br.js";import{t as I}from"./date-picker-DTsMzjoZ.js";import{t as Be}from"./dependency-picker-Y1QYCcLp.js";var L=n(),R=e(t(),1),z=r();function Ve({wait:e,detail:t,zh:n,onUpdated:r}){let[i,a]=(0,R.useState)(``),[o,s]=(0,R.useState)(!1),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(!1),f=(0,R.useRef)(null),p=e.kind===`approval`,m=Array.isArray(e.condition.choices)?e.condition.choices.filter(e=>typeof e==`string`):[];async function h(a){if(!p&&!i.trim()||p&&!a||o)return;let c=JSON.stringify([t.task.version,i.trim(),a]);f.current?.signature!==c&&(f.current={signature:c,key:crypto.randomUUID()}),s(!0),l(``);try{let o=await g(t.task.id,{type:`resolve_wait`,waitId:e.id,resolution:p?{kind:`task_approval`,decision:a}:{kind:`user_answer`,answer:i.trim()}},t.task.version,f.current.key);d(!0),r(o),N({tone:`success`,title:p?n?`决定已保存`:`Decision saved`:n?`补充信息已保存`:`Answer saved`,message:o.waits.length?n?`仍有其他等待条件,任务尚未恢复执行。`:`Other waiting conditions remain.`:n?`等待已解除,请在任务状态中查看后续执行进展。`:`The wait is resolved. Follow progress in the task status.`,source:n?`任务`:`Task`})}catch{l(n?`提交未确认,内容已保留。可重试;若问题已变化,请刷新。`:`Submission not confirmed. Your answer is saved here; retry or refresh if the question changed.`)}finally{s(!1)}}return(0,z.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,onSubmit:e=>{e.preventDefault(),h()},children:[p?(0,z.jsxs)(`div`,{className:`text-sm text-fg`,children:[(0,z.jsx)(`p`,{children:e.reason}),(0,z.jsxs)(`p`,{className:`mt-2`,children:[n?`授权范围:`:`Permission: `,String(e.condition.capability)]}),(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,z.jsx)(M,{type:`button`,variant:`primary`,disabled:o||u,onClick:()=>void h(`approve`),children:n?`批准`:`Approve`}),(0,z.jsx)(M,{type:`button`,disabled:o||u,onClick:()=>void h(`deny`),children:n?`拒绝并暂停`:`Deny and pause`})]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`label`,{className:`block text-sm text-fg`,children:[typeof e.condition.question==`string`?e.condition.question:e.reason,(0,z.jsx)(`textarea`,{className:`mt-2 w-full rounded-lg border border-edge bg-surface-panel p-3`,rows:3,maxLength:12e3,value:i,disabled:o||u,onChange:e=>a(e.target.value)})]}),m.length>0&&(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:m.map(e=>(0,z.jsx)(M,{type:`button`,disabled:o||u,variant:`secondary`,"aria-pressed":i===e,onClick:()=>a(e),children:e},e))}),(0,z.jsx)(M,{type:`submit`,variant:`primary`,disabled:o||u||!i.trim(),children:o?n?`正在提交`:`Submitting`:n?`提交补充信息`:`Submit answer`})]}),(0,z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n?`保存到任务上下文;其他等待条件满足后继续执行。`:`Saved to task context. Work continues once all waiting conditions are met.`}),c&&(0,z.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c})]})}function He(e,t){let n;try{n=new URL(e)}catch{return}return t.find(e=>[e.shareUrl,e.lanUrl].some(e=>{if(!e)return!1;try{let t=new URL(e);return t.origin===n.origin&&t.pathname.replace(/\/$/,``)===n.pathname.replace(/\/$/,``)}catch{return!1}}))}function B({uri:e,zh:t}){let[n,r]=(0,R.useState)(),[i,a]=(0,R.useState)(!1),[o,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(``),[d,f]=(0,R.useState)(``);async function p(){a(!0),u(``);try{let n=He(e,(await fe()).payload.shares);r(n),c(!0),n?n.kind!==`file`&&n.kind!==`directory`?u(t?`这是文档快照,请从原笔记或对话的分享面板重新发布。`:`This is a document snapshot. Republish it from the original note or conversation.`):n.revoked?u(t?`分享已被撤销,不能自动恢复。请从原任务重新生成并分享。`:`This share was revoked. Generate and share a new artifact from the task.`):n.maxViews!==null&&n.downloadCount>=n.maxViews?u(t?`已达到访问次数上限,请在分享设置中调整后重试。`:`The access limit was reached. Adjust it in share settings.`):n.expired||(f(n.shareUrl),u(t?`链接仍在有效期内;若打不开,请检查网关连接。`:`The link has not expired. If it cannot open, check gateway connectivity.`)):u(t?`未找到本机管理的分享记录。外部链接或已清理的记录无法在这里续期,请从原任务重新生成产物。`:`No locally managed share matches this link. Regenerate the artifact from its task.`)}catch{u(t?`检查失败,请重试。`:`Check failed. Please retry.`)}finally{a(!1)}}async function m(){if(!(!n||i)){a(!0),u(``);try{let e=await pe(n.id,864e5);f(e.payload.shareUrl),r({...n,expired:!1,expiresAt:e.payload.expiresAt}),u(t?`已续期 24 小时,访问范围与次数限制保持不变。`:`Renewed for 24 hours. Access scope and view limits are unchanged.`)}catch(e){u(`${t?`恢复失败:`:`Recovery failed: `}${e instanceof Error?e.message:String(e)}`)}finally{a(!1)}}}return(0,z.jsxs)(`details`,{className:`mt-2 text-xs text-fg-muted`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer py-2`,children:t?`链接打不开?`:`Trouble opening the link?`}),(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void p(),children:t?`检查链接状态`:`Check link`}),o&&n?.expired&&(n.kind===`file`||n.kind===`directory`)&&!n.revoked&&(n.maxViews===null||n.downloadCount<n.maxViews)&&(0,z.jsx)(M,{type:`button`,disabled:i,onClick:()=>void m(),children:t?`恢复链接 · 续期 24 小时`:`Restore link for 24 hours`}),l&&(0,z.jsx)(`p`,{role:`status`,className:`break-words leading-5`,children:l}),d&&(0,z.jsx)(`a`,{className:`block py-2 text-accent`,href:d,target:`_blank`,rel:`noopener noreferrer`,children:t?`打开产物`:`Open artifact`}),o&&(0,z.jsx)(s,{className:`block py-2 text-accent`,to:`/settings/shares`,children:t?`管理分享记录`:`Manage shares`})]})]})}function Ue(e){let t=(0,L.c)(14),{evidence:n,projectId:r,conversationId:i,language:a}=e,o=F(We);if(!n.length)return null;let s=a===`zh`?`交付物与验证依据`:`Deliverables and evidence`,c;if(t[0]!==i||t[1]!==n||t[2]!==a||t[3]!==r||t[4]!==o){let e;t[6]!==i||t[7]!==a||t[8]!==r||t[9]!==o?(e=(e,t)=>{let n=e.uri?.trim(),s=n&&/^https?:\/\//i.test(n),c=n&&!s&&e.kind===`artifact`&&!/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(`//`),l=e.title||(a===`zh`?`查看产物`:`Open artifact`);return(0,z.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-edge-subtle p-3`,children:[s?(0,z.jsxs)(`a`,{className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline`,href:n,target:`_blank`,rel:`noopener noreferrer`,children:[(0,z.jsx)(f,{className:`size-4 shrink-0`}),l]}):c&&(r||i)?(0,z.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-11 items-center gap-2 text-sm font-medium text-accent hover:underline`,onClick:()=>o(n,null,r,i),children:[(0,z.jsx)(ge,{className:`size-4 shrink-0`}),l]}):(0,z.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:l}),s&&e.kind===`artifact`&&(0,z.jsx)(B,{uri:n,zh:a===`zh`},n),e.summary?(0,z.jsx)(`p`,{className:`mt-1 break-words text-xs leading-5 text-fg-muted`,children:e.summary}):null,(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e.strength===`verified`?a===`zh`?`已验证`:`Verified`:a===`zh`?`已记录,待验证`:`Observed, not verified`})]},`${e.title}-${t}`)},t[6]=i,t[7]=a,t[8]=r,t[9]=o,t[10]=e):e=t[10],c=n.map(e),t[0]=i,t[1]=n,t[2]=a,t[3]=r,t[4]=o,t[5]=c}else c=t[5];let l;return t[11]!==s||t[12]!==c?(l=(0,z.jsx)(`div`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,"aria-label":s,children:c}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function We(e){return e.setPath}function Ge({taskId:e}){let t=O(e=>e.conversationId),n=ae(e=>e.language),[r,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(!1),[l,u]=(0,R.useState)(!1),[d,f]=(0,R.useState)([]),[p,m]=(0,R.useState)(null),h=k(`/api/tasks/${encodeURIComponent(e)}/collaboration`),{data:g,error:_,mutate:v}=de([`task-collaboration`,e,t],()=>D(`${h}?recent=1`),{revalidateOnFocus:!0}),y=[...new Map([...d,...g?.items??[]].map(e=>[e.id,e])).values()].sort((e,t)=>e.sequence-t.sequence),ee=async()=>{let e=y[0];if(!(!e||l)){u(!0);try{let t=await D(`${h}?recent=1&beforeSequence=${e.sequence}`);f(e=>[...t.items,...e])}catch(e){m(e instanceof Error?e.message:String(e))}finally{u(!1)}}};(0,R.useEffect)(()=>{let t=t=>{let n=t.detail;(!n?.taskId||n.taskId===e)&&v()};return window.addEventListener(`task-collaboration-entry-added`,t),window.addEventListener(`gateway-realtime-connected`,t),()=>{window.removeEventListener(`task-collaboration-entry-added`,t),window.removeEventListener(`gateway-realtime-connected`,t)}},[v,e]);let te=async()=>{if(!(!r.trim()||s)){c(!0),m(null);try{await D(h,{method:`POST`,headers:{"idempotency-key":crypto.randomUUID()},body:JSON.stringify({kind:a?`answer`:`instruction`,body:r.trim(),...a?{causationId:a}:{}})}),i(``),o(null),await v()}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}}};return(0,z.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n===`zh`?`任务留言`:`Task updates`}),(0,z.jsxs)(`div`,{className:`mt-3 max-h-64 space-y-2 overflow-y-auto`,children:[!g&&!_?(0,z.jsxs)(`div`,{"aria-busy":`true`,className:`space-y-2`,children:[(0,z.jsx)(P,{className:`h-14 w-full`}),(0,z.jsx)(P,{className:`h-14 w-4/5`})]}):null,_?(0,z.jsx)(`p`,{role:`status`,className:`text-xs text-fg-muted`,children:n===`zh`?`暂时无法读取留言`:`Updates unavailable`}):null,y[0]&&y[0].sequence>1?(0,z.jsx)(`button`,{type:`button`,disabled:l,onClick:()=>void ee(),className:`text-xs text-accent hover:underline disabled:opacity-50`,children:n===`zh`?`查看更早留言`:`Earlier updates`}):null,y.map(e=>(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-base px-3 py-2 text-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-fg-subtle`,children:[(0,z.jsx)(`span`,{children:e.authorKind===`worker_agent`?n===`zh`?`执行 Agent`:`Worker`:e.authorKind===`main_agent`?n===`zh`?`主 Agent`:`Main Agent`:e.authorKind===`system`?n===`zh`?`系统`:`System`:n===`zh`?`用户`:`You`}),(0,z.jsxs)(`span`,{children:[`· `,e.kind]}),e.deliveryStatus?(0,z.jsxs)(`span`,{children:[`· `,e.deliveryStatus]}):null]}),(0,z.jsx)(`div`,{className:`mt-1 min-w-0 text-fg`,"data-task-collaboration-body":!0,children:(0,z.jsx)(x,{content:e.body,compact:!0,breaks:!0})}),e.kind===`question`&&e.authorKind===`worker_agent`?(0,z.jsx)(`button`,{type:`button`,className:`mt-2 text-xs text-accent hover:underline`,onClick:()=>o(e.id),children:n===`zh`?`回复问题`:`Reply`}):null]},e.id)),g&&!y.length?(0,z.jsx)(`p`,{className:`text-xs text-fg-muted`,children:n===`zh`?`暂无进展留言`:`No updates yet`}):null]}),a?(0,z.jsxs)(`p`,{className:`mt-3 text-xs text-accent`,children:[n===`zh`?`正在回复执行 Agent 的问题`:`Replying to the worker`,(0,z.jsx)(`button`,{type:`button`,className:`ml-2 underline`,onClick:()=>o(null),children:n===`zh`?`取消`:`Cancel`})]}):null,(0,z.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),rows:2,"aria-label":n===`zh`?`任务留言`:`Task message`,placeholder:n===`zh`?`给执行 Agent 留言`:`Message the worker`,className:`mt-3 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`}),p?(0,z.jsx)(`p`,{role:`alert`,className:`mt-1 text-xs text-danger`,children:p}):null,(0,z.jsx)(`button`,{type:`button`,disabled:!r.trim()||s,onClick:()=>void te(),className:`mt-2 rounded-lg bg-accent px-3 py-2 text-xs font-medium text-white disabled:opacity-50`,children:s?n===`zh`?`发送中`:`Sending`:n===`zh`?`发送`:`Send`})]})}function Ke(e){let t=e.task.contract?.acceptanceCriteria??[],n=new Map(e.runs.map(e=>[e.id,e])),r=e.receipts.filter(t=>n.get(t.runId)?.contractVersion===e.task.latestContractVersion).sort((e,t)=>t.finalizedAt-e.finalizedAt);return t.map((t,n)=>{let i=e.criterionReviews.find(r=>r.criterionIndex===n&&r.contractVersion===e.task.latestContractVersion&&r.criterionText===t),a={text:t,status:`unverified`,evidence:[]};for(let e of r){let n=e.verification.checks.find(e=>e.criterion===t);if(!n||n.status===`unverified`)continue;let r=e.evidence.filter(e=>n.evidenceTitles.includes(e.title)),i=n.status===`passed`&&j(e).has(t)?`passed`:n.status===`failed`?`failed`:`unverified`;if(i!==`unverified`){a={text:t,status:i,evidence:r,runId:e.runId};break}}return i&&e.task.contract?.acceptancePolicy!==`verified_auto`?{...a,status:i.status,review:i}:e.task.contract?.acceptancePolicy===`manual`?{...a,status:`unverified`}:a})}function qe(e,t,n,r){return!!(e&&t!==e.version&&n!==e.value&&r!==n)}function Je(e,t){let n={...e.task};t.title!==void 0&&(n.title=t.title),t.priority!==void 0&&(n.priority=t.priority);for(let e of[`body`,`projectId`,`milestoneId`,`parentTaskId`,`dueAt`,`ownerId`]){let r=t[e];r!==void 0&&(r===null?delete n[e]:Object.assign(n,{[e]:r}))}return n.version+=1,n.updatedAt=Date.now(),{...e,task:n}}function Ye(e,t){return(t===`zh`?{backlog:`待规划`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已完成`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Completed`})[e]}function Xe(){let e=(0,L.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,z.jsx)(P,{className:`h-32 rounded-2xl`}),(0,z.jsx)(P,{className:`h-52 rounded-2xl`}),(0,z.jsx)(P,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Ze(e){if(e===void 0)return``;let t=new Date(e);return new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,10)}function Qe(e){return e?new Date(`${e}T23:59:59.999`).getTime():null}var $e=[`backlog`,`ready`,`active`,`review`,`closed`],et=[`low`,`normal`,`high`,`critical`],tt=(0,R.memo)(function(e){let t=(0,L.c)(20),{value:n,disabled:r,canMove:i,canApprove:a,canReopen:o,language:s,label:u,onChange:d}=e,f;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==n?(f=e=>e!==n&&(e===`closed`?!a:n===`closed`?!o:!i),t[0]=a,t[1]=i,t[2]=o,t[3]=n,t[4]=f):f=t[4];let p=f,m;t[5]===u?m=t[6]:(m=(0,z.jsx)(`span`,{children:u}),t[5]=u,t[6]=m);let h;t[7]===d?h=t[8]:(h=e=>d(e.target.value),t[7]=d,t[8]=h);let g;t[9]!==s||t[10]!==p?(g=$e.map(e=>(0,z.jsx)(l,{value:e,disabled:p(e),children:Ye(e,s)},e)),t[9]=s,t[10]=p,t[11]=g):g=t[11];let _;t[12]!==r||t[13]!==h||t[14]!==g||t[15]!==n?(_=(0,z.jsx)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:h,children:g}),t[12]=r,t[13]=h,t[14]=g,t[15]=n,t[16]=_):_=t[16];let v;return t[17]!==m||t[18]!==_?(v=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[m,_]}),t[17]=m,t[18]=_,t[19]=v):v=t[19],v}),nt=(0,R.memo)(function(e){let t=(0,L.c)(14),{value:n,disabled:r,label:i,labels:a,onChange:o}=e,s;t[0]===i?s=t[1]:(s=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=s);let u;t[2]===o?u=t[3]:(u=e=>o(e.target.value),t[2]=o,t[3]=u);let d;t[4]===a?d=t[5]:(d=et.map(e=>(0,z.jsx)(l,{value:e,children:a[e]},e)),t[4]=a,t[5]=d);let f;t[6]!==r||t[7]!==u||t[8]!==d||t[9]!==n?(f=(0,z.jsx)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:u,children:d}),t[6]=r,t[7]=u,t[8]=d,t[9]=n,t[10]=f):f=t[10];let p;return t[11]!==s||t[12]!==f?(p=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[s,f]}),t[11]=s,t[12]=f,t[13]=p):p=t[13],p}),rt=(0,R.memo)(function(e){let t=(0,L.c)(10),{value:n,disabled:r,label:i,onChange:a}=e,o;t[0]===i?o=t[1]:(o=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=o);let s;t[2]!==r||t[3]!==i||t[4]!==a||t[5]!==n?(s=(0,z.jsx)(I,{disabled:r,value:n,onChange:a,ariaLabel:i}),t[2]=r,t[3]=i,t[4]=a,t[5]=n,t[6]=s):s=t[6];let c;return t[7]!==o||t[8]!==s?(c=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}),it=(0,R.memo)(function(e){let t=(0,L.c)(17),{value:n,disabled:r,label:i,unassignedLabel:a,agents:o,onChange:s}=e,u;t[0]===i?u=t[1]:(u=(0,z.jsx)(`span`,{children:i}),t[0]=i,t[1]=u);let d;t[2]===s?d=t[3]:(d=e=>s(e.target.value),t[2]=s,t[3]=d);let f;t[4]===a?f=t[5]:(f=(0,z.jsx)(l,{value:``,disabled:!0,children:a}),t[4]=a,t[5]=f);let p;t[6]===o?p=t[7]:(p=o.map(Ct),t[6]=o,t[7]=p);let m;t[8]!==r||t[9]!==d||t[10]!==f||t[11]!==p||t[12]!==n?(m=(0,z.jsxs)(c,{triggerClassName:`border-0 bg-surface-hover shadow-none focus-visible:ring-2 focus-visible:ring-accent/30`,contentClassName:`border-0`,value:n,disabled:r,onChange:d,children:[f,p]}),t[8]=r,t[9]=d,t[10]=f,t[11]=p,t[12]=n,t[13]=m):m=t[13];let h;return t[14]!==u||t[15]!==m?(h=(0,z.jsxs)(`label`,{className:`grid gap-1.5 text-xs text-fg-muted`,children:[u,m]}),t[14]=u,t[15]=m,t[16]=h):h=t[16],h}),at=(0,R.memo)(function(e){let t=(0,L.c)(9),{candidates:n,selected:r,disabled:i,labels:a,getTaskHref:o,onChange:s}=e,c;t[0]===r?c=t[1]:(c=r.map(wt),t[0]=r,t[1]=c);let l;return t[2]!==n||t[3]!==i||t[4]!==o||t[5]!==a||t[6]!==s||t[7]!==c?(l=(0,z.jsx)(Be,{borderless:!0,candidates:n,selectedIds:c,disabled:i,getTaskHref:o,onChange:s,labels:a}),t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l):l=t[8],l},(e,t)=>e.disabled===t.disabled&&e.labels===t.labels&&e.getTaskHref===t.getTaskHref&&e.onChange===t.onChange&&e.candidates.length===t.candidates.length&&e.candidates.every((e,n)=>e.id===t.candidates[n]?.id&&e.title===t.candidates[n]?.title)&&e.selected.length===t.selected.length&&e.selected.every((e,n)=>e.id===t.selected[n]?.id&&e.title===t.selected[n]?.title)),ot=`xopc.taskDetail.chatPanelPercent`,st=42;function ct(e,t){let n=Math.max(30,352/Math.max(t,1)*100),r=Math.min(60,(t-480)/Math.max(t,1)*100);return r<n?st:Math.min(r,Math.max(n,e))}function lt(){try{let e=Number(window.localStorage.getItem(ot));return Number.isFinite(e)&&e>=30&&e<=60?e:st}catch{return st}}function ut(e){return e.task.phase===`closed`?e.task.resolution===`done`?`completed`:`ended`:e.waits.some(e=>e.kind===`paused`)?`paused`:e.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`)?`needsUser`:e.operationalState===`idle`?e.task.phase===`backlog`?`captured`:e.task.phase===`ready`?`ready`:e.task.phase===`review`?`review`:`ready`:e.operationalState}function dt(e){return e===`needsUser`||e===`blocked`?`bg-warning/10 text-warning`:e===`completed`?`bg-success-soft text-success`:e===`running`||e===`verifying`||e===`review`?`bg-accent-soft text-accent-fg`:`bg-surface-hover text-fg-muted`}function ft(e){let t=(0,L.c)(6),{items:n,empty:r}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,z.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let i;t[2]===n?i=t[3]:(i=n.map(pt),t[2]=n,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,z.jsx)(`ul`,{className:`space-y-2`,children:i}),t[4]=i,t[5]=a),a}function pt(e){return(0,z.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,z.jsx)(Ae,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,z.jsx)(`span`,{children:e})]},e)}function mt({taskId:e,presentation:t,backgroundPath:n,onDeleted:r}){let[o]=a(),c=i(),l=ae(e=>e.language),ie=O(e=>e.conversationId),D=(0,R.useMemo)(()=>ye(l),[l]),k=be(e=>e.setPageHeader),oe=be(e=>e.clearPageHeader),se=De(e=>e.open),ce=De(e=>e.conversationIdOverride),le=De(e=>e.openForSession),ue=ve(e=>e.setOpen),{data:A,error:j,mutate:N,lastChange:P,conversationLoading:fe,conversationError:pe}=Ie(e),{data:ge}=de(e?`task-detail-automations`:null,()=>Ne.list()),[Oe,F]=(0,R.useState)(null),[I,Be]=(0,R.useState)(()=>new Set),[L,He]=(0,R.useState)([]),[B,We]=(0,R.useState)(null),[Ye,$e]=(0,R.useState)([]),[et,pt]=(0,R.useState)(!1),[mt,ht]=(0,R.useState)(``),[gt,V]=(0,R.useState)(!1),[_t,vt]=(0,R.useState)(``),[yt,bt]=(0,R.useState)(!1),[H,xt]=(0,R.useState)(lt),[St,Ct]=(0,R.useState)(!1),wt=(0,R.useRef)(null),Tt=(0,R.useRef)(!1),Et=(0,R.useRef)(!1),Dt=(0,R.useRef)(``),Ot=(0,R.useRef)(null),kt=(0,R.useRef)(null),At=(0,R.useRef)(null),U=(0,R.useRef)(A),[jt,W]=(0,R.useState)(null),[Mt,Nt]=(0,R.useState)(null),[Pt,Ft]=(0,R.useState)(!1),It=(0,R.useMemo)(()=>({link:D.linkDependencies,linked:D.linkedDependencies,searchPlaceholder:D.dependencySearchPlaceholder,noMatches:D.noDependencyMatches,noCandidates:D.noDependencyCandidates,remove:D.removeDependency}),[D.dependencySearchPlaceholder,D.linkDependencies,D.linkedDependencies,D.noDependencyCandidates,D.noDependencyMatches,D.removeDependency]),Lt=A?.dependencies.map(e=>`${e.id}:${e.title}`).join(`\0`)??``,Rt=(0,R.useMemo)(()=>b(o.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[o]),zt=(0,R.useCallback)(e=>t===`modal`&&n?te(n,e):ne(`/tasks/${encodeURIComponent(e)}`,Rt),[n,t,Rt]);U.current=A;let G=(0,R.useCallback)((e,t)=>{Be(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]);(0,R.useEffect)(()=>{F(null),W(null),pt(!1),Ot.current=null,V(!1),bt(!1),Nt(null),Ft(!1)},[e]),(0,R.useEffect)(()=>{let e=!0;return Pe().then(t=>{e&&$e(t.items)}).catch(()=>void 0),()=>{e=!1}},[ie]),(0,R.useEffect)(()=>{if(!P||P.source===`user`)return;Nt(P);let e=window.setTimeout(()=>Nt(null),3500);return()=>window.clearTimeout(e)},[P]),(0,R.useEffect)(()=>{let t=A?.task.projectId,n=A?.dependencies??[];if(!t){At.current=null,We(null),He(n);return}At.current!==t&&(At.current=t,We(null));let r=!0;return Le(t).then(t=>{if(!r)return;We(t.project.name);let i=new Map;for(let r of[...t.tasks,...n])r.id!==e&&i.set(r.id,{id:r.id,title:r.title});He([...i.values()])}).catch(()=>{r&&He(n)}),()=>{r=!1}},[Lt,A?.task.projectId,e]);let K=(0,R.useCallback)(async(t,n=`command`)=>{let r=U.current;if(r){G(n,!0),F(null);try{await N(await g(e,t,r.task.version),{revalidate:!1})}catch{F(D.actionFailed)}finally{G(n,!1)}}},[D.actionFailed,N,G,e]),q=(0,R.useCallback)(async(t,n)=>{let r=U.current;if(!r)return!1;n&&G(n,!0),F(null);try{return await N(v(e,t,r.task.version),{optimisticData:Je(r,t),populateCache:!0,revalidate:!1,rollbackOnError:!0}),!0}catch{return F(D.actionFailed),!1}finally{n&&G(n,!1)}},[D.actionFailed,N,G,e]),Bt=()=>{A&&(Ot.current={value:A.task.title,version:A.task.version},W(null),ht(A.task.title),pt(!0))},Vt=()=>{Tt.current=!0,ht(U.current?.task.title??``),Ot.current=null,W(null),pt(!1),queueMicrotask(()=>{Tt.current=!1})},Ht=async(e=!1)=>{if(Tt.current){Tt.current=!1;return}let t=U.current;if(!t||I.has(`title`))return;let n=mt.trim();if(!n){Vt();return}let r=Ot.current;if(!e&&qe(r,t.task.version,t.task.title,n)){W(`title`);return}if(n===t.task.title){Vt();return}await q({title:n},`title`)&&(Ot.current=null,W(null),pt(!1))},Ut=async()=>{if(!A)return;if(Et.current){Et.current=!1;return}let e=_t.trim(),t=kt.current;if(qe(t,A.task.version,A.task.body??``,e)){W(`description`);return}if(_t===Dt.current||e===(A.task.body??``).trim()){V(!1);return}await q({body:e||null})&&(W(null),V(!1))},Wt=(0,R.useCallback)(async e=>{let t=U.current;if(!(!t||e===t.task.phase)){if(t.task.phase===`closed`){await K({type:`reopen`,phase:e===`closed`?`ready`:e},`phase`);return}if(e===`closed`){await K({type:`close`,resolution:`done`},`phase`);return}await K({type:`move`,phase:e},`phase`)}},[K]),Gt=(0,R.useCallback)(e=>{q({priority:e},`priority`)},[q]),Kt=(0,R.useCallback)(e=>{q({dueAt:Qe(e)},`dueAt`)},[q]),qt=(0,R.useCallback)(e=>{xt(e);try{window.localStorage.setItem(ot,String(e))}catch{}},[]),Jt=(0,R.useCallback)(e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`&&e.key!==`Home`)return;e.preventDefault();let t=wt.current?.clientWidth??0;qt(ct(e.key===`Home`?st:H+(e.key===`ArrowLeft`?2:-2),t))},[H,qt]),Yt=(0,R.useCallback)(e=>{if(!window.matchMedia(`(min-width: 1024px)`).matches)return;let t=wt.current;if(!t)return;e.preventDefault();let n=e.currentTarget,r=e.pointerId;n.setPointerCapture(r),Ct(!0);let i=H,a=0,o=()=>{a=0,t.style.setProperty(`--task-chat-panel-width`,`${i}%`)},s=e=>{let n=t.getBoundingClientRect();i=ct((n.right-e.clientX)/n.width*100,n.width),a===0&&(a=window.requestAnimationFrame(o))},c=()=>{a!==0&&(window.cancelAnimationFrame(a),o());try{n.releasePointerCapture(r)}catch{}Ct(!1),qt(i),window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c)};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[H,qt]),Xt=(0,R.useCallback)(async t=>{let n=U.current;if(n){G(`dependencies`,!0),F(null);try{await N(await h(e,t,n.task.version),{revalidate:!1})}catch{F(D.dependencyUpdateFailed)}finally{G(`dependencies`,!1)}}},[D.dependencyUpdateFailed,N,G,e]),Zt=(0,R.useCallback)(async t=>{let n=U.current;if(!(!n||!t||t===n.conversation.currentExecutorAgentId)){G(`delegateAgentId`,!0),F(null);try{await N(await p(e,t,n.task.version),{revalidate:!1})}catch{F(D.actionFailed)}finally{G(`delegateAgentId`,!1)}}},[D.actionFailed,N,G,e]),Qt=(0,R.useCallback)(async()=>{G(`delete`,!0),F(null);try{await ee(e),r?r():c(Rt,{replace:!0})}catch(e){F(e instanceof Error?e.message:D.actionFailed)}finally{G(`delete`,!1)}},[D.actionFailed,c,r,Rt,G,e]),$t=(0,R.useCallback)(async(t,n)=>{let r=U.current;if(r){G(`acceptance`,!0),F(null);try{await N(await m(e,t,n,r.task.version,r.task.latestContractVersion),{revalidate:!1})}catch{F(D.actionFailed),await N()}finally{G(`acceptance`,!1)}}},[D.actionFailed,N,G,e]);if((0,R.useLayoutEffect)(()=>{if(t!==`modal`)return k({startExtra:(0,z.jsx)(s,{to:Rt,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":D.backToWork,children:(0,z.jsx)(Ce,{className:`size-4`})}),main:A?(0,z.jsx)(`p`,{className:`truncate text-sm font-semibold text-fg`,children:B?`${B} / ${D.taskLabel}`:D.taskLabel}):null,end:null}),oe},[oe,D.backToWork,D.taskLabel,A,t,B,Rt,k]),j&&!A)return(0,z.jsx)(`div`,{className:t===`modal`?`p-5 text-sm text-danger`:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:D.taskNotFound});if(!A)return(0,z.jsx)(`div`,{className:t===`modal`?`p-5`:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,z.jsx)(Xe,{})});let en=A.waits[0],J=Ke(A),tn=J.length>0&&J.every(e=>e.status===`passed`),nn=A.waits.find(e=>e.kind===`paused`),Y=A.receipts[0],rn=ut(A),an=D.detailStatuses[rn],on=A.task.body?.trim()||A.task.contract?.objective.trim(),sn=A.allowedCommands.includes(`mark_ready`),cn=A.allowedCommands.includes(`start`),ln=A.allowedCommands.includes(`add_wait`),un=!en&&tn&&A.task.phase===`review`&&A.allowedCommands.includes(`close`),dn=A.allowedCommands.includes(`reopen`),X=A.conversation.activeConversationId,fn=A.conversation.currentExecutorAgentId??A.task.delegateAgentId??A.task.ownerId,pn=Ye.find(e=>e.id===fn),mn=!!(X&&se&&ce===X),hn=A.attention.some(e=>e.kind===`input_required`||e.kind===`approval_required`),gn=J.filter(e=>e.status===`passed`).length,_n=A.context.filter(e=>e.role===`deliverable`),vn=new Set(A.runs.filter(e=>e.contractVersion===A.task.latestContractVersion).map(e=>e.id)),yn=[...new Map(A.receipts.filter(e=>vn.has(e.runId)).flatMap(e=>e.evidence.filter(e=>e.kind===`artifact`)).map(e=>[e.uri??e.title,e])).values()],bn=A.context.filter(e=>e.role!==`deliverable`),xn=A.runs.filter(e=>e.executorKind===`workflow`&&!e.parentRunId),Sn=[...new Set(xn.map(e=>e.executorRef.workflowId).filter(e=>typeof e==`string`))],Cn=ge?.automations.filter(t=>t.action.kind===`task_command`&&t.action.taskId===e)??[],Z=A.sessions.filter((e,t,n)=>n.findIndex(t=>t.conversationId===e.conversationId)===t),wn=A.task.contract?.expectedOutputs??[],Tn=A.task.contract?.constraints??[],En=A.task.contract?.approvalRequired??[],Dn=A.task.contract?.assumptions??[],On=A.task.contract?.risks??[],kn=Tn.length>0||En.length>0||Dn.length>0||On.length>0,Q=(...e)=>!!Mt?.changedFields.some(t=>e.includes(t)),An=A.allowedCommands.includes(`move`),$=I.has(`command`),jn=I.has(`delete`),Mn=A.runs.find(e=>!e.parentRunId&&[`queued`,`running`,`waiting`,`verifying`].includes(e.status)),Nn=Mn!==void 0,Pn=`/automations?action=create&taskId=${encodeURIComponent(A.task.id)}${A.task.projectId?`&projectId=${encodeURIComponent(A.task.projectId)}`:``}`,Fn=(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[sn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`mark_ready`}),children:[(0,z.jsx)(T,{className:`size-4`}),D.scheduleTask]}):null,nn&&A.allowedCommands.includes(`resolve_wait`)?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`resolve_wait`,waitId:nn.id}),children:[(0,z.jsx)(T,{className:`size-4`}),D.resumeTask]}):null,!en&&cn&&fn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`start`,executor:{kind:`agent`,agentId:fn}}),children:[(0,z.jsx)(T,{className:`size-4`}),D.runTask]}):null,un?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`close`,resolution:`done`}),children:[(0,z.jsx)(u,{className:`size-4`}),D.approveTask]}):null,dn?(0,z.jsxs)(M,{className:`min-h-9 px-3 py-1.5 text-xs`,variant:`primary`,disabled:$,onClick:()=>void K({type:`reopen`,phase:`ready`}),children:[(0,z.jsx)(T,{className:`size-4`}),D.reopenTask]}):null,!nn&&ln?(0,z.jsxs)(M,{variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,disabled:$,onClick:()=>void K({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,z.jsx)(w,{className:`size-4`}),D.pauseTask]}):null,A.task.phase===`closed`?null:(0,z.jsx)(M,{asChild:!0,variant:`ghost`,className:`min-h-9 px-3 py-1.5 text-xs`,children:(0,z.jsxs)(s,{to:Pn,children:[(0,z.jsx)(Re,{className:`size-4`}),D.scheduleRecurringTask]})}),(0,z.jsxs)(we,{children:[(0,z.jsx)(he,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`size-9 p-0`,disabled:$||jn,"aria-label":D.moreActions,children:(0,z.jsx)(d,{className:`size-4`,"aria-hidden":!0})})}),(0,z.jsx)(Se,{children:(0,z.jsxs)(me,{align:`end`,sideOffset:6,className:`z-[100] min-w-44 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[Mn?(0,z.jsx)(Me,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{G(`command`,!0),F(null),N(_(e,Mn.id,Mn.version),{revalidate:!1}).catch(()=>F(D.actionFailed)).finally(()=>G(`command`,!1))},children:D.cancelActiveRun}):null,Mn?(0,z.jsx)(Ee,{className:`my-1 h-px bg-edge`}):null,A.task.phase===`closed`?null:(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Me,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void K({type:`close`,resolution:`cancelled`}),children:D.cancelTask}),(0,z.jsx)(Ee,{className:`my-1 h-px bg-edge`})]}),(0,z.jsx)(Me,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-danger outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>{if(Nn){F(D.deleteActiveTaskBlocked);return}Ft(!0)},children:D.deleteTask})]})})]})]});return(0,z.jsxs)(`div`,{ref:wt,className:`flex h-full min-h-0 flex-col overflow-hidden ${St?`lg:cursor-col-resize lg:select-none`:``}`,style:{"--task-chat-panel-width":`${H}%`},children:[(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto lg:flex-row lg:overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`task-detail-scroll flex min-w-0 shrink-0 flex-col lg:min-h-0 lg:flex-1 lg:shrink lg:overflow-y-auto lg:overscroll-contain`,children:[(0,z.jsxs)(`header`,{className:E(`shrink-0 border-b border-edge-subtle bg-surface-panel px-5 py-4 sm:px-6`,Q(`title`)&&`task-detail-live-update`),children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-muted`,children:[B?(0,z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,z.jsx)(_e,{className:`size-3.5`,"aria-hidden":!0}),B]}):null,B?(0,z.jsx)(`span`,{"aria-hidden":`true`,children:`/`}):null,(0,z.jsx)(`span`,{children:D.taskLabel}),Mt?(0,z.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,role:`status`,children:Mt.source===`agent`?l===`zh`?`Agent 刚刚更新`:`Updated by Agent`:l===`zh`?`执行结果已同步`:`Execution result synced`}):null]}),et?(0,z.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,"aria-label":l===`zh`?`任务标题`:`Task title`,rows:2,value:mt,onFocus:e=>{Ot.current?.value===mt&&(e.currentTarget.setSelectionRange(0,0),e.currentTarget.scrollTop=0)},onChange:e=>ht(e.target.value),onBlur:()=>void Ht(),onKeyDown:e=>{e.nativeEvent.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),Vt()):e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),e.currentTarget.blur()))},className:`mt-2 block max-h-56 min-h-14 w-full max-w-3xl resize-none overflow-y-auto bg-transparent p-0 text-xl font-semibold leading-7 text-fg outline-none [field-sizing:content]`}):(0,z.jsx)(`h1`,{className:`mt-2 max-w-3xl break-words text-xl font-semibold leading-7 text-fg`,children:(0,z.jsx)(`button`,{type:`button`,className:`line-clamp-2 max-w-full rounded-sm text-left outline-none hover:bg-surface-hover/60 focus-visible:ring-2 focus-visible:ring-accent/40`,title:A.task.title,onClick:Bt,children:A.task.title})}),jt===`title`?(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`Agent 在你编辑期间更新了标题。`:`The Agent updated the title while you were editing.`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:Vt,children:l===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,disabled:I.has(`title`),onClick:()=>void Ht(!0),children:l===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),(0,z.jsx)(`span`,{className:E(`shrink-0 rounded-full px-2.5 py-1 text-xs font-medium`,dt(rn)),children:an})]}),(0,z.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-fg-muted`,children:[(0,z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[fn?(0,z.jsx)(xe,{agentId:fn,avatar:pn?.avatar,size:20,className:`shrink-0`}):null,(0,z.jsxs)(`span`,{className:`truncate`,children:[D.executorLabel,` · `,pn?.name??fn??D.unassigned]})]}),(0,z.jsx)(`span`,{className:`text-fg-subtle`,children:D.updatedAt.replace(`{{date}}`,Te(A.task.updatedAt,l))})]}),(0,z.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:Fn}),Oe?(0,z.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:Oe}):null]}),(0,z.jsxs)(`section`,{className:`min-w-0 p-5 sm:p-6`,children:[(0,z.jsxs)(`section`,{className:`mb-4 overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`border-b border-edge-subtle p-5`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`目标与验收`:`Goal and acceptance`}),J.length>0?(0,z.jsx)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:D.criteriaProgress.replace(`{{verified}}`,String(gn)).replace(`{{total}}`,String(J.length))}):null]}),(0,z.jsx)(`p`,{className:E(`mt-3 whitespace-pre-wrap break-words text-sm leading-6 text-fg`,!yt&&(A.task.contract?.objective||A.task.title).length>280&&`line-clamp-3`),children:A.task.contract?.objective||A.task.title}),(A.task.contract?.objective||A.task.title).length>280?(0,z.jsx)(`button`,{type:`button`,className:`mt-2 text-xs font-medium text-accent hover:underline`,"aria-expanded":yt,onClick:()=>bt(e=>!e),children:l===`zh`?yt?`收起目标`:`展开完整目标`:yt?`Show less`:`Show full goal`}):null]}),(0,z.jsxs)(`div`,{className:`p-5`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.successDefinition}),J.length>0?(0,z.jsx)(`ul`,{className:`mt-3 space-y-3`,children:J.map((e,t)=>(0,z.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm leading-5 text-fg`,children:[(0,z.jsx)(e.status===`passed`?u:e.status===`failed`?je:Ae,{className:E(`mt-0.5 size-4 shrink-0`,e.status===`passed`?`text-success`:e.status===`failed`?`text-danger`:`text-fg-subtle`),"aria-hidden":!0}),(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`p`,{children:e.text}),e.evidence.length>0?(0,z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-x-2 text-xs leading-5 text-fg-muted`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`依据:`:`Evidence:`}),e.evidence.map(e=>e.uri&&/^https?:\/\//.test(e.uri)?(0,z.jsx)(`a`,{className:`text-accent hover:underline`,href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.title},e.title):(0,z.jsx)(`span`,{children:e.title},e.title))]}):null,e.review?(0,z.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[l===`zh`?`人工判定`:`Reviewed by user`,` · `,Te(e.review.reviewedAt,l)]}):null]}),A.task.phase!==`closed`&&A.task.contract?.acceptancePolicy!==`verified_auto`?(0,z.jsxs)(we,{children:[(0,z.jsx)(he,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`h-7 shrink-0 px-2 text-xs`,disabled:I.has(`acceptance`),children:l===`zh`?`判定`:`Review`})}),(0,z.jsx)(Se,{children:(0,z.jsxs)(me,{align:`end`,sideOffset:4,className:`z-[100] min-w-32 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:[(0,z.jsx)(Me,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void $t(t,`passed`),children:l===`zh`?`确认通过`:`Mark passed`}),(0,z.jsx)(Me,{className:`cursor-pointer rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,onSelect:()=>void $t(t,`failed`),children:l===`zh`?`标记未通过`:`Mark failed`})]})})]}):null]},`${t}-${e.text}`))}):(0,z.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:D.noDefinition})]})]}),A.attention.length>0?(0,z.jsxs)(`section`,{className:E(`mb-4 rounded-xl border border-warning/20 bg-warning/10 p-4`,Q(`attention`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:hn?D.needsAttention:D.waitingStatus}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5 text-sm leading-6 text-fg-muted`,children:A.attention.map((t,n)=>(0,z.jsxs)(`li`,{className:`flex flex-wrap items-start justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`min-w-0 flex-1`,children:t.summary}),t.kind===`input_required`||t.kind===`approval_required`?(0,z.jsx)(s,{className:`inline-flex min-h-11 items-center rounded-lg bg-surface-panel px-3 text-sm font-medium text-accent`,to:S(e),children:l===`zh`?t.kind===`approval_required`?`查看并决定`:`补充信息`:t.kind===`approval_required`?`Review decision`:`Provide information`}):null]},`${t.kind}-${n}`))})]}):null,A.task.phase!==`closed`&&!nn&&A.waits.filter(e=>(e.kind===`user_input`||e.kind===`approval`&&typeof e.condition.capability==`string`)&&e.condition.type!==`connection`).map(e=>(0,z.jsx)(Ve,{wait:e,detail:A,zh:l===`zh`,onUpdated:e=>{N(e,{revalidate:!1})}},e.id)),(0,z.jsx)(`div`,{className:`mb-4`,children:(0,z.jsx)(Ge,{taskId:e},e)}),_n.length>0||yn.length>0||wn.length>0?(0,z.jsxs)(`section`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`交付物`:`Deliverables`}),_n.length>0||yn.length>0?(0,z.jsxs)(`ul`,{className:`mt-3 space-y-2`,children:[_n.map(e=>(0,z.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:D.contextKindLabels[e.targetKind]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,z.jsx)(`span`,{className:`mt-1 block break-words text-fg`,children:e.title??e.targetId})]},e.id)),yn.map(e=>(0,z.jsxs)(`li`,{className:`rounded-lg bg-surface-hover p-3 text-sm`,children:[(0,z.jsx)(`span`,{className:`block text-xs text-fg-muted`,children:l===`zh`?`执行产物`:`Run artifact`}),e.uri&&/^https?:\/\//.test(e.uri)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-accent hover:underline`,href:e.uri,target:`_blank`,rel:`noreferrer`,children:e.title}):(0,z.jsx)(`span`,{className:`mt-1 block break-words text-fg`,children:e.title})]},e.uri??e.title))]}):(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:l===`zh`?`尚未关联交付物`:`No deliverables linked yet`}),wn.length>0?(0,z.jsxs)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.expectedOutputs}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(ft,{items:wn,empty:D.noDefinition})})]}):null]}):null,(0,z.jsxs)(`section`,{className:`mb-4 rounded-xl border border-edge-subtle bg-surface-panel p-5 shadow-surface`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:l===`zh`?`关联内容`:`Related work`}),Z.length>0||A.runs.length>0||Cn.length>0||A.dependencies.length>0||A.dependents.length>0?(0,z.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[Z.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`对话 · ${Z.length}`:`Conversations · ${Z.length}`}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Z.slice(0,3).map(t=>(0,z.jsx)(`li`,{children:(0,z.jsx)(s,{className:`block truncate text-sm text-accent hover:underline`,to:t.conversationId===X?S(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===X?l===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?l===`zh`?`关联讨论`:`Linked discussion`:l===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})]}):null,A.runs.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`执行 · ${A.runs.length}`:`Runs · ${A.runs.length}`}),(0,z.jsxs)(`p`,{className:`mt-2 text-sm text-fg`,children:[l===`zh`?`最近执行:`:`Latest run: `,Y?D.receiptStatuses[Y.status]:an]}),xn.length>0?(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:l===`zh`?`含 ${xn.length} 次工作流执行`:`${xn.length} workflow runs`}):null,Sn.map(e=>(0,z.jsxs)(s,{className:`mt-1 block truncate text-xs text-accent hover:underline`,to:`/workflows/${encodeURIComponent(e)}`,children:[l===`zh`?`工作流:`:`Workflow: `,e]},e))]}):null,Cn.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:l===`zh`?`自动化 · ${Cn.length}`:`Automations · ${Cn.length}`}),(0,z.jsx)(`ul`,{className:`mt-2 space-y-1.5`,children:Cn.slice(0,3).map(e=>(0,z.jsx)(`li`,{children:(0,z.jsx)(s,{className:`block truncate text-sm text-accent hover:underline`,to:`/automations?automation=${encodeURIComponent(e.id)}`,children:e.name})},e.id))})]}):null,A.dependencies.length>0||A.dependents.length>0?(0,z.jsxs)(`div`,{className:`rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.taskRelations}),(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg`,children:l===`zh`?`${A.dependencies.length} 个前置任务 · ${A.dependents.length} 个后续任务`:`${A.dependencies.length} prerequisites · ${A.dependents.length} dependents`})]}):null]}):(0,z.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:l===`zh`?`还没有关联内容`:`No related work yet`}),(0,z.jsx)(`div`,{className:`mt-4 border-t border-edge-subtle pt-3`,children:(0,z.jsx)(ze,{resource:{kind:`task`,id:A.task.id,revision:String(A.task.version)},disabled:et||gt||I.size>0})})]}),(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsxs)(`main`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`body`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskDescription}),gt?(0,z.jsx)(`textarea`,{autoFocus:!0,"data-task-inline-editor":!0,rows:6,value:_t,onChange:e=>vt(e.target.value),onBlur:()=>void Ut(),onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Et.current=!0,vt(A.task.body??A.task.contract?.objective??``),V(!1),queueMicrotask(()=>{Et.current=!1}))},className:`mt-3 w-full resize-y rounded-lg bg-surface-hover px-3 py-2 text-sm leading-6 text-fg outline-none ring-2 ring-accent/20 focus:ring-accent/50`}):(0,z.jsxs)(`div`,{className:`mt-2`,children:[on&&on!==A.task.title?(0,z.jsx)(x,{content:on,compact:!0,className:`break-words text-sm leading-6 text-fg-muted`}):(0,z.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:D.noTaskDescription}),(0,z.jsx)(`button`,{type:`button`,className:`mt-2 rounded-md px-2 py-1 text-xs text-accent hover:bg-surface-hover focus-visible:bg-surface-hover`,onClick:()=>{let e=A.task.body??A.task.contract?.objective??``;Dt.current=e,kt.current={value:A.task.body??``,version:A.task.version},W(null),vt(e),V(!0)},children:l===`zh`?`编辑说明`:`Edit description`})]}),jt===`description`?(0,z.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-xs text-warning`,role:`alert`,children:[(0,z.jsx)(`span`,{children:l===`zh`?`Agent 在你编辑期间更新了描述。`:`The Agent updated the description while you were editing.`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-surface-hover px-2 py-1 text-fg`,onClick:()=>{vt(A.task.body??``),W(null),V(!1)},children:l===`zh`?`使用 Agent 版本`:`Use Agent version`}),(0,z.jsx)(`button`,{type:`button`,className:`rounded-md bg-accent-soft px-2 py-1 text-accent-fg`,onClick:()=>void q({body:_t.trim()||null}).then(e=>{e&&(W(null),V(!1))}),children:l===`zh`?`保留我的修改`:`Keep my changes`})]}):null]}),kn?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`contract`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskDefinition}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:l===`zh`?`执行边界及补充背景`:`Execution boundaries and supporting context`}),Tn.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.constraints}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:Tn,empty:D.noDefinition})})]}):null,En.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.approvalRequired}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:En,empty:D.noDefinition})})]}):null,Dn.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.contextAssumptions}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:Dn,empty:D.noDefinition})})]}):null,On.length>0?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.contextRisks}),(0,z.jsx)(`div`,{className:`mt-3`,children:(0,z.jsx)(ft,{items:On,empty:D.noDefinition})})]}):null]}):null,Y?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`runs`,`receipts`)&&`task-detail-live-update`),children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.latestResult}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:l===`zh`?Y.completionVerdict===`achieved`?`本次执行报告目标已达成,请结合下方验证依据验收。`:`这是阶段性结果,尚不能代表任务全部完成。`:Y.completionVerdict===`achieved`?`The run reports the goal achieved. Review the evidence below.`:`This is a partial result; the task is not yet fully complete.`}),(0,z.jsx)(x,{content:Y.summary,compact:!0,className:`mt-2 text-sm leading-6 text-fg`})]}),(0,z.jsxs)(`span`,{className:`rounded-full bg-surface-hover px-2.5 py-1 text-xs text-fg-muted`,children:[D.receiptStatuses[Y.status],` · `,D.verificationStatuses[Y.verification.status]]})]}),Y.remainingWork.length>0?(0,z.jsxs)(`div`,{className:`mt-4`,children:[(0,z.jsx)(`h3`,{className:`text-xs font-medium text-fg-muted`,children:D.remainingWork}),(0,z.jsx)(`div`,{className:`mt-2`,children:(0,z.jsx)(ft,{items:Y.remainingWork,empty:D.noRemainingWork})})]}):null,Y.nextAction?(0,z.jsxs)(`div`,{className:`mt-4 rounded-lg bg-surface-hover p-3`,children:[(0,z.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:D.nextAction}),(0,z.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:Y.nextAction})]}):null,(0,z.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(M,{className:`border-0 bg-surface-hover px-2 py-1 text-xs shadow-none`,variant:`secondary`,onClick:()=>void y(Y.runId,`helpful`),children:D.doneWell}),(0,z.jsx)(M,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void y(Y.runId,`not_helpful`),children:D.needsFix})]}),(0,z.jsx)(Ue,{evidence:Y.evidence,projectId:A.task.projectId,conversationId:X??void 0,language:l}),A.receipts.length>1?(0,z.jsxs)(`details`,{className:`mt-4 border-t border-edge-subtle pt-4`,children:[(0,z.jsx)(`summary`,{className:`cursor-pointer text-sm font-medium text-fg-muted hover:text-fg`,children:D.executionHistory.replace(`{{count}}`,String(A.receipts.length-1))}),(0,z.jsx)(`div`,{className:`mt-3 space-y-3`,children:A.receipts.slice(1).map(e=>(0,z.jsx)(`article`,{className:`rounded-lg bg-surface-hover p-3`,children:(0,z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,z.jsx)(`p`,{className:`text-sm text-fg`,children:e.summary}),(0,z.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:D.receiptStatuses[e.status]})]})},e.runId))})]}):null]}):null,bn.length>0?(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`context`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.contextUsed}),(0,z.jsx)(`ul`,{className:`mt-4 grid gap-2 sm:grid-cols-2`,children:bn.map(e=>(0,z.jsxs)(`li`,{className:`min-w-0 rounded-lg bg-surface-hover p-2.5`,children:[(0,z.jsxs)(`span`,{className:`text-[11px] text-fg-subtle`,children:[D.contextRoleLabels[e.role],` · `,D.contextKindLabels[e.targetKind]]}),e.targetKind===`url`&&/^https?:\/\//.test(e.targetId)?(0,z.jsx)(`a`,{className:`mt-1 block break-all text-sm text-accent hover:underline`,href:e.targetId,target:`_blank`,rel:`noreferrer`,children:e.title??e.targetId}):(0,z.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg`,children:e.title??e.targetId})]},e.id))})]}):null]}),(0,z.jsxs)(`aside`,{className:`min-w-0 overflow-hidden rounded-xl bg-surface-panel shadow-surface divide-y divide-edge-subtle`,children:[(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`phase`,`resolution`,`priority`,`dueAt`,`delegateAgentId`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskProperties}),(0,z.jsxs)(`div`,{className:`mt-4 grid gap-3 sm:grid-cols-2`,children:[(0,z.jsx)(tt,{value:A.task.phase,disabled:I.has(`phase`),canMove:An,canApprove:un,canReopen:dn,language:l,label:D.taskPhase,onChange:Wt}),(0,z.jsx)(nt,{value:A.task.priority,disabled:I.has(`priority`),label:D.priority,labels:D.priorityLabels,onChange:Gt}),(0,z.jsx)(rt,{value:Ze(A.task.dueAt),disabled:I.has(`dueAt`),label:D.dueDate,onChange:Kt}),(0,z.jsx)(it,{value:A.conversation.currentExecutorAgentId??``,disabled:I.has(`delegateAgentId`),label:D.executorLabel,unassignedLabel:D.unassigned,agents:Ye,onChange:Zt})]})]}),(0,z.jsxs)(`section`,{className:E(`p-5`,Q(`dependencies`)&&`task-detail-live-update`),children:[(0,z.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:D.taskRelations}),(0,z.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:D.dependencies}),(0,z.jsx)(at,{candidates:L,selected:A.dependencies,disabled:I.has(`dependencies`),labels:It,getTaskHref:zt,onChange:Xt})]}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:D.dependents}),A.dependents.length>0?(0,z.jsx)(`div`,{className:`space-y-1.5`,children:A.dependents.map(e=>(0,z.jsx)(s,{to:zt(e.id),className:`block rounded-lg bg-surface-hover p-2.5 text-sm text-fg-muted transition-colors hover:text-fg`,children:e.title},e.id))}):(0,z.jsx)(`p`,{className:`text-sm text-fg-subtle`,children:D.noDependents})]})]})]})]})]})]})]}),(0,z.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":l===`zh`?`调整任务信息和 Agent 对话的宽度`:`Resize task details and Agent chat`,"aria-valuemin":30,"aria-valuemax":60,"aria-valuenow":Math.round(H),tabIndex:0,onPointerDown:Yt,onKeyDown:Jt,onDoubleClick:()=>qt(st),className:`group hidden w-2 shrink-0 cursor-col-resize touch-none items-stretch justify-center bg-surface-panel outline-none transition-colors hover:bg-surface-hover focus-visible:bg-surface-hover lg:flex ${St?`bg-surface-hover`:``}`,children:(0,z.jsx)(`div`,{className:`w-px bg-edge-strong/70 transition-colors group-hover:bg-accent group-focus-visible:bg-accent`})}),(0,z.jsxs)(`aside`,{className:`flex min-h-[34rem] min-w-0 shrink-0 flex-col border-t border-edge-subtle bg-surface-panel lg:min-h-0 lg:w-[var(--task-chat-panel-width)] lg:border-t-0`,children:[(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge-subtle px-4 py-3`,children:[(0,z.jsx)(`h2`,{className:`text-sm font-medium text-fg-muted`,children:l===`zh`?`执行对话`:`Execution chat`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[Z.length>1?(0,z.jsxs)(we,{children:[(0,z.jsx)(he,{asChild:!0,children:(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,children:l===`zh`?`${Z.length} 段对话`:`${Z.length} conversations`})}),(0,z.jsx)(Se,{children:(0,z.jsx)(me,{align:`end`,sideOffset:6,className:`z-[100] min-w-52 rounded-lg border border-edge bg-surface-panel p-1 shadow-popover`,children:Z.map(t=>(0,z.jsx)(Me,{asChild:!0,children:(0,z.jsx)(s,{className:`block rounded-md px-3 py-2 text-sm text-fg outline-none hover:bg-surface-hover focus:bg-surface-hover`,to:t.conversationId===X?S(e):`/chat/${encodeURIComponent(t.conversationId)}`,children:t.conversationId===X?l===`zh`?`当前执行对话`:`Current execution chat`:t.role===`discussion`?l===`zh`?`关联讨论`:`Linked discussion`:l===`zh`?`历史执行对话`:`Earlier execution chat`})},t.id))})})]}):null,X?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(M,{type:`button`,variant:`ghost`,className:E(`size-8 p-0`,mn&&`bg-surface-hover text-fg`),"aria-label":l===`zh`?`项目文件`:`Project files`,"aria-pressed":mn,onClick:()=>{ue(X,!1),le(X)},children:(0,z.jsx)(re,{className:`size-4`,"aria-hidden":!0})}),(0,z.jsx)(M,{asChild:!0,variant:`ghost`,className:`size-8 p-0`,children:(0,z.jsx)(s,{to:S(e),"aria-label":l===`zh`?`全屏打开对话`:`Open chat full screen`,children:(0,z.jsx)(f,{className:`size-4`,"aria-hidden":!0})})})]}):null]})]}),X?(0,z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,z.jsx)(Fe,{embedded:!0,conversationId:X,taskId:e})}):fe?(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 animate-pulse text-fg-subtle`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`正在创建任务会话`:`Creating task conversation`})]})}):pe?(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 text-danger`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`任务会话创建失败`:`Could not create task conversation`}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:pe instanceof Error?pe.message:String(pe)})]})}):(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-8 text-center`,children:(0,z.jsxs)(`div`,{className:`max-w-xs`,children:[(0,z.jsx)(C,{className:`mx-auto size-8 text-fg-subtle`}),(0,z.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:l===`zh`?`等待任务会话`:`Waiting for a task conversation`}),(0,z.jsx)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:l===`zh`?`安排或开始任务后,Agent 的执行过程和持续对话会显示在这里。`:`Schedule or start the task to see the agent run and continue the conversation here.`})]})})]})]}),(0,z.jsx)(ke,{open:Pt,title:D.deleteTaskTitle,description:D.deleteTaskDescription.replace(`{{title}}`,A.task.title),confirmLabel:D.confirmDeleteTask,cancelLabel:D.keepTask,destructive:!0,onConfirm:()=>{Ft(!1),Qt()},onCancel:()=>Ft(!1)})]})}function ht(){let e=(0,L.c)(2),{taskId:t}=o(),n=t===void 0?``:t,r;return e[0]===n?r=e[1]:(r=(0,z.jsx)(mt,{taskId:n,presentation:`page`}),e[0]=n,e[1]=r),r}function gt(e){let t=(0,L.c)(47),{taskId:n,backgroundPath:r,onClose:i}=e,a=ae(St),o=De(xt),s=De(H),c=De(bt),l=F(yt),u=F(vt),d=o?s:0,f;t[0]!==i||t[1]!==u?(f=e=>{e||(u(null),i())},t[0]=i,t[1]=u,t[2]=f):f=t[2];let p=a===`zh`?`关闭任务详情`:`Close task details`,m;t[3]!==i||t[4]!==u?(m=()=>{u(null),i()},t[3]=i,t[4]=u,t[5]=m):m=t[5];let h;t[6]!==p||t[7]!==m?(h=(0,z.jsx)(`button`,{type:`button`,tabIndex:-1,"data-task-modal-backdrop":!0,className:`fixed inset-0 z-[80] bg-black/45 backdrop-blur-[1px]`,"aria-label":p,onClick:m}),t[6]=p,t[7]=m,t[8]=h):h=t[8];let g=o?`true`:`false`,_=`${d/2}px`,v=`${d}px`,y;t[9]!==_||t[10]!==v?(y={"--task-detail-workspace-offset":_,"--task-detail-workspace-width":v},t[9]=_,t[10]=v,t[11]=y):y=t[11];let ee=y,te=a===`zh`?`任务详情`:`Task details`,b;t[12]===te?b=t[13]:(b=(0,z.jsx)(ue,{className:`font-medium text-fg`,children:te}),t[12]=te,t[13]=b);let ne=a===`zh`?`查看并操作任务详情`:`View and manage task details`,x;t[14]===ne?x=t[15]:(x=(0,z.jsx)(oe,{className:`sr-only`,children:ne}),t[14]=ne,t[15]=x);let S=a===`zh`?`关闭任务详情`:`Close task details`,re;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,z.jsx)(ie,{className:`size-4`,"aria-hidden":!0}),t[16]=re):re=t[16];let C;t[17]===S?C=t[18]:(C=(0,z.jsx)(`div`,{className:`flex shrink-0 items-center gap-1`,children:(0,z.jsx)(se,{className:`flex size-8 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":S,children:re})}),t[17]=S,t[18]=C);let w;t[19]!==b||t[20]!==x||t[21]!==C?(w=(0,z.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 bg-surface-panel px-5 py-3.5`,children:[b,x,C]}),t[19]=b,t[20]=x,t[21]=C,t[22]=w):w=t[22];let T;t[23]!==i||t[24]!==u?(T=()=>{u(null),i()},t[23]=i,t[24]=u,t[25]=T):T=t[25];let E;t[26]!==r||t[27]!==T||t[28]!==n?(E=(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,z.jsx)(mt,{taskId:n,presentation:`modal`,backgroundPath:r,onDeleted:T})}),t[26]=r,t[27]=T,t[28]=n,t[29]=E):E=t[29];let D;t[30]!==w||t[31]!==E||t[32]!==g||t[33]!==ee?(D=(0,z.jsxs)(le,{className:`xopc-dialog-content task-detail-modal-content fixed top-1/2 z-[90] flex h-[min(54rem,calc(100dvh-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay focus:outline-none`,"data-workspace-panel-open":g,style:ee,onEscapeKeyDown:_t,onInteractOutside:V,children:[w,E]}),t[30]=w,t[31]=E,t[32]=g,t[33]=ee,t[34]=D):D=t[34];let O;t[35]!==l||t[36]!==c||t[37]!==o||t[38]!==s?(O=l?(0,z.jsx)(`div`,{className:`fixed inset-y-0 left-0 z-[100] flex min-h-0 min-w-0 overflow-hidden bg-surface-panel transition-[right] duration-200 ease-out motion-reduce:transition-none`,style:{right:o?s:0},children:(0,z.jsx)(Oe,{allowOutsideChat:!0,conversationId:c??void 0})}):null,t[35]=l,t[36]=c,t[37]=o,t[38]=s,t[39]=O):O=t[39];let k;t[40]!==D||t[41]!==O||t[42]!==h?(k=(0,z.jsxs)(ce,{children:[h,D,O]}),t[40]=D,t[41]=O,t[42]=h,t[43]=k):k=t[43];let j;return t[44]!==f||t[45]!==k?(j=(0,z.jsx)(A,{modal:!1,open:!0,onOpenChange:f,children:k}),t[44]=f,t[45]=k,t[46]=j):j=t[46],j}function V(e){let t=e.detail.originalEvent.target;t instanceof Element&&t.closest(`#app-workspace-panel, [data-task-modal-backdrop]`)&&e.preventDefault()}function _t(e){let t=e.target;t instanceof HTMLElement&&t.closest(`[data-task-inline-editor]`)&&e.preventDefault()}function vt(e){return e.setPath}function yt(e){return e.path}function bt(e){return e.conversationIdOverride}function H(e){return e.widthPx}function xt(e){return e.open}function St(e){return e.language}function Ct(e){return(0,z.jsx)(l,{value:e.id,children:e.name||e.id},e.id)}function wt(e){return e.id}export{gt as TaskDetailModal,ht as TaskDetailPage};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,t as a,u as o}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as s}from"./bot-DjLkhyZL.js";import{t as c}from"./check-DUBLcKHA.js";import{t as l}from"./chevron-right-BweFrslA.js";import{n as u,r as d,t as f}from"./popover-select-DcsFzD_i.js";import{t as p}from"./circle-alert-BEjgurr2.js";import{t as m}from"./circle-check-C23XjkUj.js";import{t as h}from"./clock-3-DnrAnuyZ.js";import{t as g}from"./download-Dk-ZjtO6.js";import{t as _}from"./ellipsis-0k4rZLoy.js";import{t as v}from"./folder-open-CyzJ19I9.js";import{t as y}from"./git-branch-Dh9uxTot.js";import{t as b}from"./loader-circle-CifKLtgG.js";import{t as x}from"./pencil-DmIY3Oa-.js";import{t as S}from"./plus-Q2yW6OE7.js";import{t as C}from"./search-DA7gz22f.js";import{t as w}from"./sparkles-DHlfQFAF.js";import{t as T}from"./x-B_N4OPjy.js";import{t as ee}from"./cn-JdwAhgNB.js";import{n as E}from"./locale-store-Y1aBayM_.js";import{a as D,c as O,i as k,n as A,o as te,r as j,s as M,t as N}from"./dist-BGTk37IG.js";import{i as P}from"./vendor-swr-BIWyz7Rc.js";import{t as F}from"./button-CS04eWY9.js";import{r as I}from"./app-chrome-BeB4KgOf.js";import{t as L}from"./skeleton-BwbyijEw.js";import{$s as R,An as z,Do as B,Ec as V,Fn as ne,Fo as H,Gi as U,J as W,Js as G,Ki as K,Mn as re,Nn as ie,Qs as ae,Rs as oe,Ts as se,_c as q,_t as J,at as ce,bc as le,co as ue,cs as Y,ct as de,dt as fe,ft as pe,go as me,gt as he,ht as ge,io as _e,it as ve,jn as ye,lt as be,mt as xe,nc as Se,no as Ce,os as we,ot as Te,ps as Ee,pt as De,ro as Oe,rt as ke,ss as Ae,st as je,us as Me,ut as Ne,vc as Pe,vt as Fe,wo as Ie,xc as Le}from"./index-ByFXhQ-T.js";import{t as Re}from"./page-tabs-D2xpUV26.js";import{t as ze}from"./date-picker-DTsMzjoZ.js";var X=e(t(),1),Z=n(),Q=r();function Be(e){let t=(0,Z.c)(15),{sourceId:n,disabled:r}=e,i=r===void 0?!1:r,a=E(Ue)===`zh`,{sources:o,starting:s,start:c}=W(),l;t[0]!==n||t[1]!==o?(l=n?o.filter(e=>e.grantId===n):o,t[0]=n,t[1]=o,t[2]=l):l=t[2];let u=l,d;t[3]===u?d=t[4]:(d=u.some(He),t[3]=u,t[4]=d);let f=d,p=n&&u.some(Ve),m=f?a?`更新中`:`Updating`:p?a?`重试`:`Retry`:n?a?`更新理解`:`Update understanding`:a?`更新全部`:`Update all`,h=i||s||f,g;t[5]!==n||t[6]!==c?(g=()=>void c(n),t[5]=n,t[6]=c,t[7]=g):g=t[7];let _;t[8]===f?_=t[9]:(_=f?(0,Q.jsx)(b,{className:`size-3.5 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(H,{className:`size-3.5`}),t[8]=f,t[9]=_);let v;return t[10]!==m||t[11]!==h||t[12]!==g||t[13]!==_?(v=(0,Q.jsxs)(F,{variant:`ghost`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs`,disabled:h,onClick:g,children:[_,m]}),t[10]=m,t[11]=h,t[12]=g,t[13]=_,t[14]=v):v=t[14],v}function Ve(e){return e.status===`failed`||e.status===`partial`||e.status===`canceled`}function He(e){return e.status===`queued`||e.status===`running`}function Ue(e){return e.language}function We(e){let t=(0,Z.c)(22),{sourceId:n,lastCollectedAt:r}=e,i=E(Ge),a=i===`zh`,o;t[0]===n?o=t[1]:(o=e=>e.sources.find(e=>e.grantId===n),t[0]=n,t[1]=o);let s=W(o);if(!s){let e;t[2]!==i||t[3]!==r||t[4]!==a?(e=r?`${a?`上次更新:`:`Last updated: `}${new Date(r).toLocaleString(i)}`:a?`尚未分析`:`Not analyzed yet`,t[2]=i,t[3]=r,t[4]=a,t[5]=e):e=t[5];let n;return t[6]===e?n=t[7]:(n=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e}),t[6]=e,t[7]=n),n}let c;t[8]===a?c=t[9]:(c=a?{queued:`等待更新`,waiting_desktop:`等待桌面端读取资料`,reading:`正在读取资料`,analyzing:`正在更新理解`}:{queued:`Queued`,waiting_desktop:`Waiting for desktop collection`,reading:`Reading source`,analyzing:`Updating understanding`},t[8]=a,t[9]=c);let l=c,u=s.status===`running`||s.status===`queued`,d=s.status===`failed`||s.status===`partial`||s.status===`canceled`,f=s.metadata.added,p=u?l[s.metadata.phase??`queued`]??l.queued:d?a?`更新未完成,可重试`:`Update incomplete; retry available`:f===0?a?`更新完成,暂无新增理解`:`Updated; no new understanding`:f===void 0?a?`更新完成`:`Updated`:a?`更新完成,新增 ${f} 条`:`Updated; ${f} added`,m;t[10]===p?m=t[11]:(m=(0,Q.jsx)(`p`,{children:p}),t[10]=p,t[11]=m);let h;t[12]!==i||t[13]!==s.completedAt?(h=s.completedAt?(0,Q.jsx)(`p`,{children:new Date(s.completedAt).toLocaleString(i)}):null,t[12]=i,t[13]=s.completedAt,t[14]=h):h=t[14];let g;t[15]!==d||t[16]!==s.errorMessage?(g=d&&s.errorMessage?(0,Q.jsx)(`p`,{className:`text-danger`,children:s.errorMessage}):null,t[15]=d,t[16]=s.errorMessage,t[17]=g):g=t[17];let _;return t[18]!==m||t[19]!==h||t[20]!==g?(_=(0,Q.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,"aria-live":`polite`,children:[m,h,g]}),t[18]=m,t[19]=h,t[20]=g,t[21]=_):_=t[21],_}function Ge(e){return e.language}function Ke(e){let t=(0,Z.c)(64),{language:n,busy:r,statement:i,scope:a,onEdit:o,onDelete:c,onScopeChange:l}=e,[u,d]=(0,X.useState)(!1),[f,p]=(0,X.useState)(!1),m=n===`zh`,h=m?`修改或删除这条内容`:`Edit or delete this item`,g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(_,{className:`size-4`,"aria-hidden":`true`}),t[0]=g):g=t[0];let v;t[1]!==r||t[2]!==h?(v=(0,Q.jsx)(ne,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,className:`size-11 shrink-0 p-0`,disabled:r,"aria-label":h,children:g})}),t[1]=r,t[2]=h,t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(x,{className:`size-4`,"aria-hidden":`true`}),t[4]=y):y=t[4];let b=m?`修改`:`Edit`,S;t[5]!==r||t[6]!==o||t[7]!==b?(S=(0,Q.jsxs)(ye,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:o,children:[y,b]}),t[5]=r,t[6]=o,t[7]=b,t[8]=S):S=t[8];let C;t[9]!==r||t[10]!==l||t[11]!==a||t[12]!==m?(C=a&&l?(0,Q.jsxs)(ye,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:()=>p(!0),children:[(0,Q.jsx)(Ie,{className:`size-4`,"aria-hidden":`true`}),m?`作用范围`:`Where it applies`]}):null,t[9]=r,t[10]=l,t[11]=a,t[12]=m,t[13]=C):C=t[13];let w,T;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>d(!0),T=(0,Q.jsx)(ue,{className:`size-4`,"aria-hidden":`true`}),t[14]=w,t[15]=T):(w=t[14],T=t[15]);let ee=m?`删除`:`Delete`,E;t[16]!==r||t[17]!==ee?(E=(0,Q.jsxs)(ye,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:w,children:[T,ee]}),t[16]=r,t[17]=ee,t[18]=E):E=t[18];let O;t[19]!==E||t[20]!==S||t[21]!==C?(O=(0,Q.jsx)(re,{children:(0,Q.jsxs)(z,{align:`end`,sideOffset:4,className:`z-[100] min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[S,C,E]})}),t[19]=E,t[20]=S,t[21]=C,t[22]=O):O=t[22];let P;t[23]!==O||t[24]!==v?(P=(0,Q.jsxs)(ie,{modal:!1,children:[v,O]}),t[23]=O,t[24]=v,t[25]=P):P=t[25];let I;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Q.jsx)(D,{className:`fixed inset-0 z-[110] bg-scrim`}),t[26]=I):I=t[26];let L=m?`删除这条内容?`:`Delete this item?`,R;t[27]===L?R=t[28]:(R=(0,Q.jsx)(M,{className:`font-semibold text-fg`,children:L}),t[27]=L,t[28]=R);let B=m?`删除后将不再使用这条记忆,原始对话和文件会保留。`:`This memory will no longer be used. Original conversations and files are kept.`,V;t[29]===B?V=t[30]:(V=(0,Q.jsx)(k,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:B}),t[29]=B,t[30]=V);let H;t[31]!==R||t[32]!==V?(H=(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[R,V]}),t[31]=R,t[32]=V,t[33]=H):H=t[33];let U;t[34]===i?U=t[35]:(U=(0,Q.jsx)(`p`,{className:`min-h-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words px-5 py-4 text-sm leading-6 text-fg`,children:i}),t[34]=i,t[35]=U);let W=m?`取消`:`Cancel`,G;t[36]===W?G=t[37]:(G=(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,children:W})}),t[36]=W,t[37]=G);let K;t[38]===c?K=t[39]:(K=()=>{d(!1),c()},t[38]=c,t[39]=K);let oe=m?`删除`:`Delete`,se;t[40]!==r||t[41]!==K||t[42]!==oe?(se=(0,Q.jsx)(F,{disabled:r,onClick:K,children:oe}),t[40]=r,t[41]=K,t[42]=oe,t[43]=se):se=t[43];let q;t[44]!==G||t[45]!==se?(q=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[G,se]}),t[44]=G,t[45]=se,t[46]=q):q=t[46];let J;t[47]!==H||t[48]!==U||t[49]!==q?(J=(0,Q.jsxs)(te,{children:[I,(0,Q.jsxs)(j,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[H,U,q]})]}),t[47]=H,t[48]=U,t[49]=q,t[50]=J):J=t[50];let ce;t[51]!==u||t[52]!==P||t[53]!==J?(ce=(0,Q.jsxs)(N,{open:u,onOpenChange:d,children:[P,J]}),t[51]=u,t[52]=P,t[53]=J,t[54]=ce):ce=t[54];let le;t[55]!==r||t[56]!==l||t[57]!==a||t[58]!==f||t[59]!==m?(le=a&&l?(0,Q.jsx)(N,{open:f,onOpenChange:p,children:(0,Q.jsxs)(te,{children:[(0,Q.jsx)(D,{className:`fixed inset-0 z-[110] bg-scrim`}),(0,Q.jsxs)(j,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(25rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[(0,Q.jsx)(M,{className:`font-semibold text-fg`,children:m?`这条记忆在哪里生效?`:`Where should this memory apply?`}),(0,Q.jsx)(k,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:m?`你可以让它用于所有协作,或只用于当前助手。`:`Use it across all work, or keep it only for this assistant.`})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-4`,children:[{value:{type:`global`},icon:ae,title:m?`所有协作`:`All work`,detail:m?`任何助手和对话都可按需使用`:`Available when relevant in any assistant or conversation`},{value:{type:`agent`,id:a.type===`agent`?a.id??`main`:`main`},icon:s,title:m?`仅当前助手`:`This assistant only`,detail:m?`不会分享给其他助手`:`Not shared with other assistants`}].map(e=>{let{value:t,icon:n,title:i,detail:o}=e,s=a.type===t.type&&(a.id??``)===(t.id??``);return(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-h-20 w-full items-center gap-3 rounded-xl px-4 py-3 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${s?`bg-surface-active`:`hover:bg-surface-hover`}`,disabled:r,onClick:()=>{p(!1),l(t)},children:[(0,Q.jsx)(n,{className:`size-5 shrink-0 text-fg-muted`,"aria-hidden":`true`}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:i}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:o})]}),s?(0,Q.jsx)(`span`,{className:`text-xs font-medium text-accent-fg`,children:m?`当前`:`Current`}):null]},t.type)})}),(0,Q.jsx)(`footer`,{className:`flex shrink-0 justify-end border-t border-edge px-5 py-3`,children:(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,children:m?`取消`:`Cancel`})})})]})]})}):null,t[55]=r,t[56]=l,t[57]=a,t[58]=f,t[59]=m,t[60]=le):le=t[60];let Y;return t[61]!==ce||t[62]!==le?(Y=(0,Q.jsxs)(Q.Fragment,{children:[ce,le]}),t[61]=ce,t[62]=le,t[63]=Y):Y=t[63],Y}function qe(e,t){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}).format(e):null}function Je(e,t,n=new Date){let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r);i.setDate(r.getDate()-1);let a=new Map;for(let n of[...e].sort((e,t)=>t.recordedAt-e.recordedAt)){let e=n.recordedAt>=r.getTime()?t===`zh`?`今天`:`Today`:n.recordedAt>=i.getTime()?t===`zh`?`昨天`:`Yesterday`:qe(n.recordedAt,t)??(t===`zh`?`更早`:`Earlier`),o=a.get(e)??[];o.push(n),a.set(e,o)}return[...a].map(([e,t])=>({label:e,items:t}))}function Ye(e,t){return(t===`zh`?{user_explicit:`你告诉我的`,user_observed:`从协作中观察到`,system_inferred:`我形成的判断`,external_untrusted:`来自连接的信息`}:{user_explicit:`You told me`,user_observed:`Observed while working together`,system_inferred:`My current read`,external_untrusted:`From connected information`})[e.authority]}function Xe(e,t){if(e.validTo){let n=qe(e.validTo,t);return t===`zh`?`适用至 ${n}`:`Applies until ${n}`}return(t===`zh`?{stable:`相对稳定`,slow:`会随时间复核`,dynamic:`近期状态`,event:`特定阶段`}:{stable:`Relatively stable`,slow:`Reviewed over time`,dynamic:`Current context`,event:`Specific period`})[e.volatility]}function Ze(e,t){return e.authority===`user_explicit`?null:e.confidence>=.85?t===`zh`?`把握较高`:`High confidence`:e.confidence>=.65?t===`zh`?`把握中等`:`Medium confidence`:t===`zh`?`证据较少`:`Limited evidence`}function Qe(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function $e(e){let t=(0,Z.c)(24),{item:n,language:r,busy:i,editing:a,draft:o,onDraftChange:s,onEdit:c,onCancel:l,onDelete:u,onCorrect:d,onScopeChange:f}=e,p=(0,X.useId)(),m=r===`zh`,h;t[0]!==n||t[1]!==r?(h=Ze(n,r),t[0]=n,t[1]=r,t[2]=h):h=t[2];let g=h,_;t[3]===n.sources?_=t[4]:(_=new Set(n.sources?.map(tt).filter(Boolean)),t[3]=n.sources,t[4]=_);let v;t[5]===_?v=t[6]:(v=[..._],t[5]=_,t[6]=v);let y=v,b=m?`修改`:`Edit`,x;return t[7]!==i||t[8]!==g||t[9]!==o||t[10]!==b||t[11]!==a||t[12]!==p||t[13]!==n||t[14]!==r||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==c||t[20]!==f||t[21]!==y||t[22]!==m?(x=(0,Q.jsx)(`article`,{className:`border-t border-edge-subtle px-4 py-3 first:border-t-0 sm:px-5 [content-visibility:auto] [contain-intrinsic-size:auto_100px]`,children:a?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:p,children:m?`修改这条理解`:`Edit this understanding`}),(0,Q.jsx)(`textarea`,{id:p,value:o,disabled:i,onChange:e=>s(e.target.value),className:`mt-2 min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-base leading-7 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(F,{variant:`ghost`,disabled:i,onClick:l,children:m?`取消`:`Cancel`}),(0,Q.jsx)(F,{variant:`primary`,disabled:!o.trim()||i,onClick:d,children:i?m?`保存中…`:`Saving…`:m?`保存修改`:`Save changes`})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 sm:gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 pt-1.5`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg`,children:n.statement}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:Ye(n,r)}),n.usable===!1?(0,Q.jsx)(`span`,{children:m?`暂不使用`:`Not in use`}):null,n.validTo?(0,Q.jsx)(`span`,{children:Xe(n,r)}):null,n.authority!==`user_explicit`&&n.confidence<.65?(0,Q.jsx)(`span`,{children:g}):null,(0,Q.jsxs)(`details`,{className:`open:basis-full`,children:[(0,Q.jsx)(`summary`,{className:`w-fit cursor-pointer rounded-md py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:m?`查看依据`:`View sources`}),(0,Q.jsxs)(`div`,{className:`my-2 space-y-1 border-l-2 border-edge pl-3 text-sm leading-6`,children:[(0,Q.jsx)(`p`,{children:n.usable?m?`按需用于当前协作`:`Used when relevant`:m?`暂不使用,后台继续复核`:`Not in use; reviewed automatically`}),(0,Q.jsxs)(`p`,{children:[Xe(n,r),` · `,Qe(n.scope,r),g?` · ${g}`:``]}),(0,Q.jsxs)(`p`,{children:[m?`最近观察:`:`Last observed: `,qe(n.observedAt,r)]}),(0,Q.jsxs)(`p`,{children:[m?`模型层:`:`Model layer: `,m?{fact:`事实`,pattern:`模式`,interpretation:`解释`}[n.layer]:n.layer,` · `,m?`${n.independentSourceCount} 个独立来源`:`${n.independentSourceCount} independent sources`]}),y.length?y.map(et):(0,Q.jsx)(`p`,{children:m?`暂无更详细的来源记录`:`No further source details available`}),(0,Q.jsx)(F,{variant:`ghost`,className:`-ml-2 px-2`,disabled:i,onClick:c,children:b})]})]})]})]}),(0,Q.jsx)(Ke,{language:r,busy:i,statement:n.statement,scope:n.scope,onEdit:c,onDelete:u,onScopeChange:f})]})}),t[7]=i,t[8]=g,t[9]=o,t[10]=b,t[11]=a,t[12]=p,t[13]=n,t[14]=r,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=c,t[20]=f,t[21]=y,t[22]=m,t[23]=x):x=t[23],x}function et(e){return(0,Q.jsx)(`p`,{className:`break-words`,children:e},e)}function tt(e){return e.label}var nt={zh:{eyebrow:`全局用户理解`,title:`xopc 如何形成对你的理解`,subtitle:`这里汇总跨项目、跨对话形成的认识,并说明它们来自哪些渠道。项目事实不会混入你的个人画像。`,channels:`理解渠道`,channelHint:`查看来源及其最近更新。`,noChannels:`尚未通过任何渠道形成可展示的全局理解。`,activeCount:`{{count}} 条已在使用`,pendingCount:`{{count}} 条暂不使用`,noUnderstanding:`暂无来自此渠道的全局理解`,pending:`最近更新`,pendingHint:`自动整理并按需使用,你可以随时修改或删除。`,nothingPending:`尚未形成全局理解。`,showAll:`查看全部 {{count}} 条`,showLess:`收起`,done:`完成`,updating:`正在从已授权渠道更新理解;你可以先查看已有内容。`,sourceKinds:{user:`你明确告诉我的`,conversation:`对话与协作`,connector:`连接的服务`,work_folder:`工作目录`,local_source:`本机来源`,inference:`综合整理`}},en:{eyebrow:`Global user understanding`,title:`How xopc forms its understanding of you`,subtitle:`This brings together understanding formed across projects and conversations, with the channel behind each item. Project facts stay out of your personal portrait.`,channels:`Understanding channels`,channelHint:`View sources and their latest updates.`,noChannels:`No channel has formed displayable global understanding yet.`,activeCount:`{{count}} in use`,pendingCount:`{{count}} not in use`,noUnderstanding:`No usable global understanding has formed from this channel yet`,pending:`Recent updates`,pendingHint:`Organized automatically and used when relevant. Edit or delete anytime.`,nothingPending:`No understanding has formed yet.`,showAll:`View all {{count}}`,showLess:`Show less`,done:`Done`,updating:`Updating from authorized channels. You can review existing understanding now.`,sourceKinds:{user:`You told me`,conversation:`Conversations and work`,connector:`Connected services`,work_folder:`Work folders`,local_source:`On-device sources`,inference:`Synthesized understanding`}}},rt={"local-recent-files":{en:`Recent files`,zh:`最近文件`},"chromium-bookmarks":{en:`Recent bookmarks`,zh:`最近书签`},"apple-notes":{en:`Apple Notes`,zh:`Apple 备忘录`},"apple-mail":{en:`Apple Mail`,zh:`Apple 邮件`},"apple-calendar":{en:`Apple Calendar`,zh:`Apple 日历`},"apple-reminders":{en:`Apple Reminders`,zh:`Apple 提醒事项`},"windows-recent-documents":{en:`Recent documents`,zh:`最近文档`},"linux-recent-documents":{en:`Recent documents`,zh:`最近文档`}},it={user:Ce,conversation:we,connector:R,work_folder:v,local_source:G,inference:R},$={files:v,recent_documents:G,calendar:Pe,tasks:Ee,notes:me,mail:Y,messages:we,code_activity:y};function at(e){let t=e.authority===`user_explicit`?`user`:e.authority===`user_observed`?`conversation`:e.authority===`external_untrusted`?`connector`:`inference`;return{id:t,kind:t,observedAt:e.observedAt}}function ot(e,t){return e.kind===`local_source`&&e.label?rt[e.label]?.[t]??e.label:e.kind===`work_folder`&&e.label?t===`zh`?`工作目录 · ${e.label}`:`Work folder · ${e.label}`:e.label?e.label:nt[t].sourceKinds[e.kind]}function st(e){return`${e.kind}:${e.adapterId}:${e.displayName}`}function ct(e){let t=(0,Z.c)(91),{assertions:n,configuredSources:r,activityRunning:i,language:a,busy:o,error:s,onReviewAssertion:l,onCompleted:u}=e,d=nt[a],[f,p]=(0,X.useState)(!1),[h,g]=(0,X.useState)(null),[_,v]=(0,X.useState)(``),y;t[0]===n?y=t[1]:(y=n.filter(ht),t[0]=n,t[1]=y);let x=y,S;t[2]===x?S=t[3]:(S=[...x].sort(mt),t[2]=x,t[3]=S);let C=S,w;if(t[4]!==r||t[5]!==x||t[6]!==a){let e=new Map;for(let t of r){let n=t.kind===`local_source`?rt[t.adapterId]?.[a]??t.displayName:t.displayName,r=st(t);e.set(r,{key:r,grantId:t.id,kind:t.kind,category:t.category,label:t.kind===`work_folder`?a===`zh`?`工作目录 · ${n}`:`Work folder · ${n}`:n,assertions:[],lastObservedAt:t.lastCollectedAt})}for(let t of x)for(let n of t.sources?.length?t.sources:[at(t)]){let r=ot(n,a),i=[...e.values()].find(e=>e.kind===n.kind&&e.label===r),o=i?.key??`${n.kind}:${r}`,s=i??e.get(o)??{key:o,kind:n.kind,category:n.category,label:r,assertions:[],lastObservedAt:n.observedAt};s.assertions.some(e=>e.id===t.id)||s.assertions.push(t),s.lastObservedAt=Math.max(s.lastObservedAt??0,n.observedAt),e.set(o,s)}w=[...e.values()].sort(pt),t[4]=r,t[5]=x,t[6]=a,t[7]=w}else w=t[7];let T=w,E;t[8]===l?E=t[9]:(E=async(e,t,n)=>{await l(e,t,n)&&g(null)},t[8]=l,t[9]=E);let D=E,O,k,A,te,j,M,N,P,I;if(t[10]!==i||t[11]!==o||t[12]!==_||t[13]!==h||t[14]!==a||t[15]!==C||t[16]!==D||t[17]!==f||t[18]!==d.eyebrow||t[19]!==d.nothingPending||t[20]!==d.pending||t[21]!==d.pendingHint||t[22]!==d.showAll||t[23]!==d.showLess||t[24]!==d.subtitle||t[25]!==d.title||t[26]!==d.updating){let e=f?C:C.slice(0,5);O=`mx-auto w-full max-w-[42rem] pb-2`,k=`polite`;let n;t[36]===d.eyebrow?n=t[37]:(n=(0,Q.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-accent-fg`,children:d.eyebrow}),t[36]=d.eyebrow,t[37]=n);let r;t[38]===d.title?r=t[39]:(r=(0,Q.jsx)(`h2`,{className:`mt-3 text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:d.title}),t[38]=d.title,t[39]=r);let s;t[40]===d.subtitle?s=t[41]:(s=(0,Q.jsx)(`p`,{className:`mx-auto mt-3 max-w-[38rem] text-sm leading-6 text-fg-muted`,children:d.subtitle}),t[40]=d.subtitle,t[41]=s),t[42]!==n||t[43]!==r||t[44]!==s?(A=(0,Q.jsxs)(`div`,{className:`text-center`,children:[n,r,s]}),t[42]=n,t[43]=r,t[44]=s,t[45]=A):A=t[45],t[46]!==i||t[47]!==d.updating?(te=i?(0,Q.jsxs)(`div`,{className:`mt-6 flex items-center gap-3 rounded-xl border border-accent/20 bg-accent-soft/55 px-4 py-3 text-sm text-accent-fg`,children:[(0,Q.jsx)(b,{className:`size-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,Q.jsx)(`p`,{children:d.updating})]}):null,t[46]=i,t[47]=d.updating,t[48]=te):te=t[48],j=`mt-8`,M=`understanding-updates-title`;let c=C.length?` · ${C.length}`:``;t[49]!==d.pending||t[50]!==c?(N=(0,Q.jsxs)(`h3`,{id:`understanding-updates-title`,className:`text-sm font-semibold text-fg`,children:[d.pending,c]}),t[49]=d.pending,t[50]=c,t[51]=N):N=t[51],t[52]===d.pendingHint?P=t[53]:(P=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.pendingHint}),t[52]=d.pendingHint,t[53]=P),I=C.length?(0,Q.jsxs)(`div`,{className:`mt-3`,children:[Je(e,a).map(e=>{let{label:t,items:n}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`border-b border-edge-subtle px-4 pb-2 pt-3 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{children:n.map(e=>(0,Q.jsx)($e,{item:e,language:a,busy:o,editing:h===e.id,draft:_,onDraftChange:v,onEdit:()=>{g(e.id),v(e.statement)},onCancel:()=>g(null),onCorrect:()=>void D(e,`edited`,_.trim()),onDelete:()=>void D(e,`deleted`)},e.id))})]},t)}),C.length>5?(0,Q.jsxs)(`button`,{type:`button`,className:`mx-auto flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>p(ft),children:[f?d.showLess:d.showAll.replace(`{{count}}`,String(C.length)),(0,Q.jsx)(q,{className:ee(`size-3.5 transition-transform`,f&&`rotate-180`)})]}):null]}):(0,Q.jsxs)(`div`,{className:`mt-3 flex items-start gap-3 rounded-xl border border-edge bg-surface-base/55 p-4`,children:[(0,Q.jsx)(m,{className:`mt-0.5 size-5 shrink-0 text-success`}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:d.nothingPending})]}),t[10]=i,t[11]=o,t[12]=_,t[13]=h,t[14]=a,t[15]=C,t[16]=D,t[17]=f,t[18]=d.eyebrow,t[19]=d.nothingPending,t[20]=d.pending,t[21]=d.pendingHint,t[22]=d.showAll,t[23]=d.showLess,t[24]=d.subtitle,t[25]=d.title,t[26]=d.updating,t[27]=O,t[28]=k,t[29]=A,t[30]=te,t[31]=j,t[32]=M,t[33]=N,t[34]=P,t[35]=I}else O=t[27],k=t[28],A=t[29],te=t[30],j=t[31],M=t[32],N=t[33],P=t[34],I=t[35];let L;t[54]!==j||t[55]!==M||t[56]!==N||t[57]!==P||t[58]!==I?(L=(0,Q.jsxs)(`section`,{className:j,"aria-labelledby":M,children:[N,P,I]}),t[54]=j,t[55]=M,t[56]=N,t[57]=P,t[58]=I,t[59]=L):L=t[59];let R;t[60]!==T.length||t[61]!==d.channels?(R=(0,Q.jsxs)(`summary`,{className:`w-fit cursor-pointer rounded-md py-2 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[d.channels,` · `,T.length]}),t[60]=T.length,t[61]=d.channels,t[62]=R):R=t[62];let z;t[63]===d.channelHint?z=t[64]:(z=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.channelHint}),t[63]=d.channelHint,t[64]=z);let B;t[65]!==T||t[66]!==d.activeCount||t[67]!==d.noChannels||t[68]!==d.noUnderstanding||t[69]!==d.pendingCount?(B=T.length?(0,Q.jsx)(`div`,{className:`mt-3 space-y-3`,children:T.map(e=>{let t=e.category?$[e.category]??it[e.kind]:it[e.kind],n=e.assertions.filter(dt).length,r=e.assertions.filter(ut).length;return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge bg-surface-base/55 px-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h4`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),e.grantId?(0,Q.jsx)(We,{sourceId:e.grantId,lastCollectedAt:e.lastObservedAt}):null,e.assertions.length?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?d.activeCount.replace(`{{count}}`,String(n)):``,r?d.pendingCount.replace(`{{count}}`,String(r)):``].filter(Boolean).join(` · `)}):(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:d.noUnderstanding})]}),e.grantId?(0,Q.jsx)(Be,{sourceId:e.grantId}):null]}),e.assertions.length?(0,Q.jsx)(`ul`,{className:`ml-12 mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.assertions.slice(0,5).map(lt)}):null]},e.key)})}):(0,Q.jsx)(`p`,{className:`mt-3 rounded-xl border border-edge bg-surface-base/55 p-4 text-sm text-fg-muted`,children:d.noChannels}),t[65]=T,t[66]=d.activeCount,t[67]=d.noChannels,t[68]=d.noUnderstanding,t[69]=d.pendingCount,t[70]=B):B=t[70];let V;t[71]!==R||t[72]!==z||t[73]!==B?(V=(0,Q.jsxs)(`details`,{className:`mt-6 border-t border-edge pt-4`,children:[R,z,B]}),t[71]=R,t[72]=z,t[73]=B,t[74]=V):V=t[74];let ne;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(c,{className:`size-4`}),t[75]=ne):ne=t[75];let H;t[76]!==o||t[77]!==u||t[78]!==d.done?(H=(0,Q.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,Q.jsxs)(F,{variant:`primary`,disabled:o,onClick:u,children:[ne,d.done]})}),t[76]=o,t[77]=u,t[78]=d.done,t[79]=H):H=t[79];let U;t[80]===s?U=t[81]:(U=s?(0,Q.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:s}):null,t[80]=s,t[81]=U);let W;return t[82]!==O||t[83]!==k||t[84]!==A||t[85]!==te||t[86]!==L||t[87]!==V||t[88]!==H||t[89]!==U?(W=(0,Q.jsxs)(`section`,{className:O,"aria-live":k,children:[A,te,L,V,H,U]}),t[82]=O,t[83]=k,t[84]=A,t[85]=te,t[86]=L,t[87]=V,t[88]=H,t[89]=U,t[90]=W):W=t[90],W}function lt(e){return(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent/60`}),(0,Q.jsx)(`span`,{children:e.statement})]},e.id)}function ut(e){return!e.usable}function dt(e){return e.usable}function ft(e){return!e}function pt(e,t){return t.assertions.length-e.assertions.length||(t.lastObservedAt??0)-(e.lastObservedAt??0)}function mt(e,t){return t.recordedAt-e.recordedAt}function ht(e){return e.scope.type===`global`&&e.status!==`archived`&&e.status!==`rejected`}function gt(){let{pathname:e,search:t}=o(),n=E(e=>e.language),r=ke(),[i,a]=(0,X.useState)(!1),[s,c]=(0,X.useState)(null),l=e===`/user-model`,{data:u,mutate:d}=P(l?`/api/user-model`:null,fe),f=W(e=>e.error),p=W(e=>e.sources.some(e=>e.status===`running`||e.status===`queued`)),m=n===`zh`;if((0,X.useEffect)(()=>{l&&new URLSearchParams(t).get(`workDiscovery`)===`review`&&ke.getState().setDrawerOpen(!0)},[l,t]),(0,X.useEffect)(()=>{l&&r.status!==`running`&&d()},[d,l,r.directoryRun?.id,r.status]),!l)return null;let h=r.status===`running`||p,g=async(e,t,n)=>{a(!0),c(null);try{return t===`edited`&&n?await ve(e.id,n):t===`deleted`&&await je(e.id),await d(),!0}catch(e){return c(e instanceof Error?e.message:String(e)),!1}finally{a(!1)}},_=e=>{if(!e&&u&&r.status!==`running`){r.finish();return}r.setDrawerOpen(e)};return(0,Q.jsxs)(N,{open:r.drawerOpen,onOpenChange:_,children:[(0,Q.jsx)(O,{asChild:!0,children:(0,Q.jsx)(F,{type:`button`,variant:`ghost`,className:ee(`relative size-8 rounded-xl p-0`,I),title:m?`查看 xopc 对你的理解`:`Review what xopc understands`,"aria-label":m?`查看 xopc 对你的理解`:`Review what xopc understands`,children:h?(0,Q.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(w,{className:`size-4 text-accent-fg`})})}),(0,Q.jsxs)(te,{children:[(0,Q.jsx)(D,{className:`fixed inset-0 z-[60] bg-scrim backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:backdrop-blur-none`}),(0,Q.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[61] flex items-center justify-center p-3 sm:p-6`,children:(0,Q.jsxs)(j,{className:`xopc-understanding-center pointer-events-auto flex h-[min(42rem,calc(100dvh-1.5rem))] w-[min(44rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float outline-none sm:h-[min(42rem,calc(100dvh-3rem))] sm:w-[min(44rem,calc(100vw-3rem))]`,children:[(0,Q.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center justify-between border-b border-edge-subtle px-5 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(M,{className:`text-sm font-semibold text-fg`,children:h?m?`正在更新用户理解`:`Updating user understanding`:m?`用户理解`:`User understanding`}),(0,Q.jsx)(k,{className:`mt-0.5 text-xs text-fg-muted`,children:h?m?`关闭窗口也会在后台继续`:`You can close this window; work continues in the background`:m?`自动更新,可随时修改或删除`:`Updated automatically. Edit or delete anytime`})]}),(0,Q.jsx)(Be,{disabled:!u?.sources?.length}),(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,className:`size-8 rounded-xl p-0`,"aria-label":m?`关闭`:`Close`,children:(0,Q.jsx)(T,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-7 sm:px-9 sm:py-9`,children:u?(0,Q.jsx)(ct,{assertions:u.assertions,configuredSources:u.sources??[],activityRunning:h,language:n,busy:i,error:s??f??null,onReviewAssertion:g,onCompleted:()=>{_(!1)}}):(0,Q.jsxs)(`section`,{className:`space-y-4`,"aria-label":m?`正在加载用户理解`:`Loading user understanding`,children:[(0,Q.jsx)(L,{className:`h-8 w-2/3`}),(0,Q.jsx)(L,{className:`h-32 w-full`}),(0,Q.jsx)(L,{className:`h-32 w-full`})]})})]})})]})]})}function _t(e){let t=e.get(`tab`);return t===`understanding`||t===`privacy`?t:`overview`}var vt={en:{pageTitle:`Me`,overview:`Overview`,understanding:`What xopc knows`,privacy:`Data & privacy`,knowledge:`Work memory`,editProfile:`Edit basics`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: founder, designer, or engineer`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,timezoneSearch:`Search timezones…`,timezoneNoMatch:`No matching timezone`,locale:`Language / locale`,useDeviceTimezone:`Use this device`,notProvided:`Not provided`,editProfileHint:`These are facts you provide directly. They remain separate from xopc’s observations and inferences.`,saveProfile:`Save`,saving:`Saving…`,explicit:`You told me`,explicitHint:`Facts and preferences you stated directly`,learned:`Learned together`,learnedHint:`Patterns formed from our work`,allUnderstanding:`All understanding`,understandingFilterHint:`Filter this view by how each item was formed.`,importantNow:`What matters now`,prioritySourceGoal:`From a goal you confirmed`,prioritySourceWork:`From your current work`,editPriority:`Edit focus`,addPriority:`Set current focus`,priorityTitle:`Current focus`,priorityTitlePlaceholder:`What matters most right now?`,priorityOutcome:`What a good outcome looks like`,priorityOutcomePlaceholder:`Describe the result you want…`,priorityUntil:`Focus through`,savePriority:`Save focus`,endPriority:`End focus`,endingPriority:`Ending…`,priorityHint:`This is used to keep xopc aligned with what deserves attention now.`,otherGoals:`Other active outcomes`,howWeWork:`How we work together`,noRules:`No collaboration preferences yet.`,seeAll:`See all`,workMemory:`What I remember from the work`,items:`items`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshComplete:`Refreshed`,refreshFailed:`Refresh failed`,aboutYouTitle:`A view you can correct`,aboutYouHint:`xopc quietly maintains this working context from collaboration. You can edit or retire any item.`,identity:`Who you are`,preferences:`Preferences and working rhythm`,relationships:`People and relationships`,currentState:`Current context`,insights:`My current read`,emptyGroup:`No understanding has formed here yet.`,correct:`Correct`,save:`Save correction`,cancel:`Cancel`,correctionPlaceholder:`Write the accurate version…`,searchPlaceholder:`Search work memory…`,allMemory:`All work memory`,memoryFilterHint:`Filter by memory type`,memoryLibraryHint:`Only distilled facts, decisions, lessons, commitments, and open questions appear here. Source records stay with their connector.`,noKnowledge:`No work memory has formed yet.`,noKnowledgeMatch:`No work memory matches this search.`,showMore:`Show more`,expand:`Show details`,collapse:`Hide details`,disable:`Disable`,disabled:`Not in use`,enable:`Enable`,loadFailed:`Could not load your understanding.`,tryAgain:`Try again`,actionFailed:`The change could not be saved. Please try again.`},zh:{pageTitle:`我的`,overview:`总览`,understanding:`对我的了解`,privacy:`数据与隐私`,knowledge:`工作记忆`,editProfile:`编辑基本信息`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:创业者、产品设计师、工程师`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,timezoneSearch:`搜索时区…`,timezoneNoMatch:`没有匹配的时区`,locale:`语言 / 地区`,useDeviceTimezone:`使用本机时区`,notProvided:`未填写`,editProfileHint:`这些是由你直接提供的事实,与 xopc 的观察和推断分开维护。`,saveProfile:`保存`,saving:`正在保存…`,explicit:`你告诉我的`,explicitHint:`你明确表达的事实与偏好`,learned:`协作中学到的`,learnedHint:`从实际协作中形成的认识`,allUnderstanding:`全部理解`,understandingFilterHint:`按内容来源筛选这份理解。`,importantNow:`此刻重要`,prioritySourceGoal:`来自你确认的当前目标`,prioritySourceWork:`来自当前工作上下文`,editPriority:`编辑`,addPriority:`设置当前关注`,priorityTitle:`当前关注`,priorityTitlePlaceholder:`现在最重要的是什么?`,priorityOutcome:`期待结果`,priorityOutcomePlaceholder:`描述你希望达成的结果…`,priorityUntil:`关注至`,savePriority:`保存关注`,endPriority:`结束关注`,endingPriority:`正在结束…`,priorityHint:`这项内容会帮助 xopc 在协作中优先关注当前最重要的事情。`,otherGoals:`其他进行中的目标`,howWeWork:`我们怎样协作`,noRules:`还没有形成协作偏好。`,seeAll:`查看全部`,workMemory:`我在工作中记住的`,items:`条`,refresh:`刷新`,refreshing:`正在刷新…`,refreshComplete:`已刷新`,refreshFailed:`刷新失败`,aboutYouTitle:`一份可以共同修正的理解`,aboutYouHint:`xopc 会在协作中安静地维护这份工作认知。你仍可随时修改或停止使用任何一条。`,identity:`关于你是谁`,preferences:`偏好与工作节奏`,relationships:`重要的人与关系`,currentState:`当前状态`,insights:`我形成的判断`,emptyGroup:`这里还没有形成理解。`,correct:`修正`,save:`保存修正`,cancel:`取消`,correctionPlaceholder:`写下更准确的说法…`,searchPlaceholder:`搜索工作记忆…`,allMemory:`全部工作记忆`,memoryFilterHint:`按记忆类型筛选`,memoryLibraryHint:`这里只显示提炼后的事实、决定、经验、承诺和待解问题;邮件、日历与文档原文保留在对应来源中。`,noKnowledge:`还没有形成工作记忆。`,noKnowledgeMatch:`没有符合搜索条件的工作记忆。`,showMore:`显示更多`,expand:`查看详情`,collapse:`收起详情`,disable:`停用`,disabled:`已停用`,enable:`启用`,loadFailed:`无法载入对你的理解。`,tryAgain:`重试`,actionFailed:`修改没有保存,请重试。`}},yt=new Set([`identity.call_name`,`identity.role`,`identity.pronouns`,`preference.timezone`,`preference.locale`]),bt=[`work_thread`,`project_fact`,`workspace_fact`,`decision`,`task_lesson`,`commitment`,`open_question`,`episode`,`note`],xt=`UTC.Africa/Cairo.Africa/Johannesburg.America/Chicago.America/Denver.America/Los_Angeles.America/Mexico_City.America/New_York.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Kolkata.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Berlin.Europe/London.Europe/Madrid.Europe/Paris.Europe/Rome.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function St(){try{let e=Intl.supportedValuesOf(`timeZone`);return[...new Set([`UTC`,...e])]}catch{return[...xt]}}var Ct=St();function wt(e){return e.map(e=>({value:e,label:e.replaceAll(`_`,` `),group:e.includes(`/`)?e.split(`/`)[0]:`UTC`}))}function Tt(e,t,n=!1){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,...n?{timeStyle:`short`}:{}}).format(e):null}function Et(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function Dt(e){return{callName:Et(e.profile.callName)??``,role:Et(e.profile.role)??``,pronouns:Et(e.profile.pronouns)??``,timezone:Et(e.profile.timezone)??``,locale:Et(e.profile.locale)??``}}function Ot(e,t){return{"zh-CN":{en:`Simplified Chinese`,zh:`简体中文`},"zh-TW":{en:`Traditional Chinese`,zh:`繁体中文`},"en-US":{en:`English (US)`,zh:`英语(美国)`},"en-GB":{en:`English (UK)`,zh:`英语(英国)`},"ja-JP":{en:`Japanese`,zh:`日语`}}[e]?.[t]??e}function kt(e,t){let n=Tt(e,t);return t===`zh`?`当前安排至 ${n}`:`Current plan through ${n}`}function At(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function jt(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r,23,59,59,999).getTime()}function Mt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function Nt(e,t){return(t===`zh`?{work_thread:`工作主线`,project_fact:`项目事实`,workspace_fact:`工作区事实`,decision:`已经决定`,task_lesson:`工作经验`,commitment:`承诺与约定`,open_question:`待解问题`,episode:`重要经历`,note:`其他记录`}:{work_thread:`Work threads`,project_fact:`Project facts`,workspace_fact:`Workspace facts`,decision:`Decisions`,task_lesson:`Lessons`,commitment:`Commitments`,open_question:`Open questions`,episode:`Episodes`,note:`Notes`})[e]}function Pt(e,t,n){if(e)return e.targetType===`goal`?t.find(t=>t.id===e.targetId)?.title:/^[0-9a-f]{8}-[0-9a-f-]{20,}$/i.test(e.targetId)?(n===`zh`?{project:`当前项目`,task:`当前任务`,assertion:`一项待处理的理解`,topic:`当前主题`}:{project:`Current project`,task:`Current task`,assertion:`An understanding to address`,topic:`Current topic`})[e.targetType]:e.targetId}function Ft(e){let t=(0,Z.c)(16),{title:n,hint:r,action:i,children:a,className:o}=e,s=o===void 0?``:o,c;t[0]===n?c=t[1]:(c=(0,Q.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=r?(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:r}):null,t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,Q.jsxs)(`div`,{children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==i||t[8]!==u?(d=(0,Q.jsxs)(`header`,{className:`flex items-end justify-between gap-4 px-1 pb-3`,children:[u,i]}),t[7]=i,t[8]=u,t[9]=d):d=t[9];let f;t[10]===a?f=t[11]:(f=(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:a}),t[10]=a,t[11]=f);let p;return t[12]!==s||t[13]!==d||t[14]!==f?(p=(0,Q.jsxs)(`section`,{className:s,children:[d,f]}),t[12]=s,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function It(e){let t=(0,Z.c)(7),{icon:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`p`,{children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-5 text-sm text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Lt({open:e,profile:t,language:n,saving:r,onOpenChange:i,onSave:a}){let o=vt[n],[s,c]=(0,X.useState)(t),[l,p]=(0,X.useState)(``);(0,X.useEffect)(()=>{e&&(c(t),p(``))},[e,t]);let m=e=>{e.preventDefault(),a({callName:s.callName.trim(),role:s.role.trim(),pronouns:s.pronouns.trim(),timezone:s.timezone.trim(),locale:s.locale.trim()})},h=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.jsx)(`input`,{value:s[e],onChange:t=>c(n=>({...n,[e]:t.target.value})),placeholder:n,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}),g=[`zh-CN`,`zh-TW`,`en-US`,`en-GB`,`ja-JP`];s.locale&&!g.includes(s.locale)&&g.push(s.locale);let _=be(),v=(0,X.useMemo)(()=>[...new Set([...Ct,_,s.timezone].filter(Boolean))].sort(),[_,s.timezone]),y=l.trim().toLocaleLowerCase(),x=(0,X.useMemo)(()=>wt(v.filter(e=>!y||e.toLocaleLowerCase().includes(y)||e.replaceAll(`_`,` `).toLocaleLowerCase().includes(y))),[v,y]);return(0,Q.jsx)(N,{open:e,onOpenChange:i,children:(0,Q.jsxs)(te,{children:[(0,Q.jsx)(D,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsx)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(40rem,calc(100vh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:m,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(M,{className:`font-semibold text-fg`,children:o.editProfile}),(0,Q.jsx)(k,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.editProfileHint})]}),(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:(0,Q.jsx)(T,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[h(`callName`,o.callName,o.callNamePlaceholder),h(`role`,o.role,o.rolePlaceholder),h(`pronouns`,o.pronouns,o.pronounsPlaceholder),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.locale}),(0,Q.jsxs)(u,{value:s.locale,onChange:e=>c(t=>({...t,locale:e.target.value})),children:[(0,Q.jsx)(d,{value:``,children:o.notProvided}),g.map(e=>(0,Q.jsx)(d,{value:e,children:Ot(e,n)},e))]})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm sm:col-span-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.timezone}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(f,{value:s.timezone,options:x,placeholder:be(),emptyLabel:o.notProvided,ariaLabel:o.timezone,selectedLabel:s.timezone||o.notProvided,searchPlaceholder:o.timezoneSearch,searchValue:l,onSearchChange:p,statusMessage:x.length?void 0:o.timezoneNoMatch,triggerClassName:`min-w-0 flex-1 rounded-xl bg-surface-base`,onChange:e=>{c(t=>({...t,timezone:e})),p(``)}}),(0,Q.jsx)(F,{className:`shrink-0 whitespace-nowrap`,onClick:()=>c(e=>({...e,timezone:_})),children:o.useDeviceTimezone})]})]})]})}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{disabled:r,children:o.cancel})}),(0,Q.jsxs)(F,{type:`submit`,variant:`primary`,disabled:r,children:[r?(0,Q.jsx)(b,{className:`size-4 animate-spin`}):null,r?o.saving:o.saveProfile]})]})]})})]})})}function Rt(e){let t=(0,Z.c)(94),{open:n,priority:r,title:i,outcome:a,language:o,saving:s,onOpenChange:c,onSave:l,onEnd:u}=e,d=vt[o],[f,p]=(0,X.useState)(i),[m,h]=(0,X.useState)(a??``),g=r?.validTo??Date.now()+6048e5,_;t[0]===g?_=t[1]:(_=At(g),t[0]=g,t[1]=_);let v=_,[y,x]=(0,X.useState)(v),S,C;t[2]!==v||t[3]!==n||t[4]!==a||t[5]!==i?(S=()=>{n&&(p(i),h(a??``),x(v))},C=[v,n,a,i],t[2]=v,t[3]=n,t[4]=a,t[5]=i,t[6]=S,t[7]=C):(S=t[6],C=t[7]),(0,X.useEffect)(S,C);let w;t[8]!==m||t[9]!==f||t[10]!==y||t[11]!==l||t[12]!==r?.targetType?(w=e=>{e.preventDefault(),l({title:f.trim(),...r?.targetType===`goal`?{desiredOutcome:m.trim()}:{},validTo:jt(y)})},t[8]=m,t[9]=f,t[10]=y,t[11]=l,t[12]=r?.targetType,t[13]=w):w=t[13];let ee=w,E;t[14]!==m||t[15]!==f||t[16]!==y||t[17]!==r?.targetType?(E=f.trim()&&y&&(r?.targetType!==`goal`||m.trim()),t[14]=m,t[15]=f,t[16]=y,t[17]=r?.targetType,t[18]=E):E=t[18];let O=!!E,P;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Q.jsx)(D,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[19]=P):P=t[19];let I=r?d.editPriority:d.addPriority,L;t[20]===I?L=t[21]:(L=(0,Q.jsx)(M,{className:`font-semibold text-fg`,children:I}),t[20]=I,t[21]=L);let R;t[22]===d.priorityHint?R=t[23]:(R=(0,Q.jsx)(k,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.priorityHint}),t[22]=d.priorityHint,t[23]=R);let z;t[24]!==R||t[25]!==L?(z=(0,Q.jsxs)(`div`,{children:[L,R]}),t[24]=R,t[25]=L,t[26]=z):z=t[26];let B;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(T,{className:`size-4`}),t[27]=B):B=t[27];let V;t[28]===d.cancel?V=t[29]:(V=(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":d.cancel,children:B})}),t[28]=d.cancel,t[29]=V);let ne;t[30]!==z||t[31]!==V?(ne=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[z,V]}),t[30]=z,t[31]=V,t[32]=ne):ne=t[32];let H;t[33]===d.priorityTitle?H=t[34]:(H=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityTitle}),t[33]=d.priorityTitle,t[34]=H);let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>p(e.target.value),t[35]=U):U=t[35];let W;t[36]!==f||t[37]!==d.priorityTitlePlaceholder?(W=(0,Q.jsx)(`input`,{autoFocus:!0,value:f,onChange:U,placeholder:d.priorityTitlePlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[36]=f,t[37]=d.priorityTitlePlaceholder,t[38]=W):W=t[38];let G;t[39]!==H||t[40]!==W?(G=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[H,W]}),t[39]=H,t[40]=W,t[41]=G):G=t[41];let K;t[42]!==m||t[43]!==r?.targetType||t[44]!==d.priorityOutcome||t[45]!==d.priorityOutcomePlaceholder?(K=r?.targetType===`goal`?(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityOutcome}),(0,Q.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),placeholder:d.priorityOutcomePlaceholder,className:`min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}):null,t[42]=m,t[43]=r?.targetType,t[44]=d.priorityOutcome,t[45]=d.priorityOutcomePlaceholder,t[46]=K):K=t[46];let re;t[47]===d.priorityUntil?re=t[48]:(re=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityUntil}),t[47]=d.priorityUntil,t[48]=re);let ie;t[49]===r?.validFrom?ie=t[50]:(ie=r?.validFrom??Date.now(),t[49]=r?.validFrom,t[50]=ie);let ae;t[51]===ie?ae=t[52]:(ae=At(ie),t[51]=ie,t[52]=ae);let oe;t[53]!==y||t[54]!==d.priorityUntil||t[55]!==ae?(oe=(0,Q.jsx)(ze,{min:ae,value:y,onChange:x,ariaLabel:d.priorityUntil,className:`rounded-xl border border-edge bg-surface-base hover:border-edge-strong hover:bg-surface-base`}),t[53]=y,t[54]=d.priorityUntil,t[55]=ae,t[56]=oe):oe=t[56];let se;t[57]!==re||t[58]!==oe?(se=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[re,oe]}),t[57]=re,t[58]=oe,t[59]=se):se=t[59];let q;t[60]!==G||t[61]!==K||t[62]!==se?(q=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5 sm:p-6`,children:[G,K,se]}),t[60]=G,t[61]=K,t[62]=se,t[63]=q):q=t[63];let J;t[64]!==u||t[65]!==r||t[66]!==s||t[67]!==d.endPriority||t[68]!==d.endingPriority?(J=r&&u?(0,Q.jsxs)(F,{variant:`ghost`,className:`text-danger hover:text-danger`,disabled:s,onClick:u,children:[s?(0,Q.jsx)(b,{className:`size-4 animate-spin`}):null,s?d.endingPriority:d.endPriority]}):(0,Q.jsx)(`span`,{}),t[64]=u,t[65]=r,t[66]=s,t[67]=d.endPriority,t[68]=d.endingPriority,t[69]=J):J=t[69];let ce;t[70]!==s||t[71]!==d.cancel?(ce=(0,Q.jsx)(A,{asChild:!0,children:(0,Q.jsx)(F,{disabled:s,children:d.cancel})}),t[70]=s,t[71]=d.cancel,t[72]=ce):ce=t[72];let le=!O||s,ue;t[73]===s?ue=t[74]:(ue=s?(0,Q.jsx)(b,{className:`size-4 animate-spin`}):null,t[73]=s,t[74]=ue);let Y;t[75]!==d.savePriority||t[76]!==le||t[77]!==ue?(Y=(0,Q.jsxs)(F,{type:`submit`,variant:`primary`,disabled:le,children:[ue,d.savePriority]}),t[75]=d.savePriority,t[76]=le,t[77]=ue,t[78]=Y):Y=t[78];let de;t[79]!==ce||t[80]!==Y?(de=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[ce,Y]}),t[79]=ce,t[80]=Y,t[81]=de):de=t[81];let fe;t[82]!==J||t[83]!==de?(fe=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[J,de]}),t[82]=J,t[83]=de,t[84]=fe):fe=t[84];let pe;t[85]!==ee||t[86]!==ne||t[87]!==q||t[88]!==fe?(pe=(0,Q.jsxs)(te,{children:[P,(0,Q.jsx)(j,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:ee,children:[ne,q,fe]})})]}),t[85]=ee,t[86]=ne,t[87]=q,t[88]=fe,t[89]=pe):pe=t[89];let me;return t[90]!==c||t[91]!==n||t[92]!==pe?(me=(0,Q.jsx)(N,{open:n,onOpenChange:c,children:pe}),t[90]=c,t[91]=n,t[92]=pe,t[93]=me):me=t[93],me}function zt(e){let t=(0,Z.c)(16),{rule:n,language:r,busy:i,onToggle:a}=e,o=vt[r],s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(oe,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l;t[3]!==n.status||t[4]!==o.disabled?(l=n.status===`disabled`?(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:o.disabled}):null,t[3]=n.status,t[4]=o.disabled,t[5]=l):l=t[5];let u=n.status===`active`?o.disable:o.enable,d;t[6]!==i||t[7]!==a||t[8]!==u?(d=(0,Q.jsx)(F,{variant:`ghost`,className:`h-8`,disabled:i,onClick:a,children:u}),t[6]=i,t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==l||t[11]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==c||t[14]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,c,f]}),t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function Bt(e){let t=(0,Z.c)(15),{suggestion:n,language:r,busy:i,onConfirm:a}=e,o=r===`zh`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(w,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l=o?`根据你已确认的模式生成;确认前不会生效`:`Suggested from a pattern you confirmed; inactive until you approve`,u;t[3]===l?u=t[4]:(u=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:l}),t[3]=l,t[4]=u);let d;t[5]!==c||t[6]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[c,u]}),t[5]=c,t[6]=u,t[7]=d):d=t[7];let f=i?o?`启用中…`:`Enabling…`:o?`确认启用`:`Approve`,p;t[8]!==i||t[9]!==a||t[10]!==f?(p=(0,Q.jsx)(F,{variant:`secondary`,className:`h-8 shrink-0`,disabled:i,onClick:a,children:f}),t[8]=i,t[9]=a,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function Vt(e){let t=(0,Z.c)(22),{item:n,language:r,busy:i,expanded:a,onToggle:o,editing:s,draft:c,onDraftChange:l,onEdit:u,onCancel:d,onReview:f,onDelete:p}=e,m=vt[r],h=n.updatedAt??n.createdAt,g;t[0]!==r||t[1]!==h?(g=Tt(h,r),t[0]=r,t[1]=h,t[2]=g):g=t[2];let _=g,v;t[3]===n.content?v=t[4]:(v=n.content.length>96||n.content.includes(`
|
|
2
|
-
`),t[3]=n.content,t[4]=v);let y=v,b;return t[5]!==i||t[6]!==y||t[7]!==_||t[8]!==c||t[9]!==s||t[10]!==a||t[11]!==n.content||t[12]!==n.scope||t[13]!==r||t[14]!==d||t[15]!==p||t[16]!==l||t[17]!==u||t[18]!==f||t[19]!==o||t[20]!==m?(b=(0,Q.jsx)(`article`,{className:`group border-t border-edge-subtle px-5 py-4 first:border-t-0 sm:px-6`,children:s?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`textarea`,{"aria-label":m.correctionPlaceholder,disabled:i,value:c,onChange:e=>l(e.target.value),className:`min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(F,{variant:`ghost`,className:`h-8`,onClick:d,children:m.cancel}),(0,Q.jsx)(F,{variant:`primary`,className:`h-8`,disabled:!c.trim()||i,onClick:()=>f(`edit_and_approve`,c.trim()),children:m.save})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(V,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg ${a?``:`line-clamp-2`}`,children:n.content}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:Mt(n.scope,r)}),_?(0,Q.jsx)(`span`,{children:_}):null]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[y?(0,Q.jsx)(F,{variant:`ghost`,className:`size-11 p-0`,"aria-expanded":a,"aria-label":a?m.collapse:m.expand,onClick:o,children:(0,Q.jsx)(q,{className:`size-3.5 transition-transform ${a?`rotate-180`:``}`})}):null,(0,Q.jsx)(Ke,{language:r,busy:i,statement:n.content,onEdit:u,onDelete:p})]})]})}),t[5]=i,t[6]=y,t[7]=_,t[8]=c,t[9]=s,t[10]=a,t[11]=n.content,t[12]=n.scope,t[13]=r,t[14]=d,t[15]=p,t[16]=l,t[17]=u,t[18]=f,t[19]=o,t[20]=m,t[21]=b):b=t[21],b}function Ht(){let e=E(e=>e.language),t=vt[e],n=K(e=>e.setPageHeader),r=K(e=>e.clearPageHeader),[o,s]=i(),{data:f,error:m,isLoading:_,isValidating:v,mutate:y}=P(`/api/user-model`,fe),ee=_t(o),[D,O]=(0,X.useState)(),[k,A]=(0,X.useState)(),[te,j]=(0,X.useState)(``),[M,N]=(0,X.useState)(),[I,z]=(0,X.useState)(``),[V,ne]=(0,X.useState)(``),[W,G]=(0,X.useState)(24),[re,ie]=(0,X.useState)(),[ae,q]=(0,X.useState)(!1),[ue,Y]=(0,X.useState)(!1),[me,ye]=(0,X.useState)(`all`),[be,we]=(0,X.useState)(`personal`),[Ee,ke]=(0,X.useState)(`all`),[Ie,ze]=(0,X.useState)(`idle`),Z=(0,X.useRef)(void 0),Be=e=>{if(e===ee)return;let t=document.getElementById(`app-main-content`);typeof t?.scrollTo==`function`&&t.scrollTo({top:0,behavior:`auto`}),s(t=>{let n=new URLSearchParams(t);return e===`overview`?n.delete(`tab`):n.set(`tab`,e),n})},Ve=(0,X.useCallback)(async()=>{if(!(Ie===`refreshing`||v)){Z.current&&window.clearTimeout(Z.current),ze(`refreshing`),A(void 0),j(t.refreshing);try{await y(),ze(`success`),j(t.refreshComplete)}catch{ze(`error`),j(``),A(t.refreshFailed)}finally{Z.current=window.setTimeout(()=>ze(`idle`),1600)}}},[v,y,Ie,t]);(0,X.useEffect)(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);let He=v||Ie===`refreshing`,Ue=He?t.refreshing:Ie===`success`?t.refreshComplete:Ie===`error`?t.refreshFailed:t.refresh;(0,X.useEffect)(()=>(n({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:t.pageTitle}),end:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(gt,{}),(0,Q.jsx)(F,{variant:`secondary`,className:`size-9 p-0 ${Ie===`success`?`text-success`:Ie===`error`?`text-danger`:``}`,disabled:He,"aria-label":Ue,title:Ue,onClick:()=>void Ve(),children:He?(0,Q.jsx)(b,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):Ie===`success`?(0,Q.jsx)(c,{className:`size-4`,"aria-hidden":`true`}):Ie===`error`?(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":`true`}):(0,Q.jsx)(H,{className:`size-4`,"aria-hidden":`true`})})]})}),r),[r,He,Ie,Ue,Ve,n,t]);let We=async(n,r)=>{O(n),A(void 0),j(``);try{await r(),await y(),j(e===`zh`?`已更新`:`Updated`)}catch{A(t.actionFailed)}finally{O(void 0)}},Ge=e=>{We(e.id,async()=>{await ve(e.id,I.trim()),N(void 0),z(``)})},Ke=async e=>{O(`profile`),A(void 0),j(``);try{await Fe(e),await y(),q(!1)}catch{A(t.actionFailed)}finally{O(void 0)}},qe=async(n,r)=>{O(`priority:${n.id}`),A(void 0),j(``);try{await J(n.id,r),await y(),Y(!1),j(e===`zh`?`当前关注已更新`:`Current focus updated`)}catch{A(t.actionFailed)}finally{O(void 0)}},Je=async n=>{O(`priority:create`),A(void 0),j(``);try{await ce(n),await y(),Y(!1),j(e===`zh`?`当前关注已设置`:`Current focus set`)}catch{A(t.actionFailed)}finally{O(void 0)}},Ye=async n=>{O(`priority:${n.id}`),A(void 0),j(``);try{await J(n.id,{status:`completed`}),await y(),Y(!1),j(e===`zh`?`当前关注已结束`:`Current focus ended`)}catch{A(t.actionFailed)}finally{O(void 0)}};if(_)return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl space-y-5 px-4 pb-7 pt-3 sm:px-6 lg:px-8 lg:pb-9 lg:pt-4`,children:[(0,Q.jsx)(L,{className:`h-10 w-72 rounded-xl`}),(0,Q.jsx)(L,{className:`h-72 rounded-xl`}),(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(L,{className:`h-80 rounded-xl`}),(0,Q.jsx)(L,{className:`h-80 rounded-xl`})]})]});if(m||!f)return(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-72 max-w-xl flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,Q.jsx)(Le,{className:`size-6 text-fg-subtle`}),(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:t.loadFailed}),(0,Q.jsx)(F,{onClick:()=>void y(),children:t.tryAgain})]});let Xe=f.assertions.filter(e=>e.usable&&!yt.has(e.predicate)).sort((e,t)=>{let n=e.declaredImportance??e.inferredImportance;return(t.declaredImportance??t.inferredImportance)-n||t.recordedAt-e.recordedAt}),Ze=f.assertions.filter(e=>[`candidate`,`needs_review`,`conflicted`].includes(e.status)).sort((e,t)=>t.recordedAt-e.recordedAt),Qe=Dt(f),et=Qe.callName||(e===`zh`?`你`:`You`),tt=Xe.filter(e=>e.authority===`user_explicit`).length,nt=Xe.length-tt,rt=Xe.filter(e=>me===`explicit`?e.authority===`user_explicit`:me===`learned`?e.authority!==`user_explicit`:!0),it=f.priorities.filter(e=>e.status===`active`&&e.validTo>Date.now()),$=it.find(e=>e.rank===`primary`)??it[0],at=Pt($,f.goals,e),ot=$?.targetType===`goal`?f.goals.find(e=>e.id===$.targetId):void 0,st=f.goals.filter(e=>e.status===`active`||e.status===`paused`),ct=st.filter(e=>$?.targetType!==`goal`||e.id!==$.targetId),lt=f.rules.filter(e=>e.status!==`archived`),ut=f.ruleSuggestions??[],dt=f.knowledge.filter(e=>e.status!==`archived`&&e.status!==`rejected`),ft=V.trim().toLocaleLowerCase(),pt=dt.filter(e=>Ee===`all`||e.kind===Ee),mt=pt.filter(t=>!ft||t.content.toLocaleLowerCase().includes(ft)||Nt(t.kind,e).toLocaleLowerCase().includes(ft)),ht=[{key:`identity`,title:t.identity,icon:Ce,items:rt.filter(e=>e.kind===`identity`)},{key:`preferences`,title:t.preferences,icon:Se,items:rt.filter(e=>[`preference`,`value`,`routine`,`capability`].includes(e.kind))},{key:`relationships`,title:t.relationships,icon:oe,items:rt.filter(e=>e.kind===`relationship`)},{key:`current`,title:t.currentState,icon:h,items:rt.filter(e=>e.kind===`current_state`)},{key:`insights`,title:t.insights,icon:w,items:rt.filter(e=>e.kind===`derived_insight`)}].filter(e=>e.items.length>0),xt=[{key:`about`,icon:Ce,label:e===`zh`?`关于我`:`About me`,hint:e===`zh`?`身份、背景与能力`:`Identity, background, and capabilities`,count:Xe.filter(e=>[`identity`,`capability`].includes(e.kind)).length},{key:`preferences`,icon:Se,label:e===`zh`?`偏好与习惯`:`Preferences & habits`,hint:e===`zh`?`沟通方式与日常习惯`:`Communication and routines`,count:Xe.filter(e=>[`preference`,`value`,`routine`].includes(e.kind)).length},{key:`people`,icon:oe,label:e===`zh`?`重要的人`:`Important people`,hint:e===`zh`?`与你有关的人和关系`:`People and relationships`,count:Xe.filter(e=>e.kind===`relationship`).length},{key:`goals`,icon:w,label:e===`zh`?`目标与计划`:`Goals & plans`,hint:e===`zh`?`正在推进的长期目标`:`Long-term outcomes in progress`,count:st.length}],St=bt.map(e=>({kind:e,count:dt.filter(t=>t.kind===e).length})).filter(e=>e.count>0),Ct=St.slice(0,4),wt=Ct.length===1?`grid-cols-1`:`sm:grid-cols-2`,Tt=mt.slice(0,W),Et=bt.map(e=>({kind:e,items:Tt.filter(t=>t.kind===e),totalCount:mt.filter(t=>t.kind===e).length})).filter(e=>e.items.length>0),At=[{id:`all`,label:t.allUnderstanding,count:Xe.length},{id:`explicit`,label:t.explicit,count:tt},{id:`learned`,label:t.learned,count:nt}],jt=e=>{ye(e),we(`personal`),Be(`understanding`)},Mt=e=>{ke(e),ne(``),G(24),we(`work`),Be(`understanding`)},Ht=t=>(0,Q.jsx)($e,{item:t,language:e,busy:!!D,editing:M===t.id,draft:M===t.id?I:``,onDraftChange:z,onEdit:()=>{N(t.id),z(t.statement)},onCancel:()=>{N(void 0),z(``)},onDelete:()=>void We(t.id,()=>je(t.id)),onCorrect:()=>Ge(t),onScopeChange:e=>void We(t.id,()=>De(t.id,e))},t.id);return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-6 px-4 pb-4 pt-3 sm:space-y-8 sm:px-6 sm:pb-7 lg:px-8 lg:pb-10 lg:pt-4`,children:[(0,Q.jsx)(Re,{items:[{id:`overview`,label:t.overview,icon:w},{id:`understanding`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`记忆`:`Memory`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.understanding})]}),icon:Ce,count:Xe.length},{id:`privacy`,label:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`sm:hidden`,children:e===`zh`?`隐私`:`Privacy`}),(0,Q.jsx)(`span`,{className:`hidden sm:inline`,children:t.privacy})]}),icon:B}],activeTab:ee,onChange:Be,ariaLabel:t.pageTitle,tabIdPrefix:`understanding-tab`,panelIdPrefix:`understanding-panel`,className:`w-full max-w-full gap-1 rounded-full bg-surface-panel p-1 shadow-surface sm:w-fit`,buttonClassName:`min-w-0 flex-1 justify-center rounded-full px-2 py-2 sm:flex-none sm:px-3.5`,selectedClassName:`bg-surface-active text-fg`,unselectedClassName:`text-fg-muted hover:bg-surface-hover hover:text-fg`}),(0,Q.jsx)(`p`,{role:`status`,className:`sr-only`,children:te}),k?(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 rounded-xl border border-danger bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:k}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>A(void 0),"aria-label":t.cancel,children:(0,Q.jsx)(T,{className:`size-4`})})]}):null,ee===`overview`?(0,Q.jsxs)(`div`,{id:`understanding-panel-overview`,role:`tabpanel`,"aria-labelledby":`understanding-tab-overview`,className:`space-y-8 sm:space-y-10`,children:[(0,Q.jsxs)(`section`,{"data-testid":`overview-hero`,className:`grid gap-5 sm:gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,24rem)] lg:gap-12`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 px-1 sm:py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 sm:flex-wrap sm:gap-5`,children:[(0,Q.jsx)(U,{className:`size-16 sm:size-20`,mood:k?`care`:He||D?`work`:`listen`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-xl font-semibold tracking-tight text-fg sm:text-3xl`,children:et}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg-muted`,children:Qe.role||t.notProvided})]}),(0,Q.jsxs)(F,{variant:`ghost`,className:`size-11 shrink-0 px-0 sm:h-9 sm:w-auto sm:px-3`,onClick:()=>q(!0),children:[(0,Q.jsx)(Oe,{className:`size-4`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:t.editProfile})]})]}),(0,Q.jsx)(`dl`,{className:`mt-6 hidden gap-x-8 gap-y-5 sm:grid sm:grid-cols-3`,children:[{icon:se,label:t.locale,value:Qe.locale?Ot(Qe.locale,e):t.notProvided},{icon:Ae,label:t.timezone,value:Qe.timezone||t.notProvided},{icon:Ce,label:t.pronouns,value:Qe.pronouns||t.notProvided}].map(({icon:e,label:t,value:n})=>(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-xs text-fg-subtle`,children:[(0,Q.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`}),t]}),(0,Q.jsx)(`dd`,{className:`mt-1.5 truncate text-sm font-medium text-fg`,children:n})]},t))})]}),(0,Q.jsxs)(`aside`,{"data-testid":`priority-panel`,className:`flex min-h-0 flex-col rounded-[1.4rem] bg-surface-panel p-5 shadow-surface sm:min-h-64 sm:p-6`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-fg-subtle`,children:t.importantNow}),$?(0,Q.jsxs)(`p`,{className:`mt-1.5 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Q.jsx)(le,{className:`size-3.5`,"aria-hidden":`true`}),$.targetType===`goal`?t.prioritySourceGoal:t.prioritySourceWork]}):null]}),$&&at?(0,Q.jsxs)(F,{variant:`ghost`,className:`h-8 shrink-0 px-2.5`,onClick:()=>Y(!0),children:[(0,Q.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),t.editPriority]}):null]}),at?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`mt-3 text-lg font-semibold leading-7 tracking-tight text-fg`,children:at}),ot?.desiredOutcome?(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:ot.desiredOutcome}):null,$?(0,Q.jsxs)(`p`,{className:`mt-auto flex items-center gap-1.5 pt-4 text-xs text-fg-subtle`,children:[(0,Q.jsx)(Pe,{className:`size-3.5`,"aria-hidden":`true`}),kt($.validTo,e)]}):null]}):(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-6 text-center text-sm text-fg-muted`,children:[(0,Q.jsx)(le,{className:`size-5 text-fg-subtle`}),(0,Q.jsxs)(F,{variant:`primary`,onClick:()=>Y(!0),children:[(0,Q.jsx)(S,{className:`size-4`,"aria-hidden":`true`}),t.addPriority]})]}),ct.length?(0,Q.jsxs)(`div`,{className:`mt-5 hidden border-t border-edge-subtle pt-4 sm:block`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.otherGoals}),(0,Q.jsx)(`div`,{className:`mt-2 space-y-2`,children:ct.slice(0,3).map(e=>(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:e.title},e.id))})]}):null]})]}),Ze.length?(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-accent-soft/70 shadow-surface`,"aria-label":e===`zh`?`需要你确认`:`Needs your review`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-full bg-surface-panel text-accent-fg`,children:(0,Q.jsx)(w,{className:`size-4`,"aria-hidden":`true`})}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`需要你确认`:`Needs your review`})})]}),(0,Q.jsx)(`span`,{className:`rounded-full bg-surface-panel px-2.5 py-1 text-xs font-medium tabular-nums text-accent-fg`,children:Ze.length})]}),(0,Q.jsxs)(`div`,{className:`border-t border-accent/10 bg-surface-panel px-5 py-4 sm:flex sm:items-center sm:gap-4 sm:px-6`,children:[(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:Ze[0].statement}),(0,Q.jsxs)(`div`,{className:`mt-3 flex shrink-0 gap-2 sm:mt-0`,children:[(0,Q.jsx)(F,{variant:`ghost`,className:`min-h-11 flex-1 sm:flex-none`,disabled:D===Ze[0].id,onClick:()=>void We(Ze[0].id,()=>xe(Ze[0].id,`rejected`)),children:e===`zh`?`不是`:`No`}),(0,Q.jsx)(F,{variant:`primary`,className:`min-h-11 flex-1 sm:flex-none`,disabled:D===Ze[0].id,onClick:()=>void We(Ze[0].id,()=>xe(Ze[0].id,`active`)),children:e===`zh`?`是的`:`That’s right`})]})]})]}):null,(0,Q.jsx)(Ft,{title:e===`zh`?`xopc 对我的了解`:`What xopc knows about me`,action:(0,Q.jsx)(F,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Be(`understanding`),children:t.seeAll}),children:(0,Q.jsx)(`div`,{className:`grid sm:grid-cols-2`,children:xt.map(({key:e,icon:t,label:n,hint:r,count:i})=>(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-24 w-full items-center gap-4 border-t border-edge-subtle px-5 py-4 text-left first:border-t-0 hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:[&:nth-child(-n+2)]:border-t-0 sm:[&:nth-child(even)]:border-l`,onClick:()=>jt(`all`),"aria-label":`${n}: ${i}`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-fg-subtle`,children:r})]}),(0,Q.jsx)(`span`,{className:`text-sm tabular-nums text-fg-muted`,children:i}),(0,Q.jsx)(l,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-hidden":`true`})]},e))})}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-8 lg:grid-cols-2`,children:[(0,Q.jsx)(Ft,{title:t.howWeWork,className:`min-w-0`,children:lt.length||ut.length?(0,Q.jsxs)(Q.Fragment,{children:[lt.slice(0,3).map(t=>(0,Q.jsx)(zt,{rule:t,language:e,busy:D===t.id,onToggle:()=>void We(t.id,()=>ge(t.id,t.status===`active`?`disabled`:`active`))},t.id)),ut.slice(0,2).map(t=>(0,Q.jsx)(Bt,{suggestion:t,language:e,busy:D===t.id,onConfirm:()=>void We(t.id,()=>Te(t))},t.id))]}):(0,Q.jsx)(It,{icon:(0,Q.jsx)(oe,{className:`size-5`}),children:t.noRules})}),(0,Q.jsx)(Ft,{title:t.workMemory,className:`min-w-0`,action:(0,Q.jsx)(F,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Mt(`all`),children:t.seeAll}),children:St.length?(0,Q.jsx)(`div`,{"data-testid":`memory-summary-grid`,className:`grid gap-3 bg-surface-base ${wt}`,children:Ct.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-28 cursor-pointer items-start justify-between rounded-2xl bg-surface-panel px-5 py-5 text-left transition-colors hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>Mt(t),"aria-label":`${Nt(t,e)}: ${n}`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{className:`block text-2xl font-semibold tabular-nums text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:Nt(t,e)})]}),(0,Q.jsx)(l,{className:`mt-1 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted motion-reduce:transform-none`,"aria-hidden":`true`})]},t))}):(0,Q.jsx)(It,{icon:(0,Q.jsx)(R,{className:`size-5`}),children:t.noKnowledge})})]})]}):null,ee===`understanding`?(0,Q.jsxs)(`div`,{id:`understanding-panel-understanding`,role:`tabpanel`,"aria-labelledby":`understanding-tab-understanding`,className:`space-y-10`,children:[(0,Q.jsx)(`div`,{className:`flex w-full gap-1 rounded-xl bg-surface-panel p-1 sm:w-fit`,role:`group`,"aria-label":e===`zh`?`记忆分类`:`Memory category`,children:[{id:`personal`,label:e===`zh`?`关于我`:`About me`,icon:Ce,count:Xe.length},{id:`work`,label:e===`zh`?`工作记忆`:`Work memory`,icon:le,count:dt.length}].map(({id:e,label:t,icon:n,count:r})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":be===e,className:`touch-target flex min-h-10 flex-1 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-colors sm:flex-none ${be===e?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>we(e),children:[(0,Q.jsx)(n,{className:`size-4`,"aria-hidden":`true`}),t,(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]},e))}),be===`personal`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(Le,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:t.aboutYouTitle}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:t.aboutYouHint})]})]}),(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.understandingFilterHint,children:At.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":me===e.id,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${me===e.id?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ye(e.id),children:[e.label,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:e.count})]},e.id))})]}),ht.length?ht.map(({key:e,title:t,icon:n,items:r})=>(0,Q.jsx)(Ft,{title:t,action:(0,Q.jsx)(n,{className:`size-4 text-fg-subtle`,"aria-hidden":`true`}),children:(0,Q.jsx)(`div`,{children:r.map(Ht)})},e)):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(It,{icon:(0,Q.jsx)(Le,{className:`size-5`}),children:t.emptyGroup})})]}):(0,Q.jsxs)(`div`,{className:`space-y-8`,children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:Ee===`all`?t.allMemory:Nt(Ee,e)}),(0,Q.jsxs)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:[pt.length,` `,t.items,` · `,t.memoryLibraryHint]})]}),(0,Q.jsxs)(`label`,{className:`relative block sm:w-80`,children:[(0,Q.jsx)(C,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.searchPlaceholder}),(0,Q.jsx)(`input`,{type:`search`,value:V,onChange:e=>{ne(e.target.value),G(24)},placeholder:t.searchPlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.memoryFilterHint,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Ee===`all`,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Ee===`all`?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ke(`all`),children:[t.allMemory,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:dt.length})]}),St.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Ee===t,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Ee===t?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ke(t),children:[Nt(t,e),(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:n})]},t))]})]}),mt.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`space-y-8`,children:Et.map(({kind:t,items:n,totalCount:r})=>(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between px-5 pb-1 pt-4 sm:px-6`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:Nt(t,e)}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]}),(0,Q.jsx)(`div`,{children:n.map(t=>(0,Q.jsx)(Vt,{item:t,language:e,busy:!!D,expanded:re===t.id,onToggle:()=>ie(e=>e===t.id?void 0:t.id),editing:M===`knowledge:${t.id}`,draft:I,onDraftChange:z,onEdit:()=>{N(`knowledge:${t.id}`),z(t.content)},onCancel:()=>{N(void 0),z(``)},onDelete:()=>void We(t.id,()=>de(t.id)),onReview:(e,n)=>void We(t.id,async()=>{await pe(t,e,n),N(void 0),z(``)})},t.id))})]},t))}),mt.length>W?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(F,{onClick:()=>G(e=>e+24),children:t.showMore})}):null]}):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(It,{icon:(0,Q.jsx)(C,{className:`size-5`}),children:V.trim()?t.noKnowledgeMatch:t.noKnowledge})})]})]}):null,ee===`privacy`?(0,Q.jsxs)(`div`,{id:`understanding-panel-privacy`,role:`tabpanel`,"aria-labelledby":`understanding-tab-privacy`,className:`space-y-8`,children:[(0,Q.jsx)(`div`,{className:`px-1 pt-1`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(B,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:e===`zh`?`你的信息,由你掌控`:`Your information, under your control`}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:e===`zh`?`决定 xopc 可以记住什么、从哪里了解你,以及如何迁移你的数据。`:`Decide what xopc can remember, where it learns from, and how your data moves.`})]})]})}),(0,Q.jsx)(Ft,{title:e===`zh`?`记忆与使用`:`Memory & use`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[[{key:`memory`,icon:Le,title:e===`zh`?`长期记忆`:`Long-term memory`,detail:e===`zh`?`记住长期有用的信息,减少重复说明。`:`Remember useful information so you do not have to repeat yourself.`,enabled:f.settings.memoryEnabled},{key:`references`,icon:w,title:e===`zh`?`回答中的记忆引用`:`Memory references in answers`,detail:e===`zh`?`当个人信息影响回答时,显示本次参考内容。`:`Show what personal context was referenced when it shapes an answer.`,enabled:f.settings.showMemoryReferences}].map(({key:e,icon:t,title:n,detail:r,enabled:i})=>(0,Q.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":i,disabled:!!D,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void We(`setting:${e}`,()=>he(e===`memory`?{memoryEnabled:!i}:{showMemoryReferences:!i})),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:r})]}),(0,Q.jsx)(`span`,{className:`relative h-6 w-11 shrink-0 rounded-full transition-colors ${i?`bg-accent`:`bg-surface-active`}`,"aria-hidden":`true`,children:(0,Q.jsx)(`span`,{className:`absolute top-0.5 size-5 rounded-full bg-white shadow-sm transition-transform ${i?`translate-x-5`:`translate-x-0.5`}`})})]},e)),(0,Q.jsxs)(`div`,{className:`flex min-h-20 items-center gap-4 px-5 py-4 sm:px-6`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(Me,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`敏感信息`:`Sensitive information`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`控制健康、财务等信息是否可以保存。`:`Control whether health, financial, and similar information can be saved.`})]}),(0,Q.jsxs)(u,{"aria-label":e===`zh`?`敏感信息策略`:`Sensitive information policy`,value:f.settings.sensitiveWritePolicy,disabled:!!D,onChange:e=>void We(`setting:sensitive`,()=>he({sensitiveWritePolicy:e.target.value})),children:[(0,Q.jsx)(d,{value:`confirm`,children:e===`zh`?`先询问`:`Ask first`}),(0,Q.jsx)(d,{value:`deny`,children:e===`zh`?`不保存`:`Never save`}),(0,Q.jsx)(d,{value:`allow`,children:e===`zh`?`允许`:`Allow`})]})]})]})}),(0,Q.jsx)(Ft,{title:e===`zh`?`数据管理`:`Data management`,children:(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle`,children:[(0,Q.jsxs)(a,{to:`/settings/imports`,className:`flex min-h-20 items-center gap-4 px-5 py-4 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent sm:px-6`,children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(_e,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`从其他 AI 导入`:`Import from another AI`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导入前预览新增、重复和冲突内容。`:`Preview new, duplicate, and conflicting items before import.`})]}),(0,Q.jsx)(l,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]}),(0,Q.jsxs)(`button`,{type:`button`,disabled:!!D,className:`flex min-h-20 w-full items-center gap-4 px-5 py-4 text-left hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-accent disabled:opacity-60 sm:px-6`,onClick:()=>void We(`export`,Ne),children:[(0,Q.jsx)(`span`,{className:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-surface-base text-fg-muted`,children:(0,Q.jsx)(g,{className:`size-4.5`,"aria-hidden":`true`})}),(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e===`zh`?`下载我的记忆`:`Download my memory`}),(0,Q.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e===`zh`?`导出为可阅读、可迁移的数据包。`:`Export a readable, portable archive.`})]}),(0,Q.jsx)(l,{className:`size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`})]})]})}),(0,Q.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel px-5 py-5 sm:px-6`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:e===`zh`?`纠正与忘记`:`Correct and forget`}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e===`zh`?`在“记忆”中打开任意一条内容的菜单,即可修改、调整作用范围或彻底删除。`:`Open any item in Memory to edit it, change where it applies, or delete it permanently.`}),(0,Q.jsx)(F,{variant:`ghost`,className:`mt-3`,onClick:()=>{we(`personal`),Be(`understanding`)},children:e===`zh`?`管理记忆`:`Manage memory`})]})]}):null,(0,Q.jsx)(Lt,{open:ae,profile:Qe,language:e,saving:D===`profile`,onOpenChange:q,onSave:e=>void Ke(e)}),(0,Q.jsx)(Rt,{open:ue,priority:$,title:at??``,outcome:ot?.desiredOutcome,language:e,saving:D===($?`priority:${$.id}`:`priority:create`),onOpenChange:Y,onSave:e=>$?void qe($,e):void Je(e),onEnd:$?()=>void Ye($):void 0})]})}export{Ht as UserModelPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,r as t}from"./locale-store-Y1aBayM_.js";import{n}from"./gateway-config-swr-B31I6Gbq.js";async function r(){return(await e(t(`/api/voice/realtime/status`))).payload}async function i(n){let r=await e(t(`/api/voice/realtime/preview`),{method:`POST`,signal:n});if(r.payload.sampleRate!==24e3)throw Error(`Unsupported preview sample rate`);return Uint8Array.from(atob(r.payload.audio),e=>e.charCodeAt(0)).buffer}async function a(n,r,i){let a=new URLSearchParams({provider:n,model:r});return i&&a.set(`purpose`,i),(await e(t(`/api/voice/tts-voices?${a.toString()}`))).payload?.voices??[]}function o(){return{enabled:!1,provider:`openai`,providers:{alibaba:{model:`qwen-audio-3.0-asr-flash`},openai:{model:`gpt-4o-mini-transcribe`}},fallback:{enabled:!1,order:[]}}}function s(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,providers:{alibaba:{model:`qwen-tts`,voice:`Cherry`},openai:{model:`tts-1`,voice:`alloy`},edge:{voice:`zh-CN-XiaoxiaoNeural`,lang:`zh-CN`},minimax:{model:`speech-2.8-hd`,voice:`male-qn-qingse`}}}}function c(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function l(e){return typeof e==`string`&&e.trim().length>0?e.trim():`openai`}function u(e){let t=o();if(!c(e))return t;let n=l(e.provider),r=t.fallback??{enabled:!1,order:[]};if(c(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):r.order;r={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:r.enabled,order:t.length?t:r.order}}let i={...t.providers??{},...c(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,c(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,providers:i,fallback:r}}function d(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function f(e){let t=s();if(!c(e))return t;let n=d(e.provider),r=e.trigger===`off`||e.trigger===`always`||e.trigger===`inbound`||e.trigger===`tagged`?e.trigger:`inbound`,i={...t.providers??{},...c(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,c(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,trigger:r,maxTextLength:typeof e.maxTextLength==`number`&&Number.isFinite(e.maxTextLength)?e.maxTextLength:t.maxTextLength,timeoutMs:typeof e.timeoutMs==`number`&&Number.isFinite(e.timeoutMs)?e.timeoutMs:t.timeoutMs,providers:i}}function p(e){return{...e}}function m(e){return{...e}}function h(e){let t=c(e)?e:{},n=c(t.voice)?t.voice:{},r=c(n.input)?n.input:{},i=c(r.refinement)?r.refinement:{},a=c(n.realtime)?n.realtime:{},o=i.mode===`punctuation`||i.mode===`light`||i.mode===`custom`?i.mode:`off`;return{stt:u(t.stt),tts:f(t.tts),voice:{languageMode:n.languageMode===`manual`?`manual`:`auto`,language:n.language===`zh`?`zh`:`en`,input:{refinement:{mode:o,...typeof i.model==`string`&&i.model.trim()?{model:i.model.trim()}:{},...typeof i.customInstruction==`string`?{customInstruction:i.customInstruction}:{}}},realtime:{enabled:a.enabled===!0,defaultEngine:a.defaultEngine===`omni`?`omni`:`agent`,silenceDurationMs:typeof a.silenceDurationMs==`number`?a.silenceDurationMs:1200,idleTimeoutMs:typeof a.idleTimeoutMs==`number`?a.idleTimeoutMs:6e4,maxDictationMs:typeof a.maxDictationMs==`number`?a.maxDictationMs:6e5,maxConversationMs:typeof a.maxConversationMs==`number`?a.maxConversationMs:36e5,bargeIn:a.bargeIn!==!1,...c(a.stt)&&a.stt.provider===`xopc-cloud`&&typeof a.stt.model==`string`?{stt:{provider:`xopc-cloud`,model:a.stt.model}}:{},...c(a.tts)&&(a.tts.provider===`alibaba`||a.tts.provider===`xopc-cloud`)?{tts:{provider:a.tts.provider,...typeof a.tts.model==`string`?{model:a.tts.model}:{},...typeof a.tts.voice==`string`?{voice:a.tts.voice}:{}}}:{},...c(a.omni)?{omni:{...a.omni}}:{}}}}}async function g(){return h((await e(t(`/api/config`))).payload?.config??{})}async function _(r){await e(t(`/api/config`),{method:`PATCH`,body:JSON.stringify({stt:p(r.stt),tts:m(r.tts),voice:r.voice})}),r.voice.languageMode===`auto`&&await e(t(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:r.voice.language})}),typeof window<`u`&&window.dispatchEvent(new Event(`voice-config-changed`)),n()}async function v(){let n=await e(t(`/api/voice/models`));if(!n.payload?.models)throw Error(`Missing voice models payload`);return n.payload.models}async function y(){let n=await e(t(`/api/voice/providers`));if(!n.payload?.providers)throw Error(`Missing voice providers payload`);return n.payload}async function b(){let n=await e(t(`/api/voice/stt-providers`));if(!n.payload?.providers)throw Error(`Missing STT providers payload`);return n.payload}async function x(n,r){let i=await e(t(`/api/voice/tts-test`),{method:`POST`,signal:r,body:JSON.stringify(n)});if(i.ok===!1){let e=typeof i.error==`string`?i.error:i.error?.message;throw Error(e||`TTS test failed`)}if(!i.payload||typeof i.payload.audio!=`string`||!i.payload.audio.trim())throw Error(`TTS test returned no audio. Check the selected voice engine and try again.`);return i.payload}async function S(n){let r=await e(t(`/api/voice/reveal-api-key`),{method:`POST`,body:JSON.stringify(n)});if(!r.payload)throw Error(`Missing reveal payload`);return r.payload}export{g as a,_ as c,x as d,y as i,i as l,a as n,b as o,v as r,h as s,r as t,S as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./x-B_N4OPjy.js";import{t as a}from"./messages-DPw2X06D.js";import{n as o}from"./locale-store-Y1aBayM_.js";import{a as s,i as c,o as l,r as u,s as d,t as f}from"./dist-BGTk37IG.js";import{t as p}from"./button-CS04eWY9.js";import{Y as m,rt as h,ta as g}from"./index-ByFXhQ-T.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=o(C),w=h(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=a(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(s,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(g,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(d,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(c,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(i,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(p,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(m,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(l,{children:[z,(0,y.jsx)(u,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(f,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};
|