@xopcai/xopc 0.0.460 → 0.0.462
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/dist/assets/{pcm-capture-worklet-CGN9Mlhg.js → pcm-capture-worklet-Df5TcFw4.js} +4 -2
- package/dist/browser-ext/dist/sidepanel.js +3 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agents-CGUdvmIT.js → agents-DC0lHtl5.js} +3 -3
- package/dist/gateway/static/root/assets/{apps-page-M2XD1Pzu.js → apps-page-QLOYw2QR.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-CiJmJ7_h.js → automation-task-card-CJbIHRxN.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CVjgENMO.js → automations-page-DpKnqajR.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-CGPWyL0P.js → automations-workspace-BXT_EDON.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-CmnkluMF.js → block-editor-DrZyRQQ0.js} +5 -5
- package/dist/gateway/static/root/assets/{capabilities-DDqDvCBs.js → capabilities-Dr-vvMez.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-hSb-qEgL.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-CnU0htlO.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CvF8VRTv.js → capabilities-settings-panel-B08mjrGB.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-BDVQ6Z7A.js → channels-B--IHNs4.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-stPJEZ90.js → chat-chart-block-ClCZyIi0.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-U2a7d6wP.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B4uA_W6R.js → chat-terminal-dock-eneTvxV3.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DyzDVVfz.js → connectors-page-Bs29RvXz.js} +1 -1
- package/dist/gateway/static/root/assets/constants-Bg1wM2nv.js +1 -0
- package/dist/gateway/static/root/assets/diagnostics-Bo0Z42P_.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BPwRrP3L.js → extension-debug-page-Bn_5xu_M.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DIH4TcdH.js → extension-iframe-host-Vs6USa0c.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-C9JDpo_7.js → extension-message-router-GIekDj_w.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CLDoL5N8.js → extension-page-C_3bIjSB.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BPIoHw4r.js → extension-provider-D-LolObs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BO_UKeG8.js → extension-settings-page-BV51dk16.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DefKShSW.js +8 -0
- package/dist/gateway/static/root/assets/index-CChzK_5b.css +1 -0
- package/dist/gateway/static/root/assets/index-CEBDMkde.js +11 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D8oqDDAn.js → local-app-workbench-page-CfnixDO3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BlxIaCCQ.js → markdown-view-CNJaAdNN.js} +39 -39
- package/dist/gateway/static/root/assets/note-detail-panel-D_l5jkV9.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-D6mvMSKr.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CdXA-g9r.js → notes-api-BOIM9Q_D.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-R4uJroeD.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-Dibmspef.js → page-context-capture-button-B_Vdo2Ai.js} +1 -1
- package/dist/gateway/static/root/assets/pcm-capture-worklet-CpXsv44v.js +1 -0
- package/dist/gateway/static/root/assets/{personal-page-BwfyW7Hx.js → personal-page-BsONyPfQ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-CQhZjoK6.js → personal-profile-settings-C4CxmQLQ.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-peD05ktj.js → personal-settings-panel-CnxI2TL0.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-D51I7Lg3.js → product-automation-feedback-CGso8wGv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-WkF2j_c-.js → product-preview-content-Dgtb4LF7.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-modal-C35EWUps.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-xNSy6SAv.js +7 -0
- package/dist/gateway/static/root/assets/recording-upload-CFX7CANT.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-Dwb_N8L-.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-KH1VaEdC.js +2 -0
- package/dist/gateway/static/root/assets/session-manager-63NaXb1s.js +25 -0
- package/dist/gateway/static/root/assets/{settings-page-BHImcF1q.js → settings-page-8MiJzbbl.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-fV5USZb1.js → share-preview-page-Cqy-7-rd.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-sl40lqND.js → shares-settings-BDr50uTV.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-FTd0Z7Ey.js → skills-page-DReUQ4Ug.js} +1 -1
- package/dist/gateway/static/root/assets/star-CnYNmpLd.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DxKXoBbE.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-CSJeB9AH.js → task-result-evidence-CW_tN93T.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-CO7XLI4x.js → use-composer-attachments-Xn6eUus2.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BXXeXnT0.js → use-file-preview-expanded-D0IBFhM9.js} +1 -1
- package/dist/gateway/static/root/assets/use-realtime-voice-B5IsKrRW.js +1 -0
- package/dist/gateway/static/root/assets/{use-workspace-tree-D27u-eoX.js → use-workspace-tree-7X2ydgS8.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-BiqJ0tlf.js → voice-settings-57pwZeKD.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-Dd_UDfeo.js +2 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-NffP-UXC.js → workspace-file-preview-dialog-Clj9hMj5.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-Do31QQH5.js → workspace-preview-store-imhtuEIP.js} +1 -1
- package/dist/gateway/static/root/index.html +27 -26
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/follow-ups.js +97 -0
- package/dist/packages/gateway-contract/src/home.js +1 -0
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/observation-starters.js +95 -0
- package/dist/packages/gateway-contract/src/observation.js +7 -0
- package/dist/packages/gateway-contract/src/task-research-result.js +3 -0
- package/dist/src/agent/agent-manager.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +1 -0
- package/dist/src/agent/background-review/prompts.js +7 -1
- package/dist/src/agent/background-review/run-background-review.js +85 -7
- package/dist/src/agent/coding/run-verification.d.ts +14 -7
- package/dist/src/agent/coding/run-verification.js +28 -6
- package/dist/src/agent/context/coordinator.js +1 -1
- package/dist/src/agent/context/deep-recall.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +4 -2
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +9 -0
- package/dist/src/agent/embedded/run-turn.js +63 -14
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +1 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +1 -0
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +17 -2
- package/dist/src/agent/service/process-direct-streaming.d.ts +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -0
- package/dist/src/agent/service.d.ts +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -0
- package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
- package/dist/src/agent/tool-manuals/browser.js +3 -1
- package/dist/src/agent/tools/factory.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +36 -4
- package/dist/src/agent/tools/personal-task-tool.d.ts +7 -1
- package/dist/src/agent/tools/personal-task-tool.js +68 -3
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.d.ts +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +54 -3
- package/dist/src/agent/tools/task-result-tool.js +31 -0
- package/dist/src/agent/tools/xopc-use-tool.js +50 -19
- package/dist/src/automations/capabilities/write.d.ts +2 -2
- package/dist/src/automations/domain/validation.d.ts +4 -4
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/browser/drivers/browser-driver.d.ts +1 -0
- package/dist/src/browser/drivers/create-driver.js +2 -11
- package/dist/src/browser/drivers/playwright-driver.d.ts +5 -2
- package/dist/src/browser/drivers/playwright-driver.js +83 -38
- package/dist/src/browser/runtime/browser-runtime.d.ts +5 -0
- package/dist/src/browser/runtime/browser-runtime.js +71 -9
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +4 -4
- package/dist/src/computer/errors.d.ts +4 -4
- package/dist/src/computer/evaluation.d.ts +3 -3
- package/dist/src/computer/flows.d.ts +1 -1
- package/dist/src/computer/runtime.d.ts +3 -3
- package/dist/src/config/schema.d.ts +6 -2
- package/dist/src/config/schema.js +3 -0
- package/dist/src/connectors/connected-source-understanding.js +11 -3
- package/dist/src/connectors/learning-coordinator.js +45 -11
- package/dist/src/discussions/recording.js +13 -6
- package/dist/src/endpoint-tools/device-host.d.ts +2 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +4 -0
- package/dist/src/gateway/hono/routes/home.js +52 -1
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/session-command-handler.js +15 -1
- package/dist/src/gateway/hono/routes/user-model.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +2 -8
- package/dist/src/gateway/service/agent-runner.js +1 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +5 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +13 -8
- package/dist/src/gateway/service/run-gateway-agent.js +5 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +4 -0
- package/dist/src/gateway/service/session-input-coordinator.js +6 -1
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +8 -1
- package/dist/src/home-intelligence/follow-ups.d.ts +36 -0
- package/dist/src/home-intelligence/follow-ups.js +496 -0
- package/dist/src/home-intelligence/host.d.ts +80 -4
- package/dist/src/home-intelligence/host.js +122 -2
- package/dist/src/home-intelligence/observation-starters.d.ts +3 -0
- package/dist/src/home-intelligence/observation-starters.js +27 -0
- package/dist/src/home-intelligence/observation.d.ts +1 -1
- package/dist/src/home-intelligence/observation.js +16 -4
- package/dist/src/local-apps/automation-proposals.d.ts +4 -4
- package/dist/src/local-apps/capabilities/projections.d.ts +38 -38
- package/dist/src/memory-learning/choice-observations.d.ts +9 -0
- package/dist/src/memory-learning/choice-observations.js +155 -0
- package/dist/src/memory-learning/evidence-repair.d.ts +12 -0
- package/dist/src/memory-learning/evidence-repair.js +31 -0
- package/dist/src/memory-learning/repository.d.ts +1 -0
- package/dist/src/memory-learning/repository.js +43 -5
- package/dist/src/memory-learning/source-learning.js +52 -7
- package/dist/src/memory-learning/task-receipts.js +19 -10
- package/dist/src/memory-learning/transcript-source.js +7 -0
- package/dist/src/memory-learning/work-candidate.d.ts +14 -0
- package/dist/src/memory-learning/work-candidate.js +17 -2
- package/dist/src/memory-learning/work-capture.d.ts +1 -0
- package/dist/src/memory-learning/work-capture.js +28 -10
- package/dist/src/memory-learning/work-review.d.ts +46 -0
- package/dist/src/memory-learning/work-review.js +209 -0
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/personal-agent/communication.d.ts +1 -1
- package/dist/src/personal-agent/communication.js +1 -1
- package/dist/src/personal-agent/default-style.d.ts +1 -1
- package/dist/src/personal-agent/default-style.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
- package/dist/src/personal-agent/prompts.js +4 -4
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +52 -34
- package/dist/src/personal-agent/reply-style.d.ts +2 -2
- package/dist/src/personal-agent/reply-style.js +3 -2
- package/dist/src/personal-agent/request-repository.d.ts +3 -0
- package/dist/src/personal-agent/request-service.d.ts +2 -0
- package/dist/src/personal-agent/request-service.js +8 -2
- package/dist/src/phone/contracts.d.ts +1 -1
- package/dist/src/projects/capabilities/write.js +1 -1
- package/dist/src/projects/index.js +1 -1
- package/dist/src/projects/project-service.js +1 -1
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +22 -0
- package/dist/src/storage/sqlite/upgrades/274_home_followups.sql +21 -0
- package/dist/src/tasks/capabilities/management.d.ts +3 -3
- package/dist/src/tasks/capabilities/relations.d.ts +3 -3
- package/dist/src/tasks/capabilities/write.d.ts +4 -4
- package/dist/src/tasks/capabilities/write.js +2 -0
- package/dist/src/tasks/home-query-service.js +4 -2
- package/dist/src/tasks/task-allocation-service.js +10 -2
- package/dist/src/tasks/task-application-service.d.ts +4 -0
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-context-assembler.js +7 -2
- package/dist/src/tasks/task-contract-planner.js +3 -3
- package/dist/src/tasks/task-conversation-summary.d.ts +64 -0
- package/dist/src/tasks/task-conversation-summary.js +105 -0
- package/dist/src/tasks/task-delay-notice.d.ts +4 -0
- package/dist/src/tasks/task-delay-notice.js +113 -0
- package/dist/src/tasks/task-deletion-service.js +6 -1
- package/dist/src/tasks/task-handoff.d.ts +21 -0
- package/dist/src/tasks/task-handoff.js +77 -1
- package/dist/src/tasks/task-json-acceptance.d.ts +22 -0
- package/dist/src/tasks/task-json-acceptance.js +96 -0
- package/dist/src/tasks/task-main-update-decision-service.js +17 -21
- package/dist/src/tasks/task-main-update-delivery.js +34 -7
- package/dist/src/tasks/task-notification-preference.d.ts +16 -0
- package/dist/src/tasks/task-notification-preference.js +42 -0
- package/dist/src/tasks/task-origin-repository.d.ts +1 -0
- package/dist/src/tasks/task-origin-repository.js +3 -0
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-repository.js +1 -0
- package/dist/src/tasks/task-research-repair.d.ts +19 -1
- package/dist/src/tasks/task-research-repair.js +14 -4
- package/dist/src/tasks/task-research-result.d.ts +12 -0
- package/dist/src/tasks/task-research-result.js +5 -0
- package/dist/src/tasks/task-result-delivery-repository.d.ts +4 -1
- package/dist/src/tasks/task-result-delivery-repository.js +8 -5
- package/dist/src/tasks/task-result-delivery-service.js +9 -1
- package/dist/src/tasks/task-run-coordinator.js +45 -10
- package/dist/src/usage/cloud-wire.d.ts +1 -0
- package/dist/src/user-context/config.d.ts +8 -0
- package/dist/src/user-context/config.js +10 -0
- package/dist/src/user-model/capture/evidence-policy.d.ts +2 -0
- package/dist/src/user-model/capture/evidence-policy.js +8 -1
- package/dist/src/user-model/capture/executor.js +16 -4
- package/dist/src/user-model/capture/semantic.d.ts +4 -0
- package/dist/src/user-model/capture/semantic.js +3 -0
- package/dist/src/user-model/index.js +1 -1
- package/dist/src/user-model/observation-repository.d.ts +6 -0
- package/dist/src/user-model/observation-repository.js +12 -0
- package/dist/src/user-model/repository.js +10 -1
- package/dist/src/voice/realtime/agentEngine.js +29 -7
- package/dist/src/voice/realtime/pcmPlaybackEcho.d.ts +10 -0
- package/dist/src/voice/realtime/pcmPlaybackEcho.js +56 -0
- package/dist/src/voice/realtime/playback-echo.d.ts +3 -0
- package/dist/src/voice/realtime/playback-echo.js +35 -5
- package/dist/src/voice/realtime/runtime.js +6 -1
- package/dist/src/voice/realtime/turnPolicy.js +1 -1
- package/package.json +14 -8
- package/dist/gateway/static/root/assets/capabilities-DB713nRi.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +0 -2
- package/dist/gateway/static/root/assets/chat-page-BhPw56Vc.js +0 -71
- package/dist/gateway/static/root/assets/constants-DpkUgykJ.js +0 -1
- package/dist/gateway/static/root/assets/discussion-annotation-sync-fwPPMPv9.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +0 -7
- package/dist/gateway/static/root/assets/index-DjzrnmBA.js +0 -11
- package/dist/gateway/static/root/assets/index-YQxumvaS.css +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-BbHlfAju.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-CqK_uJ6Y.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-8w2Stfak.js +0 -8
- package/dist/gateway/static/root/assets/pcm-capture-worklet-uW_SEACy.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-DMHOKocl.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-CNFuzmRr.js +0 -7
- package/dist/gateway/static/root/assets/recording-upload-CyZSl2DJ.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-CuxNu-LB.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +0 -2
- package/dist/gateway/static/root/assets/session-manager-D2LaQymu.js +0 -25
- package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +0 -3
- package/dist/gateway/static/root/assets/use-realtime-voice-C7iWQuUv.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-LghfbP5g.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,c as t,d as n,i as r,m as i,n as a,u as o}from"./schemas-CCWMleym.js";var s=i().min(1).max(120),c=n({id:s,toolCallId:i().min(1),toolName:i().min(1),excerpt:i().min(1).max(2e3),url:i().url().optional(),snapshotHash:i().regex(/^[a-f0-9]{64}$/),observedAt:o().int().nonnegative()}),l=n({id:s,statement:i().min(1).max(2e3),kind:a([`fact`,`inference`,`recommendation`]),sourceIds:r(s).min(1).max(8),support:a([`supported`,`unsupported`,`uncertain`,`unreviewed`]),note:i().max(1e3).optional()}),u=n({criterionIndex:o().int().nonnegative(),criterion:i().min(1),status:a([`passed`,`failed`,`unverified`]),claimIds:r(s).max(40),note:i().min(1).max(1e3)}),d=n({version:t(1),contractVersion:o().int().positive(),instructionSequence:o().int().nonnegative(),personalResultHash:i().regex(/^[a-f0-9]{64}$/).optional(),sources:r(c).max(40),claims:r(l).min(1).max(40),checks:r(u).max(40),review:a([`model_reviewed`,`unavailable`]),finalText:i().min(1).max(16e3).optional(),finalArtifactIds:r(i().min(1)).max(50).optional(),inspectedArtifactIds:r(i().min(1)).max(50).optional(),instructionChecks:r(n({sequence:o().int().positive(),instruction:i().min(1),status:a([`passed`,`failed`,`unverified`]),claimIds:r(s).max(40),note:i().min(1).max(1e3)})).max(40).optional()}).superRefine((e,t)=>{let n=(e,n)=>{new Set(e).size!==e.length&&t.addIssue({code:`custom`,message:`Duplicate ${n}`})};n(e.sources.map(e=>e.id),`source IDs`),n(e.claims.map(e=>e.id),`claim IDs`),n(e.checks.map(e=>e.criterionIndex),`criterion indices`),n((e.instructionChecks??[]).map(e=>e.sequence),`instruction sequences`);let r=new Set(e.sources.map(e=>e.id)),i=new Set(e.claims.map(e=>e.id));for(let n of e.claims)n.sourceIds.some(e=>!r.has(e))&&t.addIssue({code:`custom`,message:`Unknown claim source`});for(let n of[...e.checks,...e.instructionChecks??[]])n.claimIds.some(e=>!i.has(e))&&t.addIssue({code:`custom`,message:`Unknown criterion claim`})}),f=a([`document`,`spreadsheet`,`presentation`,`pdf`,`image`,`video`,`audio`,`site`,`archive`,`file`]),p=a([`workspace`,`external_host`,`worktree`,`remote_runtime`,`artifact_store`]),m=a([`materializing`,`available`,`expired`,`missing`,`failed`]),h=a([`preview`,`download`,`open`,`import`,`share`,`regenerate`]),g=n({artifactId:i().min(1),sourceFileId:i().min(1).optional(),title:i().min(1),kind:f,mimeType:i().optional(),sha256:i().regex(/^[a-f0-9]{64}$/).optional(),sizeBytes:o().nonnegative().optional(),availability:m,location:p,capabilities:r(h),uri:i().optional(),workspaceRelativePath:i().optional(),shareUrl:i().url().optional(),thumbnailUrl:i().optional(),expiresAt:i().optional()}),_=n({path:i().min(1),status:a([`added`,`modified`,`deleted`,`renamed`]).optional(),added:o().nonnegative().optional(),removed:o().nonnegative().optional()}),v=n({changeSetId:i().min(1),files:r(_),added:o().nonnegative(),removed:o().nonnegative(),diff:i(),diffTruncated:e().optional(),environment:a([`workspace`,`worktree`,`remote_runtime`])}),y=n({evidenceId:i().min(1),kind:a([`check`,`screenshot`,`video`,`log`]),label:i().min(1),status:a([`passed`,`failed`,`warning`]),durationMs:o().nonnegative().optional(),command:i().optional(),artifactId:i().optional(),revision:i().optional(),logPath:i().optional()}),b=n({version:t(1),outcomeId:i().min(1),runId:i().min(1),turnId:i().min(1),status:a([`succeeded`,`partial`,`failed`]),summary:i().optional(),deliverables:r(g),changeSet:v.optional(),evidence:r(y),research:d.optional(),createdAt:i()}),x=`xopc-file:`;function S(e){if(!e.startsWith(x))return null;try{return decodeURIComponent(e.slice(10)).trim()||null}catch{return null}}function C(e){let t=new Map(e.map(e=>[e.artifactId,e])),n=new Map,r=e=>e.availability===`available`?e.location===`artifact_store`?2:1:0;for(let e of t.values()){let t=e.sourceFileId??S(e.uri??``),i=t?`source:${t}`:`artifact:${e.artifactId}`,a=n.get(i);(!a||r(e)>=r(a))&&n.set(i,e)}return[...n.values()]}function w(e){let t=b.safeParse(e);return t.success?{...t.data,deliverables:C(t.data.deliverables)}:null}var T=32*1024*1024;export{w as i,b as n,S as r,T as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{i as n,o as r}from"./locale-store-Dy1EByeG.js";import{t as i}from"./createLucideIcon-DPHK1VkS.js";import{t as a}from"./chevron-down-ccbiQQz_.js";import{t as o}from"./button-Cc4hUNTt.js";var s=i(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),c=i(`bookmark`,[[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),l=i(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]);function u(e){let t=e.audioAvailable&&!e.audioDeleted,n=`sync_pending`,r=`none`;return e.audioDeleted?n=`audio_deleted`:e.localSave===`saving`?n=`local_saving`:e.localSave===`failed`?n=`save_failed`:e.localSave===`partial`?(n=`local_partial`,r=`recover`):t?e.serverStatus===`cancelled`?n=`cancelled`:e.serverStatus===`needs_attention`?(n=e.failureStage===`organization`?`analysis_failed`:`transcription_failed`,r=`pipeline`):e.serverStatus===`completed`?e.noteAvailable?e.analysisStale?(n=`analysis_stale`,r=`analyze`):n=`ready`:(n=`analysis_missing`,r=`regenerate`):n=e.serverStatus===`organizing`?e.retryScheduled?`analysis_retrying`:`organizing`:e.retryScheduled?`transcription_retrying`:`transcribing`:e.jobState===`failed`?(n=`verify_failed`,r=`pipeline`):e.jobState===`queued`||e.jobState===`running`||e.sync===`verifying`?n=`verifying`:e.sync===`offline`||e.sync===`failed`?(n=`sync_failed`,r=e.localSave===`complete`?`sync`:`none`):e.localSave!==`complete`&&e.serverStatus===`needs_attention`&&(n=`source_missing`),{stage:n,leave:e.localSave===`saving`?`hold`:t?`cloud`:e.localSave===`complete`?`local`:`hold`,retry:r,audio:t,text:e.textAvailable,note:e.noteAvailable,stale:e.analysisStale}}var d=`open-discussion-capture`;function f(e){window.dispatchEvent(new CustomEvent(d,{detail:e?{projectId:e}:{}}))}var p=e(),m={save_failed:[`录音未能保存`,`Recording could not be saved`,`尚未确认可恢复的原音。请检查麦克风权限和可用存储空间后重新录制。`,`No recoverable audio has been confirmed. Check microphone permission and available storage before recording again.`],cancelled:[`已停止整理`,`Processing stopped`,`已有原音、文字和笔记仍可使用。`,`Existing audio, text and notes remain available.`],local_saving:[`正在保存录音`,`Saving recording`,`请稍候,确认保存完成前请留在此页面。`,`Please stay on this page until saving is confirmed.`],local_partial:[`已保留部分录音`,`Part of the recording was retained`,`本次录音未完整保存。请先恢复或导出已保存部分,确认缺失范围。`,`This recording was not saved completely. Recover or export the saved portion and review the missing parts.`],sync_pending:[`正在同步原音`,`Syncing original audio`,`已完成的文字和笔记可先使用。原音确认可用后,会继续整理。`,`Available text and notes can be used now. Processing continues once the original audio is confirmed.`],sync_failed:[`原音同步未完成`,`Audio sync incomplete`,`已保存的内容仍保留在录制设备。连接网络后可重试同步,无需重新录音。`,`Saved content remains on the recording device. Reconnect and retry sync without recording again.`],verifying:[`原音已上传,正在确认`,`Confirming uploaded audio`,`上传完成后,还需确认原音可用。已有文字可以先查看。`,`Uploaded audio is being checked. Existing text can be read now.`],verify_failed:[`原音确认未完成`,`Audio confirmation incomplete`,`上传内容已保留,可重试确认原音。已有文字和笔记仍可使用。`,`Uploaded content is retained. Retry audio confirmation; existing text and notes remain available.`],transcribing:[`正在整理文字`,`Preparing transcript`,`原音已可回听,已完成的文字可先搜索和查看。文字完成后继续生成笔记。`,`Play the original audio and search available text now. Notes will follow the transcript.`],transcription_retrying:[`正在重试整理文字`,`Retrying transcription`,`原音和处理进度已保留,系统稍后自动重试。已有文字仍可使用。`,`Audio and progress are retained. An automatic retry is scheduled; existing text remains available.`],transcription_failed:[`文字整理未完成`,`Transcription incomplete`,`原音和已有文字均保留。重试会从已保存进度继续,无需重新录音。`,`Audio and existing text are retained. Retry from saved progress without recording again.`],organizing:[`正在生成笔记`,`Preparing notes`,`可以先回听原音、查找原话。笔记完成后可查看重点、结论和行动建议。`,`Play audio and find original statements now. Highlights, conclusions and suggested actions will follow.`],analysis_retrying:[`正在重试生成笔记`,`Retrying notes`,`原音、文字和已有笔记均保留,系统稍后自动重试。`,`Audio, text and existing notes are retained. An automatic retry is scheduled.`],analysis_failed:[`笔记生成未完成`,`Notes incomplete`,`原音、文字和已有笔记均保留。重试只继续整理,不会重新录音或创建重复笔记。`,`Audio, text and existing notes are retained. Retry continues processing without recording again or creating another note.`],ready:[`录音与笔记已就绪`,`Recording and notes are ready`,`现在可以回听原音、查找原话,并回顾重要信息。`,`Play the audio, find original statements and review important information.`],analysis_missing:[`暂未生成笔记`,`Notes are not available yet`,`原音和已有文字仍可使用,可以从原音重新生成文字与笔记。`,`Audio and existing text remain available. Regenerate text and notes from the original audio.`],analysis_stale:[`原文已更新`,`Transcript updated`,`当前笔记基于修改前的原文,可保留查看,也可按新版原文重新整理。`,`Existing notes use an earlier transcript. Keep them or generate notes from the updated text.`],source_missing:[`原音尚不可用`,`Original audio is not available yet`,`请到录制设备的待恢复录音中继续同步。已有文字和笔记仍可查看。`,`Continue sync from recoverable recordings on the recording device. Existing text and notes remain readable.`],audio_deleted:[`原音已删除`,`Original audio was deleted`,`已有文字和笔记仍可查看;重新生成需要重新导入原音。`,`Existing text and notes remain readable. Import the original audio again to regenerate.`]},h={leave_local:[`录音已在本机保存,可以离开当前页面。`,`Recording saved on this device. You can leave this page.`],leave_cloud:[`原音已同步,可以离开当前页面。`,`Original audio synced. You can leave this page.`],leave_hold:[`请先确认保存结果,再离开当前页面。`,`Confirm the recording is saved before leaving this page.`],local_hint:[`关闭应用后,可在待恢复录音中继续同步。请保留本机录音数据。`,`After closing the app, continue sync from recoverable recordings. Keep the recording data on this device.`],cloud_hint:[`后续转写与笔记整理在后台继续;失败时可在这条笔记中重试。`,`Transcription and notes continue on the server. Retry here if processing fails.`],retry_sync:[`重试同步`,`Retry sync`],retry_pipeline:[`继续处理`,`Resume processing`],retry_analysis_failed:[`重试生成笔记`,`Retry notes`],retry_transcription_failed:[`继续整理文字`,`Resume transcription`],retry_verify_failed:[`重试确认原音`,`Retry audio confirmation`],retry_recover:[`恢复已录内容`,`Recover saved audio`],retry_regenerate:[`从原音重新生成`,`Regenerate from audio`],retry_analyze:[`按新版原文整理`,`Update notes from transcript`],audio:[`原音`,`Audio`],text:[`文字`,`Transcript`],note:[`笔记`,`Notes`],available:[`可用`,`Available`],pending:[`尚未完成`,`Not ready`],old_note:[`旧版可用`,`Earlier version available`],open:[`打开笔记`,`Open note`],recover:[`待恢复录音`,`Recoverable recordings`],export:[`导出已录内容`,`Export saved audio`],close:[`稍后查看`,`View later`],annotation_failed:[`重点同步未完成,原音和笔记处理不受影响。`,`Highlights are not synced yet. Audio and note processing are unaffected.`],retry_annotation:[`重试重点同步`,`Retry highlights`]},g=t();function _(e,t=`unknown`,n=`pending`){return{localSave:t,sync:n,serverStatus:e?.discussion.status??``,failureStage:e?.discussion.failureStage??``,jobState:e?.recordingJob?.state??``,retryScheduled:!!e?.processing?.nextAttemptAt,audioAvailable:!!e?.discussion.audioAttachmentId,audioDeleted:!!e?.discussion.audioDeletedAt,textAvailable:!!e?.transcript?.text?.trim()||!!e?.discussion.canonicalTranscript?.trim(),noteAvailable:!!e?.organization?.organization,analysisStale:!!e?.organization&&e.organization.transcriptRevision!==e.transcript?.revision}}function v(e){let t=(0,p.c)(61),{input:n,zh:r,compact:i,busy:s,onRetry:c,children:l,nextAttemptAt:d,context:f}=e,_=i!==void 0&&i,v=s!==void 0&&s,y=f===void 0?`capture`:f,b,x,S,C,w,T,E,D,O,k,A,j,M;if(t[0]!==y||t[1]!==n||t[2]!==r){C=u(n),S=m[C.stage];let e;t[16]===r?e=t[17]:(e=e=>h[e][+!r],t[16]=r,t[17]=e),b=e,x=`retry_${[`analysis_failed`,`transcription_failed`,`verify_failed`].includes(C.stage)?C.stage:C.retry}`,M=`polite`,w=C.stage,T=y===`note`?`mx-auto w-full max-w-[46rem] text-fg`:`rounded-xl bg-surface-inset p-3 text-fg`,E=y===`capture`?(0,g.jsx)(`p`,{className:`mb-1 text-sm font-medium`,children:b(`leave_${C.leave}`)}):null,k=`group`,A=y,j=y===`note`&&(C.stage.endsWith(`_failed`)||C.stage.includes(`retry`)||C.stage===`local_partial`)?!0:void 0,O=`flex min-h-11 cursor-pointer list-none items-center gap-2 rounded-lg text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent [&::-webkit-details-marker]:hidden`,D=C.stage.endsWith(`_failed`)||C.stage===`local_partial`?`bg-danger`:`bg-accent`,t[0]=y,t[1]=n,t[2]=r,t[3]=b,t[4]=x,t[5]=S,t[6]=C,t[7]=w,t[8]=T,t[9]=E,t[10]=D,t[11]=O,t[12]=k,t[13]=A,t[14]=j,t[15]=M}else b=t[3],x=t[4],S=t[5],C=t[6],w=t[7],T=t[8],E=t[9],D=t[10],O=t[11],k=t[12],A=t[13],j=t[14],M=t[15];let N=`size-1.5 shrink-0 rounded-full ${D}`,P;t[18]===N?P=t[19]:(P=(0,g.jsx)(`span`,{className:N,"aria-hidden":!0}),t[18]=N,t[19]=P);let F=S[+!r],I;t[20]===F?I=t[21]:(I=(0,g.jsx)(`span`,{className:`min-w-0 flex-1`,children:F}),t[20]=F,t[21]=I);let L;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,g.jsx)(a,{className:`size-3.5 shrink-0 text-fg-muted transition-transform group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0}),t[22]=L):L=t[22];let R;t[23]!==P||t[24]!==I||t[25]!==O?(R=(0,g.jsxs)(`summary`,{className:O,children:[P,I,L]}),t[23]=P,t[24]=I,t[25]=O,t[26]=R):R=t[26];let z;t[27]!==y||t[28]!==b||t[29]!==C.leave?(z=y===`note`?(0,g.jsx)(`p`,{children:b(`leave_${C.leave}`)}):null,t[27]=y,t[28]=b,t[29]=C.leave,t[30]=z):z=t[30];let B;t[31]!==_||t[32]!==d||t[33]!==b||t[34]!==S||t[35]!==C||t[36]!==r?(B=_?null:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`p`,{children:S[r?2:3]}),d&&Number.isFinite(d)?(0,g.jsxs)(`p`,{children:[r?`下次自动重试时间:`:`Next automatic retry: `,new Date(d).toLocaleTimeString(r?`zh-CN`:`en-US`,{hour:`2-digit`,minute:`2-digit`})]}):null,C.leave===`local`?(0,g.jsx)(`p`,{children:b(`local_hint`)}):null,(0,g.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1`,"aria-label":r?`已可用内容`:`Available content`,children:[`audio`,`text`,`note`].map(e=>(0,g.jsxs)(`li`,{children:[b(e),` · `,e===`note`&&C.note&&C.stale?b(`old_note`):b(C[e]?`available`:`pending`)]},e))})]}),t[31]=_,t[32]=d,t[33]=b,t[34]=S,t[35]=C,t[36]=r,t[37]=B):B=t[37];let V;t[38]!==z||t[39]!==B?(V=(0,g.jsxs)(`div`,{className:`space-y-2 pb-3 text-xs leading-5 text-fg-muted`,children:[z,B]}),t[38]=z,t[39]=B,t[40]=V):V=t[40];let H;t[41]!==R||t[42]!==V||t[43]!==k||t[44]!==A||t[45]!==j?(H=(0,g.jsxs)(`details`,{className:k,open:j,children:[R,V]},A),t[41]=R,t[42]=V,t[43]=k,t[44]=A,t[45]=j,t[46]=H):H=t[46];let U;t[47]!==v||t[48]!==c||t[49]!==b||t[50]!==x||t[51]!==C.retry?(U=C.retry!==`none`&&c?(0,g.jsx)(o,{className:`min-h-11`,disabled:v,onClick:()=>c(C.retry),children:b(x)}):null,t[47]=v,t[48]=c,t[49]=b,t[50]=x,t[51]=C.retry,t[52]=U):U=t[52];let W;return t[53]!==l||t[54]!==w||t[55]!==T||t[56]!==E||t[57]!==H||t[58]!==U||t[59]!==M?(W=(0,g.jsxs)(`section`,{"aria-live":M,"data-recording-outcome":w,className:T,children:[E,H,U,l]}),t[53]=l,t[54]=w,t[55]=T,t[56]=E,t[57]=H,t[58]=U,t[59]=M,t[60]=W):W=t[60],W}function y(){return r(n(`/api/discussion-capture/settings`))}function b(e){return r(n(`/api/discussion-capture/settings`),{method:`PUT`,body:JSON.stringify({consentPolicyVersion:e})})}async function x(e){return r(n(`/api/discussions`),{method:`POST`,body:JSON.stringify(e)})}function S(e){return r(n(`/api/discussions/${encodeURIComponent(e)}`))}async function C(e){try{return await r(n(`/api/discussions/by-note/${encodeURIComponent(e)}`))}catch(e){if(e.status===404)return null;throw e}}function w(e){return r(n(`/api/discussions/${encodeURIComponent(e)}/transcript`))}function T(e,t,i){let a=new FormData;return a.set(`file`,i.blob,`segment-${t}.wav`),a.set(`startedAtMs`,String(i.startedAtMs)),a.set(`endedAtMs`,String(i.endedAtMs)),a.set(`sha256`,i.sha256),r(n(`/api/discussions/${encodeURIComponent(e)}/segments/${t}`),{method:`PUT`,body:a})}function E(e,t=`resume`){return r(n(`/api/discussions/${encodeURIComponent(e)}/retry`),{method:`POST`,body:JSON.stringify({mode:t})})}function D(e){return r(n(`/api/discussions/${encodeURIComponent(e)}/project`),{method:`DELETE`})}function O(e){return r(n(`/api/discussions/${encodeURIComponent(e)}/recording/chunks`))}function k(e,t,i,a){return r(n(`/api/discussions/${encodeURIComponent(e)}/recording/chunks/${t}`),{method:`PUT`,headers:{"Content-Type":`application/octet-stream`,"x-audio-sha256":a},body:i})}function A(e,t){return r(n(`/api/discussions/${encodeURIComponent(e)}/capture/seal`),{method:`POST`,body:JSON.stringify(t)})}function j(e){return r(n(`/api/discussions/${encodeURIComponent(e)}/recording/job`))}var M=()=>window.dispatchEvent(new Event(`discussion-annotations-changed`));async function N(){return new Promise((e,t)=>{let n=indexedDB.open(`xopc-note-annotations`,1);n.onupgradeneeded=()=>{n.result.createObjectStore(`annotations`,{keyPath:[`recordingId`,`annotation.id`]}).createIndex(`recordingId`,`recordingId`)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)})}async function P(e,t){let n=await N();try{return await new Promise((r,i)=>{let a=n.transaction(`annotations`,e?`readwrite`:`readonly`,{durability:`strict`}),o,s;a.oncomplete=()=>r(o),a.onabort=()=>i(s??a.error??Error(`Annotation save failed`)),a.onerror=()=>i(a.error);try{t(a.objectStore(`annotations`),e=>{o=e},e=>{s=e,a.abort()})}catch(e){a.abort(),i(e)}})}finally{n.close()}}async function F(e){return P(!1,(t,n)=>{let r=t.index(`recordingId`).getAll(e);r.onsuccess=()=>n(r.result)})}async function I(e,t,n){await P(!0,(r,i,a)=>{let o=r.get([e,t.id]);o.onsuccess=()=>{let s=o.result;if(n!==void 0&&(n===null?s&&s.state!==`synced`:s?.nonce!==n)){a(Error(`Annotation changed in another tab. Your editor content is retained; reload before saving.`));return}r.put({recordingId:e,annotation:t,nonce:crypto.randomUUID(),state:`pending`}),i()}}),M()}function L(e,t=`highlight`){let n=Date.now();return{id:crypto.randomUUID(),kind:t,text:``,anchor:e,revision:0,deleted:!1,createdAt:n,updatedAt:n}}async function R(e,t,n){await P(!0,(r,i)=>{let a=r.get([e,t]);a.onsuccess=()=>{let e=a.result;e&&e.annotation.anchor.offsetMs===void 0&&r.put({...e,nonce:crypto.randomUUID(),state:`pending`,annotation:{...e.annotation,anchor:{...e.annotation.anchor,offsetMs:n}}}),i()}}),M()}async function z(e,t,n=!1){await P(!0,(r,i)=>{let a=r.get([e.recordingId,e.annotation.id]);a.onsuccess=()=>{let o=a.result;o&&(o.nonce===e.nonce?r.put({...o,annotation:t??o.annotation,state:n?`conflict`:`synced`}):t&&o.annotation.revision===e.annotation.revision&&r.put({...o,annotation:{...o.annotation,revision:t.revision}})),i()}}),M()}var B=new Map;function V(e,t){let i=`${e}:${t}`;if(B.has(i))return B.get(i);let a=(async()=>{for(let i=0;i<5;i++){let i=(await F(e)).filter(e=>e.state===`pending`);if(!i.length)return;for(let e of i){if(e.state!==`pending`)continue;let i=e.annotation;try{await z(e,await r(n(`/api/discussions/${encodeURIComponent(t)}/annotations/${encodeURIComponent(i.id)}`),{method:`PUT`,signal:AbortSignal.timeout(15e3),body:JSON.stringify({id:i.id,kind:i.kind,text:i.text,anchor:i.anchor,expectedRevision:i.revision,deleted:i.deleted})}))}catch(t){throw t.status===409&&await z(e,void 0,!0),t}}}throw Error(`Highlights are still being updated. Saved local changes will sync on retry.`)})().finally(()=>B.delete(i));return B.set(i,a),a}export{f as C,s as E,d as S,c as T,D as _,R as a,v as b,x as c,C as d,w as f,A as g,E as h,L as i,S as l,j as m,z as n,I as o,O as p,F as r,b as s,V as t,y as u,T as v,l as w,_ as x,k as y};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/workspace-file-preview-dialog-NffP-UXC.js","assets/rolldown-runtime-aKtaBQYM.js","assets/vendor-react-BOUWij0V.js","assets/locale-store-Dy1EByeG.js","assets/messages-BAnhwALN.js","assets/use-file-preview-expanded-BXXeXnT0.js","assets/preload-helper-Czpn1I53.js","assets/chunk-KS7C4IRE-CiwuuyV8.js","assets/createLucideIcon-DPHK1VkS.js","assets/app-window-DXFNqt_0.js","assets/check-DUBLcKHA.js","assets/chevron-down-ccbiQQz_.js","assets/copy-Dv6d4Dvw.js","assets/download-Dk-ZjtO6.js","assets/ellipsis-0k4rZLoy.js","assets/external-link-DjqjBmc3.js","assets/eye-CABVeTq0.js","assets/folder-open-CyzJ19I9.js","assets/link-2-D_ZKYUW7.js","assets/loader-circle-CifKLtgG.js","assets/markdown-view-BlxIaCCQ.js","assets/dist-CY7CS_D3.js","assets/es2015-DBLcMg5B.js","assets/dist-CxGUk8J-.js","assets/file-image-CDUPkZvG.js","assets/plus-Q2yW6OE7.js","assets/x-B_N4OPjy.js","assets/cn-0WouolD0.js","assets/bundle-mjs-rHxsej31.js","assets/app-link-DImAfVs5.js","assets/product-delivery-BFfqdKLe.js","assets/schemas-CCWMleym.js","assets/local-apps-DeqzkJiF.js","assets/copy-to-clipboard-HOJ79TWv.js","assets/xml-_d7dTN2Q.js","assets/mermaid-render-oOellPHt.js","assets/markdown-view-DG8DDkEA.css","assets/message-square-plus-XP0tGdlV.js","assets/minimize-2-DtOGrlpo.js","assets/paperclip-f1HujQY1.js","assets/pencil-DmIY3Oa-.js","assets/refresh-cw-BRlGaq2w.js","assets/rotate-cw-LIg3Am9S.js","assets/save-DRDABU--.js","assets/search-DA7gz22f.js","assets/skeleton-DzdOeGYz.js","assets/constants-DpkUgykJ.js","assets/session-api-BFiIYodK.js","assets/gateway-startup-retry-D6WPS0RW.js","assets/attachment-utils-core-BIOUBrpT.js","assets/interaction-BdhHBbYa.js","assets/composer-notifications-CqV6Xj-H.js","assets/activity-store-CQHh48Zf.js","assets/app-chrome-BeB4KgOf.js","assets/electron-env-DHOGevH3.js","assets/use-async-resource-BHFGZCY2.js","assets/sliding-tab-list-CmcrqRzN.js","assets/sliding-indicator-hwz0sx3h.js","assets/workspace-api-LghfbP5g.js","assets/files-BNL4kkSB.js","assets/index.module-Cd9ENXfk.js","assets/dist-ZrL34Ps4.js","assets/dist-BuHnPloF.js","assets/floating-ui.dom-seOukHzT.js","assets/share-link-dialog-C1t_HB6f.js","assets/popover-select-CLsphyzA.js","assets/dist-GJ8-1PAx.js","assets/settings-shell-dialog-layer-BU3UuiJr.js","assets/globe-DSSGFWFn.js","assets/button-Cc4hUNTt.js","assets/copy-text-row-CpiRzq4G.js","assets/right-workspace-store-HPw7Gw0n.js","assets/phone-workspace-store-Ltrevdsx.js","assets/theme-store-BaWep_o7.js","assets/middleware-Pd0e8Igk.js","assets/file-preview-surface-i5UOFnQF.js","assets/shares-api-Dm07CnXw.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
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"./preload-helper-Czpn1I53.js";import{l as a,m as o,t as s,u as c}from"./chunk-KS7C4IRE-CiwuuyV8.js";import{i as l,n as u,o as d}from"./locale-store-Dy1EByeG.js";import{t as f}from"./messages-BAnhwALN.js";import{a as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./dist-CY7CS_D3.js";import{f as b}from"./automation-display-DaVDNZz8.js";import{t as x}from"./check-DUBLcKHA.js";import{t as S}from"./chevron-down-ccbiQQz_.js";import{t as C}from"./chevron-right-BweFrslA.js";import{t as w}from"./circle-alert-BEjgurr2.js";import{t as T}from"./circle-check-C23XjkUj.js";import{t as E}from"./circle-pause-CN9jYH2s.js";import{t as D}from"./clock-3-DnrAnuyZ.js";import{t as O}from"./external-link-DjqjBmc3.js";import{t as k}from"./history-DXH_9jsE.js";import{M as A,t as j}from"./markdown-view-BlxIaCCQ.js";import{t as M}from"./message-circle-Badhj-4D.js";import{t as N}from"./paperclip-f1HujQY1.js";import{t as P}from"./plus-Q2yW6OE7.js";import{t as F}from"./refresh-cw-BRlGaq2w.js";import{t as I}from"./search-DA7gz22f.js";import{t as L}from"./settings-2-D-csvaET.js";import{t as R}from"./sparkles-DHlfQFAF.js";import{t as z}from"./x-B_N4OPjy.js";import{t as B}from"./cn-0WouolD0.js";import{t as V}from"./skeleton-DzdOeGYz.js";import{i as H,s as U}from"./capabilities-DB713nRi.js";import{i as W}from"./vendor-swr-CdRzEUwF.js";import{S as G,b as K,c as ee,g as q,h as J,m as te,n as ne,s as re,v as ie,w as ae,y as oe}from"./workspace-preview-store-Do31QQH5.js";import{t as Y}from"./button-Cc4hUNTt.js";import{a as se,i as ce,o as le,s as ue}from"./dist-GJ8-1PAx.js";import{a as de,i as fe,o as pe,r as me,s as he,t as ge}from"./composer-payload-handoff-Dc43dgSg.js";import{t as _e}from"./use-realtime-voice-C7iWQuUv.js";import{t as ve}from"./page-header-store-Bm8oxpFR.js";import{t as ye}from"./automation-api-DxBmyzp0.js";import{a as be,n as xe,t as Se}from"./use-composer-attachments-CO7XLI4x.js";import{t as Ce}from"./sliding-tab-list-CmcrqRzN.js";import{n as we,r as Te}from"./voice-input-shortcut-events-CEeFBhp3.js";import{n as Ee}from"./date-formatters-DukWSVwc.js";import{a as De,i as Oe,r as ke,t as Ae}from"./routine-panel-CXs4PjW0.js";import{r as je,t as Me}from"./task-result-evidence-CSJeB9AH.js";import{n as Ne}from"./tab-completion-input-CxtEp0aP.js";var X=n(),Z=e(t(),1);function Pe(e,t,n=!1){let[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(!0),[s,c]=(0,Z.useState)(null),l=(0,Z.useRef)(0),u=(0,Z.useCallback)(async()=>{let t=++l.current;c(null);try{let r=await(n?te(e,!0):te(e));t===l.current&&i(r)}catch(e){t===l.current&&c(e instanceof Error?e.message:String(e))}finally{t===l.current&&o(!1)}},[e,n]);return(0,Z.useEffect)(()=>(u(),()=>{l.current++}),[u,t]),(0,Z.useEffect)(()=>{let e,t=1/0,n=n=>{let r=Date.now()+n;r>=t||(window.clearTimeout(e),t=r,e=window.setTimeout(()=>{e=void 0,t=1/0,u()},n))},r=()=>n(100),i=()=>n(750),a=()=>{document.visibilityState===`visible`&&r()},o=[`task-changed-v2`,`task-updated`,`session-created`,`agent-run-started`,`agent-run-ended`,`automation-run-completed`,`home-advisor-updated`,`gateway-realtime-connected`,`realtime-gap`,`focus`],s=[`session-updated`,`session-transcript-updated`];return o.forEach(e=>window.addEventListener(e,r)),s.forEach(e=>window.addEventListener(e,i)),document.addEventListener(`visibilitychange`,a),()=>{o.forEach(e=>window.removeEventListener(e,r)),s.forEach(e=>window.removeEventListener(e,i)),document.removeEventListener(`visibilitychange`,a),window.clearTimeout(e)}},[u]),{home:r,loading:a,loadError:s,setLoadError:c,load:u}}var Q=r(),Fe=12e3;function Ie(e){let t=(0,X.c)(107),{variant:n,inputId:r,inputRef:i,intent:a,labels:o,attachments:s,isDragging:c,attachmentBusy:l,attachmentsFull:u,voice:d,chat:f,cancelAction:p,onIntentChange:m,onPickFiles:h,onRemoveAttachment:g,onPaste:_,onDragOver:v,onDragLeave:y,onDrop:b,onSubmit:x}=e,S=n===`inline`,C;t[0]!==s||t[1]!==a?(C=!!a.trim()||s.length>0,t[0]=s,t[1]=a,t[2]=C):C=t[2];let w=C,T=d.voiceActive&&d.phase!==`error`,E;t[3]!==x||t[4]!==d.voiceActive?(E=e=>{if(d.voiceActive){e.preventDefault();return}x(e)},t[3]=x,t[4]=d.voiceActive,t[5]=E):E=t[5];let D=S?`mx-auto mt-6 w-full overflow-hidden rounded-xl border border-edge bg-surface-base p-2 text-left shadow-surface transition-colors focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/15 sm:mt-8`:`flex min-h-0 flex-1 flex-col`,O;t[6]===D?O=t[7]:(O=B(`relative`,D),t[6]=D,t[7]=O);let k;t[8]!==S||t[9]!==c||t[10]!==o.dropFiles?(k=c?(0,Q.jsx)(`div`,{className:B(`pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-accent-soft/90 text-sm font-medium text-accent-fg backdrop-blur-[1px]`,S&&`rounded-2xl`),children:o.dropFiles}):null,t[8]=S,t[9]=c,t[10]=o.dropFiles,t[11]=k):k=t[11];let A=!S&&`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,j;t[12]===A?j=t[13]:(j=B(A),t[12]=A,t[13]=j);let M=S?`sr-only`:`mb-2 shrink-0 text-sm font-medium text-fg`,P;t[14]!==r||t[15]!==o.intentLabel||t[16]!==M?(P=(0,Q.jsx)(`label`,{htmlFor:r,className:M,children:o.intentLabel}),t[14]=r,t[15]=o.intentLabel,t[16]=M,t[17]=P):P=t[17];let F;t[18]!==l||t[19]!==f||t[20]!==d.audioLevel||t[21]!==d.cancelVoiceInput||t[22]!==d.confirmVoiceInput||t[23]!==d.elapsedLabel||t[24]!==d.error||t[25]!==d.finalTranscript||t[26]!==d.partialTranscript||t[27]!==d.phase||t[28]!==d.recordedDictation||t[29]!==d.retryVoiceInput||t[30]!==d.settingsRequired||t[31]!==d.voiceActive?(F=d.voiceActive?(0,Q.jsx)(me,{phase:d.phase,elapsedLabel:d.elapsedLabel,recordedDictation:d.recordedDictation,audioLevel:d.audioLevel,partialTranscript:d.partialTranscript,finalTranscript:d.finalTranscript,error:d.error,settingsRequired:d.settingsRequired,disabled:l,chat:f,onCancel:d.cancelVoiceInput,onConfirm:d.confirmVoiceInput,onRetry:d.retryVoiceInput}):null,t[18]=l,t[19]=f,t[20]=d.audioLevel,t[21]=d.cancelVoiceInput,t[22]=d.confirmVoiceInput,t[23]=d.elapsedLabel,t[24]=d.error,t[25]=d.finalTranscript,t[26]=d.partialTranscript,t[27]=d.phase,t[28]=d.recordedDictation,t[29]=d.retryVoiceInput,t[30]=d.settingsRequired,t[31]=d.voiceActive,t[32]=F):F=t[32];let I=T&&`hidden`,L=S?`min-h-24 bg-transparent px-3 py-2`:`min-h-32 flex-1 rounded-xl border border-edge bg-surface-base p-3 focus:border-accent focus:ring-2 focus:ring-accent/20`,z;t[33]!==I||t[34]!==L?(z=B(`w-full resize-none text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle`,I,L),t[33]=I,t[34]=L,t[35]=z):z=t[35];let V;t[36]===m?V=t[37]:(V=e=>m(e.target.value),t[36]=m,t[37]=V);let H=!S,U;t[38]!==r||t[39]!==i||t[40]!==a||t[41]!==o.intentPlaceholder||t[42]!==o.intentSuggestion||t[43]!==m||t[44]!==_||t[45]!==z||t[46]!==V||t[47]!==H?(U=(0,Q.jsx)(Ne,{ref:i,id:r,className:z,value:a,onChange:V,onPaste:_,suggestion:o.intentSuggestion,onAcceptSuggestion:m,onKeyDown:Le,placeholder:o.intentPlaceholder,maxLength:Fe,autoFocus:H}),t[38]=r,t[39]=i,t[40]=a,t[41]=o.intentPlaceholder,t[42]=o.intentSuggestion,t[43]=m,t[44]=_,t[45]=z,t[46]=V,t[47]=H,t[48]=U):U=t[48];let W=S?`border-b-0 bg-transparent px-3 pb-2 pt-0`:`mt-3 border-b-0 bg-transparent px-0 pb-0`,G;t[49]!==s||t[50]!==g||t[51]!==W?(G=(0,Q.jsx)(xe,{attachments:s,topPadded:!1,onRemove:g,className:W}),t[49]=s,t[50]=g,t[51]=W,t[52]=G):G=t[52];let K;t[53]!==S||t[54]!==a.length||t[55]!==o.shortcut?(K=S?null:(0,Q.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:o.shortcut}),(0,Q.jsxs)(`span`,{className:`tabular-nums`,children:[a.length.toLocaleString(),` / `,Fe.toLocaleString()]})]}),t[53]=S,t[54]=a.length,t[55]=o.shortcut,t[56]=K):K=t[56];let ee;t[57]!==F||t[58]!==U||t[59]!==G||t[60]!==K||t[61]!==j||t[62]!==P?(ee=(0,Q.jsxs)(`div`,{className:j,children:[P,F,U,G,K]}),t[57]=F,t[58]=U,t[59]=G,t[60]=K,t[61]=j,t[62]=P,t[63]=ee):ee=t[63];let q=S?`border-edge-subtle px-1 pt-2`:`border-edge px-5 py-4`,J;t[64]===q?J=t[65]:(J=B(`flex shrink-0 items-center gap-2 border-t`,q),t[64]=q,t[65]=J);let te=!S&&`mr-auto`,ne;t[66]===te?ne=t[67]:(ne=B(`flex items-center gap-1`,te),t[66]=te,t[67]=ne);let re=l||u,ie;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(N,{className:`size-4`,"aria-hidden":!0}),t[68]=ie):ie=t[68];let ae;t[69]!==o.attachTitle||t[70]!==h||t[71]!==re?(ae=(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`size-9 rounded-lg p-0`,disabled:re,title:o.attachTitle,"aria-label":o.attachTitle,onClick:h,children:ie}),t[69]=o.attachTitle,t[70]=h,t[71]=re,t[72]=ae):ae=t[72];let oe;t[73]!==l||t[74]!==f||t[75]!==d.startVoiceInput||t[76]!==d.voiceActive?(oe=d.voiceActive?null:(0,Q.jsx)(de,{disabled:l,chat:f,onStart:d.startVoiceInput}),t[73]=l,t[74]=f,t[75]=d.startVoiceInput,t[76]=d.voiceActive,t[77]=oe):oe=t[77];let se;t[78]!==ne||t[79]!==ae||t[80]!==oe?(se=(0,Q.jsxs)(`div`,{className:ne,children:[ae,oe]}),t[78]=ne,t[79]=ae,t[80]=oe,t[81]=se):se=t[81];let ce;t[82]!==p||t[83]!==S||t[84]!==o.shortcut?(ce=S?(0,Q.jsx)(`span`,{className:`hidden text-[11px] text-fg-subtle sm:inline`,children:o.shortcut}):p,t[82]=p,t[83]=S,t[84]=o.shortcut,t[85]=ce):ce=t[85];let le=S?`ml-auto h-9 rounded-lg px-3.5 text-xs`:`min-w-32`,ue=!w||l||d.voiceActive,fe=S?`size-3.5`:`size-4`,pe;t[86]===fe?pe=t[87]:(pe=(0,Q.jsx)(R,{className:fe,"aria-hidden":!0}),t[86]=fe,t[87]=pe);let he;t[88]!==o.submit||t[89]!==le||t[90]!==ue||t[91]!==pe?(he=(0,Q.jsxs)(Y,{type:`submit`,variant:`primary`,className:le,disabled:ue,children:[pe,o.submit]}),t[88]=o.submit,t[89]=le,t[90]=ue,t[91]=pe,t[92]=he):he=t[92];let ge;t[93]!==J||t[94]!==se||t[95]!==ce||t[96]!==he?(ge=(0,Q.jsxs)(`div`,{className:J,children:[se,ce,he]}),t[93]=J,t[94]=se,t[95]=ce,t[96]=he,t[97]=ge):ge=t[97];let _e;return t[98]!==y||t[99]!==v||t[100]!==b||t[101]!==E||t[102]!==ee||t[103]!==ge||t[104]!==O||t[105]!==k?(_e=(0,Q.jsxs)(`form`,{onSubmit:E,onDragOver:v,onDragLeave:y,onDrop:b,className:O,children:[k,ee,ge]}),t[98]=y,t[99]=v,t[100]=b,t[101]=E,t[102]=ee,t[103]=ge,t[104]=O,t[105]=k,t[106]=_e):_e=t[106],_e}function Le(e){e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())}function Re(e){let t=(0,X.c)(12),{href:n,children:r,onOpen:i}=e,o=a();if(n&&/^https?:\/\//i.test(n)){let e;return t[0]!==r||t[1]!==n?(e=(0,Q.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r}),t[0]=r,t[1]=n,t[2]=e):e=t[2],e}if(n?.startsWith(`/`)&&!n.startsWith(`//`)){let e=`${o.pathname}${o.search}`,a;t[3]!==n||t[4]!==e?(a=A(e,n),t[3]=n,t[4]=e,t[5]=a):a=t[5];let c;return t[6]!==r||t[7]!==i||t[8]!==a?(c=(0,Q.jsx)(s,{to:a,className:`rounded-sm text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:i,children:r}),t[6]=r,t[7]=i,t[8]=a,t[9]=c):c=t[9],c}let c;return t[10]===r?c=t[11]:(c=(0,Q.jsx)(`span`,{children:r}),t[10]=r,t[11]=c),c}function ze(e){let t=(0,X.c)(6),{opportunity:n,onOpen:r}=e,i=u($),a,o;if(t[0]!==i||t[1]!==r||t[2]!==n.evidence||t[3]!==n.evidencePresentation){o=Symbol.for(`react.early_return_sentinel`);bb0:{let e=f(i).projectsPage.home.advisorEvidenceCopy,t=n.evidencePresentation,s=t?.locale===i?t.groups:void 0,c=new Intl.DateTimeFormat(i===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),l=t=>(0,Q.jsx)(`ul`,{className:`mt-2 space-y-3 border-l border-edge pl-3 text-xs leading-5 text-fg-muted`,children:t.map(t=>{let n=!!(t.href&&(/^https?:\/\//i.test(t.href)||t.href.startsWith(`/`)&&!t.href.startsWith(`//`)));return(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsxs)(`p`,{className:`text-fg-subtle`,children:[e.sources[t.sourceType],` · `,(0,Q.jsx)(`time`,{dateTime:new Date(t.observedAt).toISOString(),children:c.format(t.observedAt)})]}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap`,children:t.observation}),(0,Q.jsx)(`p`,{className:`mt-1`,children:n?(0,Q.jsx)(Re,{href:t.href,onOpen:r,children:e.openSource}):e.noSource})]},t.id)})}),u=(t,r)=>(0,Q.jsxs)(`li`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:t.summary}),(0,Q.jsxs)(`details`,{className:`mt-1`,children:[(0,Q.jsxs)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-subtle focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[e.originals,` · `,e.sourceCount.replace(`{{count}}`,String(t.evidenceIds.length))]}),l(n.evidence.filter(e=>t.evidenceIds.includes(e.id)))]})]},r);if(!s){o=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`p`,{children:e.unavailable}),(0,Q.jsxs)(`details`,{children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.originals}),l(n.evidence)]})]});break bb0}a=(0,Q.jsxs)(`div`,{className:`mt-2 text-xs leading-5`,children:[(0,Q.jsx)(`p`,{className:`mb-3 text-fg-subtle`,children:e.aiNote}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(0,3).map(u)}),s.length>3?(0,Q.jsxs)(`details`,{className:`mt-2`,children:[(0,Q.jsx)(`summary`,{className:`min-h-9 cursor-pointer rounded-sm py-2 text-fg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:e.more.replace(`{{count}}`,String(s.length-3))}),(0,Q.jsx)(`ul`,{className:`space-y-3 border-l border-edge pl-3`,children:s.slice(3).map(u)})]}):null]})}t[0]=i,t[1]=r,t[2]=n.evidence,t[3]=n.evidencePresentation,t[4]=a,t[5]=o}else a=t[4],o=t[5];return o===Symbol.for(`react.early_return_sentinel`)?a:o}function $(e){return e.language}function Be(e){let t=(0,X.c)(4),{label:n,onClick:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),t[0]=i):i=t[0];let a;return t[1]!==n||t[2]!==r?(a=(0,Q.jsxs)(`button`,{type:`button`,className:`inline-flex min-h-9 items-center gap-1.5 rounded-lg px-2 text-xs font-medium text-fg-muted transition-colors duration-150 hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:r,children:[i,n]}),t[1]=n,t[2]=r,t[3]=a):a=t[3],a}function Ve(e){let t=(0,X.c)(63),{opportunity:n,copy:r,onOpenHistory:i}=e,a,o,s,c,l,u;if(t[0]!==r.aiLabel||t[1]!==r.automationAction||t[2]!==r.automationHint||t[3]!==r.history||t[4]!==r.minutes||t[5]!==r.needsSetup||t[6]!==r.why||t[7]!==i||t[8]!==n.capabilities||t[9]!==n.continuation||t[10]!==n.estimatedMinutes||t[11]!==n.outcome||t[12]!==n.rationale||t[13]!==n.title){let e=n.capabilities.filter(He),d;t[20]===r.aiLabel?d=t[21]:(d=(0,Q.jsx)(`span`,{children:r.aiLabel}),t[20]=r.aiLabel,t[21]=d);let f;t[22]!==r.minutes||t[23]!==n.estimatedMinutes?(f=n.estimatedMinutes?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,Q.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),n.estimatedMinutes,` `,r.minutes]}):null,t[22]=r.minutes,t[23]=n.estimatedMinutes,t[24]=f):f=t[24];let p;t[25]!==d||t[26]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-fg-subtle`,children:[d,f]}),t[25]=d,t[26]=f,t[27]=p):p=t[27];let m;t[28]!==r.history||t[29]!==i?(m=(0,Q.jsx)(Be,{label:r.history,onClick:i}),t[28]=r.history,t[29]=i,t[30]=m):m=t[30],t[31]!==m||t[32]!==p?(a=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[p,m]}),t[31]=m,t[32]=p,t[33]=a):a=t[33],t[34]===n.title?o=t[35]:(o=(0,Q.jsx)(`h3`,{className:`mt-3 text-xl font-semibold leading-7 tracking-tight text-fg`,children:n.title}),t[34]=n.title,t[35]=o),t[36]===n.outcome?s=t[37]:(s=(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:n.outcome}),t[36]=n.outcome,t[37]=s);let h;t[38]===r.why?h=t[39]:(h=(0,Q.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.why,`:`]}),t[38]=r.why,t[39]=h),t[40]!==n.rationale||t[41]!==h?(c=(0,Q.jsxs)(`p`,{className:`mt-4 text-sm leading-6 text-fg-muted`,children:[h,n.rationale]}),t[40]=n.rationale,t[41]=h,t[42]=c):c=t[42],t[43]!==r.automationAction||t[44]!==r.automationHint||t[45]!==n.continuation?(l=n.continuation?.kind===`automation`?(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 rounded-xl border border-edge bg-surface-subtle p-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:r.automationHint}),(0,Q.jsx)(`a`,{href:`#${n.continuation.href}`,className:`inline-flex min-h-11 shrink-0 items-center rounded-lg px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.automationAction})]}):null,t[43]=r.automationAction,t[44]=r.automationHint,t[45]=n.continuation,t[46]=l):l=t[46],u=e.length>0?(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,"aria-label":r.needsSetup,children:e.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.recoveryPath??`/settings`}`,className:`rounded-full border border-accent/25 bg-accent-soft px-2.5 py-1 text-xs text-accent hover:border-accent/50`,children:[r.needsSetup,` · `,e.capability]},`${e.kind}:${e.capability}`))}):null,t[0]=r.aiLabel,t[1]=r.automationAction,t[2]=r.automationHint,t[3]=r.history,t[4]=r.minutes,t[5]=r.needsSetup,t[6]=r.why,t[7]=i,t[8]=n.capabilities,t[9]=n.continuation,t[10]=n.estimatedMinutes,t[11]=n.outcome,t[12]=n.rationale,t[13]=n.title,t[14]=a,t[15]=o,t[16]=s,t[17]=c,t[18]=l,t[19]=u}else a=t[14],o=t[15],s=t[16],c=t[17],l=t[18],u=t[19];let d;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(S,{className:`size-3.5 transition-transform group-open:rotate-180`,"aria-hidden":!0}),t[47]=d):d=t[47];let f;t[48]===r.evidence?f=t[49]:(f=(0,Q.jsxs)(`summary`,{className:`flex min-h-9 cursor-pointer list-none items-center gap-1.5 text-xs font-medium text-fg-muted hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.evidence,d]}),t[48]=r.evidence,t[49]=f);let p;t[50]===n?p=t[51]:(p=(0,Q.jsx)(ze,{opportunity:n}),t[50]=n,t[51]=p);let m;t[52]!==f||t[53]!==p?(m=(0,Q.jsxs)(`details`,{className:`mt-4 group`,children:[f,p]}),t[52]=f,t[53]=p,t[54]=m):m=t[54];let h;return t[55]!==a||t[56]!==m||t[57]!==o||t[58]!==s||t[59]!==c||t[60]!==l||t[61]!==u?(h=(0,Q.jsxs)(Q.Fragment,{children:[a,o,s,c,l,u,m]}),t[55]=a,t[56]=m,t[57]=o,t[58]=s,t[59]=c,t[60]=l,t[61]=u,t[62]=h):h=t[62],h}function He(e){return e.readiness!==`ready`}function Ue(e){let t=(0,X.c)(142),{advisor:n,copy:r,busy:i,onRefresh:a,onAction:o,onFeedback:s,onClarification:c,onOpenHistory:l,preflight:u,receipt:d}=e,[f,p]=(0,Z.useState)(),m;t[0]!==n.alternatives||t[1]!==n.primary||t[2]!==n.state?(m=n.state===`ready`?[n.primary,...n.alternatives]:[],t[0]=n.alternatives,t[1]=n.primary,t[2]=n.state,t[3]=m):m=t[3];let h=m,g;t[4]!==h||t[5]!==f?(g=h.find(e=>e.id===f)??h[0],t[4]=h,t[5]=f,t[6]=g):g=t[6];let _=g,v;t[7]===h[0]?.id?v=t[8]:(v=()=>p(h[0]?.id),t[7]=h[0]?.id,t[8]=v);let y=h[0]?.id,b;if(t[9]!==n.state||t[10]!==y?(b=[n.state,y],t[9]=n.state,t[10]=y,t[11]=b):b=t[11],(0,Z.useEffect)(v,b),n.state===`disabled`)return null;if(d){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(T,{className:`size-5 shrink-0 text-success`,"aria-hidden":!0}),t[12]=e):e=t[12];let n;t[13]===d.title?n=t[14]:(n=(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:d.title}),t[13]=d.title,t[14]=n);let i;t[15]===d.detail?i=t[16]:(i=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.detail}),t[15]=d.detail,t[16]=i);let a;t[17]!==n||t[18]!==i?(a=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[n,i]}),t[17]=n,t[18]=i,t[19]=a):a=t[19];let o;t[20]!==r.history||t[21]!==l?(o=(0,Q.jsx)(Be,{label:r.history,onClick:l}),t[20]=r.history,t[21]=l,t[22]=o):o=t[22];let s=`#${d.href}`,c;t[23]!==r.viewProgress||t[24]!==s?(c=(0,Q.jsx)(Y,{asChild:!0,variant:`secondary`,className:`min-h-10 text-xs`,children:(0,Q.jsx)(`a`,{href:s,children:r.viewProgress})}),t[23]=r.viewProgress,t[24]=s,t[25]=c):c=t[25];let u;t[26]!==o||t[27]!==c?(u=(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o,c]}),t[26]=o,t[27]=c,t[28]=u):u=t[28];let f;return t[29]!==u||t[30]!==a?(f=(0,Q.jsx)(`section`,{className:`mt-7 rounded-2xl border border-success/25 bg-success-soft px-5 py-4`,role:`status`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center`,children:[e,a,u]})}),t[29]=u,t[30]=a,t[31]=f):f=t[31],f}if(n.state===`quiet`||n.state===`refreshing`)return null;if(n.state===`clarification`){let e;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":!0}),t[32]=e):e=t[32];let a;t[33]===r.aiLabel?a=t[34]:(a=(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-accent`,children:[e,r.aiLabel]}),t[33]=r.aiLabel,t[34]=a);let o;t[35]!==r.history||t[36]!==l?(o=(0,Q.jsx)(Be,{label:r.history,onClick:l}),t[35]=r.history,t[36]=l,t[37]=o):o=t[37];let s;t[38]!==a||t[39]!==o?(s=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,o]}),t[38]=a,t[39]=o,t[40]=s):s=t[40];let u;t[41]===n.question.question?u=t[42]:(u=(0,Q.jsx)(`h3`,{id:`home-advisor-question`,className:`mt-3 text-lg font-semibold text-fg`,children:n.question.question}),t[41]=n.question.question,t[42]=u);let d;if(t[43]!==n.question.options||t[44]!==n.question.question||t[45]!==i||t[46]!==c){let e;t[48]!==n.question.question||t[49]!==i||t[50]!==c?(e=e=>(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>c(n.question.question,e.label),children:e.label},e.id),t[48]=n.question.question,t[49]=i,t[50]=c,t[51]=e):e=t[51],d=n.question.options.map(e),t[43]=n.question.options,t[44]=n.question.question,t[45]=i,t[46]=c,t[47]=d}else d=t[47];let f;t[52]===d?f=t[53]:(f=(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:d}),t[52]=d,t[53]=f);let p;return t[54]!==u||t[55]!==f||t[56]!==s?(p=(0,Q.jsxs)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base px-5 py-5`,"aria-labelledby":`home-advisor-question`,children:[s,u,f]}),t[54]=u,t[55]=f,t[56]=s,t[57]=p):p=t[57],p}if(!_)return null;let x=u?.opportunityId===_.id?u.value:void 0,C;t[58]!==n.stale||t[59]!==r.refreshing?(C=n.stale?(0,Q.jsxs)(`p`,{className:`mb-3 inline-flex items-center gap-2 text-xs text-accent`,children:[(0,Q.jsx)(F,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),r.refreshing]}):null,t[58]=n.stale,t[59]=r.refreshing,t[60]=C):C=t[60];let w;t[61]!==r||t[62]!==l||t[63]!==_?(w=(0,Q.jsx)(Ve,{opportunity:_,copy:r,onOpenHistory:l}),t[61]=r,t[62]=l,t[63]=_,t[64]=w):w=t[64];let E;t[65]!==i||t[66]!==r.configure||t[67]!==r.degradedStart||t[68]!==r.setupHint||t[69]!==r.setupTitle||t[70]!==o||t[71]!==_||t[72]!==x?(E=x?.state===`needs_setup`?(0,Q.jsx)(`div`,{className:`mt-5 rounded-xl border border-accent/25 bg-accent-soft/40 p-4`,role:`alert`,"aria-live":`polite`,children:(0,Q.jsxs)(`div`,{className:`flex gap-3`,children:[(0,Q.jsx)(L,{className:`mt-0.5 size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-sm font-semibold text-fg`,children:r.setupTitle}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:r.setupHint}),(0,Q.jsx)(`ul`,{className:`mt-2 space-y-1 text-xs leading-5 text-fg-muted`,children:x.blockers.map(We)}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[x.recoveryActions.map(e=>(0,Q.jsxs)(`a`,{href:`#${e.href}`,className:`inline-flex min-h-11 items-center rounded-lg border border-accent/30 px-3 text-xs font-medium text-accent hover:bg-accent-soft focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[r.configure,` · `,e.capability]},e.capability)),x.degradedAction?(0,Q.jsx)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`degraded_start`),children:r.degradedStart}):null]})]})]})}):null,t[65]=i,t[66]=r.configure,t[67]=r.degradedStart,t[68]=r.setupHint,t[69]=r.setupTitle,t[70]=o,t[71]=_,t[72]=x,t[73]=E):E=t[73];let D;t[74]!==i||t[75]!==r.start||t[76]!==o||t[77]!==_?(D=_.actions.canStart?(0,Q.jsxs)(Y,{type:`button`,variant:`primary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`start`),children:[(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":!0}),r.start]}):null,t[74]=i,t[75]=r.start,t[76]=o,t[77]=_,t[78]=D):D=t[78];let O;t[79]!==i||t[80]!==r.discuss||t[81]!==o||t[82]!==_?(O=_.actions.canDiscuss?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`min-h-11`,disabled:i,onClick:()=>o(_,`discuss`),children:[(0,Q.jsx)(M,{className:`size-4`,"aria-hidden":!0}),r.discuss]}):null,t[79]=i,t[80]=r.discuss,t[81]=o,t[82]=_,t[83]=O):O=t[83];let k;t[84]!==O||t[85]!==D?(k=(0,Q.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-2`,children:[D,O]}),t[84]=O,t[85]=D,t[86]=k):k=t[86];let A;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Q.jsx)(S,{className:`size-3.5`,"aria-hidden":!0}),t[87]=A):A=t[87];let j;t[88]===r.more?j=t[89]:(j=(0,Q.jsxs)(`summary`,{className:`inline-flex min-h-9 cursor-pointer list-none items-center gap-1.5 rounded-lg px-2 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:ring-2 focus-visible:ring-accent`,children:[r.more,A]}),t[88]=r.more,t[89]=j);let N;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Q.jsx)(F,{className:`size-4`,"aria-hidden":!0}),t[90]=N):N=t[90];let P;t[91]!==i||t[92]!==r.refresh||t[93]!==a?(P=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`min-h-11`,disabled:i,onClick:a,title:r.refresh,children:[N,r.refresh]}),t[91]=i,t[92]=r.refresh,t[93]=a,t[94]=P):P=t[94];let I;t[95]===r.feedback?I=t[96]:(I=(0,Q.jsx)(`summary`,{className:`flex min-h-11 cursor-pointer list-none items-center rounded-lg px-3 text-xs text-fg-muted hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:r.feedback}),t[95]=r.feedback,t[96]=I);let z;t[97]===r.alreadyDone?z=t[98]:(z=[`already_done`,r.alreadyDone],t[97]=r.alreadyDone,t[98]=z);let B;t[99]===r.irrelevant?B=t[100]:(B=[`irrelevant`,r.irrelevant],t[99]=r.irrelevant,t[100]=B);let V;t[101]===r.later?V=t[102]:(V=[`too_early`,r.later],t[101]=r.later,t[102]=V);let H;t[103]===r.sourceIncorrect?H=t[104]:(H=[`source_incorrect`,r.sourceIncorrect],t[103]=r.sourceIncorrect,t[104]=H);let U;t[105]===r.lessLikeThis?U=t[106]:(U=[`less_like_this`,r.lessLikeThis],t[105]=r.lessLikeThis,t[106]=U);let W;t[107]!==z||t[108]!==B||t[109]!==V||t[110]!==H||t[111]!==U?(W=[z,B,V,H,U],t[107]=z,t[108]=B,t[109]=V,t[110]=H,t[111]=U,t[112]=W):W=t[112];let G=W,K;t[113]!==i||t[114]!==s||t[115]!==_||t[116]!==G?(K=(0,Q.jsx)(`div`,{className:`absolute right-0 z-20 mt-1 w-44 rounded-xl border border-edge bg-surface-overlay p-1 shadow-float`,children:G.map(e=>{let[t,n]=e;return(0,Q.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 w-full rounded-lg px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>s(_,t),children:n},t)})}),t[113]=i,t[114]=s,t[115]=_,t[116]=G,t[117]=K):K=t[117];let ee;t[118]!==I||t[119]!==K?(ee=(0,Q.jsxs)(`details`,{className:`relative`,children:[I,K]}),t[118]=I,t[119]=K,t[120]=ee):ee=t[120];let q;t[121]!==P||t[122]!==ee?(q=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[P,ee]}),t[121]=P,t[122]=ee,t[123]=q):q=t[123];let J;t[124]!==i||t[125]!==r.alternatives||t[126]!==h||t[127]!==_.id?(J=h.length>1?(0,Q.jsxs)(`div`,{className:`border-t border-edge-subtle pt-2`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:r.alternatives}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:h.filter(e=>e.id!==_.id).map(e=>(0,Q.jsx)(`button`,{type:`button`,disabled:i,className:`min-h-10 rounded-lg border border-edge px-3 text-left text-sm text-fg-muted hover:bg-surface-hover hover:text-fg`,onClick:()=>p(e.id),children:e.title},e.id))})]}):null,t[124]=i,t[125]=r.alternatives,t[126]=h,t[127]=_.id,t[128]=J):J=t[128];let te;t[129]!==j||t[130]!==q||t[131]!==J?(te=(0,Q.jsxs)(`details`,{className:`mt-1`,children:[j,q,J]}),t[129]=j,t[130]=q,t[131]=J,t[132]=te):te=t[132];let ne;t[133]!==k||t[134]!==te||t[135]!==C||t[136]!==w||t[137]!==E?(ne=(0,Q.jsxs)(`div`,{className:`px-5 py-5 sm:px-6`,children:[C,w,E,k,te]}),t[133]=k,t[134]=te,t[135]=C,t[136]=w,t[137]=E,t[138]=ne):ne=t[138];let re;return t[139]!==r.aiLabel||t[140]!==ne?(re=(0,Q.jsx)(`section`,{className:`mt-7 rounded-2xl border border-accent/25 bg-surface-base`,"aria-label":r.aiLabel,children:ne}),t[139]=r.aiLabel,t[140]=ne,t[141]=re):re=t[141],re}function We(e){return(0,Q.jsx)(`li`,{children:e.message},`${e.kind}:${e.capability}`)}function Ge({observation:e,advisor:t,language:n,onUpdated:r}){let i=n===`zh`,[a,o]=(0,Z.useState)(!1),[s,c]=(0,Z.useState)(``),[u,f]=(0,Z.useState)(``),[p,m]=(0,Z.useState)(``),[h,g]=(0,Z.useState)(`once`),[_,v]=(0,Z.useState)(),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(),[D,O]=(0,Z.useState)(!1),k=t.state===`ready`?t.primary:void 0,A=k?.evidence.map(e=>/^observation:([^:]+):/.exec(e.id)?.[1]).find(Boolean),j=_?e.topics.find(e=>e.id===_):e.topics.find(e=>e.routine&&e.routine.status!==`ended`)??e.topics.find(e=>e.trials.length)??e.topics.find(e=>e.id===A)??e.topics[0],M=e.status===`active`&&j?.id===A?k:void 0,N=j?.trials[0],P=!!(j?.routine||N||M),F=t.state===`quiet`&&[`model_unavailable`,`generation_failed`,`budget_exhausted`].includes(t.reason),I=i?`我想减少一件重复工作:
|
|
3
|
-
|
|
4
|
-
请先帮我梳理做法和适合自动化的部分,确认后再执行。`:`I want to spend less time on this recurring task:
|
|
5
|
-
|
|
6
|
-
Help me outline the steps and what can be automated. Confirm with me before acting.`,L=async e=>{if(!a){o(!0),c(``),f(``);try{await e(),r()}catch(e){c(e instanceof Error?e.message:String(e)),r()}finally{o(!1)}}},R=async t=>U.parse(await d(l(`/api/home/observation/command`),{method:`POST`,body:JSON.stringify({expectedRevision:e.revision,idempotencyKey:crypto.randomUUID(),command:t})})),z=()=>{j&&(v(j.id),b(!y))},B=()=>j&&void L(async()=>{let t=await d(l(`/api/home/observation/discussion`),{method:`POST`,body:JSON.stringify({topicId:j.id,expectedRevision:e.revision,idempotencyKey:crypto.randomUUID()})});window.dispatchEvent(new CustomEvent(`navigate-to-chat`,{detail:t}))});return(0,Q.jsxs)(`section`,{className:`rounded-xl border border-edge bg-surface-panel p-4`,"aria-label":i?`交给我`:`Let me handle it`,"aria-busy":a,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:i?`交给我`:`Let me handle it`}),(0,Q.jsx)(Y,{variant:`ghost`,className:`text-xs`,"aria-expanded":x,onClick:()=>S(!x),children:i?`记录与设置`:`History and settings`})]}),s?(0,Q.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm text-danger`,children:s}):null,u?(0,Q.jsx)(`p`,{role:`status`,className:`mt-3 text-sm text-fg-muted`,children:u}):null,_&&!j&&p?(0,Q.jsxs)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:[i?`这件事已不在记录中。未保存的内容:`:`This item is no longer available. Your unsaved note: `,p]}):null,e.status===`disabled`?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:i?`把重复的事,慢慢交给我`:`Let me take recurring work off your hands`}),(0,Q.jsx)(`p`,{className:`max-w-prose text-sm leading-6 text-fg-muted`,children:i?`我会结合你在 xopc 中的工作记录,寻找可以代劳的事情。有合适的建议时,先做一次给你看。`:`I can look through your work in xopc for tasks I could take on, then offer a first draft for you to review.`}),(0,Q.jsx)(Y,{variant:`primary`,disabled:a,onClick:()=>void L(async()=>{await R({kind:`start`,backfillDays:30})}),children:i?`帮我发现重复工作`:`Find recurring work`}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i?`仅查看最近 30 天已授权的私人会话及后续工作记录。不扫描屏幕,定期执行前会请你确认。`:`Uses up to 30 days of authorized private chats and new work. No screen recording. Recurring runs need your confirmation.`})]}):(0,Q.jsxs)(Q.Fragment,{children:[P?j?.routine?(0,Q.jsx)(ke,{routine:j.routine,language:n,onUpdated:r},j.routine.id):N?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:[`review`,`closed`].includes(N.phase)?i?`先看看这次做得怎么样`:`Review the first result`:i?`正在帮你做第一次尝试`:`Working on the first attempt`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:N.title}),(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`满意后再决定要不要定期交给我。`:`Review the result before deciding whether to make it recurring.`}),(0,Q.jsx)(Y,{variant:`primary`,onClick:()=>E(T===N.taskId?void 0:N.taskId),children:i?`查看这次结果`:`Review this result`}),[`review`,`closed`].includes(N.phase)?(0,Q.jsx)(Ae,{topicId:j.id,trial:N,language:n,onUpdated:r},N.taskId):null]}):M&&j?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`这件事,可以先让我试试`:`Here is something I could try`}),(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:M.title}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:M.outcome}),M.risk===`analysis`?(0,Q.jsx)(Y,{variant:`primary`,disabled:a,onClick:()=>void L(async()=>{let t=H.parse(await d(l(`/api/home/observation/trial`),{method:`POST`,body:JSON.stringify({topicId:j.id,opportunityId:M.id,expectedRevision:e.revision,expectedOpportunityRevision:M.revision,idempotencyKey:crypto.randomUUID()})}));if(t.outcome===`task`)E(t.taskId);else throw Error(i?`请先完成相关能力配置。`:`Set up the required capabilities first.`)}),children:i?`先帮我做一次`:`Try it once`}):(0,Q.jsx)(Y,{variant:`primary`,disabled:a,onClick:B,children:i?`先确认怎么做`:`Discuss the approach`}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:M.risk===`analysis`?i?`先生成私人草稿,由你查看后决定下一步。`:`Start with a private draft for you to review.`:i?`这件事需要外部服务,先一起确认范围。`:`This needs an external service. Agree on the scope first.`}),(0,Q.jsxs)(`details`,{className:`text-xs text-fg-muted`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:i?`为什么推荐这件事`:`Why this suggestion`}),(0,Q.jsx)(`p`,{className:`mt-2 leading-5`,children:M.rationale}),M.evidence.map(e=>(0,Q.jsx)(`p`,{className:`mt-2 leading-5`,children:e.observation},e.id))]})]}):null:(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-base font-medium text-fg`,children:i?`发现可以交给我的重复工作`:`Find recurring work I can handle`}),(0,Q.jsx)(`p`,{className:`max-w-prose text-sm leading-6 text-fg-muted`,children:e.status===`paused`?i?`已暂停寻找新建议。你也可以直接告诉我,哪件事最想少做一点。`:`New suggestions are paused. You can still tell me what you would like to spend less time on.`:F?i?`暂时无法生成新建议,已有记录和反馈都已保留。你也可以直接说说想交给我的事。`:`New suggestions are temporarily unavailable. Your records and feedback are saved. You can still tell me what you would like help with.`:i?`暂时还没有值得推荐的事项。有合适的建议时,我会先请你确认。也可以从你最想省下的一件事开始。`:`No suggestions to recommend yet. I will ask before taking on anything. You can also start with a task you would like to spend less time on.`}),(0,Q.jsx)(Y,{asChild:!0,variant:`primary`,children:(0,Q.jsx)(`a`,{href:`#/chat/new?${new URLSearchParams({draft:I})}`,children:i?`说说我经常重复做的事`:`Describe a recurring task`})}),e.status===`paused`?(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>O(!D),children:i?`恢复寻找建议`:`Resume suggestions`}):null]}),P&&j&&e.status===`active`?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-1`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:a,"aria-expanded":y,onClick:z,children:i?`调整做法`:`Refine the approach`}),(0,Q.jsx)(Y,{variant:`ghost`,disabled:a,onClick:B,children:i?`聊聊这件事`:`Discuss this task`})]}):null,T?(0,Q.jsx)(Oe,{taskId:T,language:n,onComplete:r}):null,D?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:i?`恢复后,要补看暂停期间的工作吗?`:`Include work from while suggestions were paused?`}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[[`catch_up`,`new_only`].map(e=>(0,Q.jsx)(Y,{disabled:a,onClick:()=>void L(async()=>{await R({kind:`resume`,mode:e}),O(!1)}),children:e===`catch_up`?i?`一起补看`:`Include earlier work`:i?`只看之后的工作`:`New work only`},e)),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>O(!1),children:i?`取消`:`Cancel`})]})]}):null]}),y&&j?(0,Q.jsxs)(`form`,{className:`mt-3 space-y-3 rounded-lg border border-edge p-3`,onSubmit:e=>{e.preventDefault(),L(async()=>{await R({kind:`feedback`,topicId:j.id,text:p,scope:h}),m(``),b(!1),f(i?`已记下。改变定期做法前,会先请你确认。`:`Preference saved. I will ask before changing the recurring approach.`)})},children:[(0,Q.jsxs)(`label`,{className:`block text-xs text-fg-muted`,children:[i?`关于「${j.title}」,希望我怎么做?`:`How should I handle “${j.title}”?`,(0,Q.jsx)(`textarea`,{required:!0,maxLength:1e3,value:p,onChange:e=>m(e.target.value),placeholder:i?`例如:先列出未解决的阻塞,每项附上来源。`:`For example: list unresolved blockers first and include sources.`,className:`mt-1 min-h-24 w-full rounded-lg border border-edge bg-surface-inset p-2 text-sm text-fg`})]}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,role:`group`,"aria-label":i?`反馈范围`:`Feedback scope`,children:[`once`,`project`,`similar`].filter(e=>e!==`project`||j.projectId).map(e=>(0,Q.jsx)(Y,{type:`button`,variant:e===h?`secondary`:`ghost`,"aria-pressed":e===h,onClick:()=>g(e),children:e===`once`?i?`仅这一次`:`Just this time`:e===`project`?i?`这个项目都适用`:`This project`:i?`以后这类事都适用`:`Similar future work`},e))}),(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,children:i?`记下你的要求;改变定期安排前,仍会请你确认。`:`I will remember your preference and ask before changing a recurring arrangement.`}),(0,Q.jsx)(Y,{type:`submit`,variant:`primary`,disabled:a||!p.trim(),children:i?`记住这个要求`:`Save preference`}),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>{b(!1),m(``),g(`once`)},children:i?`取消`:`Cancel`})]}):null,x?(0,Q.jsxs)(`div`,{className:`mt-4 space-y-3 border-t border-edge-subtle pt-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-muted`,role:`status`,children:e.status===`disabled`?i?`尚未开启`:`Not enabled`:e.status===`paused`?i?`已暂停寻找新建议`:`Suggestions paused`:e.analyzedRevision<e.revision?i?`正在整理最近的工作记录`:`Reviewing recent work`:i?`有新发现时会在这里告诉你`:`New suggestions will appear here`}),(0,Q.jsx)(`p`,{className:`text-xs leading-5 text-fg-muted`,children:i?`只查看已授权的 xopc 私人会话和相关任务结果。暂停寻找建议不会停止已经确认的定期安排。`:`Uses authorized private xopc chats and related task results. Pausing suggestions does not stop confirmed recurring tasks.`}),e.status===`disabled`?null:(0,Q.jsx)(Y,{disabled:a,variant:`ghost`,onClick:()=>e.status===`active`?void L(async()=>{await R({kind:`pause`})}):O(!D),children:e.status===`active`?i?`暂停寻找建议`:`Pause suggestions`:i?`恢复寻找建议`:`Resume suggestions`}),e.topics.length?(0,Q.jsxs)(`details`,{open:!!_,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer text-xs text-fg-muted`,children:i?`查看工作记录与已保存的要求`:`Work history and saved preferences`}),(0,Q.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.topics.map(e=>(0,Q.jsx)(Y,{variant:`ghost`,disabled:!!p&&e.id!==j?.id,"aria-pressed":j?.id===e.id,onClick:()=>{v(e.id),w(!1),E(void 0),b(!1),g(`once`)},children:e.title},e.id))}),j&&e.status===`active`?(0,Q.jsx)(Y,{variant:`ghost`,disabled:a,onClick:z,children:i?`补充这件事的要求`:`Add a preference for this task`}):null,j?.entries.map(e=>(0,Q.jsxs)(`div`,{className:`border-l border-edge pl-3 text-xs text-fg-muted`,children:[(0,Q.jsx)(`time`,{children:new Date(e.createdAt).toLocaleString(i?`zh-CN`:`en-US`)}),(0,Q.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.text})]},e.id)),j?.feedback.filter(e=>e.status===`active`).map(e=>(0,Q.jsxs)(`div`,{className:`rounded-lg bg-surface-inset p-2 text-xs text-fg`,children:[(0,Q.jsx)(`p`,{children:e.text}),(0,Q.jsx)(`p`,{className:`text-fg-muted`,children:e.scope===`once`?i?`仅这一次`:`Just this time`:e.scope===`project`?i?`这个项目都适用`:`This project`:i?`以后这类事都适用`:`Similar future work`}),(0,Q.jsx)(Y,{disabled:a,variant:`ghost`,onClick:()=>void L(async()=>{await R({kind:`retract`,topicId:j.id,feedbackId:e.id})}),children:i?`撤回要求`:`Retract preference`})]},e.id)),j?.trials.map(e=>(0,Q.jsxs)(Y,{variant:`ghost`,onClick:()=>E(e.taskId),children:[i?`查看尝试结果:`:`Review attempt: `,e.title]},e.taskId)),j?(0,Q.jsx)(Y,{variant:`ghost`,disabled:a,onClick:()=>w(!0),children:i?`不再参考这件事`:`Stop using this work history`}):null,C&&j?(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-edge p-3`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:i?`清除关于这件事的理解和要求,以后不再参考这段工作记录。原始记录、已有任务和自动化保留。`:`Forget this understanding and saved preferences, and exclude this work history. Original records, tasks and automations remain.`}),(0,Q.jsx)(Y,{disabled:a,onClick:()=>void L(async()=>{await R({kind:`forget`,topicId:j.id}),v(void 0),w(!1),m(``),b(!1),E(void 0)}),children:i?`确认不再参考`:`Confirm exclusion`}),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>w(!1),children:i?`取消`:`Cancel`})]}):null]})]}):null]}):null]})}var Ke=new Set([`started`,`discussing`,`completed`]);function qe(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[0,1,2].map(Je)}),e[0]=t):t=e[0],t}function Je(e){return(0,Q.jsxs)(`div`,{className:`space-y-2 rounded-xl border border-edge-subtle p-4`,children:[(0,Q.jsx)(V,{className:`h-4 w-24 rounded`}),(0,Q.jsx)(V,{className:`h-5 w-4/5 rounded`}),(0,Q.jsx)(V,{className:`h-4 w-3/5 rounded`})]},e)}function Ye(e){let t=(0,X.c)(11),{open:n,refreshKey:r,onOpenChange:i,onReevaluate:a}=e,o=u(Xe),s=f(o).projectsPage.home,l=c(),[d,b]=(0,Z.useState)(`all`),x;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[0]=x):x=t[0];let[C,w]=(0,Z.useState)(x),[T,E]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(),N;t[1]===n?N=t[2]:(N=()=>{if(!n)return;let e=!0;return E(!0),M(void 0),J().then(t=>{e&&w(t.items)}).catch(t=>{e&&M(t instanceof Error?t.message:String(t))}).finally(()=>{e&&E(!1)}),()=>{e=!1}},t[1]=n,t[2]=N);let P;t[3]!==n||t[4]!==r?(P=[n,r],t[3]=n,t[4]=r,t[5]=P):P=t[5],(0,Z.useEffect)(N,P);let I=C.filter(e=>d===`all`||(d===`adopted`?Ke.has(e.status):!Ke.has(e.status))),L=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}),R=new Intl.DateTimeFormat(o===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,timeStyle:`short`}),B=new Map;for(let e of I){let t=L.format(new Date(e.updatedAt));B.set(t,[...B.get(t)??[],e])}let V=[...B.entries()],H=e=>e.feedbackKind===`already_done`?s.advisorHistoryStatusCompleted:e.feedbackKind===`irrelevant`?s.advisorHistoryStatusIrrelevant:e.feedbackKind===`source_incorrect`?s.advisorHistoryStatusSourceIncorrect:e.feedbackKind===`less_like_this`?s.advisorHistoryStatusLessLikeThis:{available:s.advisorHistoryStatusAvailable,started:s.advisorHistoryStatusStarted,discussing:s.advisorHistoryStatusDiscussing,completed:s.advisorHistoryStatusCompleted,snoozed:s.advisorHistoryStatusSnoozed,dismissed:s.advisorHistoryStatusDismissed,expired:s.advisorHistoryStatusExpired,superseded:s.advisorHistoryStatusSuperseded}[e.status],U=e=>{if(e.href){i(!1),l(A(`/`,e.href));return}e.status===`discussing`&&(i(!1),l(`/chat/new?${new URLSearchParams({draft:e.opportunity.actionPrompt}).toString()}`))},W;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),t[6]=W):W=t[6];let G;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Q.jsx)(k,{className:`mt-0.5 size-5 shrink-0 text-accent`,"aria-hidden":!0}),t[7]=G):G=t[7];let K;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0}),t[8]=K):K=t[8];let ee=T?(0,Q.jsx)(qe,{}):j?(0,Q.jsxs)(`div`,{className:`rounded-xl border border-danger/25 bg-danger-soft p-4 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:s.advisorHistoryLoadFailed}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`mt-2`,onClick:()=>i(!1),children:s.advisorHistoryClose})]}):V.length===0?(0,Q.jsxs)(`div`,{className:`py-16 text-center`,children:[(0,Q.jsx)(k,{className:`mx-auto size-6 text-fg-subtle`,"aria-hidden":!0}),(0,Q.jsx)(`p`,{className:`mt-3 text-sm font-medium text-fg`,children:s.advisorHistoryEmpty}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:s.advisorHistoryEmptyHint})]}):(0,Q.jsx)(`div`,{className:`space-y-6`,children:V.map(e=>{let[t,n]=e;return(0,Q.jsxs)(`section`,{"aria-label":t,children:[(0,Q.jsx)(`h3`,{className:`mb-2 text-xs font-medium text-fg-subtle`,children:t}),(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(e=>{let t=!!e.href||e.status===`discussing`,n=[`snoozed`,`dismissed`,`expired`,`superseded`].includes(e.status);return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-base p-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-accent`,children:H(e)}),(0,Q.jsx)(`h4`,{className:`mt-1.5 text-sm font-semibold leading-5 text-fg`,children:e.opportunity.title}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:e.opportunity.outcome})]}),(0,Q.jsx)(`time`,{className:`shrink-0 text-[11px] text-fg-subtle`,dateTime:new Date(e.updatedAt).toISOString(),children:R.format(new Date(e.updatedAt))})]}),e.snoozedUntil?(0,Q.jsxs)(`p`,{className:`mt-2 inline-flex items-center gap-1 text-xs text-fg-muted`,children:[(0,Q.jsx)(D,{className:`size-3.5`,"aria-hidden":!0}),s.advisorHistoryReturnsAt,` `,R.format(new Date(e.snoozedUntil))]}):null,(0,Q.jsxs)(`details`,{className:`group mt-3`,children:[(0,Q.jsxs)(`summary`,{className:`flex min-h-8 cursor-pointer list-none items-center gap-1 text-xs font-medium text-fg-muted hover:text-fg`,children:[s.advisorHistoryEvidence,(0,Q.jsx)(S,{className:`size-3.5 transition-transform duration-200 group-open:rotate-180 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,Q.jsx)(ze,{opportunity:e.opportunity,onOpen:()=>i(!1)})]}),t||n?(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[t?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`min-h-9 text-xs`,onClick:()=>U(e),children:[(0,Q.jsx)(O,{className:`size-3.5`,"aria-hidden":!0}),e.status===`discussing`?s.advisorHistoryContinueDiscussion:s.advisorHistoryViewProgress]}):null,n?(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`min-h-9 text-xs`,onClick:()=>{i(!1),a()},children:[(0,Q.jsx)(F,{className:`size-3.5`,"aria-hidden":!0}),s.advisorHistoryReevaluate]}):null]}):null]},e.opportunity.id)})})]},t)})}),q;return t[9]===ee?q=t[10]:(q=(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-4`,children:ee}),t[9]=ee,t[10]=q),(0,Q.jsx)(y,{open:n,onOpenChange:i,children:(0,Q.jsxs)(g,{children:[W,(0,Q.jsxs)(_,{className:`xopc-drawer-right fixed right-0 top-0 z-[90] flex size-full max-w-lg flex-col overflow-hidden border-l border-edge bg-surface-overlay shadow-popover outline-none`,"aria-describedby":`home-advisor-history-description`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-3 border-b border-edge px-5 py-4`,children:[G,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:s.advisorHistoryTitle}),(0,Q.jsx)(m,{id:`home-advisor-history-description`,className:`mt-1 text-xs leading-5 text-fg-muted`,children:s.advisorHistoryDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`-mr-2 size-9 shrink-0 p-0`,"aria-label":s.advisorHistoryClose,children:K})})]}),(0,Q.jsx)(`div`,{className:`shrink-0 border-b border-edge-subtle px-5 py-3`,children:(0,Q.jsx)(Ce,{className:`inline-flex rounded-lg bg-surface-inset p-1`,role:`group`,"aria-label":s.advisorHistoryFilterLabel,indicatorClassName:`rounded-md bg-surface-panel shadow-surface`,children:[[`all`,s.advisorHistoryFilterAll],[`adopted`,s.advisorHistoryFilterAdopted],[`other`,s.advisorHistoryFilterOther]].map(e=>{let[t,n]=e;return(0,Q.jsx)(`button`,{type:`button`,className:`min-h-9 rounded-md px-3 text-xs font-medium transition-colors duration-150 ${d===t?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:text-fg`}`,"aria-pressed":d===t,onClick:()=>b(t),children:n},t)})})}),q]})]})})}function Xe(e){return e.language}function Ze(e,t){return e.replace(`{{count}}`,String(t))}function Qe(e,t){if(e.state===`disabled`)return null;if(e.state===`ready`){let n=1+e.alternatives.length;return{label:Ze(t.ready,n),detail:e.primary.title,tone:`accent`,refreshing:!!e.stale}}return e.state===`clarification`?{label:t.clarification,detail:e.question.question,tone:`accent`,refreshing:!1}:e.state===`refreshing`?{label:t.refreshing,detail:e.previous?.title??t.refreshingDetail,tone:`accent`,refreshing:!0}:e.reason===`generation_failed`?{label:t.generationFailed,detail:t.generationFailedDetail,tone:`danger`,refreshing:!1}:e.reason===`budget_exhausted`?{label:t.budgetExhausted,detail:t.budgetExhaustedDetail,tone:`warning`,refreshing:!1}:e.reason===`model_unavailable`?{label:t.modelUnavailable,detail:t.modelUnavailableDetail,tone:`warning`,refreshing:!1}:{label:t.idle,detail:t.idleDetail,tone:`neutral`,refreshing:!1}}var $e={accent:`bg-accent`,danger:`bg-danger`,neutral:`bg-fg-subtle`,warning:`bg-warning`};function et(e){let t=(0,X.c)(50),{advisor:n,busy:r,copy:i,onOpenHistory:a,onRefresh:o}=e,[s,c]=(0,Z.useState)(!1),l;t[0]!==n||t[1]!==i?(l=Qe(n,i),t[0]=n,t[1]=i,t[2]=l):l=t[2];let u=l;if(!u)return null;let d=n.state!==`refreshing`,f=n.state===`ready`?i.findAnother:i.retry,p=`${i.label}:${u.label}`,m;t[3]===u.refreshing?m=t[4]:(m=u.refreshing?(0,Q.jsx)(F,{className:`size-3.5 shrink-0 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(R,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[3]=u.refreshing,t[4]=m);let h=$e[u.tone],g;t[5]===h?g=t[6]:(g=B(`size-1.5 shrink-0 rounded-full`,h),t[5]=h,t[6]=g);let _;t[7]===g?_=t[8]:(_=(0,Q.jsx)(`span`,{className:g,"aria-hidden":!0}),t[7]=g,t[8]=_);let v;t[9]!==i.label||t[10]!==u.label?(v=(0,Q.jsxs)(`span`,{className:`truncate`,children:[i.label,` · `,u.label]}),t[9]=i.label,t[10]=u.label,t[11]=v):v=t[11];let y;t[12]!==p||t[13]!==m||t[14]!==_||t[15]!==v?(y=(0,Q.jsx)(ue,{asChild:!0,children:(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-9 max-w-56 rounded-lg px-2.5`,"aria-label":p,children:[m,_,v]})}),t[12]=p,t[13]=m,t[14]=_,t[15]=v,t[16]=y):y=t[16];let b;t[17]===u.refreshing?b=t[18]:(b=(0,Q.jsx)(`span`,{className:`mt-1 flex size-7 shrink-0 items-center justify-center rounded-lg bg-accent-soft text-accent`,children:u.refreshing?(0,Q.jsx)(F,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":!0})}),t[17]=u.refreshing,t[18]=b);let x;t[19]===u.label?x=t[20]:(x=(0,Q.jsx)(`p`,{className:`font-semibold text-fg`,children:u.label}),t[19]=u.label,t[20]=x);let S;t[21]===u.detail?S=t[22]:(S=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:u.detail}),t[21]=u.detail,t[22]=S);let C;t[23]!==x||t[24]!==S?(C=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[x,S]}),t[23]=x,t[24]=S,t[25]=C):C=t[25];let w;t[26]!==C||t[27]!==b?(w=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[b,C]}),t[26]=C,t[27]=b,t[28]=w):w=t[28];let T;t[29]===a?T=t[30]:(T=()=>{c(!1),a()},t[29]=a,t[30]=T);let E;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(k,{className:`size-3.5`,"aria-hidden":!0}),t[31]=E):E=t[31];let D;t[32]!==i.history||t[33]!==T?(D=(0,Q.jsxs)(Y,{type:`button`,variant:`ghost`,className:`h-9 rounded-lg text-xs`,onClick:T,children:[E,i.history]}),t[32]=i.history,t[33]=T,t[34]=D):D=t[34];let O;t[35]!==r||t[36]!==d||t[37]!==o||t[38]!==f?(O=d?(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg text-xs`,disabled:r,onClick:()=>{c(!1),o()},children:[(0,Q.jsx)(F,{className:`size-3.5`,"aria-hidden":!0}),f]}):null,t[35]=r,t[36]=d,t[37]=o,t[38]=f,t[39]=O):O=t[39];let A;t[40]!==D||t[41]!==O?(A=(0,Q.jsxs)(`div`,{className:`mt-4 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:[D,O]}),t[40]=D,t[41]=O,t[42]=A):A=t[42];let j;t[43]!==w||t[44]!==A?(j=(0,Q.jsx)(se,{children:(0,Q.jsxs)(ce,{side:`bottom`,align:`end`,sideOffset:6,className:`z-[70] w-[min(21rem,calc(100vw-1.5rem))] rounded-xl border border-edge bg-surface-overlay p-4 text-sm text-fg shadow-popover outline-none`,onOpenAutoFocus:tt,children:[w,A]})}),t[43]=w,t[44]=A,t[45]=j):j=t[45];let M;return t[46]!==s||t[47]!==j||t[48]!==y?(M=(0,Q.jsxs)(le,{open:s,onOpenChange:c,children:[y,j]}),t[46]=s,t[47]=j,t[48]=y,t[49]=M):M=t[49],M}function tt(e){return e.preventDefault()}var nt=(0,Z.lazy)(()=>i(()=>import(`./workspace-file-preview-dialog-NffP-UXC.js`).then(e=>e.n).then(e=>({default:e.WorkspaceFilePreviewPanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76])));function rt(e){let t=(0,X.c)(31),{item:n,language:r,primary:i,showNew:a,onOpen:o}=e,s=a!==void 0&&a,c;t[0]===r?c=t[1]:(c=f(r),t[0]=r,t[1]=c);let l=c.projectsPage.home.workbench,u;t[2]===n.title?u=t[3]:(u=(0,Q.jsx)(`p`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[2]=n.title,t[3]=u);let d;t[4]!==l.newDelivery||t[5]!==s?(d=s?(0,Q.jsx)(`span`,{className:`mr-2 font-medium text-accent-fg`,children:l.newDelivery}):null,t[4]=l.newDelivery,t[5]=s,t[6]=d):d=t[6];let p;t[7]===n.completedAt?p=t[8]:(p=new Date(n.completedAt).toISOString(),t[7]=n.completedAt,t[8]=p);let m;t[9]!==n.completedAt||t[10]!==r?(m=Ee(new Date(n.completedAt),r),t[9]=n.completedAt,t[10]=r,t[11]=m):m=t[11];let h;t[12]!==p||t[13]!==m?(h=(0,Q.jsx)(`time`,{dateTime:p,children:m}),t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]!==d||t[16]!==h?(g=(0,Q.jsxs)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:[d,h]}),t[15]=d,t[16]=h,t[17]=g):g=t[17];let _;t[18]===n.summary?_=t[19]:(_=n.summary?(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-1 break-words text-xs text-fg-muted`,children:n.summary}):null,t[18]=n.summary,t[19]=_);let v;t[20]!==u||t[21]!==g||t[22]!==_?(v=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-48`,children:[u,g,_]}),t[20]=u,t[21]=g,t[22]=_,t[23]=v):v=t[23];let y=i?`primary`:`secondary`,b;t[24]!==l.openDelivery||t[25]!==o||t[26]!==y?(b=(0,Q.jsx)(Y,{variant:y,className:`min-h-9 shrink-0 px-2.5 text-xs shadow-none`,onClick:o,children:l.openDelivery}),t[24]=l.openDelivery,t[25]=o,t[26]=y,t[27]=b):b=t[27];let x;return t[28]!==v||t[29]!==b?(x=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-3 py-3 sm:px-4`,children:[v,b]}),t[28]=v,t[29]=b,t[30]=x):x=t[30],x}function it({view:e,items:t,language:n,onSelect:r,onClose:i,onRead:a,onOpenFull:o,onRestoreFocus:s}){let c=f(n).projectsPage.home,[l,u]=(0,Z.useState)(!1),[d,m]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(null),S=(0,Z.useRef)(!1),C=e&&e!==`history`?e:null,{data:w,error:T,mutate:E}=W(C?[`home-delivery`,C.id]:null,async()=>{if(!C)return;if(C.kind===`automation`){let{run:e}=await ye.getRun(C.subjectId);return{kind:`automation`,summary:e.summary}}let e=await q(C.subjectId),t=e.receipts.find(e=>`task:${e.runId}`===C.id);if(!t)throw Error(c.workbench.deliveryFailed);return{kind:`task`,detail:e,receipt:t}},{shouldRetryOnError:!1}),D=w?.kind===`task`||!!w?.summary?.trim();async function O(e){if(!S.current){S.current=!0,u(!0),m(!1);try{e.kind===`automation`&&!e.read&&await ye.markRunRead(e.subjectId),a(e)}catch{m(!0)}finally{S.current=!1,u(!1)}}}return(0,Q.jsx)(y,{open:e!==null,onOpenChange:e=>{!e&&!S.current&&(m(!1),i())},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(36rem,calc(100dvh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay outline-none`,"aria-describedby":void 0,onCloseAutoFocus:e=>{e.preventDefault(),s()},children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-edge px-4 py-3`,children:[(0,Q.jsx)(v,{className:`truncate text-base font-semibold text-fg`,children:C?.title??c.workbench.deliveryHistory}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{variant:`ghost`,className:`size-9 p-0`,disabled:l,"aria-label":n===`zh`?`关闭`:`Close`,children:(0,Q.jsx)(z,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:e===`history`?t.length?(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:t.map(e=>(0,Q.jsx)(rt,{item:e,language:n,onOpen:()=>{m(!1),r(e)}},e.id))}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.deliveryEmpty}):T?(0,Q.jsxs)(`div`,{role:`alert`,className:`space-y-2 text-sm text-danger`,children:[(0,Q.jsx)(`p`,{children:c.workbench.deliveryFailed}),(0,Q.jsx)(Y,{variant:`secondary`,onClick:()=>void E(),children:c.retry})]}):w?w.kind===`task`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(je,{content:w.receipt.summary,contentKey:w.receipt.runId,language:n}),(0,Q.jsx)(Me,{evidence:w.receipt.evidence,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId??void 0,language:n,onOpenFile:x}),(0,Q.jsx)(y,{open:b!==null,onOpenChange:e=>{e||x(null)},children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`fixed inset-0 z-[90] bg-scrim`}),(0,Q.jsxs)(_,{className:`fixed left-1/2 top-1/2 z-[100] flex h-[min(54rem,calc(100dvh-2rem))] w-[min(72rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel outline-none`,"aria-describedby":void 0,children:[(0,Q.jsx)(v,{className:`sr-only`,children:b}),(0,Q.jsx)(Z.Suspense,{fallback:(0,Q.jsx)(V,{className:`m-4 min-h-24`}),children:(0,Q.jsx)(nt,{filePath:b,projectId:w.detail.task.projectId,conversationId:w.detail.conversation.activeConversationId,onClose:()=>x(null)})})]})]})})]}):w.kind===`automation`&&w.summary?(0,Q.jsx)(j,{content:w.summary}):(0,Q.jsx)(`p`,{className:`text-sm text-fg-muted`,children:c.workbench.noSummary}):(0,Q.jsxs)(`div`,{className:`space-y-3`,"aria-busy":!0,children:[(0,Q.jsx)(V,{className:`h-5 w-2/3`}),(0,Q.jsx)(V,{className:`h-24`})]})}),C?(0,Q.jsxs)(`footer`,{className:`shrink-0 space-y-2 border-t border-edge px-4 py-3`,children:[d?(0,Q.jsx)(`p`,{role:`alert`,className:`text-sm text-danger`,children:c.workbench.readFailed}):null,(0,Q.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,Q.jsx)(Y,{variant:`ghost`,disabled:l,onClick:()=>o(C),children:c.workbench.openFullResult}),(0,Q.jsx)(Y,{variant:`primary`,disabled:!!T||!D||l,onClick:()=>void O(C),children:c.workbench.markRead})]})]}):null]})]})})}function at(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}var ot=`xopc-home-read-deliveries`;function st(){try{let e=JSON.parse(localStorage.getItem(ot)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`).slice(0,300):[]}catch{return[]}}function ct(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(`div`,{className:`space-y-8`,"aria-busy":!0,children:[(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(V,{className:`h-10 w-3/5 rounded-xl`}),(0,Q.jsx)(V,{className:`h-5 w-4/5 rounded-lg`})]}),(0,Q.jsx)(V,{className:`h-64 rounded-2xl`}),(0,Q.jsx)(V,{className:`h-32 rounded-xl`})]}),e[0]=t):t=e[0],t}function lt(e){let t=(0,X.c)(91),{item:n,busy:r,primary:i,dueLabel:a,failureLabel:s,locale:c,onAction:l,onComplete:u,onUpdated:d}=e,[p,m]=o(),h;t[0]===n.openAction?h=t[1]:(h=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=h);let g=h,_=n.primaryAction?.type===`task_review`?n.primaryAction.taskId:g?decodeURIComponent(g[1]):void 0,v;t[2]!==_||t[3]!==p?(v=_&&p.get(`reviewTask`)===_,t[2]=_,t[3]=p,t[4]=v):v=t[4];let y=!!v,b;t[5]!==_||t[6]!==p||t[7]!==m?(b=e=>{let t=new URLSearchParams(p);e&&_?t.set(`reviewTask`,_):t.delete(`reviewTask`),m(t)},t[5]=_,t[6]=p,t[7]=m,t[8]=b):b=t[8];let x=b,[S,C]=(0,Z.useState)(!1),w;t[9]===c?w=t[10]:(w=f(c),t[9]=c,t[10]=w);let T=w.projectsPage.home.workbench,E=n.primaryAction?.type===`connector_decision`,D;t[11]!==a||t[12]!==n.dueAt||t[13]!==c?(D=n.dueAt===void 0?null:`${a} ${Ee(n.dueAt,c)}`,t[11]=a,t[12]=n.dueAt,t[13]=c,t[14]=D):D=t[14];let O=D,k;t[15]!==E||t[16]!==n.summary?(k=E?n.summary.split(`
|
|
7
|
-
`)[0]:n.summary,t[15]=E,t[16]=n.summary,t[17]=k):k=t[17];let A;t[18]!==n.projectName||t[19]!==k?(A=[n.projectName,k].filter(Boolean),t[18]=n.projectName,t[19]=k,t[20]=A):A=t[20];let j=A.join(` · `),M=!!(_&&(n.primaryAction?.type===`task_review`||n.primaryAction?.type===`open`)),N;t[21]!==n.id||t[22]!==n.openAction||t[23]!==n.title||t[24]!==l?(N=n.openAction?(0,Q.jsx)(`button`,{type:`button`,className:`break-words text-left text-sm font-semibold text-fg hover:underline`,onClick:()=>l(n.openAction,n.id),children:n.title}):(0,Q.jsx)(`span`,{className:`break-words text-sm font-semibold text-fg`,children:n.title}),t[21]=n.id,t[22]=n.openAction,t[23]=n.title,t[24]=l,t[25]=N):N=t[25];let P;t[26]!==O||t[27]!==s||t[28]!==n.kind?(P=O||n.kind===`failure`?(0,Q.jsx)(`span`,{className:`rounded bg-warning/10 px-1.5 py-0.5 text-xs text-warning`,children:O??s}):null,t[26]=O,t[27]=s,t[28]=n.kind,t[29]=P):P=t[29];let F;t[30]!==N||t[31]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[N,P]}),t[30]=N,t[31]=P,t[32]=F):F=t[32];let I;t[33]===j?I=t[34]:(I=(0,Q.jsx)(`p`,{className:`mt-0.5 line-clamp-2 break-words text-xs text-fg-muted`,children:j}),t[33]=j,t[34]=I);let L;t[35]!==F||t[36]!==I?(L=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-52`,children:[F,I]}),t[35]=F,t[36]=I,t[37]=L):L=t[37];let R;t[38]!==n.primaryAction?.type||t[39]!==c||t[40]!==y||t[41]!==_||t[42]!==x?(R=_&&n.primaryAction?.type===`retry_task`?(0,Q.jsx)(Y,{variant:`ghost`,className:`min-h-9 px-2 text-xs`,"aria-expanded":y,onClick:()=>x(!y),children:c===`zh`?`查看结果与依据`:`View result and evidence`}):null,t[38]=n.primaryAction?.type,t[39]=c,t[40]=y,t[41]=_,t[42]=x,t[43]=R):R=t[43];let z;t[44]!==E||t[45]!==r||t[46]!==M||t[47]!==n.id||t[48]!==n.primaryAction||t[49]!==l||t[50]!==i||t[51]!==y||t[52]!==S||t[53]!==x||t[54]!==T?(z=n.primaryAction?(0,Q.jsx)(Y,{type:`button`,variant:i?`primary`:`secondary`,className:`min-h-9 shrink-0 px-2.5 text-xs shadow-none`,disabled:r,"aria-expanded":E?S:M?y:void 0,onClick:()=>{E?C(dt):M?x(!y):l(n.primaryAction,n.id)},children:E?T.viewScope:n.primaryAction.label}):null,t[44]=E,t[45]=r,t[46]=M,t[47]=n.id,t[48]=n.primaryAction,t[49]=l,t[50]=i,t[51]=y,t[52]=S,t[53]=x,t[54]=T,t[55]=z):z=t[55];let B;t[56]!==R||t[57]!==z?(B=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[R,z]}),t[56]=R,t[57]=z,t[58]=B):B=t[58];let V;t[59]!==L||t[60]!==B?(V=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[L,B]}),t[59]=L,t[60]=B,t[61]=V):V=t[61];let H;t[62]!==E||t[63]!==r||t[64]!==n.id||t[65]!==n.primaryAction||t[66]!==n.secondaryActions||t[67]!==n.summary||t[68]!==l||t[69]!==S?(H=E&&S?(0,Q.jsxs)(`div`,{className:`mt-3 space-y-2 rounded-lg bg-surface-inset px-3 py-2`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-xs text-fg-muted`,children:n.summary}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsx)(Y,{variant:`primary`,disabled:r,onClick:()=>l(n.primaryAction,n.id),children:n.primaryAction?.label}),n.secondaryActions.map(e=>(0,Q.jsx)(Y,{disabled:r,onClick:()=>l(e,n.id),children:e.label},e.label))]})]}):null,t[62]=E,t[63]=r,t[64]=n.id,t[65]=n.primaryAction,t[66]=n.secondaryActions,t[67]=n.summary,t[68]=l,t[69]=S,t[70]=H):H=t[70];let U;t[71]!==E||t[72]!==r||t[73]!==M||t[74]!==n.id||t[75]!==n.secondaryActions||t[76]!==l?(U=!E&&!M&&n.secondaryActions.length?(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:n.secondaryActions.filter(ut).map(e=>(0,Q.jsx)(Y,{variant:`ghost`,disabled:r,onClick:()=>l(e,n.id),children:e.label},e.label))}):null,t[71]=E,t[72]=r,t[73]=M,t[74]=n.id,t[75]=n.secondaryActions,t[76]=l,t[77]=U):U=t[77];let W;t[78]!==c||t[79]!==u||t[80]!==d||t[81]!==y||t[82]!==_||t[83]!==x?(W=y&&_?(0,Q.jsx)(Oe,{taskId:_,language:c,onUpdated:d,onComplete:()=>{x(!1),u()}},_):null,t[78]=c,t[79]=u,t[80]=d,t[81]=y,t[82]=_,t[83]=x,t[84]=W):W=t[84];let G;return t[85]!==r||t[86]!==V||t[87]!==H||t[88]!==U||t[89]!==W?(G=(0,Q.jsxs)(`article`,{className:`px-3 py-3 sm:px-4`,"aria-busy":r,children:[V,H,U,W]}),t[85]=r,t[86]=V,t[87]=H,t[88]=U,t[89]=W,t[90]=G):G=t[90],G}function ut(e){return e.type!==`open`}function dt(e){return!e}function ft(e){let t=(0,X.c)(39),{item:n,onAction:r,language:i,onUpdated:a}=e,[o,s]=(0,Z.useState)(!1),c;t[0]===n.openAction?c=t[1]:(c=n.openAction?.type===`open`?/^\/tasks\/([^/?#]+)/.exec(n.openAction.href):null,t[0]=n.openAction,t[1]=c);let l=c,u=l?decodeURIComponent(l[1]):void 0,d;t[2]!==n.backgroundState||t[3]!==n.kind?(d=n.kind===`scheduled`?(0,Q.jsx)(b,{className:`size-4`,"aria-hidden":!0}):n.backgroundState===`paused`?(0,Q.jsx)(E,{className:`size-4`,"aria-hidden":!0}):(0,Q.jsx)(`span`,{className:`size-1.5 rounded-full bg-fg-subtle`,"aria-hidden":!0}),t[2]=n.backgroundState,t[3]=n.kind,t[4]=d):d=t[4];let f=d,p=!n.openAction,m=u?o:void 0,h;t[5]!==n.id||t[6]!==n.openAction||t[7]!==r||t[8]!==u?(h=()=>u?s(pt):n.openAction&&r(n.openAction,n.id),t[5]=n.id,t[6]=n.openAction,t[7]=r,t[8]=u,t[9]=h):h=t[9];let g;t[10]===f?g=t[11]:(g=(0,Q.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center text-fg-muted`,children:f}),t[10]=f,t[11]=g);let _;t[12]===n.title?_=t[13]:(_=(0,Q.jsx)(`span`,{className:`block line-clamp-2 break-words text-sm font-medium text-fg`,children:n.title}),t[12]=n.title,t[13]=_);let v;t[14]!==n.kind||t[15]!==n.summary||t[16]!==n.updatedAt||t[17]!==i?(v=n.kind===`scheduled`?(0,Q.jsx)(`time`,{className:`block text-xs text-fg-muted`,dateTime:new Date(n.updatedAt).toISOString(),children:Ee(n.updatedAt,i)}):(0,Q.jsx)(`span`,{className:`block truncate text-xs text-fg-muted`,children:n.summary}),t[14]=n.kind,t[15]=n.summary,t[16]=n.updatedAt,t[17]=i,t[18]=v):v=t[18];let y;t[19]!==_||t[20]!==v?(y=(0,Q.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[_,v]}),t[19]=_,t[20]=v,t[21]=y):y=t[21];let x;t[22]===n.openAction?x=t[23]:(x=n.openAction?(0,Q.jsxs)(`span`,{className:`flex shrink-0 items-center gap-0.5 text-xs text-accent-fg`,children:[(0,Q.jsx)(`span`,{children:n.openAction.label}),(0,Q.jsx)(C,{className:`size-3.5`,"aria-hidden":!0})]}):null,t[22]=n.openAction,t[23]=x);let S;t[24]!==x||t[25]!==p||t[26]!==m||t[27]!==h||t[28]!==g||t[29]!==y?(S=(0,Q.jsxs)(`button`,{type:`button`,className:`flex min-h-11 w-full items-center gap-2 rounded-md px-1 py-2 text-left hover:bg-surface-hover focus-visible:ring-2 focus-visible:ring-accent`,disabled:p,"aria-expanded":m,onClick:h,children:[g,y,x]}),t[24]=x,t[25]=p,t[26]=m,t[27]=h,t[28]=g,t[29]=y,t[30]=S):S=t[30];let w;t[31]!==o||t[32]!==i||t[33]!==a||t[34]!==u?(w=u&&o?(0,Q.jsx)(Oe,{taskId:u,language:i,onUpdated:a,onComplete:()=>s(!1)}):null,t[31]=o,t[32]=i,t[33]=a,t[34]=u,t[35]=w):w=t[35];let T;return t[36]!==S||t[37]!==w?(T=(0,Q.jsxs)(`div`,{children:[S,w]}),t[36]=S,t[37]=w,t[38]=T):T=t[38],T}function pt(e){return!e}function mt(){let e=u(e=>e.language),t=f(e),n=t.projectsPage,r=he(e),i=c(),o=a(),s=ve(e=>e.setPageHeader),l=ve(e=>e.clearPageHeader),[d,b]=(0,Z.useState)(!1),{home:C,loading:T,loadError:E,setLoadError:D,load:O}=Pe(e,o.key,!0),k=n.home.workbench,j=(0,Z.useRef)(null),[M,N]=(0,Z.useState)(null),[F,L]=(0,Z.useState)(st),B=(0,Z.useRef)(null),[V,H]=(0,Z.useState)(!1),[U,W]=(0,Z.useState)(!1),[q,J]=(0,Z.useState)(``),te=(0,Z.useRef)(!1),[se,ce]=(0,Z.useState)(),[le,ue]=(0,Z.useState)(!1),[de,me]=(0,Z.useState)(null),[ye,xe]=(0,Z.useState)(!1),[Ce,Oe]=(0,Z.useState)(),[ke,Ae]=(0,Z.useState)(!1),[je,Me]=(0,Z.useState)(0),[Ne,X]=(0,Z.useState)(),[Fe,Le]=(0,Z.useState)(),[Re,ze]=(0,Z.useState)(!1),$=Se({chat:t.chat}),Be=(0,Z.useRef)(null),Ve=_e({disabled:Re,chat:t.chat,onTranscript:e=>{J(t=>fe(t,e)),window.setTimeout(()=>Be.current?.focus(),0)}}),{phase:He,voiceActive:We,startVoiceInput:Ke,cancelVoiceInput:qe,confirmVoiceInput:Je,retryVoiceInput:Xe}=Ve;(0,Z.useEffect)(()=>{if(!Ne)return;let e=window.setTimeout(()=>X(void 0),8e3);return()=>window.clearTimeout(e)},[Ne]);let Ze=(0,Z.useCallback)(async e=>{if(!(e.length===0||Re)){ze(!0);try{await $.processFiles(e)}finally{ze(!1)}}},[Re,$.processFiles]),Qe=(0,Z.useCallback)(async e=>{let t=pe(e.clipboardData);t.length!==0&&(e.preventDefault(),await Ze(t))},[Ze]),$e=(0,Z.useCallback)(e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,$.setIsDragging(!0))},[$.setIsDragging]),tt=(0,Z.useCallback)(e=>{let t=e.relatedTarget;(!(t instanceof Node)||!e.currentTarget.contains(t))&&$.setIsDragging(!1)},[$.setIsDragging]),nt=(0,Z.useCallback)(async e=>{e.preventDefault(),$.setIsDragging(!1),await Ze(Array.from(e.dataTransfer.files))},[$.setIsDragging,Ze]),ut=(0,Z.useCallback)(e=>{e.preventDefault();let t=$.wireAttachmentsPayload(),n=t.length>0?ge(t):void 0,r=be(q,n,{projectScope:`none`});r&&(W(!1),J(``),$.clearAttachments(),i(r))},[$.clearAttachments,$.wireAttachmentsPayload,q,i]),dt=$.attachments.length>=10,pt={attachTitle:dt?at(t.chat.maxAttachmentsReached,{max:10}):`${t.chat.attachFile} (${$.attachments.length}/10)`,dropFiles:t.chat.dropFiles,intentLabel:r.intentLabel,intentPlaceholder:r.intentPlaceholder,intentSuggestion:r.intentSuggestion,shortcut:n.home.submitShortcut,submit:r.newWork},mt=(0,Z.useMemo)(()=>({label:n.home.advisorStatusLabel,ready:n.home.advisorStatusReady,clarification:n.home.advisorStatusClarification,refreshing:n.home.advisorStatusRefreshing,refreshingDetail:n.home.advisorRefreshing,idle:n.home.advisorStatusIdle,idleDetail:n.home.advisorUnavailableTitle,generationFailed:n.home.advisorStatusGenerationFailed,budgetExhausted:n.home.advisorStatusBudgetExhausted,modelUnavailable:n.home.advisorStatusModelUnavailable,generationFailedDetail:n.home.advisorGenerationFailed,budgetExhaustedDetail:n.home.advisorBudgetExhausted,modelUnavailableDetail:n.home.advisorModelUnavailable,history:n.home.advisorHistory,retry:n.home.retry,findAnother:n.home.advisorRefresh}),[n.home]),ht=(C?.recentDeliveries??[]).map(e=>F.includes(e.id)?{...e,read:!0}:e),gt=Date.now(),_t=ht.filter(e=>!e.read&&e.completedAt>=gt-10080*6e4),vt=C?.resumable??[],yt=(C?.needsUser.length??0)+(C?.attentionPolicy?.suppressedAttentionCount??0)+(C?.attentionPolicy?.suppressedDecisionCount??0),bt=new Date(gt);bt.setHours(24,0,0,0);let xt=C?.needsUser.filter(e=>e.dueAt!==void 0&&e.dueAt>=gt&&e.dueAt<bt.getTime()).length??0,St=C?.background??[],Ct=St.filter(e=>e.kind!==`scheduled`),wt=St.filter(e=>e.kind===`scheduled`),Tt=C?.advisor.state===`ready`||C?.advisor.state===`clarification`||!!Ce;(0,Z.useEffect)(()=>{if(!Ce)return;let e=window.setTimeout(()=>Oe(void 0),8e3);return()=>window.clearTimeout(e)},[Ce]);let Et=C?yt>0?`attention`:_t.length>0?`delivery`:vt.length>0||Ct.length>0||C.runningConversations?.length||Tt?`resume`:`idle`:void 0,Dt=Et===`idle`,Ot=Dt&&!U,kt=Ot||U,At=(0,Z.useRef)(Et),jt=(0,Z.useRef)(!1);(0,Z.useLayoutEffect)(()=>{let e=At.current;if(At.current=Et,!e||!Et||Et===e||(jt.current&&(jt.current=!1,document.activeElement===document.body&&j.current?.focus({preventScroll:!0})),window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches))return;let t=j.current?.animate?.([{opacity:.7,transform:`translateY(4px)`},{opacity:1,transform:`translateY(0)`}],{duration:180,easing:`ease-out`});return()=>t?.cancel()},[Et]),(0,Z.useEffect)(()=>{let e=e=>{(e.key===ot||e.key===null)&&L(st())};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]);let Mt=(0,Z.useCallback)(e=>{L(t=>[...new Set([e,...t])].slice(0,300));try{localStorage.setItem(ot,JSON.stringify([...new Set([e,...st()])].slice(0,300)))}catch{}},[]);(0,Z.useEffect)(()=>{!kt&&We&&qe()},[qe,kt,We]),(0,Z.useEffect)(()=>{let e=e=>{let t=e.detail?.target;t&&t!==`chat`||!kt||Re||(e.preventDefault(),He===`recording`?Je():He===`idle`?(Be.current?.focus(),Ke()):He===`error`&&Xe())},t=e=>{let t=e.detail?.target;t&&t!==`chat`||!kt||!We||(e.preventDefault(),qe(),Be.current?.focus())};return window.addEventListener(Te,e),window.addEventListener(we,t),()=>{window.removeEventListener(Te,e),window.removeEventListener(we,t)}},[Re,qe,kt,Je,Xe,Ke,We,He]);let Nt=(0,Z.useCallback)(e=>{e||qe(),W(e)},[qe]),Pt=(0,Z.useCallback)((t,n)=>{if(t.type===`open`){i(A(`/`,t.href));return}if(t.type===`task_review`||te.current)return;te.current=!0,me(n);let r=C?.needsUser.findIndex(e=>e.id===n)??-1,a=r<0?void 0:{item:C?.needsUser[r],slot:r};ce(void 0),D(null),(async()=>{try{if(t.type===`retry_task`)await De(t.taskId,e),ce({...a,message:e===`zh`?`任务已重新开始,可查看执行进度。`:`Task restarted. View progress.`,href:A(`/`,`/tasks/${encodeURIComponent(t.taskId)}`)});else if(t.type===`connector_decision`)await oe({kind:`connector_approval`,approvalId:t.approvalId},t.decision),ce({...a,message:e===`zh`?t.decision===`approve`?`已批准授权,任务状态将自动更新。`:`已拒绝授权。`:t.decision===`approve`?`Permission approved. Task status will update.`:`Permission denied.`});else if(t.type===`retry_run`){let n=await K({kind:t.subjectKind,runId:t.runId});ce({...a,message:e===`zh`?`已发起重试,可查看新的执行结果。`:`Retry started. Follow the new execution.`,href:n.conversationId?`/chat/${encodeURIComponent(n.conversationId)}`:`/automations?run=${encodeURIComponent(n.runId)}`})}else t.type===`acknowledge_run`&&(await re({kind:t.subjectKind,runId:t.runId}),ce({...a,message:e===`zh`?`已确认此异常,已从待处理事项移除。`:`Issue acknowledged and removed from pending items.`}));jt.current=!0,await O()}catch(e){D(e instanceof Error?e.message:String(e))}finally{te.current=!1,me(null)}})()},[C,e,O,i]),Ft=(0,Z.useCallback)((t,n)=>{let r=t.task.phase===`closed`&&t.task.resolution===`done`?ne(t):void 0;r&&Mt(`task:${r.runId}`),jt.current=!0;let i=n?C?.needsUser.findIndex(e=>e.id===n.id):void 0;ce({item:n,slot:i,message:e===`zh`?t.task.phase===`closed`?`任务已验收完成。`:`操作已保存,任务状态已更新。`:t.task.phase===`closed`?`Task accepted.`:`Action saved. Task status updated.`,href:A(`/`,`/tasks/${encodeURIComponent(t.task.id)}`)}),O()},[C,e,O,Mt]),It=(0,Z.useCallback)(()=>{xe(!0),Oe(void 0),Le(void 0),D(null),ie(e).then(()=>O()).catch(e=>D(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[e,O]),Lt=(0,Z.useCallback)((e,t)=>{xe(!0),D(null),ee(e,t).then(async t=>{if(t.outcome===`needs_setup`){Le({opportunityId:e.id,value:t.preflight});return}if(Le(void 0),Me(e=>e+1),t.outcome===`task`){Oe({title:n.home.advisorStartedTitle,detail:at(n.home.advisorStartedDetail,{title:e.title}),href:A(`/`,t.href)}),await O();return}i(t.href)}).catch(e=>D(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[O,i,n.home.advisorStartedDetail,n.home.advisorStartedTitle]),Rt=(0,Z.useCallback)((e,t)=>{xe(!0),Oe(void 0),Le(void 0),D(null),G(e,{kind:t,snoozedUntil:t===`too_early`?Date.now()+4320*6e4:void 0}).then(({idempotencyKey:t})=>(X({opportunityId:e.id,idempotencyKey:t}),Me(e=>e+1),O())).catch(e=>D(e instanceof Error?e.message:String(e))).finally(()=>xe(!1))},[O]),zt=(0,Z.useCallback)(()=>{if(!Ne)return;let e=Ne;X(void 0),xe(!0),D(null),ae(e.opportunityId,e.idempotencyKey).then(()=>(Me(e=>e+1),O())).catch(t=>{X(e),D(t instanceof Error?t.message:String(t))}).finally(()=>xe(!1))},[Ne,O]),Bt=(0,Z.useCallback)((e,t)=>{i(`/chat/new?${new URLSearchParams({draft:`${e}\n\n${t}`}).toString()}`)},[i]),Vt=(0,Z.useMemo)(()=>(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[C&&!Dt?(0,Q.jsx)(et,{advisor:C.advisor,busy:ye,copy:mt,onOpenHistory:()=>Ae(!0),onRefresh:It}):null,Dt?null:(0,Q.jsxs)(Y,{type:`button`,variant:`secondary`,className:`h-9 rounded-lg`,onClick:()=>W(!0),children:[(0,Q.jsx)(P,{className:`size-4`,"aria-hidden":!0}),r.newWork]})]}),[ye,mt,r.newWork,C,Dt,It]);(0,Z.useLayoutEffect)(()=>(s({startExtra:null,main:(0,Q.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),end:Vt}),()=>l()),[l,Vt,s,n.title]);let Ht=e=>{B.current=document.activeElement instanceof HTMLElement?document.activeElement:null,N(e)},Ut=e=>{Mt(e.id),N(null),ce({message:k.deliverySaved}),O()},Wt=d?C?.needsUser??[]:C?.needsUser.slice(0,2)??[],Gt=yt-Wt.length,Kt=se?.item&&!C?.needsUser.some(e=>e.id===se.item?.id)&&(se.slot??1/0)<2?se.item:void 0,qt=[...Wt];Kt&&qt.splice(se?.slot??0,0,Kt);let Jt=(C?.runningConversations??[]).map(t=>({id:t.runId,kind:`running`,title:t.title??(e===`zh`?`对话正在执行`:`Conversation in progress`),summary:k.inProgress,updatedAt:t.updatedAt,secondaryActions:[],openAction:{type:`open`,label:k.inProgress,href:`/chat/${encodeURIComponent(t.conversationId)}`}})),Yt=[...Ct,...Jt].sort((e,t)=>t.updatedAt-e.updatedAt),Xt=Et===`attention`&&!Ce&&!V,Zt=C?.advisor.state===`ready`?C.advisor.primary.title:C?.advisor.state===`clarification`?C.advisor.question.question:void 0,Qt=_t.length>0?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-delivery-title`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center justify-between gap-x-3`,children:[(0,Q.jsx)(`h2`,{id:`home-delivery-title`,className:`text-base font-semibold text-fg`,children:k.progress}),(0,Q.jsx)(Y,{variant:`ghost`,className:`px-2 text-xs`,onClick:()=>Ht(`history`),children:k.deliveryHistory})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-panel`,children:_t.slice(0,Et===`attention`?1:3).map((t,n)=>(0,Q.jsx)(rt,{item:t,language:e,showNew:!0,primary:Et===`delivery`&&n===0,onOpen:()=>Ht(t)},t.id))})]}):null,$t=[{title:k.inProgress,items:Yt.filter(e=>!e.backgroundState&&!e.statusLabel)},{title:k.waiting,items:Yt.filter(e=>e.backgroundState===`waiting`||!e.backgroundState&&e.statusLabel)},{title:k.paused,items:Yt.filter(e=>e.backgroundState===`paused`)},{title:k.scheduled,items:wt}].filter(e=>e.items.length>0),en=Et===`attention`?1:3,tn=$t.length?(0,Q.jsxs)(`section`,{className:`min-w-0 space-y-2`,"aria-labelledby":`home-background-title`,children:[(0,Q.jsx)(`div`,{className:`flex min-h-9 items-center`,children:(0,Q.jsx)(`h2`,{id:`home-background-title`,className:`text-base font-semibold text-fg`,children:k.background})}),(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-panel`,children:[$t.map(({title:t,items:n})=>(0,Q.jsxs)(`div`,{className:`px-3 py-2`,children:[(0,Q.jsx)(`h3`,{className:`px-1 pt-1 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:(le?n:n.slice(0,en)).map(t=>(0,Q.jsx)(ft,{item:t,language:e,onAction:Pt,onUpdated:Ft},t.id))})]},t)),$t.some(({items:e})=>e.length>en)?(0,Q.jsx)(Y,{variant:`ghost`,className:`w-full justify-start rounded-t-none px-4 text-xs`,"aria-expanded":le,onClick:()=>ue(e=>!e),children:e===`zh`?le?`收起`:`查看全部 ${Yt.length+wt.length} 项`:le?`Show less`:`View all ${Yt.length+wt.length} items`}):null]})]}):null,nn=yt>0||_t.length>0||vt.length>0||Tt||!!C?.observation;return(0,Q.jsxs)(`div`,{className:`@container/workbench mx-auto flex w-full min-w-0 max-w-7xl flex-1 flex-col px-4 pb-6 pt-3 sm:px-6 lg:px-8`,children:[(0,Q.jsx)(`input`,{ref:$.fileInputRef,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{let t=e.target.files;t&&Ze(Array.from(t)),e.target.value=``}}),(0,Q.jsx)(y,{open:U,onOpenChange:Nt,children:(0,Q.jsxs)(g,{children:[(0,Q.jsx)(p,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsxs)(_,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float focus:outline-none`,children:[(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(v,{className:`text-base font-semibold text-fg`,children:r.dialogTitle}),(0,Q.jsx)(m,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:r.dialogDescription})]}),(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,children:(0,Q.jsx)(z,{className:`size-4`,"aria-hidden":!0})})})]}),(0,Q.jsx)(Ie,{variant:`dialog`,inputId:`new-conversation-intent`,inputRef:Be,intent:q,labels:{...pt,submit:r.submit},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:Re,attachmentsFull:dt,voice:Ve,chat:t.chat,cancelAction:(0,Q.jsx)(h,{asChild:!0,children:(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,children:n.cancel})}),onIntentChange:J,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void Qe(e),onDragOver:$e,onDragLeave:tt,onDrop:e=>void nt(e),onSubmit:ut})]})]})}),(0,Q.jsx)(Ye,{open:ke,refreshKey:je,onOpenChange:Ae,onReevaluate:It}),E?(0,Q.jsxs)(`div`,{role:`alert`,className:`mb-6 flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:E}),(0,Q.jsx)(Y,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void O(),children:n.home.retry})]}):null,(0,Q.jsx)(it,{view:M,items:ht,language:e,onSelect:N,onClose:()=>N(null),onRead:Ut,onOpenFull:e=>{N(null),i(A(`/`,e.href))},onRestoreFocus:()=>{(B.current?.isConnected?B.current:j.current)?.focus({preventScroll:!0})}}),(0,Q.jsx)(`div`,{role:`status`,children:se?(0,Q.jsxs)(`div`,{className:`mb-3 flex w-full flex-wrap items-center justify-between gap-2 rounded-lg bg-success-soft px-3 py-1.5 text-xs text-fg`,children:[(0,Q.jsx)(`span`,{children:se.message}),se.href?(0,Q.jsx)(Y,{variant:`ghost`,className:`px-2 py-1 text-xs`,onClick:()=>i(se.href),children:e===`zh`?`查看进展与结果`:`View progress and result`}):null]}):null}),T?(0,Q.jsx)(ct,{}):C?(0,Q.jsxs)(`div`,{ref:j,tabIndex:-1,className:`flex min-h-0 w-full flex-1 flex-col gap-4 outline-none`,children:[yt===0?(0,Q.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,"aria-live":`polite`,children:k.noAttention}):null,Ot?(0,Q.jsxs)(`section`,{className:`mx-auto flex w-full max-w-[640px] flex-1 flex-col justify-center pb-12 pt-10 text-center sm:pb-20 sm:pt-16`,children:[(0,Q.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:k.startTitle}),(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:k.startHint}),(0,Q.jsx)(Ie,{variant:`inline`,inputId:`home-conversation-intent`,inputRef:Be,intent:q,labels:{...pt,intentPlaceholder:k.startExample},attachments:$.attachments,isDragging:$.isDragging,attachmentBusy:Re,attachmentsFull:dt,voice:Ve,chat:t.chat,onIntentChange:J,onPickFiles:()=>$.fileInputRef.current?.click(),onRemoveAttachment:$.removeAttachment,onPaste:e=>void Qe(e),onDragOver:$e,onDragLeave:tt,onDrop:e=>void nt(e),onSubmit:ut}),(0,Q.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-center gap-2`,children:[(0,Q.jsxs)(Y,{variant:`ghost`,onClick:()=>window.dispatchEvent(new Event(`open-command-palette`)),children:[(0,Q.jsx)(I,{className:`size-4`,"aria-hidden":!0}),k.findWork]}),(0,Q.jsx)(Y,{variant:`ghost`,onClick:()=>Ht(`history`),children:k.deliveryHistory})]})]}):null,(0,Q.jsxs)(`div`,{className:nn&&tn?`grid min-w-0 items-start gap-5 @min-[56rem]/workbench:grid-cols-[minmax(0,1fr)_minmax(17rem,0.57fr)]`:`grid min-w-0 gap-4`,children:[nn?(0,Q.jsxs)(`div`,{className:`min-w-0 space-y-4`,children:[yt>0?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-needs-user-title`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-9 flex-wrap items-center gap-2`,children:[(0,Q.jsx)(w,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,Q.jsx)(`h2`,{id:`home-needs-user-title`,className:`text-base font-semibold text-fg`,children:k.attention}),(0,Q.jsx)(`span`,{className:`rounded-md bg-surface-inset px-1.5 py-0.5 text-xs font-medium tabular-nums text-fg-muted`,"aria-live":`polite`,"aria-label":at(n.home.attentionTitle,{count:yt}),children:yt}),xt>0?(0,Q.jsx)(`span`,{className:`text-xs text-warning`,children:at(k.dueToday,{count:xt})}):null]}),(0,Q.jsxs)(`div`,{className:`divide-y divide-edge-subtle overflow-hidden rounded-xl border border-edge-subtle bg-surface-panel`,children:[qt.map((t,i)=>t===Kt?(0,Q.jsxs)(`div`,{className:`flex min-h-16 items-center justify-between gap-3 px-4 py-3 text-sm text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:t.title}),(0,Q.jsx)(x,{className:`size-4 shrink-0 text-success`,"aria-label":e===`zh`?`已处理`:`Handled`})]},t.id):(0,Q.jsx)(lt,{item:t,primary:i===0||i===1&&qt[0]===Kt,busy:de!==null,dueLabel:n.home.dueLabel,failureLabel:r.runAttention,locale:e,onAction:Pt,onComplete:()=>void O(),onUpdated:e=>Ft(e,t)},t.id)),d||Gt>0?(0,Q.jsxs)(Y,{variant:`ghost`,className:`w-full justify-start rounded-t-none px-4 text-xs`,"aria-expanded":d,onClick:()=>b(e=>!e),children:[(0,Q.jsx)(S,{className:d?`size-4 rotate-180`:`size-4`,"aria-hidden":!0}),d?k.collapse:at(k.remaining,{count:Gt})]}):null]})]}):null,Qt,vt.length>0||Tt||C.observation?(0,Q.jsxs)(`section`,{className:`space-y-2`,"aria-labelledby":`home-resume-title`,children:[(0,Q.jsx)(`h2`,{id:`home-resume-title`,className:`flex min-h-9 items-center text-base font-semibold text-fg`,children:k.resume}),vt.length>0?(0,Q.jsx)(`div`,{className:`divide-y divide-edge-subtle rounded-xl border border-edge-subtle bg-surface-panel`,children:vt.slice(0,Et===`attention`?1:3).map(t=>(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 px-4 py-3`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 basis-48`,children:[(0,Q.jsx)(`p`,{className:`break-words text-sm font-semibold text-fg`,children:t.title}),(0,Q.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-fg-muted`,children:[t.projectName,t.summary||at(k.lastActive,{time:Ee(t.updatedAt,e)})].filter(Boolean).join(` · `)})]}),(0,Q.jsx)(Y,{variant:`secondary`,onClick:()=>i(A(`/`,t.href)),children:t.kind===`task`?k.continueTask:k.continueChat})]},`${t.kind}:${t.id}`))}):null,C.observation?(0,Q.jsx)(Ge,{observation:C.observation,advisor:C.advisor,language:e,onUpdated:()=>void O()}):null,!C.observation&&Zt&&Et===`attention`&&!Ce?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 rounded-lg bg-surface-inset px-3 py-1`,children:[(0,Q.jsxs)(`p`,{className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-fg-muted`,children:[(0,Q.jsx)(R,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{className:`truncate`,children:[n.home.advisorStatusLabel,` · `,Zt]})]}),(0,Q.jsx)(Y,{variant:`ghost`,"aria-expanded":V,onClick:()=>H(e=>!e),children:V?k.hideSuggestion:k.viewSuggestion})]}):null,!C.observation&&Tt&&!Xt?(0,Q.jsx)(Ue,{advisor:C.advisor,busy:ye,copy:{aiLabel:n.home.advisorAiLabel,why:n.home.advisorWhy,evidence:n.home.advisorEvidence,needsSetup:n.home.advisorNeedsSetup,start:n.home.advisorStart,discuss:n.home.advisorDiscuss,refresh:n.home.advisorRefresh,refreshing:n.home.advisorRefreshing,history:n.home.advisorHistory,viewProgress:n.home.advisorViewProgress,alternatives:n.home.advisorAlternatives,more:k.moreSuggestionActions,feedback:n.home.advisorFeedback,alreadyDone:n.home.advisorAlreadyDone,irrelevant:n.home.advisorIrrelevant,later:n.home.advisorLater,lessLikeThis:n.home.advisorLessLikeThis,sourceIncorrect:n.home.advisorSourceIncorrect,minutes:n.home.advisorMinutes,setupTitle:n.home.advisorSetupTitle,setupHint:n.home.advisorSetupHint,configure:n.home.advisorConfigure,degradedStart:n.home.advisorDegradedStart,automationHint:n.home.advisorAutomationHint,automationAction:n.home.advisorAutomationAction},onRefresh:It,onAction:Lt,onFeedback:Rt,onClarification:Bt,onOpenHistory:()=>Ae(!0),preflight:Fe,receipt:Ce}):null]}):null]}):null,tn]}),!Dt&&!Qt&&ht.length>0?(0,Q.jsx)(Y,{variant:`ghost`,className:`self-start px-2 text-xs`,onClick:()=>Ht(`history`),children:k.deliveryHistory}):null]}):null,Ne?(0,Q.jsxs)(`div`,{role:`status`,className:`fixed bottom-5 left-1/2 z-[100] flex -translate-x-1/2 items-center gap-4 rounded-lg border border-edge bg-surface-overlay px-4 py-3 text-sm text-fg shadow-float`,children:[(0,Q.jsx)(`span`,{children:n.home.advisorFeedbackSaved}),(0,Q.jsx)(`button`,{type:`button`,className:`font-medium text-accent-fg hover:underline`,onClick:zt,children:n.home.advisorUndo})]}):null]})}export{mt as HomePage};
|