@xopcai/xopc 0.0.324 → 0.0.329
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/README.md +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B-Gczr_A.js → agent-avatar-dicebear-Bs1qnnhD.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DHJyAT7t.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DLKj_iIh.js +1 -0
- package/dist/gateway/static/root/assets/agents-SXZ5O0g4.js +70 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BwWdVRlb.js → app-management-settings-panel-BrIji9B5.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-EoXNDO1j.js → appearance-settings-Uts-MQ7K.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DcclVdxW.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-B_T0uMvL.js → archive-plugin-_EzRfBuI.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D9DDwxd2.js → attachment-load-CHg7_XFl.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-jI9vNr2r.js → automations-page-CGMErk_w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-Cc4yqiF6.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Dzsxh9OL.js → binary-plugins-D3WB-tVn.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CWUUgWWk.js → block-editor-Cm1W-14I.js} +53 -53
- package/dist/gateway/static/root/assets/box-DvYoGszj.js +1 -0
- package/dist/gateway/static/root/assets/braces-Cfmtagno.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DSWXq9lI.js → browser-automation-inputs-VnvK-GQP.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CZYCvSSU.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-DDz9PE6m.js +3 -0
- package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-DH3aDk53.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C8jMZAJl.js +8 -0
- package/dist/gateway/static/root/assets/capability-discover-page-CgGvsf3t.js +1 -0
- package/dist/gateway/static/root/assets/capability-header-actions-C3chJDQu.js +1 -0
- package/dist/gateway/static/root/assets/capability-icon-BYm2-nS-.js +1 -0
- package/dist/gateway/static/root/assets/channels-CuVS_KsY.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-WXZrEB3K.js → chat-terminal-dock-ClbmjCL2.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-BfZaf516.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-F-fYNIx8.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-B4SLpvSL.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-DXQTsUJn.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-B_z3zihW.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DPVPqFlh.js → desktop-pet-C1TZzKS3.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-B5JGIfqn.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DFYK_Ywf.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-BfxaNwMB.js +1 -0
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-cuG5Lnwf.js → extension-debug-page-Bs8_FYCm.js} +1 -1
- package/dist/gateway/static/root/assets/extension-marketplace-api-DqV4YRYs.js +1 -0
- package/dist/gateway/static/root/assets/{extension-page-BCTAXdyE.js → extension-page-DH5vFbBw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-kadW_icu.js → extension-settings-page-hGKovxxC.js} +1 -1
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +1 -0
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +1 -0
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoQVulMd.js → gateway-config-swr-BYMrbKZE.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BIsiP-JI.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B5GJ-CQV.js → gateway-startup-retry-DMqYXHAn.js} +1 -1
- package/dist/gateway/static/root/assets/gauge-C78eD2BA.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
- package/dist/gateway/static/root/assets/home-page-CoBivEvx.js +1 -0
- package/dist/gateway/static/root/assets/image-Cwyalflz.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DvWDkbk1.js → image-generation-api-D1sQGaJz.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-rssb4rjP.js +1 -0
- package/dist/gateway/static/root/assets/inbox-DNoSz682.js +1 -0
- package/dist/gateway/static/root/assets/index-C4QN4gCi.css +1 -0
- package/dist/gateway/static/root/assets/index-Cr4SINLG.js +121 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-C1fKIjz4.js → keyboard-shortcuts-settings-CMitbles.js} +1 -1
- package/dist/gateway/static/root/assets/layout-grid-CEVZdVFU.js +1 -0
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
- package/dist/gateway/static/root/assets/list-BBGUdmkF.js +1 -0
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-Di82Oacm.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-CCvA9d9L.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-BPZR8x9b.js → locale-store-BSkKhYkc.js} +1 -1
- package/dist/gateway/static/root/assets/lock-keyhole-DEK5kH0u.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-BK8ol1q0.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-CebXkEtB.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-Dft8ASFD.js → markdown-view-DXubGEic.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-Cjj-fidX.js → media-plugins-DLJrmU9J.js} +1 -1
- package/dist/gateway/static/root/assets/message-circle-Badhj-4D.js +1 -0
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +1 -0
- package/dist/gateway/static/root/assets/messages-D0G_sZvA.js +3 -0
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-B0EUPwTv.js +1 -0
- package/dist/gateway/static/root/assets/network-BUQLY1BV.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-xsKDIJdK.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-1qg2v-9j.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-BFm7XnWH.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-C3JiQEKD.js +1 -0
- package/dist/gateway/static/root/assets/paperclip-f1HujQY1.js +1 -0
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +1 -0
- package/dist/gateway/static/root/assets/power-ZI-pBczI.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-buk_gdip.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DlpCi5zT.js → product-open-page-DwEEO0Ak.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CRQGCRSU.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DcqylysA.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DWWO6ajd.js → registry-api-tx8XCHOs.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cq5MaiRW.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BT_ANpaT.js → runtime-tools-settings-panel-De7HmmBu.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-GXJ-b3dO.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-BcqsqSsV.js → schema-form-DPMEuj5D.js} +1 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/server-BlHCBjiE.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-C6FwYIRA.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BEyQiZs0.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-DM0D-BQ_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-B65vii9U.js → settings-page-CWS9yOH3.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-X1x-2Cp9.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-BhGKiTPf.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BS8o58NJ.js → share-preview-page-CcRi2yGy.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DNmcCBfX.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-BCAV_F1P.js +1 -0
- package/dist/gateway/static/root/assets/skill-card-icon-BrrpZ3Mw.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BEV2WXGk.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-C8zOGpKw.js +2 -0
- package/dist/gateway/static/root/assets/star-BUWJqJ5c.js +1 -0
- package/dist/gateway/static/root/assets/stethoscope-DRqTAtjD.js +1 -0
- package/dist/gateway/static/root/assets/store-SzD1Jvgm.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-C_lajq9u.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-Dk8Bmlhw.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-CYvKiE_f.js +1 -0
- package/dist/gateway/static/root/assets/upload-rrb46c3c.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-ZTHe1zCM.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-C_SPNZbP.js +2 -0
- package/dist/gateway/static/root/assets/user-round-C9jxPhMR.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-DJV-qERt.js → voice-api-key-field-C8Kpkct-.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-BvzxINUk.js +1 -0
- package/dist/gateway/static/root/assets/wand-sparkles-DWuJz5ya.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DcHhy54L.js → work-discovery-overlay-ClB6T-dm.js} +1 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-X0Cyh2AR.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-BrL6dzf0.js +6 -0
- package/dist/gateway/static/root/connector-icons/SOURCES.md +1 -0
- package/dist/gateway/static/root/connector-icons/wecom.svg +9 -0
- package/dist/gateway/static/root/index.html +26 -8
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +4 -2
- package/dist/src/agent/agent-manager.js +58 -19
- package/dist/src/agent/background-review/coordinator.d.ts +2 -7
- package/dist/src/agent/background-review/coordinator.js +17 -34
- package/dist/src/agent/background-review/prompts.d.ts +13 -5
- package/dist/src/agent/background-review/prompts.js +17 -12
- package/dist/src/agent/background-review/run-background-review.d.ts +3 -3
- package/dist/src/agent/background-review/run-background-review.js +58 -43
- package/dist/src/agent/context/execution-context.js +5 -2
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +2 -2
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +2 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +3 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +12 -0
- package/dist/src/agent/tools/user-context-tool.js +29 -4
- package/dist/src/automations/domain/types.d.ts +7 -1
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +36 -13
- package/dist/src/automations/service/automation-service.js +2 -1
- package/dist/src/browser/automations/index.js +2 -2
- package/dist/src/browser/automations/service.d.ts +11 -2
- package/dist/src/browser/automations/service.js +19 -5
- package/dist/src/capabilities/readiness/from-config.d.ts +0 -1
- package/dist/src/capabilities/readiness/from-config.js +2 -4
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -1
- package/dist/src/config/schema.js +4 -4
- package/dist/src/connectors/china-catalog.js +5 -1
- package/dist/src/connectors/connected-source-ingestion.js +6 -1
- package/dist/src/connectors/connected-source-observations.d.ts +10 -0
- package/dist/src/connectors/connected-source-observations.js +80 -0
- package/dist/src/connectors/connected-source-understanding.js +198 -8
- package/dist/src/connectors/learning-coordinator.js +63 -26
- package/dist/src/connectors/learning-recipes.js +19 -2
- package/dist/src/discussions/audio-repair.d.ts +1 -1
- package/dist/src/discussions/live-worker.js +1 -3
- package/dist/src/discussions/recording.js +2 -2
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/extensions/agent-plugins/auth.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/auth.js +6 -35
- package/dist/src/extensions/agent-plugins/credentials.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/credentials.js +37 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +8 -0
- package/dist/src/extensions/marketplace.d.ts +4 -0
- package/dist/src/extensions/marketplace.js +4 -0
- package/dist/src/gateway/file-space-service.d.ts +9 -2
- package/dist/src/gateway/hono/routes/agent-plugins.js +2 -1
- package/dist/src/gateway/hono/routes/config.js +0 -3
- package/dist/src/gateway/hono/routes/connectors.js +3 -10
- package/dist/src/gateway/hono/routes/context-sources.d.ts +0 -1
- package/dist/src/gateway/hono/routes/context-sources.js +12 -15
- package/dist/src/gateway/hono/routes/status.js +0 -1
- package/dist/src/gateway/hono/routes/user-model.js +21 -3
- package/dist/src/gateway/hono/routes/voice.js +0 -67
- package/dist/src/gateway/service.js +6 -4
- package/dist/src/media-understanding/types.d.ts +1 -1
- package/dist/src/memory-maintenance/service.d.ts +1 -0
- package/dist/src/memory-maintenance/service.js +13 -0
- package/dist/src/migrations/retired-local-stt.d.ts +2 -0
- package/dist/src/migrations/retired-local-stt.js +52 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/session/turn-outcome-projector.js +1 -1
- package/dist/src/storage/sqlite/connection.js +1 -0
- package/dist/src/storage/sqlite/migrations/207_user_model_policy_contract.sql +121 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/sql-assets.d.ts +1 -0
- package/dist/src/storage/sqlite/sql-assets.js +7 -4
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +4 -2
- package/dist/src/tasks/task-context-assembler.js +10 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +15 -2
- package/dist/src/user-context/sources/consent-repository.d.ts +7 -0
- package/dist/src/user-context/sources/consent-repository.js +81 -0
- package/dist/src/user-context/sources/index.d.ts +1 -0
- package/dist/src/user-context/sources/index.js +2 -1
- package/dist/src/user-context/sources/repository.js +73 -1
- package/dist/src/user-context/sources/types.d.ts +16 -0
- package/dist/src/user-model/action-rule-suggestions.d.ts +11 -0
- package/dist/src/user-model/action-rule-suggestions.js +29 -0
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +83 -7
- package/dist/src/user-model/capture/semantic.d.ts +5 -2
- package/dist/src/user-model/capture/semantic.js +27 -11
- package/dist/src/user-model/domain.d.ts +26 -0
- package/dist/src/user-model/domain.js +40 -2
- package/dist/src/user-model/index.d.ts +2 -0
- package/dist/src/user-model/index.js +6 -4
- package/dist/src/user-model/maintenance-policy.d.ts +1 -0
- package/dist/src/user-model/maintenance-policy.js +13 -0
- package/dist/src/user-model/observation-repository.d.ts +48 -0
- package/dist/src/user-model/observation-repository.js +100 -0
- package/dist/src/user-model/repository.d.ts +5 -0
- package/dist/src/user-model/repository.js +121 -10
- package/dist/src/user-model/usage-policy.d.ts +5 -2
- package/dist/src/user-model/usage-policy.js +2 -2
- package/dist/src/voice/audio/normalize.d.ts +1 -1
- package/dist/src/voice/audio/normalize.js +1 -1
- package/dist/src/voice/{local → audio}/wav.js +1 -1
- package/dist/src/voice/language-profile.js +10 -16
- package/dist/src/voice/metadata/builtin.js +0 -46
- package/dist/src/voice/stt/providers/index.d.ts +0 -1
- package/dist/src/voice/stt/providers/index.js +1 -2
- package/dist/src/voice/stt/types.js +3 -4
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/speech-registry.d.ts +1 -1
- package/dist/src/voice/tts/types.d.ts +1 -1
- package/dist/src/work-discovery/analyzer.js +6 -5
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/work-discovery/types.d.ts +1 -1
- package/dist/src/workflows/context/workflow-context.js +5 -1
- package/dist/src/workflows/index.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +13 -4
- package/package.json +13 -17
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CxcIHW_Z.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CNuqJcHQ.js +0 -1
- package/dist/gateway/static/root/assets/agents-CPpmkx7O.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-6xEgLDv8.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-rztQnZDk.js +0 -7
- package/dist/gateway/static/root/assets/browser-automations-page-D96o3bDY.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-DUQzQ3ic.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CKWtXof8.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-C8ducWB7.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-uy9YDwxJ.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BpF0SjB9.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-eZTfIMWI.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-Do1dl0La.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-BhS8s080.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dv3vG9HZ.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DdvO1O6W.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLZyN-u9.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BSqg-JE9.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-_pddpuej.js +0 -1
- package/dist/gateway/static/root/assets/index-BKL5tg2f.css +0 -1
- package/dist/gateway/static/root/assets/index-CJuypaNt.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-DXFnYiA0.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-CkXKS5xe.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-C33z-ife.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-8eDZb0uS.js +0 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-C95RtLuL.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-kFxknjMR.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-OUL3fEYh.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-CVbY7_N5.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-CKiIby0r.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-LPAxUszX.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-Cbyb4hyy.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BtDFZc6g.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-CJlc-mg1.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-CUo6-iV2.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-XeSxPjP7.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-Dol9j_pF.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-eqTUTW2L.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BCt__prc.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BsjSqEnw.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-evN7gs0S.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BifYwEhe.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-DOk-iOvN.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CcSvoHfY.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-pCRG7Jb3.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-DDGMf44u.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-DiIkxIq7.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CvYeM0Ml.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BaxITrwZ.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-DbVtLh0R.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-CT8ouKcB.js +0 -6
- package/dist/src/voice/local/model-files.d.ts +0 -14
- package/dist/src/voice/local/model-files.js +0 -92
- package/dist/src/voice/local/model-manager.d.ts +0 -18
- package/dist/src/voice/local/model-manager.js +0 -133
- package/dist/src/voice/local/models.d.ts +0 -28
- package/dist/src/voice/local/models.js +0 -99
- package/dist/src/voice/local/provider-switch.d.ts +0 -4
- package/dist/src/voice/local/provider-switch.js +0 -36
- package/dist/src/voice/local/runtime-client.d.ts +0 -28
- package/dist/src/voice/local/runtime-client.js +0 -183
- package/dist/src/voice/local/runtime-worker.d.ts +0 -1
- package/dist/src/voice/local/runtime-worker.js +0 -271
- package/dist/src/voice/stt/providers/local-transcription.d.ts +0 -2
- package/dist/src/voice/stt/providers/local-transcription.js +0 -53
- /package/dist/src/voice/{local → audio}/wav.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./external-link-DjqjBmc3.js";import{t as a}from"./globe-DSSGFWFn.js";import{t as o}from"./loader-circle-CifKLtgG.js";import{t as s}from"./power-ZI-pBczI.js";import{t as c}from"./messages-D0G_sZvA.js";import{t as l}from"./cn-JdwAhgNB.js";import{a as u,c as d,i as f,n as ee,r as p}from"./locale-store-BSkKhYkc.js";import{i as m}from"./vendor-swr-BIWyz7Rc.js";import{t as h}from"./button-CS04eWY9.js";import{n as g,r as _}from"./gateway-config-swr-BYMrbKZE.js";import{t as v}from"./skeleton-BwbyijEw.js";import{$o as y,Uo as b,ma as x}from"./index-Cr4SINLG.js";import{n as te,t as ne}from"./settings-form-section-DM0D-BQ_.js";var S=e(t(),1),C=n(),w=r();function T(e){let t=(0,C.c)(10),{language:n,label:r,section:a,className:o}=e,s;t[0]!==n||t[1]!==a?(s=b(n,a),t[0]=n,t[1]=a,t[2]=s):s=t[2];let c;t[3]===o?c=t[4]:(c=l(`inline-flex items-center gap-1 text-sm font-medium text-accent hover:underline`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/40`,o),t[3]=o,t[4]=c);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,w.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),t[5]=u):u=t[5];let d;return t[6]!==r||t[7]!==s||t[8]!==c?(d=(0,w.jsxs)(`a`,{href:s,target:`_blank`,rel:`noreferrer`,className:c,children:[r,u]}),t[6]=r,t[7]=s,t[8]=c,t[9]=d):d=t[9],d}async function E(){let e=await f(`/api/exposure/status`);if(!e.ok)throw Error(`Failed to load exposure status (${e.status})`);return await e.json()}async function D(e=`serve`){let t=await f(`/api/exposure/tailscale/start`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({mode:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`Start failed (${t.status})`)}return await t.json()}async function O(){let e=await f(`/api/exposure/tailscale/stop`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`Stop failed (${e.status})`)}return await e.json()}var k=`https://tailscale.com/download`;function A(e){let t=(0,C.c)(2),{label:n}=e,r;return t[0]===n?r=t[1]:(r=(0,w.jsx)(`a`,{href:k,target:`_blank`,rel:`noreferrer`,className:`font-medium text-accent hover:underline`,children:n}),t[0]=n,t[1]=r),r}function j({embedded:e=!1}){let t=ee(e=>e.language),n=c(t).remoteAccess.tailscale,r=(0,S.useMemo)(()=>({copy:n.copyUrl,copied:n.copied,copyFailed:c(t).clipboard.copyFailed}),[t,n.copyUrl,n.copied]),i=!!d(e=>e.conversationId),[l,u]=(0,S.useState)(!1),[f,p]=(0,S.useState)(null),{data:g,mutate:_,isLoading:y}=m(i?`exposure-status`:null,E,{refreshInterval:3e4}),b=g?.tailscale.hostname,C=g?.tailscale.active===!0,k=g?.tailscale.cliAvailable!==!1,j=b?`https://${b}/`:null,re=(0,S.useCallback)(async()=>{u(!0),p(null);try{await D(`serve`),await _()}catch(e){p(e instanceof Error?e.message:String(e))}finally{u(!1)}},[_]),ie=(0,S.useCallback)(async()=>{u(!0),p(null);try{await O(),await _()}catch(e){p(e instanceof Error?e.message:String(e))}finally{u(!1)}},[_]);if(!i)return null;let M=(0,w.jsxs)(`div`,{className:e?`space-y-4`:`mt-4 space-y-3`,children:[e?(0,w.jsxs)(`ol`,{className:`space-y-3 text-sm text-fg-muted`,children:[(0,w.jsxs)(`li`,{className:`flex gap-2`,children:[(0,w.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`1`}),(0,w.jsxs)(`span`,{children:[n.stepInstallBefore,(0,w.jsx)(A,{label:n.stepInstallLink}),n.stepInstallAfter]})]}),(0,w.jsxs)(`li`,{className:`flex gap-2`,children:[(0,w.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`2`}),(0,w.jsx)(`span`,{children:n.stepEnable})]}),(0,w.jsxs)(`li`,{className:`flex gap-2`,children:[(0,w.jsx)(`span`,{className:`flex size-5 shrink-0 items-center justify-center rounded-full bg-surface-hover text-xs font-semibold text-fg`,children:`3`}),(0,w.jsx)(`span`,{children:n.stepCopy})]})]}):null,e&&g?.tailscale.cliAvailable===!1?(0,w.jsxs)(`p`,{className:`rounded-lg bg-amber-500/10 px-3 py-2 text-sm text-fg-muted`,children:[n.cliMissingIntro,` `,(0,w.jsx)(A,{label:n.cliMissingDownloadLink}),n.cliMissingSuffix]}):null,y&&!g?(0,w.jsxs)(`div`,{className:`grid gap-3`,"aria-busy":`true`,children:[(0,w.jsx)(v,{className:`h-20 rounded-lg`}),(0,w.jsx)(v,{className:`h-20 rounded-lg`})]}):(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)(ne,{children:[(0,w.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.statusLabel}),(0,w.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:C?n.statusActive:n.statusOff}),j?(0,w.jsx)(`div`,{className:`mt-3`,children:(0,w.jsx)(x,{text:j,labels:r})}):null,f?(0,w.jsx)(`p`,{className:`mt-2 text-sm text-red-600 dark:text-red-400`,children:f}):null,(0,w.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:C?(0,w.jsxs)(h,{type:`button`,variant:`secondary`,disabled:l,onClick:()=>void ie(),children:[l?(0,w.jsx)(o,{className:`mr-1 size-4 animate-spin`}):null,n.disableServe]}):(0,w.jsxs)(h,{type:`button`,disabled:l||!k,onClick:()=>void re(),children:[l?(0,w.jsx)(o,{className:`mr-1 size-4 animate-spin`}):(0,w.jsx)(s,{className:`mr-1 size-4`}),n.enableServe]})})]}),(0,w.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:n.hint}),(0,w.jsx)(T,{language:t,label:n.docsLink,section:`tailscale-serve`,className:`mt-2`})]})]});return e?M:(0,w.jsxs)(ne,{children:[(0,w.jsx)(te,{icon:a,title:n.title,subtitle:n.subtitle}),M]})}async function re(e){let t=await f(p(`/api/tunnel/probe-public`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e})});if(!t.ok&&t.status!==400)throw Error(`Probe failed (${t.status})`);return await t.json()}async function ie(e){await u(p(`/api/config`),{method:`PATCH`,body:JSON.stringify({gateway:{publicUrl:e??null}})})}function M(e){let t=e.split(`.`).map(e=>Number.parseInt(e,10));if(t.length!==4||t.some(e=>!Number.isFinite(e)))return!1;let[n,r]=t;return n===10||n===127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===100&&r>=64&&r<=127}function ae(){return(0,S.useMemo)(()=>{if(typeof window>`u`)return null;let{protocol:e,hostname:t,origin:n}=window.location;if(e!==`https:`&&e!==`http:`)return null;let r=t.toLowerCase();return!r||r===`localhost`||r===`127.0.0.1`||r===`::1`||r===`[::1]`||r.endsWith(`.local`)||r.endsWith(`.localhost`)||M(r)?null:n.toLowerCase().replace(/\/+$/,``)},[])}function oe(){return l(`w-full rounded-lg border border-edge bg-surface-panel px-3 py-2 text-sm text-fg`,`placeholder:text-fg-subtle`,y,`dark:border-edge`)}function se(e){if(!e||typeof e!=`object`||Array.isArray(e))return null;let t=e.gateway;if(!t||typeof t!=`object`||Array.isArray(t))return null;let n=t.publicUrl;return typeof n==`string`&&n.trim()?n.trim():null}function N(){let e=(0,C.c)(85),t=ee(le),n;e[0]===t?n=e[1]:(n=c(t),e[0]=t,e[1]=n);let r=n.remoteAccess.reverseProxy,i=!!d(ce),s=ae(),u=_(i).data?.payload?.config,f;e[2]===u?f=e[3]:(f=se(u),e[2]=u,e[3]=f);let p=f,[m,v]=(0,S.useState)(``),y;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(y={busy:!1,result:null},e[4]=y):y=e[4];let[b,x]=(0,S.useState)(y),T;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(T={busy:!1,error:null},e[5]=T):T=e[5];let[E,D]=(0,S.useState)(T),O,k;e[6]!==p||e[7]!==s||e[8]!==m?(O=()=>{m||(p?v(p):s&&v(s))},k=[p,s,m],e[6]=p,e[7]=s,e[8]=m,e[9]=O,e[10]=k):(O=e[9],k=e[10]),(0,S.useEffect)(O,k);let A;bb0:{let t;e[11]===m?t=e[12]:(t=m.trim(),e[11]=m,e[12]=t);let n=t;if(n){A=n;break bb0}A=p??s??``}let j=A,M=!p&&!!s&&j===s,N;e[13]!==m||e[14]!==j?(N=async()=>{let e=m.trim()||j;if(e){x({busy:!0,result:null});try{x({busy:!1,result:await re(e)})}catch(e){let t=e;x({busy:!1,result:{ok:!1,code:`NETWORK_ERROR`,message:t instanceof Error?t.message:String(t)}})}}},e[13]=m,e[14]=j,e[15]=N):N=e[15];let de=N,fe;e[16]===j?fe=e[17]:(fe=async()=>{let e=j.trim();if(e){D({busy:!0,error:null});try{await ie(e),await g(),D({busy:!1,error:null})}catch(e){let t=e;D({busy:!1,error:t instanceof Error?t.message:String(t)})}}},e[16]=j,e[17]=fe);let pe=fe,P;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(P=async()=>{D({busy:!0,error:null});try{await ie(null),await g(),v(``),x({busy:!1,result:null}),D({busy:!1,error:null})}catch(e){let t=e;D({busy:!1,error:t instanceof Error?t.message:String(t)})}},e[18]=P):P=e[18];let me=P;if(!i)return null;let F;e[19]!==r.subtitle||e[20]!==r.title?(F=(0,w.jsx)(te,{icon:a,title:r.title,subtitle:r.subtitle}),e[19]=r.subtitle,e[20]=r.title,e[21]=F):F=e[21];let I;e[22]===r.urlLabel?I=e[23]:(I=(0,w.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`reverse-proxy-url`,children:r.urlLabel}),e[22]=r.urlLabel,e[23]=I);let L;e[24]===Symbol.for(`react.memo_cache_sentinel`)?(L=l(oe(),`font-mono text-xs sm:flex-1 sm:min-w-0 sm:w-auto`),e[24]=L):L=e[24];let R;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{v(e.target.value),x({busy:!1,result:null})},e[25]=R):R=e[25];let z;e[26]!==m||e[27]!==r.urlPlaceholder||e[28]!==L?(z=(0,w.jsx)(`input`,{id:`reverse-proxy-url`,className:L,type:`text`,autoComplete:`off`,spellCheck:!1,placeholder:r.urlPlaceholder,value:m,onChange:R}),e[26]=m,e[27]=r.urlPlaceholder,e[28]=L,e[29]=z):z=e[29];let B;e[30]===de?B=e[31]:(B=()=>void de(),e[30]=de,e[31]=B);let V;e[32]!==m||e[33]!==b.busy?(V=b.busy||!m.trim(),e[32]=m,e[33]=b.busy,e[34]=V):V=e[34];let H;e[35]===b.busy?H=e[36]:(H=b.busy?(0,w.jsx)(o,{className:`size-3.5 animate-spin`}):null,e[35]=b.busy,e[36]=H);let he=b.busy?r.probing:r.probeButton,U;e[37]!==B||e[38]!==V||e[39]!==H||e[40]!==he?(U=(0,w.jsxs)(h,{type:`button`,variant:`secondary`,className:`shrink-0 whitespace-nowrap`,onClick:B,disabled:V,children:[H,he]}),e[37]=B,e[38]=V,e[39]=H,e[40]=he,e[41]=U):U=e[41];let W;e[42]!==z||e[43]!==U?(W=(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-stretch`,children:[z,U]}),e[42]=z,e[43]=U,e[44]=W):W=e[44];let G;e[45]===r.urlHint?G=e[46]:(G=(0,w.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:r.urlHint}),e[45]=r.urlHint,e[46]=G);let K;e[47]!==s||e[48]!==M||e[49]!==r.autoDetectedHint||e[50]!==r.autoDetectedTitle?(K=M&&s?(0,w.jsxs)(`div`,{className:`rounded-lg bg-accent-soft/60 px-3 py-2 text-xs leading-relaxed text-accent-fg`,children:[(0,w.jsx)(`div`,{className:`font-medium`,children:r.autoDetectedTitle}),(0,w.jsx)(`div`,{className:`mt-1 break-all font-mono text-[11px]`,children:s}),(0,w.jsx)(`p`,{className:`mt-1`,children:r.autoDetectedHint})]}):null,e[47]=s,e[48]=M,e[49]=r.autoDetectedHint,e[50]=r.autoDetectedTitle,e[51]=K):K=e[51];let q;e[52]!==b.result||e[53]!==r.probeStatus?(q=b.result?(0,w.jsx)(ue,{result:b.result,labels:r.probeStatus}):null,e[52]=b.result,e[53]=r.probeStatus,e[54]=q):q=e[54];let J;e[55]!==p||e[56]!==j||e[57]!==pe||e[58]!==r.saveAsDefault||e[59]!==r.saving||e[60]!==E.busy?(J=j&&p!==j?(0,w.jsxs)(h,{type:`button`,onClick:()=>void pe(),disabled:E.busy,children:[E.busy?(0,w.jsx)(o,{className:`size-3.5 animate-spin`}):null,E.busy?r.saving:r.saveAsDefault]}):null,e[55]=p,e[56]=j,e[57]=pe,e[58]=r.saveAsDefault,e[59]=r.saving,e[60]=E.busy,e[61]=J):J=e[61];let Y;e[62]!==p||e[63]!==r.clear||e[64]!==E.busy?(Y=p?(0,w.jsx)(h,{type:`button`,variant:`ghost`,onClick:()=>void me(),disabled:E.busy,children:r.clear}):null,e[62]=p,e[63]=r.clear,e[64]=E.busy,e[65]=Y):Y=e[65];let X;e[66]!==J||e[67]!==Y?(X=(0,w.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:flex-wrap`,children:[J,Y]}),e[66]=J,e[67]=Y,e[68]=X):X=e[68];let Z;e[69]===E.error?Z=e[70]:(Z=E.error?(0,w.jsx)(`p`,{className:`text-xs text-red-800 dark:text-red-200`,children:E.error}):null,e[69]=E.error,e[70]=Z);let Q;e[71]===r.certWarning?Q=e[72]:(Q=(0,w.jsx)(`div`,{className:`rounded-lg bg-amber-50 px-3 py-2 text-xs leading-relaxed text-amber-950 dark:bg-amber-950/30 dark:text-amber-100`,children:r.certWarning}),e[71]=r.certWarning,e[72]=Q);let $;e[73]!==I||e[74]!==W||e[75]!==G||e[76]!==K||e[77]!==q||e[78]!==X||e[79]!==Z||e[80]!==Q?($=(0,w.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[I,W,G,K,q,X,Z,Q]}),e[73]=I,e[74]=W,e[75]=G,e[76]=K,e[77]=q,e[78]=X,e[79]=Z,e[80]=Q,e[81]=$):$=e[81];let ge;return e[82]!==F||e[83]!==$?(ge=(0,w.jsx)(`div`,{className:`flex flex-col gap-4`,children:(0,w.jsxs)(ne,{children:[F,$]})}),e[82]=F,e[83]=$,e[84]=ge):ge=e[84],ge}function ce(e){return e.conversationId}function le(e){return e.language}function ue(e){let t=(0,C.c)(18),{result:n,labels:r}=e;if(n.ok){let e;t[0]===r.ok?e=t[1]:(e=(0,w.jsx)(`span`,{className:`font-medium`,children:r.ok}),t[0]=r.ok,t[1]=e);let i;t[2]===n.latencyMs?i=t[3]:(i=(0,w.jsxs)(`span`,{className:`font-mono`,children:[n.latencyMs,`ms`]}),t[2]=n.latencyMs,t[3]=i);let a;t[4]!==r.gatewayReady||t[5]!==n.gatewayReady?(a=n.gatewayReady?(0,w.jsxs)(w.Fragment,{children:[` · `,(0,w.jsx)(`span`,{children:r.gatewayReady})]}):null,t[4]=r.gatewayReady,t[5]=n.gatewayReady,t[6]=a):a=t[6];let o;return t[7]!==e||t[8]!==i||t[9]!==a?(o=(0,w.jsxs)(`div`,{className:`rounded-lg bg-emerald-50 px-3 py-2 text-xs text-emerald-900 dark:bg-emerald-950/30 dark:text-emerald-100`,children:[e,` · `,i,a]}),t[7]=e,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}let i=r[`code_${n.code}`]??r.codeUnknown,a;t[11]===i?a=t[12]:(a=(0,w.jsx)(`span`,{className:`font-medium`,children:i}),t[11]=i,t[12]=a);let o;t[13]===n.message?o=t[14]:(o=n.message?(0,w.jsxs)(w.Fragment,{children:[` — `,(0,w.jsx)(`span`,{className:`font-mono break-all`,children:n.message})]}):null,t[13]=n.message,t[14]=o);let s;return t[15]!==a||t[16]!==o?(s=(0,w.jsxs)(`div`,{className:`rounded-lg bg-red-50 px-3 py-2 text-xs text-red-900 dark:bg-red-950/30 dark:text-red-100`,children:[a,o]}),t[15]=a,t[16]=o,t[17]=s):s=t[17],s}async function de(){let e=await u(p(`/api/device-pairing/readiness`));return{ready:e.ready,routes:e.routes,protocolVersion:e.protocolVersion}}async function fe(e){try{return{kind:`ready`,setup:(await u(p(`/api/device-pairing/setups`),{method:`POST`,body:JSON.stringify({targetKind:e})})).setup}}catch(e){if(e.body?.error?.code===`NO_SECURE_ROUTE`)return{kind:`needs-secure-route`};throw e}}async function pe(e){return u(p(`/api/device-pairing/setups/${encodeURIComponent(e)}`))}async function P(e){await u(p(`/api/device-pairing/setups/${encodeURIComponent(e)}`),{method:`DELETE`})}async function me(e,t){await u(p(`/api/device-pairing/requests/${encodeURIComponent(e.requestId)}/decision`),{method:`POST`,body:JSON.stringify({decision:t,expectedRevision:e.revision})})}async function F(){let e=await f(p(`/api/browser/extension/archive`));if(!e.ok)throw Error(`Browser extension download failed (${e.status})`);let t=e.headers.get(`Content-Disposition`)??``,n=/filename="([^"]+)"/.exec(t)?.[1]??`xopc-browser-extension.zip`,r=URL.createObjectURL(await e.blob());try{let e=document.createElement(`a`);e.href=r,e.download=n,e.click()}finally{URL.revokeObjectURL(r)}}var I=`https://console.xopc.ai/access/client`;function L(e){if(!e||typeof e!=`object`)return;let t=e.body;if(!t||typeof t!=`object`)return;let n=t.error;if(!n||typeof n!=`object`)return;let r=n.code;return typeof r==`string`?r:void 0}function R(e){return[`tunnel_oauth_required`,`invalid_token`,`insufficient_scope`].includes(L(e)??``)}async function z(){return u(p(`/api/tunnel/status`))}async function B(){await u(p(`/api/tunnel/consent`),{method:`POST`,body:JSON.stringify({})})}async function V(){await u(p(`/api/tunnel/registration-key`),{method:`POST`,body:JSON.stringify({})})}async function H(){return u(p(`/api/tunnel/start`),{method:`POST`,body:JSON.stringify({})})}async function he(e){return u(p(`/api/tunnel/stop`),{method:`POST`,body:JSON.stringify({release:e?.release===!0})})}async function U(){let e=(await u(p(`/api/tunnel/reveal-registration-secret`),{method:`POST`,body:JSON.stringify({})})).payload;if(!e)throw Error(`Missing reveal payload`);return{registrationSecret:e.registrationSecret??null,source:e.source===`config`?`config`:`none`}}async function W(e){await u(p(`/api/config`),{method:`PATCH`,body:JSON.stringify({tunnel:e})})}export{N as _,B as a,T as b,he as c,P as d,fe as f,pe as g,de as h,V as i,L as l,F as m,z as n,U as o,me as p,W as r,H as s,I as t,R as u,j as v,E as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./check-DUBLcKHA.js";import{t as a}from"./loader-circle-CifKLtgG.js";import{t as o}from"./cn-JdwAhgNB.js";import{n as s}from"./locale-store-BSkKhYkc.js";import{Hl as c}from"./index-Cr4SINLG.js";var l=n(),u=r();function d(e){let t=(0,l.c)(21),{status:n,error:r,className:d}=e,p=s(f)===`zh`;if(n===`idle`)return null;let m=n===`saving`?p?`正在保存…`:`Saving…`:n===`saved`?p?`已自动保存`:`Saved automatically`:n===`error`?r||(p?`自动保存失败`:`Autosave failed`):n===`dirty`?p?`编辑中,将自动保存`:`Editing — autosave pending`:``,h=n===`error`?`text-danger`:n===`saved`?`text-success`:`text-fg-subtle`,g;t[0]!==d||t[1]!==h?(g=o(`inline-flex min-w-0 items-center gap-1.5 text-xs`,h,d),t[0]=d,t[1]=h,t[2]=g):g=t[2];let _;t[3]===n?_=t[4]:(_=n===`saving`?(0,u.jsx)(a,{className:`size-3.5 shrink-0 animate-spin`,"aria-hidden":!0}):null,t[3]=n,t[4]=_);let v;t[5]===n?v=t[6]:(v=n===`saved`?(0,u.jsx)(i,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[5]=n,t[6]=v);let y;t[7]===n?y=t[8]:(y=n===`error`?(0,u.jsx)(c,{className:`size-3.5 shrink-0`,"aria-hidden":!0}):null,t[7]=n,t[8]=y);let b;t[9]===n?b=t[10]:(b=n===`dirty`?(0,u.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-current`,"aria-hidden":!0}):null,t[9]=n,t[10]=b);let x;t[11]===m?x=t[12]:(x=(0,u.jsx)(`span`,{className:`truncate`,children:m}),t[11]=m,t[12]=x);let S;return t[13]!==m||t[14]!==g||t[15]!==_||t[16]!==v||t[17]!==y||t[18]!==b||t[19]!==x?(S=(0,u.jsxs)(`span`,{className:g,role:`status`,"aria-live":`polite`,title:m,children:[_,v,y,b,x]}),t[13]=m,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S):S=t[20],S}function f(e){return e.language}var p=e(t(),1);function m({value:e,dirty:t,onSave:n,enabled:r=!0,delayMs:i=700,validate:a,serialize:o=JSON.stringify}){let[s,c]=(0,p.useState)(`idle`),[l,u]=(0,p.useState)(null),d=(0,p.useRef)(e),f=(0,p.useRef)(n),m=(0,p.useRef)(a),h=(0,p.useRef)(o),g=(0,p.useRef)(null),_=(0,p.useRef)(!1),v=(0,p.useRef)(null),y=(0,p.useRef)(null),b=(0,p.useRef)(null),x=(0,p.useRef)(!0);d.current=e,f.current=n,m.current=a,h.current=o;let S=(0,p.useCallback)(()=>{g.current!==null&&(window.clearTimeout(g.current),g.current=null)},[]),C=(0,p.useCallback)(async e=>{S();let t=h.current(e);b.current=t;let n=m.current?.(e)??null;if(n){u(n),c(`error`);return}if(_.current){v.current=e;return}_.current=!0,u(null),c(`saving`);try{await f.current(e),y.current=t,x.current&&c(`saved`)}catch(e){x.current&&(u(e instanceof Error?e.message:String(e)),c(`error`))}finally{_.current=!1;let e=v.current;v.current=null,e&&h.current(e)!==y.current&&C(e)}},[S]),w=(0,p.useCallback)(()=>{let e=d.current;!r||!t||e===null||C(e)},[t,r,C]),T=(0,p.useCallback)(e=>{let t=e??d.current;!r||t===null||C(t)},[r,C]);return(0,p.useEffect)(()=>{if(!r||!t||e===null){S(),!t&&s===`dirty`&&c(`idle`);return}let n=o(e);if(n!==y.current&&!(s===`error`&&n===b.current))return c(e=>e===`saving`?e:`dirty`),S(),g.current=window.setTimeout(()=>void C(e),i),S},[S,i,t,r,C,o,s,e]),(0,p.useEffect)(()=>(x.current=!0,()=>{x.current=!1,S()}),[S]),(0,p.useEffect)(()=>{if(s!==`saved`)return;let e=window.setTimeout(()=>c(`idle`),1600);return()=>window.clearTimeout(e)},[s]),{status:s,error:l,flush:w,saveNow:T,retry:w,onBlurCapture:w}}export{d as n,m as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{g as i,u as a}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as o}from"./createLucideIcon-DPHK1VkS.js";import{t as s}from"./check-DUBLcKHA.js";import{n as c,r as l,t as u}from"./popover-select-DcsFzD_i.js";import{t as d}from"./circle-check-C23XjkUj.js";import{t as f}from"./clock-3-DnrAnuyZ.js";import{t as p}from"./ellipsis-0k4rZLoy.js";import{t as m}from"./folder-open-CyzJ19I9.js";import{t as h}from"./git-branch-Dh9uxTot.js";import{t as g}from"./loader-circle-CifKLtgG.js";import{t as _}from"./message-circle-Badhj-4D.js";import{t as v}from"./pencil-DmIY3Oa-.js";import{t as y}from"./plus-Q2yW6OE7.js";import{t as b}from"./search-DA7gz22f.js";import{t as x}from"./user-round-C9jxPhMR.js";import{t as S}from"./x-B_N4OPjy.js";import{t as C}from"./cn-JdwAhgNB.js";import{n as w}from"./locale-store-BSkKhYkc.js";import{a as ee,c as T,i as te,n as E,o as D,r as O,s as k,t as A}from"./dist-BGTk37IG.js";import{i as j}from"./vendor-swr-BIWyz7Rc.js";import{t as M}from"./button-CS04eWY9.js";import{t as N}from"./skeleton-BwbyijEw.js";import{Bn as P,El as F,Eo as I,Gl as L,Hl as R,Hn as z,Ic as B,Nc as V,Oc as ne,Ul as H,Vn as U,Wl as W,Wn as G,Y as K,Yl as q,at as re,ct as ie,dl as J,dt as ae,ft as oe,ht as se,it as Y,kl as ce,lt as le,mt as ue,ot as de,pt as fe,qc as pe,ql as me,st as he,ts as ge,ul as _e,ut as ve,zn as ye,zo as be}from"./index-Cr4SINLG.js";import{t as xe}from"./date-picker-DXQTsUJn.js";var Se=o(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),Ce=o(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),we=o(`handshake`,[[`path`,{d:`m11 17 2 2a1 1 0 1 0 3-3`,key:`efffak`}],[`path`,{d:`m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4`,key:`9pr0kb`}],[`path`,{d:`m21 3 1 11h-2`,key:`1tisrp`}],[`path`,{d:`M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3`,key:`1uvwmv`}],[`path`,{d:`M3 4h8`,key:`1ep09j`}]]),Te=o(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Ee=o(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),De=o(`user-round-pen`,[[`path`,{d:`M2 21a8 8 0 0 1 10.821-7.487`,key:`1c8h7z`}],[`path`,{d:`M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`1817ys`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}]]),X=e(t(),1),Z=n(),Q=r();function Oe(e){let t=(0,Z.c)(15),{sourceId:n,disabled:r}=e,i=r===void 0?!1:r,a=w(je)===`zh`,{sources:o,starting:s,start:c}=K(),l;t[0]!==n||t[1]!==o?(l=n?o.filter(e=>e.grantId===n):o,t[0]=n,t[1]=o,t[2]=l):l=t[2];let u=l,d;t[3]===u?d=t[4]:(d=u.some(Ae),t[3]=u,t[4]=d);let f=d,p=n&&u.some(ke),m=f?a?`更新中`:`Updating`:p?a?`重试`:`Retry`:n?a?`更新理解`:`Update understanding`:a?`更新全部`:`Update all`,h=i||s||f,_;t[5]!==n||t[6]!==c?(_=()=>void c(n),t[5]=n,t[6]=c,t[7]=_):_=t[7];let v;t[8]===f?v=t[9]:(v=f?(0,Q.jsx)(g,{className:`size-3.5 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(pe,{className:`size-3.5`}),t[8]=f,t[9]=v);let y;return t[10]!==m||t[11]!==h||t[12]!==_||t[13]!==v?(y=(0,Q.jsxs)(M,{variant:`ghost`,className:`h-8 shrink-0 gap-1.5 px-2 text-xs`,disabled:h,onClick:_,children:[v,m]}),t[10]=m,t[11]=h,t[12]=_,t[13]=v,t[14]=y):y=t[14],y}function ke(e){return e.status===`failed`||e.status===`partial`||e.status===`canceled`}function Ae(e){return e.status===`queued`||e.status===`running`}function je(e){return e.language}function Me(e){let t=(0,Z.c)(22),{sourceId:n,lastCollectedAt:r}=e,i=w(Ne),a=i===`zh`,o;t[0]===n?o=t[1]:(o=e=>e.sources.find(e=>e.grantId===n),t[0]=n,t[1]=o);let s=K(o);if(!s){let e;t[2]!==i||t[3]!==r||t[4]!==a?(e=r?`${a?`上次更新:`:`Last updated: `}${new Date(r).toLocaleString(i)}`:a?`尚未分析`:`Not analyzed yet`,t[2]=i,t[3]=r,t[4]=a,t[5]=e):e=t[5];let n;return t[6]===e?n=t[7]:(n=(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:e}),t[6]=e,t[7]=n),n}let c;t[8]===a?c=t[9]:(c=a?{queued:`等待更新`,waiting_desktop:`等待桌面端读取资料`,reading:`正在读取资料`,analyzing:`正在更新理解`}:{queued:`Queued`,waiting_desktop:`Waiting for desktop collection`,reading:`Reading source`,analyzing:`Updating understanding`},t[8]=a,t[9]=c);let l=c,u=s.status===`running`||s.status===`queued`,d=s.status===`failed`||s.status===`partial`||s.status===`canceled`,f=s.metadata.added,p=u?l[s.metadata.phase??`queued`]??l.queued:d?a?`更新未完成,可重试`:`Update incomplete; retry available`:f===0?a?`更新完成,暂无新增理解`:`Updated; no new understanding`:f===void 0?a?`更新完成`:`Updated`:a?`更新完成,新增 ${f} 条`:`Updated; ${f} added`,m;t[10]===p?m=t[11]:(m=(0,Q.jsx)(`p`,{children:p}),t[10]=p,t[11]=m);let h;t[12]!==i||t[13]!==s.completedAt?(h=s.completedAt?(0,Q.jsx)(`p`,{children:new Date(s.completedAt).toLocaleString(i)}):null,t[12]=i,t[13]=s.completedAt,t[14]=h):h=t[14];let g;t[15]!==d||t[16]!==s.errorMessage?(g=d&&s.errorMessage?(0,Q.jsx)(`p`,{className:`text-danger`,children:s.errorMessage}):null,t[15]=d,t[16]=s.errorMessage,t[17]=g):g=t[17];let _;return t[18]!==m||t[19]!==h||t[20]!==g?(_=(0,Q.jsxs)(`div`,{className:`mt-1 text-xs leading-5 text-fg-subtle`,"aria-live":`polite`,children:[m,h,g]}),t[18]=m,t[19]=h,t[20]=g,t[21]=_):_=t[21],_}function Ne(e){return e.language}function Pe(e){let t=(0,Z.c)(49),{language:n,busy:r,statement:i,onEdit:a,onDelete:o}=e,[s,c]=(0,X.useState)(!1),l=n===`zh`,u=l?`修改或删除这条内容`:`Edit or delete this item`,d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),t[0]=d):d=t[0];let f;t[1]!==r||t[2]!==u?(f=(0,Q.jsx)(G,{asChild:!0,children:(0,Q.jsx)(M,{variant:`ghost`,className:`size-11 shrink-0 p-0`,disabled:r,"aria-label":u,children:d})}),t[1]=r,t[2]=u,t[3]=f):f=t[3];let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Q.jsx)(v,{className:`size-4`,"aria-hidden":`true`}),t[4]=m):m=t[4];let h=l?`修改`:`Edit`,g;t[5]!==r||t[6]!==a||t[7]!==h?(g=(0,Q.jsxs)(P,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:a,children:[m,h]}),t[5]=r,t[6]=a,t[7]=h,t[8]=g):g=t[8];let _,y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>c(!0),y=(0,Q.jsx)(ne,{className:`size-4`,"aria-hidden":`true`}),t[9]=_,t[10]=y):(_=t[9],y=t[10]);let b=l?`删除`:`Delete`,x;t[11]!==r||t[12]!==b?(x=(0,Q.jsxs)(P,{className:`flex min-h-11 cursor-pointer items-center gap-2 rounded-lg px-3 text-sm text-fg outline-none focus:bg-surface-hover data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,disabled:r,onSelect:_,children:[y,b]}),t[11]=r,t[12]=b,t[13]=x):x=t[13];let S;t[14]!==x||t[15]!==g?(S=(0,Q.jsx)(U,{children:(0,Q.jsxs)(ye,{align:`end`,sideOffset:4,className:`z-[100] min-w-36 rounded-xl border border-edge bg-surface-overlay p-1 shadow-popover`,children:[g,x]})}),t[14]=x,t[15]=g,t[16]=S):S=t[16];let C;t[17]!==S||t[18]!==f?(C=(0,Q.jsxs)(z,{modal:!1,children:[f,S]}),t[17]=S,t[18]=f,t[19]=C):C=t[19];let w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Q.jsx)(ee,{className:`fixed inset-0 z-[110] bg-scrim`}),t[20]=w):w=t[20];let T=l?`删除这条内容?`:`Delete this item?`,j;t[21]===T?j=t[22]:(j=(0,Q.jsx)(k,{className:`font-semibold text-fg`,children:T}),t[21]=T,t[22]=j);let N=l?`删除后将不再使用这条记忆,原始对话和文件会保留。`:`This memory will no longer be used. Original conversations and files are kept.`,F;t[23]===N?F=t[24]:(F=(0,Q.jsx)(te,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:N}),t[23]=N,t[24]=F);let I;t[25]!==j||t[26]!==F?(I=(0,Q.jsxs)(`header`,{className:`shrink-0 border-b border-edge px-5 py-4`,children:[j,F]}),t[25]=j,t[26]=F,t[27]=I):I=t[27];let L;t[28]===i?L=t[29]:(L=(0,Q.jsx)(`p`,{className:`min-h-0 flex-1 overflow-y-auto whitespace-pre-wrap break-words px-5 py-4 text-sm leading-6 text-fg`,children:i}),t[28]=i,t[29]=L);let R=l?`取消`:`Cancel`,B;t[30]===R?B=t[31]:(B=(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{variant:`ghost`,children:R})}),t[30]=R,t[31]=B);let V;t[32]===o?V=t[33]:(V=()=>{c(!1),o()},t[32]=o,t[33]=V);let H=l?`删除`:`Delete`,W;t[34]!==r||t[35]!==V||t[36]!==H?(W=(0,Q.jsx)(M,{disabled:r,onClick:V,children:H}),t[34]=r,t[35]=V,t[36]=H,t[37]=W):W=t[37];let K;t[38]!==B||t[39]!==W?(K=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3`,children:[B,W]}),t[38]=B,t[39]=W,t[40]=K):K=t[40];let q;t[41]!==I||t[42]!==L||t[43]!==K?(q=(0,Q.jsxs)(D,{children:[w,(0,Q.jsxs)(O,{className:`fixed left-1/2 top-1/2 z-[120] flex h-[min(22rem,calc(100dvh-2rem))] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover`,children:[I,L,K]})]}),t[41]=I,t[42]=L,t[43]=K,t[44]=q):q=t[44];let re;return t[45]!==s||t[46]!==C||t[47]!==q?(re=(0,Q.jsxs)(A,{open:s,onOpenChange:c,children:[C,q]}),t[45]=s,t[46]=C,t[47]=q,t[48]=re):re=t[48],re}function Fe(e,t){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`}).format(e):null}function Ie(e,t,n=new Date){let r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(r);i.setDate(r.getDate()-1);let a=new Map;for(let n of[...e].sort((e,t)=>t.recordedAt-e.recordedAt)){let e=n.recordedAt>=r.getTime()?t===`zh`?`今天`:`Today`:n.recordedAt>=i.getTime()?t===`zh`?`昨天`:`Yesterday`:Fe(n.recordedAt,t)??(t===`zh`?`更早`:`Earlier`),o=a.get(e)??[];o.push(n),a.set(e,o)}return[...a].map(([e,t])=>({label:e,items:t}))}function Le(e,t){return(t===`zh`?{user_explicit:`你告诉我的`,user_observed:`从协作中观察到`,system_inferred:`我形成的判断`,external_untrusted:`来自连接的信息`}:{user_explicit:`You told me`,user_observed:`Observed while working together`,system_inferred:`My current read`,external_untrusted:`From connected information`})[e.authority]}function Re(e,t){if(e.validTo){let n=Fe(e.validTo,t);return t===`zh`?`适用至 ${n}`:`Applies until ${n}`}return(t===`zh`?{stable:`相对稳定`,slow:`会随时间复核`,dynamic:`近期状态`,event:`特定阶段`}:{stable:`Relatively stable`,slow:`Reviewed over time`,dynamic:`Current context`,event:`Specific period`})[e.volatility]}function ze(e,t){return e.authority===`user_explicit`?null:e.confidence>=.85?t===`zh`?`把握较高`:`High confidence`:e.confidence>=.65?t===`zh`?`把握中等`:`Medium confidence`:t===`zh`?`证据较少`:`Limited evidence`}function Be(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function Ve(e){let t=(0,Z.c)(23),{item:n,language:r,busy:i,editing:a,draft:o,onDraftChange:s,onEdit:c,onCancel:l,onDelete:u,onCorrect:d}=e,f=(0,X.useId)(),p=r===`zh`,m;t[0]!==n||t[1]!==r?(m=ze(n,r),t[0]=n,t[1]=r,t[2]=m):m=t[2];let h=m,g;t[3]===n.sources?g=t[4]:(g=new Set(n.sources?.map(Ue).filter(Boolean)),t[3]=n.sources,t[4]=g);let _;t[5]===g?_=t[6]:(_=[...g],t[5]=g,t[6]=_);let v=_,y=p?`修改`:`Edit`,b;return t[7]!==i||t[8]!==h||t[9]!==o||t[10]!==y||t[11]!==a||t[12]!==f||t[13]!==n||t[14]!==r||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==c||t[20]!==v||t[21]!==p?(b=(0,Q.jsx)(`article`,{className:`border-t border-edge-subtle px-4 py-3 first:border-t-0 sm:px-5 [content-visibility:auto] [contain-intrinsic-size:auto_100px]`,children:a?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:f,children:p?`修改这条理解`:`Edit this understanding`}),(0,Q.jsx)(`textarea`,{id:f,value:o,disabled:i,onChange:e=>s(e.target.value),className:`mt-2 min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-base leading-7 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(M,{variant:`ghost`,disabled:i,onClick:l,children:p?`取消`:`Cancel`}),(0,Q.jsx)(M,{variant:`primary`,disabled:!o.trim()||i,onClick:d,children:i?p?`保存中…`:`Saving…`:p?`保存修改`:`Save changes`})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 sm:gap-4`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1 pt-1.5`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg`,children:n.statement}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs leading-5 text-fg-muted`,children:[(0,Q.jsx)(`span`,{children:Le(n,r)}),n.usable===!1?(0,Q.jsx)(`span`,{children:p?`暂不使用`:`Not in use`}):null,n.validTo?(0,Q.jsx)(`span`,{children:Re(n,r)}):null,n.authority!==`user_explicit`&&n.confidence<.65?(0,Q.jsx)(`span`,{children:h}):null,(0,Q.jsxs)(`details`,{className:`open:basis-full`,children:[(0,Q.jsx)(`summary`,{className:`w-fit cursor-pointer rounded-md py-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:p?`查看依据`:`View sources`}),(0,Q.jsxs)(`div`,{className:`my-2 space-y-1 border-l-2 border-edge pl-3 text-sm leading-6`,children:[(0,Q.jsx)(`p`,{children:n.usable?p?`按需用于当前协作`:`Used when relevant`:p?`暂不使用,后台继续复核`:`Not in use; reviewed automatically`}),(0,Q.jsxs)(`p`,{children:[Re(n,r),` · `,Be(n.scope,r),h?` · ${h}`:``]}),(0,Q.jsxs)(`p`,{children:[p?`最近观察:`:`Last observed: `,Fe(n.observedAt,r)]}),(0,Q.jsxs)(`p`,{children:[p?`模型层:`:`Model layer: `,p?{fact:`事实`,pattern:`模式`,interpretation:`解释`}[n.layer]:n.layer,` · `,p?`${n.independentSourceCount} 个独立来源`:`${n.independentSourceCount} independent sources`]}),v.length?v.map(He):(0,Q.jsx)(`p`,{children:p?`暂无更详细的来源记录`:`No further source details available`}),(0,Q.jsx)(M,{variant:`ghost`,className:`-ml-2 px-2`,disabled:i,onClick:c,children:y})]})]})]})]}),(0,Q.jsx)(Pe,{language:r,busy:i,statement:n.statement,onEdit:c,onDelete:u})]})}),t[7]=i,t[8]=h,t[9]=o,t[10]=y,t[11]=a,t[12]=f,t[13]=n,t[14]=r,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=c,t[20]=v,t[21]=p,t[22]=b):b=t[22],b}function He(e){return(0,Q.jsx)(`p`,{className:`break-words`,children:e},e)}function Ue(e){return e.label}var We={zh:{eyebrow:`全局用户理解`,title:`xopc 如何形成对你的理解`,subtitle:`这里汇总跨项目、跨对话形成的认识,并说明它们来自哪些渠道。项目事实不会混入你的个人画像。`,channels:`理解渠道`,channelHint:`查看来源及其最近更新。`,noChannels:`尚未通过任何渠道形成可展示的全局理解。`,activeCount:`{{count}} 条已在使用`,pendingCount:`{{count}} 条暂不使用`,noUnderstanding:`暂无来自此渠道的全局理解`,pending:`最近更新`,pendingHint:`自动整理并按需使用,你可以随时修改或删除。`,nothingPending:`尚未形成全局理解。`,showAll:`查看全部 {{count}} 条`,showLess:`收起`,done:`完成`,updating:`正在从已授权渠道更新理解;你可以先查看已有内容。`,sourceKinds:{user:`你明确告诉我的`,conversation:`对话与协作`,connector:`连接的服务`,work_folder:`工作目录`,local_source:`本机来源`,inference:`综合整理`}},en:{eyebrow:`Global user understanding`,title:`How xopc forms its understanding of you`,subtitle:`This brings together understanding formed across projects and conversations, with the channel behind each item. Project facts stay out of your personal portrait.`,channels:`Understanding channels`,channelHint:`View sources and their latest updates.`,noChannels:`No channel has formed displayable global understanding yet.`,activeCount:`{{count}} in use`,pendingCount:`{{count}} not in use`,noUnderstanding:`No usable global understanding has formed from this channel yet`,pending:`Recent updates`,pendingHint:`Organized automatically and used when relevant. Edit or delete anytime.`,nothingPending:`No understanding has formed yet.`,showAll:`View all {{count}}`,showLess:`Show less`,done:`Done`,updating:`Updating from authorized channels. You can review existing understanding now.`,sourceKinds:{user:`You told me`,conversation:`Conversations and work`,connector:`Connected services`,work_folder:`Work folders`,local_source:`On-device sources`,inference:`Synthesized understanding`}}},Ge={"local-recent-files":{en:`Recent files`,zh:`最近文件`},"chromium-bookmarks":{en:`Recent bookmarks`,zh:`最近书签`},"apple-notes":{en:`Apple Notes`,zh:`Apple 备忘录`},"apple-mail":{en:`Apple Mail`,zh:`Apple 邮件`},"apple-calendar":{en:`Apple Calendar`,zh:`Apple 日历`},"apple-reminders":{en:`Apple Reminders`,zh:`Apple 提醒事项`},"windows-recent-documents":{en:`Recent documents`,zh:`最近文档`},"linux-recent-documents":{en:`Recent documents`,zh:`最近文档`}},Ke={user:x,conversation:_,connector:ce,work_folder:m,local_source:F,inference:ce},$={files:m,recent_documents:F,calendar:L,tasks:J,notes:V,mail:_e,messages:_,code_activity:h};function qe(e){let t=e.authority===`user_explicit`?`user`:e.authority===`user_observed`?`conversation`:e.authority===`external_untrusted`?`connector`:`inference`;return{id:t,kind:t,observedAt:e.observedAt}}function Je(e,t){return e.kind===`local_source`&&e.label?Ge[e.label]?.[t]??e.label:e.kind===`work_folder`&&e.label?t===`zh`?`工作目录 · ${e.label}`:`Work folder · ${e.label}`:e.label?e.label:We[t].sourceKinds[e.kind]}function Ye(e){return`${e.kind}:${e.adapterId}:${e.displayName}`}function Xe(e){let t=(0,Z.c)(91),{assertions:n,configuredSources:r,activityRunning:i,language:a,busy:o,error:c,onReviewAssertion:l,onCompleted:u}=e,f=We[a],[p,m]=(0,X.useState)(!1),[h,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),b;t[0]===n?b=t[1]:(b=n.filter(rt),t[0]=n,t[1]=b);let x=b,S;t[2]===x?S=t[3]:(S=[...x].sort(nt),t[2]=x,t[3]=S);let w=S,ee;if(t[4]!==r||t[5]!==x||t[6]!==a){let e=new Map;for(let t of r){let n=t.kind===`local_source`?Ge[t.adapterId]?.[a]??t.displayName:t.displayName,r=Ye(t);e.set(r,{key:r,grantId:t.id,kind:t.kind,category:t.category,label:t.kind===`work_folder`?a===`zh`?`工作目录 · ${n}`:`Work folder · ${n}`:n,assertions:[],lastObservedAt:t.lastCollectedAt})}for(let t of x)for(let n of t.sources?.length?t.sources:[qe(t)]){let r=Je(n,a),i=[...e.values()].find(e=>e.kind===n.kind&&e.label===r),o=i?.key??`${n.kind}:${r}`,s=i??e.get(o)??{key:o,kind:n.kind,category:n.category,label:r,assertions:[],lastObservedAt:n.observedAt};s.assertions.some(e=>e.id===t.id)||s.assertions.push(t),s.lastObservedAt=Math.max(s.lastObservedAt??0,n.observedAt),e.set(o,s)}ee=[...e.values()].sort(tt),t[4]=r,t[5]=x,t[6]=a,t[7]=ee}else ee=t[7];let T=ee,te;t[8]===l?te=t[9]:(te=async(e,t,n)=>{await l(e,t,n)&&_(null)},t[8]=l,t[9]=te);let E=te,D,O,k,A,j,N,P,F,I;if(t[10]!==i||t[11]!==o||t[12]!==v||t[13]!==h||t[14]!==a||t[15]!==w||t[16]!==E||t[17]!==p||t[18]!==f.eyebrow||t[19]!==f.nothingPending||t[20]!==f.pending||t[21]!==f.pendingHint||t[22]!==f.showAll||t[23]!==f.showLess||t[24]!==f.subtitle||t[25]!==f.title||t[26]!==f.updating){let e=p?w:w.slice(0,5);D=`mx-auto w-full max-w-[42rem] pb-2`,O=`polite`;let n;t[36]===f.eyebrow?n=t[37]:(n=(0,Q.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.18em] text-accent-fg`,children:f.eyebrow}),t[36]=f.eyebrow,t[37]=n);let r;t[38]===f.title?r=t[39]:(r=(0,Q.jsx)(`h2`,{className:`mt-3 text-2xl font-semibold tracking-tight text-fg sm:text-3xl`,children:f.title}),t[38]=f.title,t[39]=r);let s;t[40]===f.subtitle?s=t[41]:(s=(0,Q.jsx)(`p`,{className:`mx-auto mt-3 max-w-[38rem] text-sm leading-6 text-fg-muted`,children:f.subtitle}),t[40]=f.subtitle,t[41]=s),t[42]!==n||t[43]!==r||t[44]!==s?(k=(0,Q.jsxs)(`div`,{className:`text-center`,children:[n,r,s]}),t[42]=n,t[43]=r,t[44]=s,t[45]=k):k=t[45],t[46]!==i||t[47]!==f.updating?(A=i?(0,Q.jsxs)(`div`,{className:`mt-6 flex items-center gap-3 rounded-xl border border-accent/20 bg-accent-soft/55 px-4 py-3 text-sm text-accent-fg`,children:[(0,Q.jsx)(g,{className:`size-4 shrink-0 animate-spin motion-reduce:animate-none`}),(0,Q.jsx)(`p`,{children:f.updating})]}):null,t[46]=i,t[47]=f.updating,t[48]=A):A=t[48],j=`mt-8`,N=`understanding-updates-title`;let c=w.length?` · ${w.length}`:``;t[49]!==f.pending||t[50]!==c?(P=(0,Q.jsxs)(`h3`,{id:`understanding-updates-title`,className:`text-sm font-semibold text-fg`,children:[f.pending,c]}),t[49]=f.pending,t[50]=c,t[51]=P):P=t[51],t[52]===f.pendingHint?F=t[53]:(F=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:f.pendingHint}),t[52]=f.pendingHint,t[53]=F),I=w.length?(0,Q.jsxs)(`div`,{className:`mt-3`,children:[Ie(e,a).map(e=>{let{label:t,items:n}=e;return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`border-b border-edge-subtle px-4 pb-2 pt-3 text-xs font-medium text-fg-muted`,children:t}),(0,Q.jsx)(`div`,{children:n.map(e=>(0,Q.jsx)(Ve,{item:e,language:a,busy:o,editing:h===e.id,draft:v,onDraftChange:y,onEdit:()=>{_(e.id),y(e.statement)},onCancel:()=>_(null),onCorrect:()=>void E(e,`edited`,v.trim()),onDelete:()=>void E(e,`deleted`)},e.id))})]},t)}),w.length>5?(0,Q.jsxs)(`button`,{type:`button`,className:`mx-auto flex items-center gap-1.5 px-3 py-2 text-xs font-medium text-accent-fg hover:underline`,onClick:()=>m(et),children:[p?f.showLess:f.showAll.replace(`{{count}}`,String(w.length)),(0,Q.jsx)(W,{className:C(`size-3.5 transition-transform`,p&&`rotate-180`)})]}):null]}):(0,Q.jsxs)(`div`,{className:`mt-3 flex items-start gap-3 rounded-xl border border-edge bg-surface-base/55 p-4`,children:[(0,Q.jsx)(d,{className:`mt-0.5 size-5 shrink-0 text-success`}),(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:f.nothingPending})]}),t[10]=i,t[11]=o,t[12]=v,t[13]=h,t[14]=a,t[15]=w,t[16]=E,t[17]=p,t[18]=f.eyebrow,t[19]=f.nothingPending,t[20]=f.pending,t[21]=f.pendingHint,t[22]=f.showAll,t[23]=f.showLess,t[24]=f.subtitle,t[25]=f.title,t[26]=f.updating,t[27]=D,t[28]=O,t[29]=k,t[30]=A,t[31]=j,t[32]=N,t[33]=P,t[34]=F,t[35]=I}else D=t[27],O=t[28],k=t[29],A=t[30],j=t[31],N=t[32],P=t[33],F=t[34],I=t[35];let L;t[54]!==j||t[55]!==N||t[56]!==P||t[57]!==F||t[58]!==I?(L=(0,Q.jsxs)(`section`,{className:j,"aria-labelledby":N,children:[P,F,I]}),t[54]=j,t[55]=N,t[56]=P,t[57]=F,t[58]=I,t[59]=L):L=t[59];let R;t[60]!==T.length||t[61]!==f.channels?(R=(0,Q.jsxs)(`summary`,{className:`w-fit cursor-pointer rounded-md py-2 text-sm font-medium text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[f.channels,` · `,T.length]}),t[60]=T.length,t[61]=f.channels,t[62]=R):R=t[62];let z;t[63]===f.channelHint?z=t[64]:(z=(0,Q.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:f.channelHint}),t[63]=f.channelHint,t[64]=z);let B;t[65]!==T||t[66]!==f.activeCount||t[67]!==f.noChannels||t[68]!==f.noUnderstanding||t[69]!==f.pendingCount?(B=T.length?(0,Q.jsx)(`div`,{className:`mt-3 space-y-3`,children:T.map(e=>{let t=e.category?$[e.category]??Ke[e.kind]:Ke[e.kind],n=e.assertions.filter($e).length,r=e.assertions.filter(Qe).length;return(0,Q.jsxs)(`article`,{className:`rounded-xl border border-edge bg-surface-base/55 px-4 py-4`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-surface-hover text-fg-muted`,children:(0,Q.jsx)(t,{className:`size-4`})}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h4`,{className:`truncate text-sm font-medium text-fg`,children:e.label}),e.grantId?(0,Q.jsx)(Me,{sourceId:e.grantId,lastCollectedAt:e.lastObservedAt}):null,e.assertions.length?(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[n?f.activeCount.replace(`{{count}}`,String(n)):``,r?f.pendingCount.replace(`{{count}}`,String(r)):``].filter(Boolean).join(` · `)}):(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:f.noUnderstanding})]}),e.grantId?(0,Q.jsx)(Oe,{sourceId:e.grantId}):null]}),e.assertions.length?(0,Q.jsx)(`ul`,{className:`ml-12 mt-3 space-y-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.assertions.slice(0,5).map(Ze)}):null]},e.key)})}):(0,Q.jsx)(`p`,{className:`mt-3 rounded-xl border border-edge bg-surface-base/55 p-4 text-sm text-fg-muted`,children:f.noChannels}),t[65]=T,t[66]=f.activeCount,t[67]=f.noChannels,t[68]=f.noUnderstanding,t[69]=f.pendingCount,t[70]=B):B=t[70];let V;t[71]!==R||t[72]!==z||t[73]!==B?(V=(0,Q.jsxs)(`details`,{className:`mt-6 border-t border-edge pt-4`,children:[R,z,B]}),t[71]=R,t[72]=z,t[73]=B,t[74]=V):V=t[74];let ne;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Q.jsx)(s,{className:`size-4`}),t[75]=ne):ne=t[75];let H;t[76]!==o||t[77]!==u||t[78]!==f.done?(H=(0,Q.jsx)(`div`,{className:`mt-6 flex justify-end`,children:(0,Q.jsxs)(M,{variant:`primary`,disabled:o,onClick:u,children:[ne,f.done]})}),t[76]=o,t[77]=u,t[78]=f.done,t[79]=H):H=t[79];let U;t[80]===c?U=t[81]:(U=c?(0,Q.jsx)(`p`,{className:`mt-5 text-sm text-danger`,role:`alert`,children:c}):null,t[80]=c,t[81]=U);let G;return t[82]!==D||t[83]!==O||t[84]!==k||t[85]!==A||t[86]!==L||t[87]!==V||t[88]!==H||t[89]!==U?(G=(0,Q.jsxs)(`section`,{className:D,"aria-live":O,children:[k,A,L,V,H,U]}),t[82]=D,t[83]=O,t[84]=k,t[85]=A,t[86]=L,t[87]=V,t[88]=H,t[89]=U,t[90]=G):G=t[90],G}function Ze(e){return(0,Q.jsxs)(`li`,{className:`flex gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-2 size-1 shrink-0 rounded-full bg-accent/60`}),(0,Q.jsx)(`span`,{children:e.statement})]},e.id)}function Qe(e){return!e.usable}function $e(e){return e.usable}function et(e){return!e}function tt(e,t){return t.assertions.length-e.assertions.length||(t.lastObservedAt??0)-(e.lastObservedAt??0)}function nt(e,t){return t.recordedAt-e.recordedAt}function rt(e){return e.scope.type===`global`&&e.status!==`archived`&&e.status!==`rejected`}function it(){let{pathname:e,search:t}=a(),n=w(e=>e.language),r=Y(),[i,o]=(0,X.useState)(!1),[s,c]=(0,X.useState)(null),l=e===`/user-model`,{data:u,mutate:d}=j(l?`/api/user-model`:null,ae),f=K(e=>e.error),p=K(e=>e.sources.some(e=>e.status===`running`||e.status===`queued`)),m=n===`zh`;if((0,X.useEffect)(()=>{l&&new URLSearchParams(t).get(`workDiscovery`)===`review`&&Y.getState().setDrawerOpen(!0)},[l,t]),(0,X.useEffect)(()=>{l&&r.status!==`running`&&d()},[d,l,r.directoryRun?.id,r.status]),!l)return null;let h=r.status===`running`||p,_=async(e,t,n)=>{o(!0),c(null);try{return t===`edited`&&n?await re(e.id,n):t===`deleted`&&await ie(e.id),await d(),!0}catch(e){return c(e instanceof Error?e.message:String(e)),!1}finally{o(!1)}},v=e=>{if(!e&&u&&r.status!==`running`){r.finish();return}r.setDrawerOpen(e)};return(0,Q.jsxs)(A,{open:r.drawerOpen,onOpenChange:v,children:[(0,Q.jsx)(T,{asChild:!0,children:(0,Q.jsx)(M,{type:`button`,variant:`ghost`,className:C(`relative size-8 rounded-xl p-0`,ge),title:m?`查看 xopc 对你的理解`:`Review what xopc understands`,"aria-label":m?`查看 xopc 对你的理解`:`Review what xopc understands`,children:h?(0,Q.jsx)(g,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,Q.jsx)(B,{className:`size-4 text-accent-fg`})})}),(0,Q.jsxs)(D,{children:[(0,Q.jsx)(ee,{className:`fixed inset-0 z-[60] bg-scrim backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in motion-reduce:backdrop-blur-none`}),(0,Q.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-[61] flex items-center justify-center p-3 sm:p-6`,children:(0,Q.jsxs)(O,{className:`xopc-understanding-center pointer-events-auto flex h-[min(42rem,calc(100dvh-1.5rem))] w-[min(44rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-overlay shadow-float outline-none sm:h-[min(42rem,calc(100dvh-3rem))] sm:w-[min(44rem,calc(100vw-3rem))]`,children:[(0,Q.jsxs)(`header`,{className:`flex h-16 shrink-0 items-center justify-between border-b border-edge-subtle px-5 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(k,{className:`text-sm font-semibold text-fg`,children:h?m?`正在更新用户理解`:`Updating user understanding`:m?`用户理解`:`User understanding`}),(0,Q.jsx)(te,{className:`mt-0.5 text-xs text-fg-muted`,children:h?m?`关闭窗口也会在后台继续`:`You can close this window; work continues in the background`:m?`自动更新,可随时修改或删除`:`Updated automatically. Edit or delete anytime`})]}),(0,Q.jsx)(Oe,{disabled:!u?.sources?.length}),(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{variant:`ghost`,className:`size-8 rounded-xl p-0`,"aria-label":m?`关闭`:`Close`,children:(0,Q.jsx)(S,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-5 py-7 sm:px-9 sm:py-9`,children:u?(0,Q.jsx)(Xe,{assertions:u.assertions,configuredSources:u.sources??[],activityRunning:h,language:n,busy:i,error:s??f??null,onReviewAssertion:_,onCompleted:()=>{v(!1)}}):(0,Q.jsxs)(`section`,{className:`space-y-4`,"aria-label":m?`正在加载用户理解`:`Loading user understanding`,children:[(0,Q.jsx)(N,{className:`h-8 w-2/3`}),(0,Q.jsx)(N,{className:`h-32 w-full`}),(0,Q.jsx)(N,{className:`h-32 w-full`})]})})]})})]})]})}function at(e){let t=e.get(`tab`);return t===`understanding`||t===`knowledge`?t:`overview`}var ot={en:{pageTitle:`You`,pageSubtitle:`A living portrait shaped by you and xopc.`,overview:`Your portrait`,understanding:`Shared understanding`,knowledge:`Work memory`,portraitEyebrow:`YOU × XOPC`,portraitIntro:`Your explicit profile stays clear and editable. xopc builds a separate shared understanding through conversations and work.`,editProfile:`Edit basics`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: founder, designer, or engineer`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,timezoneSearch:`Search timezones…`,timezoneNoMatch:`No matching timezone`,locale:`Language / locale`,useDeviceTimezone:`Use this device`,notProvided:`Not provided`,editProfileHint:`These are facts you provide directly. They remain separate from xopc’s observations and inferences.`,saveProfile:`Save`,saving:`Saving…`,explicit:`You told me`,explicitHint:`Facts and preferences you stated directly`,learned:`Learned together`,learnedHint:`Patterns formed from our work`,allUnderstanding:`All understanding`,understandingFilterHint:`Filter this view by how each item was formed.`,importantNow:`What matters now`,prioritySourceGoal:`From a goal you confirmed`,prioritySourceWork:`From your current work`,editPriority:`Edit focus`,addPriority:`Set current focus`,priorityTitle:`Current focus`,priorityTitlePlaceholder:`What matters most right now?`,priorityOutcome:`What a good outcome looks like`,priorityOutcomePlaceholder:`Describe the result you want…`,priorityUntil:`Focus through`,savePriority:`Save focus`,endPriority:`End focus`,endingPriority:`Ending…`,priorityHint:`This is used to keep xopc aligned with what deserves attention now.`,noPriority:`No current priority has been set.`,otherGoals:`Other active outcomes`,howWeWork:`How we work together`,howWeWorkHint:`Your standing instructions for how I should communicate and act.`,noRules:`No collaboration preferences yet.`,recent:`Recently formed understanding`,recentHint:`Recent understanding from our work. You can edit any item.`,seeAll:`See all`,workMemory:`What I remember from the work`,workMemoryHint:`Project facts, decisions, lessons, and open questions stay separate from facts about you.`,items:`items`,maintenanceReady:`Memory upkeep is enabled and waiting for its first run.`,maintenanceComplete:`Memory was last organized`,maintenanceFailed:`The latest memory upkeep needs attention`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshComplete:`Refreshed`,refreshFailed:`Refresh failed`,aboutYouTitle:`A view you can correct`,aboutYouHint:`xopc quietly maintains this working context from collaboration. You can edit or retire any item.`,identity:`Who you are`,preferences:`Preferences and working rhythm`,relationships:`People and relationships`,currentState:`Current context`,insights:`My current read`,emptyGroup:`No understanding has formed here yet.`,correct:`Correct`,save:`Save correction`,cancel:`Cancel`,correctionPlaceholder:`Write the accurate version…`,searchPlaceholder:`Search work memory…`,allMemory:`All work memory`,memoryFilterHint:`Filter by memory type`,memoryLibraryHint:`Only distilled facts, decisions, lessons, commitments, and open questions appear here. Source records stay with their connector.`,noKnowledge:`No work memory has formed yet.`,noKnowledgeMatch:`No work memory matches this search.`,showMore:`Show more`,expand:`Show details`,collapse:`Hide details`,disable:`Disable`,disabled:`Not in use`,enable:`Enable`,loadFailed:`Could not load your understanding.`,tryAgain:`Try again`,actionFailed:`The change could not be saved. Please try again.`},zh:{pageTitle:`你`,pageSubtitle:`一份由你和 xopc 共同塑造、持续生长的画像。`,overview:`你的画像`,understanding:`共同理解`,knowledge:`工作记忆`,portraitEyebrow:`YOU × XOPC`,portraitIntro:`你明确提供的基本信息会被清晰呈现并由你直接编辑;xopc 在对话与共事中形成的理解则单独维护。`,editProfile:`编辑基本信息`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:创业者、产品设计师、工程师`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,timezoneSearch:`搜索时区…`,timezoneNoMatch:`没有匹配的时区`,locale:`语言 / 地区`,useDeviceTimezone:`使用本机时区`,notProvided:`未填写`,editProfileHint:`这些是由你直接提供的事实,与 xopc 的观察和推断分开维护。`,saveProfile:`保存`,saving:`正在保存…`,explicit:`你告诉我的`,explicitHint:`你明确表达的事实与偏好`,learned:`协作中学到的`,learnedHint:`从实际协作中形成的认识`,allUnderstanding:`全部理解`,understandingFilterHint:`按内容来源筛选这份理解。`,importantNow:`此刻重要`,prioritySourceGoal:`来自你确认的当前目标`,prioritySourceWork:`来自当前工作上下文`,editPriority:`编辑`,addPriority:`设置当前关注`,priorityTitle:`当前关注`,priorityTitlePlaceholder:`现在最重要的是什么?`,priorityOutcome:`期待结果`,priorityOutcomePlaceholder:`描述你希望达成的结果…`,priorityUntil:`关注至`,savePriority:`保存关注`,endPriority:`结束关注`,endingPriority:`正在结束…`,priorityHint:`这项内容会帮助 xopc 在协作中优先关注当前最重要的事情。`,noPriority:`还没有设置当前优先事项。`,otherGoals:`其他进行中的目标`,howWeWork:`我们怎样协作`,howWeWorkHint:`你对沟通方式和执行行为的长期约定。`,noRules:`还没有形成协作偏好。`,recent:`最近形成的理解`,recentHint:`最近在协作中形成的认识,你可以随时修改。`,seeAll:`查看全部`,workMemory:`我在工作中记住的`,workMemoryHint:`项目事实、决定、经验和待解问题,与“关于你”的理解分别管理。`,items:`条`,maintenanceReady:`记忆整理已经启用,正在等待首次运行。`,maintenanceComplete:`最近一次记忆整理于`,maintenanceFailed:`最近一次记忆整理需要处理`,refresh:`刷新`,refreshing:`正在刷新…`,refreshComplete:`已刷新`,refreshFailed:`刷新失败`,aboutYouTitle:`一份可以共同修正的理解`,aboutYouHint:`xopc 会在协作中安静地维护这份工作认知。你仍可随时修改或停止使用任何一条。`,identity:`关于你是谁`,preferences:`偏好与工作节奏`,relationships:`重要的人与关系`,currentState:`当前状态`,insights:`我形成的判断`,emptyGroup:`这里还没有形成理解。`,correct:`修正`,save:`保存修正`,cancel:`取消`,correctionPlaceholder:`写下更准确的说法…`,searchPlaceholder:`搜索工作记忆…`,allMemory:`全部工作记忆`,memoryFilterHint:`按记忆类型筛选`,memoryLibraryHint:`这里只显示提炼后的事实、决定、经验、承诺和待解问题;邮件、日历与文档原文保留在对应来源中。`,noKnowledge:`还没有形成工作记忆。`,noKnowledgeMatch:`没有符合搜索条件的工作记忆。`,showMore:`显示更多`,expand:`查看详情`,collapse:`收起详情`,disable:`停用`,disabled:`已停用`,enable:`启用`,loadFailed:`无法载入对你的理解。`,tryAgain:`重试`,actionFailed:`修改没有保存,请重试。`}},st=new Set([`identity.call_name`,`identity.role`,`identity.pronouns`,`preference.timezone`,`preference.locale`]),ct=[`work_thread`,`project_fact`,`workspace_fact`,`decision`,`task_lesson`,`commitment`,`open_question`,`episode`,`note`],lt=`UTC.Africa/Cairo.Africa/Johannesburg.America/Chicago.America/Denver.America/Los_Angeles.America/Mexico_City.America/New_York.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Kolkata.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Berlin.Europe/London.Europe/Madrid.Europe/Paris.Europe/Rome.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function ut(){try{let e=Intl.supportedValuesOf(`timeZone`);return[...new Set([`UTC`,...e])]}catch{return[...lt]}}var dt=ut();function ft(e){return e.map(e=>({value:e,label:e.replaceAll(`_`,` `),group:e.includes(`/`)?e.split(`/`)[0]:`UTC`}))}function pt(e,t,n=!1){return e?new Intl.DateTimeFormat(t===`zh`?`zh-CN`:`en`,{dateStyle:`medium`,...n?{timeStyle:`short`}:{}}).format(e):null}function mt(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function ht(e){return{callName:mt(e.profile.callName)??``,role:mt(e.profile.role)??``,pronouns:mt(e.profile.pronouns)??``,timezone:mt(e.profile.timezone)??``,locale:mt(e.profile.locale)??``}}function gt(e,t){return{"zh-CN":{en:`Simplified Chinese`,zh:`简体中文`},"zh-TW":{en:`Traditional Chinese`,zh:`繁体中文`},"en-US":{en:`English (US)`,zh:`英语(美国)`},"en-GB":{en:`English (UK)`,zh:`英语(英国)`},"ja-JP":{en:`Japanese`,zh:`日语`}}[e]?.[t]??e}function _t(e){return Array.from(e.trim()).slice(0,2).join(``).toLocaleUpperCase()}function vt(e,t){let n=pt(e,t);return t===`zh`?`当前安排至 ${n}`:`Current plan through ${n}`}function yt(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function bt(e){let[t,n,r]=e.split(`-`).map(Number);return new Date(t,n-1,r,23,59,59,999).getTime()}function xt(e,t){return(t===`zh`?{global:`所有协作`,agent:`当前智能体`,workspace:`当前工作区`,project:`当前项目`,session:`当前会话`}:{global:`All work`,agent:`This agent`,workspace:`This workspace`,project:`This project`,session:`This conversation`})[e.type]}function St(e,t){return(t===`zh`?{work_thread:`工作主线`,project_fact:`项目事实`,workspace_fact:`工作区事实`,decision:`已经决定`,task_lesson:`工作经验`,commitment:`承诺与约定`,open_question:`待解问题`,episode:`重要经历`,note:`其他记录`}:{work_thread:`Work threads`,project_fact:`Project facts`,workspace_fact:`Workspace facts`,decision:`Decisions`,task_lesson:`Lessons`,commitment:`Commitments`,open_question:`Open questions`,episode:`Episodes`,note:`Notes`})[e]}function Ct(e,t,n){if(e)return e.targetType===`goal`?t.find(t=>t.id===e.targetId)?.title:/^[0-9a-f]{8}-[0-9a-f-]{20,}$/i.test(e.targetId)?(n===`zh`?{project:`当前项目`,task:`当前任务`,assertion:`一项待处理的理解`,topic:`当前主题`}:{project:`Current project`,task:`Current task`,assertion:`An understanding to address`,topic:`Current topic`})[e.targetType]:e.targetId}function wt(e){let t=(0,Z.c)(16),{title:n,hint:r,action:i,children:a,className:o}=e,s=o===void 0?``:o,c;t[0]===n?c=t[1]:(c=(0,Q.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n}),t[0]=n,t[1]=c);let l;t[2]===r?l=t[3]:(l=r?(0,Q.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm leading-6 text-fg-muted`,children:r}):null,t[2]=r,t[3]=l);let u;t[4]!==c||t[5]!==l?(u=(0,Q.jsxs)(`div`,{children:[c,l]}),t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==i||t[8]!==u?(d=(0,Q.jsxs)(`header`,{className:`flex items-end justify-between gap-4 px-1 pb-3`,children:[u,i]}),t[7]=i,t[8]=u,t[9]=d):d=t[9];let f;t[10]===a?f=t[11]:(f=(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:a}),t[10]=a,t[11]=f);let p;return t[12]!==s||t[13]!==d||t[14]!==f?(p=(0,Q.jsxs)(`section`,{className:s,children:[d,f]}),t[12]=s,t[13]=d,t[14]=f,t[15]=p):p=t[15],p}function Tt(e){let t=(0,Z.c)(7),{icon:n,children:r}=e,i;t[0]===n?i=t[1]:(i=(0,Q.jsx)(`span`,{className:`text-fg-subtle`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Q.jsx)(`p`,{children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-5 py-5 text-sm text-fg-muted`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Et({open:e,profile:t,language:n,saving:r,onOpenChange:i,onSave:a}){let o=ot[n],[s,d]=(0,X.useState)(t),[f,p]=(0,X.useState)(``);(0,X.useEffect)(()=>{e&&(d(t),p(``))},[e,t]);let m=e=>{e.preventDefault(),a({callName:s.callName.trim(),role:s.role.trim(),pronouns:s.pronouns.trim(),timezone:s.timezone.trim(),locale:s.locale.trim()})},h=(e,t,n)=>(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,Q.jsx)(`input`,{value:s[e],onChange:t=>d(n=>({...n,[e]:t.target.value})),placeholder:n,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}),_=[`zh-CN`,`zh-TW`,`en-US`,`en-GB`,`ja-JP`];s.locale&&!_.includes(s.locale)&&_.push(s.locale);let v=ve(),y=(0,X.useMemo)(()=>[...new Set([...dt,v,s.timezone].filter(Boolean))].sort(),[v,s.timezone]),b=f.trim().toLocaleLowerCase(),x=(0,X.useMemo)(()=>ft(y.filter(e=>!b||e.toLocaleLowerCase().includes(b)||e.replaceAll(`_`,` `).toLocaleLowerCase().includes(b))),[y,b]);return(0,Q.jsx)(A,{open:e,onOpenChange:i,children:(0,Q.jsxs)(D,{children:[(0,Q.jsx)(ee,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,Q.jsx)(O,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(40rem,calc(100vh-2rem))] w-[min(42rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:m,children:[(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(k,{className:`font-semibold text-fg`,children:o.editProfile}),(0,Q.jsx)(te,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:o.editProfileHint})]}),(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":o.cancel,children:(0,Q.jsx)(S,{className:`size-4`})})})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5 sm:p-6`,children:(0,Q.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2`,children:[h(`callName`,o.callName,o.callNamePlaceholder),h(`role`,o.role,o.rolePlaceholder),h(`pronouns`,o.pronouns,o.pronounsPlaceholder),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.locale}),(0,Q.jsxs)(c,{value:s.locale,onChange:e=>d(t=>({...t,locale:e.target.value})),children:[(0,Q.jsx)(l,{value:``,children:o.notProvided}),_.map(e=>(0,Q.jsx)(l,{value:e,children:gt(e,n)},e))]})]}),(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm sm:col-span-2`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:o.timezone}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(u,{value:s.timezone,options:x,placeholder:ve(),emptyLabel:o.notProvided,ariaLabel:o.timezone,selectedLabel:s.timezone||o.notProvided,searchPlaceholder:o.timezoneSearch,searchValue:f,onSearchChange:p,statusMessage:x.length?void 0:o.timezoneNoMatch,triggerClassName:`min-w-0 flex-1 rounded-xl bg-surface-base`,onChange:e=>{d(t=>({...t,timezone:e})),p(``)}}),(0,Q.jsx)(M,{className:`shrink-0 whitespace-nowrap`,onClick:()=>d(e=>({...e,timezone:v})),children:o.useDeviceTimezone})]})]})]})}),(0,Q.jsxs)(`footer`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{disabled:r,children:o.cancel})}),(0,Q.jsxs)(M,{type:`submit`,variant:`primary`,disabled:r,children:[r?(0,Q.jsx)(g,{className:`size-4 animate-spin`}):null,r?o.saving:o.saveProfile]})]})]})})]})})}function Dt(e){let t=(0,Z.c)(94),{open:n,priority:r,title:i,outcome:a,language:o,saving:s,onOpenChange:c,onSave:l,onEnd:u}=e,d=ot[o],[f,p]=(0,X.useState)(i),[m,h]=(0,X.useState)(a??``),_=r?.validTo??Date.now()+6048e5,v;t[0]===_?v=t[1]:(v=yt(_),t[0]=_,t[1]=v);let y=v,[b,x]=(0,X.useState)(y),C,w;t[2]!==y||t[3]!==n||t[4]!==a||t[5]!==i?(C=()=>{n&&(p(i),h(a??``),x(y))},w=[y,n,a,i],t[2]=y,t[3]=n,t[4]=a,t[5]=i,t[6]=C,t[7]=w):(C=t[6],w=t[7]),(0,X.useEffect)(C,w);let T;t[8]!==m||t[9]!==f||t[10]!==b||t[11]!==l||t[12]!==r?.targetType?(T=e=>{e.preventDefault(),l({title:f.trim(),...r?.targetType===`goal`?{desiredOutcome:m.trim()}:{},validTo:bt(b)})},t[8]=m,t[9]=f,t[10]=b,t[11]=l,t[12]=r?.targetType,t[13]=T):T=t[13];let j=T,N;t[14]!==m||t[15]!==f||t[16]!==b||t[17]!==r?.targetType?(N=f.trim()&&b&&(r?.targetType!==`goal`||m.trim()),t[14]=m,t[15]=f,t[16]=b,t[17]=r?.targetType,t[18]=N):N=t[18];let P=!!N,F;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Q.jsx)(ee,{className:`xopc-dialog-overlay fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),t[19]=F):F=t[19];let I=r?d.editPriority:d.addPriority,L;t[20]===I?L=t[21]:(L=(0,Q.jsx)(k,{className:`font-semibold text-fg`,children:I}),t[20]=I,t[21]=L);let R;t[22]===d.priorityHint?R=t[23]:(R=(0,Q.jsx)(te,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:d.priorityHint}),t[22]=d.priorityHint,t[23]=R);let z;t[24]!==R||t[25]!==L?(z=(0,Q.jsxs)(`div`,{children:[L,R]}),t[24]=R,t[25]=L,t[26]=z):z=t[26];let B;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(S,{className:`size-4`}),t[27]=B):B=t[27];let V;t[28]===d.cancel?V=t[29]:(V=(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{variant:`ghost`,className:`size-8 shrink-0 p-0`,"aria-label":d.cancel,children:B})}),t[28]=d.cancel,t[29]=V);let ne;t[30]!==z||t[31]!==V?(ne=(0,Q.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-edge px-5 py-4 sm:px-6`,children:[z,V]}),t[30]=z,t[31]=V,t[32]=ne):ne=t[32];let H;t[33]===d.priorityTitle?H=t[34]:(H=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityTitle}),t[33]=d.priorityTitle,t[34]=H);let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>p(e.target.value),t[35]=U):U=t[35];let W;t[36]!==f||t[37]!==d.priorityTitlePlaceholder?(W=(0,Q.jsx)(`input`,{autoFocus:!0,value:f,onChange:U,placeholder:d.priorityTitlePlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base px-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),t[36]=f,t[37]=d.priorityTitlePlaceholder,t[38]=W):W=t[38];let G;t[39]!==H||t[40]!==W?(G=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[H,W]}),t[39]=H,t[40]=W,t[41]=G):G=t[41];let K;t[42]!==m||t[43]!==r?.targetType||t[44]!==d.priorityOutcome||t[45]!==d.priorityOutcomePlaceholder?(K=r?.targetType===`goal`?(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityOutcome}),(0,Q.jsx)(`textarea`,{value:m,onChange:e=>h(e.target.value),placeholder:d.priorityOutcomePlaceholder,className:`min-h-28 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]}):null,t[42]=m,t[43]=r?.targetType,t[44]=d.priorityOutcome,t[45]=d.priorityOutcomePlaceholder,t[46]=K):K=t[46];let q;t[47]===d.priorityUntil?q=t[48]:(q=(0,Q.jsx)(`span`,{className:`font-medium text-fg`,children:d.priorityUntil}),t[47]=d.priorityUntil,t[48]=q);let re;t[49]===r?.validFrom?re=t[50]:(re=r?.validFrom??Date.now(),t[49]=r?.validFrom,t[50]=re);let ie;t[51]===re?ie=t[52]:(ie=yt(re),t[51]=re,t[52]=ie);let J;t[53]!==b||t[54]!==d.priorityUntil||t[55]!==ie?(J=(0,Q.jsx)(xe,{min:ie,value:b,onChange:x,ariaLabel:d.priorityUntil,className:`rounded-xl border border-edge bg-surface-base hover:border-edge-strong hover:bg-surface-base`}),t[53]=b,t[54]=d.priorityUntil,t[55]=ie,t[56]=J):J=t[56];let ae;t[57]!==q||t[58]!==J?(ae=(0,Q.jsxs)(`label`,{className:`grid gap-1.5 text-sm`,children:[q,J]}),t[57]=q,t[58]=J,t[59]=ae):ae=t[59];let oe;t[60]!==G||t[61]!==K||t[62]!==ae?(oe=(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto p-5 sm:p-6`,children:[G,K,ae]}),t[60]=G,t[61]=K,t[62]=ae,t[63]=oe):oe=t[63];let se;t[64]!==u||t[65]!==r||t[66]!==s||t[67]!==d.endPriority||t[68]!==d.endingPriority?(se=r&&u?(0,Q.jsxs)(M,{variant:`ghost`,className:`text-danger hover:text-danger`,disabled:s,onClick:u,children:[s?(0,Q.jsx)(g,{className:`size-4 animate-spin`}):null,s?d.endingPriority:d.endPriority]}):(0,Q.jsx)(`span`,{}),t[64]=u,t[65]=r,t[66]=s,t[67]=d.endPriority,t[68]=d.endingPriority,t[69]=se):se=t[69];let Y;t[70]!==s||t[71]!==d.cancel?(Y=(0,Q.jsx)(E,{asChild:!0,children:(0,Q.jsx)(M,{disabled:s,children:d.cancel})}),t[70]=s,t[71]=d.cancel,t[72]=Y):Y=t[72];let ce=!P||s,le;t[73]===s?le=t[74]:(le=s?(0,Q.jsx)(g,{className:`size-4 animate-spin`}):null,t[73]=s,t[74]=le);let ue;t[75]!==d.savePriority||t[76]!==ce||t[77]!==le?(ue=(0,Q.jsxs)(M,{type:`submit`,variant:`primary`,disabled:ce,children:[le,d.savePriority]}),t[75]=d.savePriority,t[76]=ce,t[77]=le,t[78]=ue):ue=t[78];let de;t[79]!==Y||t[80]!==ue?(de=(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[Y,ue]}),t[79]=Y,t[80]=ue,t[81]=de):de=t[81];let fe;t[82]!==se||t[83]!==de?(fe=(0,Q.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-edge px-5 py-3 sm:px-6`,children:[se,de]}),t[82]=se,t[83]=de,t[84]=fe):fe=t[84];let pe;t[85]!==j||t[86]!==ne||t[87]!==oe||t[88]!==fe?(pe=(0,Q.jsxs)(D,{children:[F,(0,Q.jsx)(O,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[90] h-[min(34rem,calc(100vh-2rem))] w-[min(38rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,children:(0,Q.jsxs)(`form`,{className:`flex h-full min-h-0 flex-col overflow-hidden [border-radius:inherit]`,onSubmit:j,children:[ne,oe,fe]})})]}),t[85]=j,t[86]=ne,t[87]=oe,t[88]=fe,t[89]=pe):pe=t[89];let me;return t[90]!==c||t[91]!==n||t[92]!==pe?(me=(0,Q.jsx)(A,{open:n,onOpenChange:c,children:pe}),t[90]=c,t[91]=n,t[92]=pe,t[93]=me):me=t[93],me}function Ot(e){let t=(0,Z.c)(16),{rule:n,language:r,busy:i,onToggle:a}=e,o=ot[r],s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(we,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`min-w-0 flex-1 text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l;t[3]!==n.status||t[4]!==o.disabled?(l=n.status===`disabled`?(0,Q.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:o.disabled}):null,t[3]=n.status,t[4]=o.disabled,t[5]=l):l=t[5];let u=n.status===`active`?o.disable:o.enable,d;t[6]!==i||t[7]!==a||t[8]!==u?(d=(0,Q.jsx)(M,{variant:`ghost`,className:`h-8`,disabled:i,onClick:a,children:u}),t[6]=i,t[7]=a,t[8]=u,t[9]=d):d=t[9];let f;t[10]!==l||t[11]!==d?(f=(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[l,d]}),t[10]=l,t[11]=d,t[12]=f):f=t[12];let p;return t[13]!==c||t[14]!==f?(p=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,c,f]}),t[13]=c,t[14]=f,t[15]=p):p=t[15],p}function kt(e){let t=(0,Z.c)(15),{suggestion:n,language:r,busy:i,onConfirm:a}=e,o=r===`zh`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(B,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),t[0]=s):s=t[0];let c;t[1]===n.statement?c=t[2]:(c=(0,Q.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:n.statement}),t[1]=n.statement,t[2]=c);let l=o?`根据你已确认的模式生成;确认前不会生效`:`Suggested from a pattern you confirmed; inactive until you approve`,u;t[3]===l?u=t[4]:(u=(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:l}),t[3]=l,t[4]=u);let d;t[5]!==c||t[6]!==u?(d=(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[c,u]}),t[5]=c,t[6]=u,t[7]=d):d=t[7];let f=i?o?`启用中…`:`Enabling…`:o?`确认启用`:`Approve`,p;t[8]!==i||t[9]!==a||t[10]!==f?(p=(0,Q.jsx)(M,{variant:`secondary`,className:`h-8 shrink-0`,disabled:i,onClick:a,children:f}),t[8]=i,t[9]=a,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==p?(m=(0,Q.jsxs)(`div`,{className:`flex items-start gap-3 border-t border-edge-subtle px-5 py-3 first:border-t-0`,children:[s,d,p]}),t[12]=d,t[13]=p,t[14]=m):m=t[14],m}function At(e){let t=(0,Z.c)(22),{item:n,language:r,busy:i,expanded:a,onToggle:o,editing:s,draft:c,onDraftChange:l,onEdit:u,onCancel:d,onReview:f,onDelete:p}=e,m=ot[r],h=n.updatedAt??n.createdAt,g;t[0]!==r||t[1]!==h?(g=pt(h,r),t[0]=r,t[1]=h,t[2]=g):g=t[2];let _=g,v;t[3]===n.content?v=t[4]:(v=n.content.length>96||n.content.includes(`
|
|
2
|
+
`),t[3]=n.content,t[4]=v);let y=v,b;return t[5]!==i||t[6]!==y||t[7]!==_||t[8]!==c||t[9]!==s||t[10]!==a||t[11]!==n.content||t[12]!==n.scope||t[13]!==r||t[14]!==d||t[15]!==p||t[16]!==l||t[17]!==u||t[18]!==f||t[19]!==o||t[20]!==m?(b=(0,Q.jsx)(`article`,{className:`group border-t border-edge-subtle px-5 py-4 first:border-t-0 sm:px-6`,children:s?(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`textarea`,{"aria-label":m.correctionPlaceholder,disabled:i,value:c,onChange:e=>l(e.target.value),className:`min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-sm leading-6 text-fg outline-none transition focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,Q.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,Q.jsx)(M,{variant:`ghost`,className:`h-8`,onClick:d,children:m.cancel}),(0,Q.jsx)(M,{variant:`primary`,className:`h-8`,disabled:!c.trim()||i,onClick:()=>f(`edit_and_approve`,c.trim()),children:m.save})]})]}):(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(q,{className:`mt-1 size-4 shrink-0 text-fg-subtle`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap break-words text-base leading-7 text-fg ${a?``:`line-clamp-2`}`,children:n.content}),(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-fg-subtle`,children:[(0,Q.jsx)(`span`,{children:xt(n.scope,r)}),_?(0,Q.jsx)(`span`,{children:_}):null]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[y?(0,Q.jsx)(M,{variant:`ghost`,className:`size-11 p-0`,"aria-expanded":a,"aria-label":a?m.collapse:m.expand,onClick:o,children:(0,Q.jsx)(W,{className:`size-3.5 transition-transform ${a?`rotate-180`:``}`})}):null,(0,Q.jsx)(Pe,{language:r,busy:i,statement:n.content,onEdit:u,onDelete:p})]})]})}),t[5]=i,t[6]=y,t[7]=_,t[8]=c,t[9]=s,t[10]=a,t[11]=n.content,t[12]=n.scope,t[13]=r,t[14]=d,t[15]=p,t[16]=l,t[17]=u,t[18]=f,t[19]=o,t[20]=m,t[21]=b):b=t[21],b}function jt(){let e=w(e=>e.language),t=ot[e],n=I(e=>e.setPageHeader),r=I(e=>e.clearPageHeader),[a,o]=i(),{data:c,error:l,isLoading:u,isValidating:d,mutate:p}=j(`/api/user-model`,ae),m=at(a),[h,C]=(0,X.useState)(),[ee,T]=(0,X.useState)(),[te,E]=(0,X.useState)(``),[D,O]=(0,X.useState)(),[k,A]=(0,X.useState)(``),[P,F]=(0,X.useState)(``),[z,V]=(0,X.useState)(24),[ne,U]=(0,X.useState)(),[W,G]=(0,X.useState)(!1),[K,J]=(0,X.useState)(!1),[Y,ge]=(0,X.useState)(`all`),[_e,ve]=(0,X.useState)(`all`),[ye,xe]=(0,X.useState)(`idle`),Z=(0,X.useRef)(void 0),Oe=e=>{e!==m&&o(t=>{let n=new URLSearchParams(t);return e===`overview`?n.delete(`tab`):n.set(`tab`,e),n})},ke=(0,X.useCallback)(async()=>{if(!(ye===`refreshing`||d)){Z.current&&window.clearTimeout(Z.current),xe(`refreshing`),T(void 0),E(t.refreshing);try{await p(),xe(`success`),E(t.refreshComplete)}catch{xe(`error`),E(``),T(t.refreshFailed)}finally{Z.current=window.setTimeout(()=>xe(`idle`),1600)}}},[d,p,ye,t]);(0,X.useEffect)(()=>()=>{Z.current&&window.clearTimeout(Z.current)},[]);let Ae=d||ye===`refreshing`,je=Ae?t.refreshing:ye===`success`?t.refreshComplete:ye===`error`?t.refreshFailed:t.refresh;(0,X.useEffect)(()=>(n({startExtra:null,main:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:t.pageTitle}),(0,Q.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:t.pageSubtitle})]}),end:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(it,{}),(0,Q.jsx)(M,{variant:`secondary`,className:`size-9 p-0 ${ye===`success`?`text-success`:ye===`error`?`text-danger`:``}`,disabled:Ae,"aria-label":je,title:je,onClick:()=>void ke(),children:Ae?(0,Q.jsx)(g,{className:`size-4 animate-spin motion-reduce:animate-none`,"aria-hidden":`true`}):ye===`success`?(0,Q.jsx)(s,{className:`size-4`,"aria-hidden":`true`}):ye===`error`?(0,Q.jsx)(R,{className:`size-4`,"aria-hidden":`true`}):(0,Q.jsx)(pe,{className:`size-4`,"aria-hidden":`true`})})]})}),r),[r,Ae,ye,je,ke,n,t]);let Me=async(n,r)=>{C(n),T(void 0),E(``);try{await r(),await p(),E(e===`zh`?`已更新`:`Updated`)}catch{T(t.actionFailed)}finally{C(void 0)}},Ne=e=>{Me(e.id,async()=>{await re(e.id,k.trim()),O(void 0),A(``)})},Pe=async e=>{C(`profile`),T(void 0),E(``);try{await se(e),await p(),G(!1)}catch{T(t.actionFailed)}finally{C(void 0)}},Fe=async(n,r)=>{C(`priority:${n.id}`),T(void 0),E(``);try{await ue(n.id,r),await p(),J(!1),E(e===`zh`?`当前关注已更新`:`Current focus updated`)}catch{T(t.actionFailed)}finally{C(void 0)}},Le=async n=>{C(`priority:create`),T(void 0),E(``);try{await de(n),await p(),J(!1),E(e===`zh`?`当前关注已设置`:`Current focus set`)}catch{T(t.actionFailed)}finally{C(void 0)}},Re=async n=>{C(`priority:${n.id}`),T(void 0),E(``);try{await ue(n.id,{status:`completed`}),await p(),J(!1),E(e===`zh`?`当前关注已结束`:`Current focus ended`)}catch{T(t.actionFailed)}finally{C(void 0)}};if(u)return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-7xl space-y-5 px-4 py-7 sm:px-6 lg:px-8 lg:py-9`,children:[(0,Q.jsx)(N,{className:`h-10 w-72 rounded-xl`}),(0,Q.jsx)(N,{className:`h-72 rounded-xl`}),(0,Q.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-2`,children:[(0,Q.jsx)(N,{className:`h-80 rounded-xl`}),(0,Q.jsx)(N,{className:`h-80 rounded-xl`})]})]});if(l||!c)return(0,Q.jsxs)(`div`,{className:`mx-auto flex min-h-72 max-w-xl flex-col items-center justify-center gap-3 p-6 text-center`,children:[(0,Q.jsx)(Se,{className:`size-6 text-fg-subtle`}),(0,Q.jsx)(`p`,{className:`text-sm text-danger`,children:t.loadFailed}),(0,Q.jsx)(M,{onClick:()=>void p(),children:t.tryAgain})]});let ze=c.assertions.filter(e=>e.usable&&e.scope.type===`global`&&!st.has(e.predicate)).sort((e,t)=>{let n=e.declaredImportance??e.inferredImportance;return(t.declaredImportance??t.inferredImportance)-n||t.recordedAt-e.recordedAt}),Be=ht(c),He=Be.callName||(e===`zh`?`你`:`You`),Ue=ze.filter(e=>e.authority===`user_explicit`).length,We=ze.length-Ue,Ge=ze.filter(e=>Y===`explicit`?e.authority===`user_explicit`:Y===`learned`?e.authority!==`user_explicit`:!0),Ke=c.priorities.filter(e=>e.status===`active`&&e.validTo>Date.now()),$=Ke.find(e=>e.rank===`primary`)??Ke[0],qe=Ct($,c.goals,e),Je=$?.targetType===`goal`?c.goals.find(e=>e.id===$.targetId):void 0,Ye=c.goals.filter(e=>e.status===`active`||e.status===`paused`).filter(e=>$?.targetType!==`goal`||e.id!==$.targetId),Xe=c.rules.filter(e=>e.status!==`archived`),Ze=c.ruleSuggestions??[],Qe=[...ze].sort((e,t)=>t.recordedAt-e.recordedAt),$e=c.knowledge.filter(e=>e.status!==`archived`&&e.status!==`rejected`),et=P.trim().toLocaleLowerCase(),tt=$e.filter(e=>_e===`all`||e.kind===_e),nt=tt.filter(t=>!et||t.content.toLocaleLowerCase().includes(et)||St(t.kind,e).toLocaleLowerCase().includes(et)),rt=[{key:`identity`,title:t.identity,icon:x,items:Ge.filter(e=>e.kind===`identity`)},{key:`preferences`,title:t.preferences,icon:Ce,items:Ge.filter(e=>[`preference`,`value`,`routine`,`capability`].includes(e.kind))},{key:`relationships`,title:t.relationships,icon:we,items:Ge.filter(e=>e.kind===`relationship`)},{key:`current`,title:t.currentState,icon:f,items:Ge.filter(e=>e.kind===`current_state`)},{key:`insights`,title:t.insights,icon:B,items:Ge.filter(e=>e.kind===`derived_insight`)}].filter(e=>e.items.length>0),lt=ct.map(e=>({kind:e,count:$e.filter(t=>t.kind===e).length})).filter(e=>e.count>0),ut=lt.slice(0,4),dt=ut.length===1?`grid-cols-1`:ut.length===2?`sm:grid-cols-2`:ut.length===3?`sm:grid-cols-3`:`sm:grid-cols-2 lg:grid-cols-4`,ft=nt.slice(0,z),mt=ct.map(e=>({kind:e,items:ft.filter(t=>t.kind===e),totalCount:nt.filter(t=>t.kind===e).length})).filter(e=>e.items.length>0),yt=[{id:`all`,label:t.allUnderstanding,count:ze.length},{id:`explicit`,label:t.explicit,count:Ue},{id:`learned`,label:t.learned,count:We}],bt=e=>{ge(e),Oe(`understanding`)},xt=e=>{ve(e),F(``),V(24),Oe(`knowledge`)},jt=t=>(0,Q.jsx)(Ve,{item:t,language:e,busy:!!h,editing:D===t.id,draft:D===t.id?k:``,onDraftChange:A,onEdit:()=>{O(t.id),A(t.statement)},onCancel:()=>{O(void 0),A(``)},onDelete:()=>void Me(t.id,()=>ie(t.id)),onCorrect:()=>Ne(t)},t.id),Mt=c.maintenance.lastRun?pt(c.maintenance.lastRun.finishedAt??c.maintenance.lastRun.startedAt,e,!0):null,Nt=c.maintenance.lastRun?c.maintenance.lastRun.status===`completed`?`${t.maintenanceComplete} ${Mt}`:t.maintenanceFailed:t.maintenanceReady;return(0,Q.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl space-y-8 px-4 py-7 sm:px-6 lg:px-8 lg:py-10`,children:[(0,Q.jsx)(be,{items:[{id:`overview`,label:t.overview,icon:B},{id:`understanding`,label:t.understanding,icon:x,count:ze.length},{id:`knowledge`,label:t.knowledge,icon:q,count:$e.length}],activeTab:m,onChange:Oe,ariaLabel:t.pageTitle,tabIdPrefix:`understanding-tab`,panelIdPrefix:`understanding-panel`,className:`w-fit max-w-full gap-1 rounded-full bg-surface-panel p-1 shadow-surface`,buttonClassName:`rounded-full px-3.5 py-2`,selectedClassName:`bg-surface-active text-fg`,unselectedClassName:`text-fg-muted hover:bg-surface-hover hover:text-fg`}),(0,Q.jsx)(`p`,{role:`status`,className:`sr-only`,children:te}),ee?(0,Q.jsxs)(`div`,{role:`alert`,className:`flex items-center justify-between gap-3 rounded-xl border border-danger bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,Q.jsx)(`span`,{children:ee}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>T(void 0),"aria-label":t.cancel,children:(0,Q.jsx)(S,{className:`size-4`})})]}):null,m===`overview`?(0,Q.jsxs)(`div`,{id:`understanding-panel-overview`,role:`tabpanel`,"aria-labelledby":`understanding-tab-overview`,className:`space-y-10`,children:[(0,Q.jsxs)(`section`,{"data-testid":`overview-hero`,className:`grid gap-8 lg:grid-cols-[minmax(0,1fr)_minmax(20rem,24rem)] lg:gap-12`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0 px-1 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-semibold tracking-[0.16em] text-accent-fg`,children:[(0,Q.jsx)(B,{className:`size-3.5`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{children:t.portraitEyebrow})]}),(0,Q.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-5`,children:[(0,Q.jsx)(`div`,{className:`flex size-20 shrink-0 items-center justify-center rounded-[1.4rem] bg-surface-active text-xl font-semibold text-fg`,children:_t(He)}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h2`,{className:`truncate text-3xl font-semibold tracking-tight text-fg`,children:He}),(0,Q.jsx)(`p`,{className:`mt-1 break-words text-sm text-fg-muted`,children:Be.role||t.notProvided})]}),(0,Q.jsxs)(M,{variant:`ghost`,className:`shrink-0`,onClick:()=>G(!0),children:[(0,Q.jsx)(De,{className:`size-4`,"aria-hidden":`true`}),t.editProfile]})]}),(0,Q.jsx)(`p`,{className:`mt-5 max-w-2xl text-sm leading-6 text-fg-muted`,children:t.portraitIntro}),(0,Q.jsx)(`dl`,{className:`mt-7 grid gap-x-8 gap-y-5 sm:grid-cols-3`,children:[{icon:Te,label:t.locale,value:Be.locale?gt(Be.locale,e):t.notProvided},{icon:Ee,label:t.timezone,value:Be.timezone||t.notProvided},{icon:x,label:t.pronouns,value:Be.pronouns||t.notProvided}].map(({icon:e,label:t,value:n})=>(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`dt`,{className:`flex items-center gap-1.5 text-xs text-fg-subtle`,children:[(0,Q.jsx)(e,{className:`size-3.5`,"aria-hidden":`true`}),t]}),(0,Q.jsx)(`dd`,{className:`mt-1.5 truncate text-sm font-medium text-fg`,children:n})]},t))})]}),(0,Q.jsxs)(`aside`,{"data-testid":`priority-panel`,className:`flex min-h-64 flex-col rounded-[1.4rem] bg-surface-panel p-6 shadow-surface`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-fg-subtle`,children:t.importantNow}),$?(0,Q.jsxs)(`p`,{className:`mt-1.5 flex items-center gap-1.5 text-xs text-fg-muted`,children:[(0,Q.jsx)(me,{className:`size-3.5`,"aria-hidden":`true`}),$.targetType===`goal`?t.prioritySourceGoal:t.prioritySourceWork]}):null]}),$&&qe?(0,Q.jsxs)(M,{variant:`ghost`,className:`h-8 shrink-0 px-2.5`,onClick:()=>J(!0),children:[(0,Q.jsx)(v,{className:`size-3.5`,"aria-hidden":`true`}),t.editPriority]}):null]}),qe?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`mt-3 text-lg font-semibold leading-7 tracking-tight text-fg`,children:qe}),Je?.desiredOutcome?(0,Q.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:Je.desiredOutcome}):null,$?(0,Q.jsxs)(`p`,{className:`mt-auto flex items-center gap-1.5 pt-4 text-xs text-fg-subtle`,children:[(0,Q.jsx)(L,{className:`size-3.5`,"aria-hidden":`true`}),vt($.validTo,e)]}):null]}):(0,Q.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-2 py-6 text-center text-sm text-fg-muted`,children:[(0,Q.jsx)(me,{className:`size-5 text-fg-subtle`}),(0,Q.jsx)(`span`,{children:t.noPriority}),(0,Q.jsxs)(M,{variant:`primary`,className:`mt-2`,onClick:()=>J(!0),children:[(0,Q.jsx)(y,{className:`size-4`,"aria-hidden":`true`}),t.addPriority]})]}),Ye.length?(0,Q.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,Q.jsx)(`p`,{className:`text-xs text-fg-subtle`,children:t.otherGoals}),(0,Q.jsx)(`div`,{className:`mt-2 space-y-2`,children:Ye.slice(0,3).map(e=>(0,Q.jsx)(`p`,{className:`text-sm text-fg`,children:e.title},e.id))})]}):null]})]}),(0,Q.jsx)(`section`,{"aria-label":t.understanding,className:`grid gap-2 sm:grid-cols-2`,children:[{filter:`explicit`,icon:_,label:t.explicit,hint:t.explicitHint,count:Ue},{filter:`learned`,icon:Se,label:t.learned,hint:t.learnedHint,count:We}].map(({filter:e,icon:t,label:n,hint:r,count:i})=>(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-24 w-full cursor-pointer items-start gap-3 rounded-2xl px-4 py-4 text-left transition-colors hover:bg-surface-panel focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent sm:px-5`,onClick:()=>bt(e),"aria-label":`${n}: ${i}`,children:[(0,Q.jsx)(t,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsxs)(`p`,{className:`text-sm font-medium text-fg`,children:[(0,Q.jsx)(`span`,{className:`mr-1.5 text-lg tabular-nums`,children:i}),n]}),(0,Q.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-subtle`,children:r})]}),(0,Q.jsx)(H,{className:`mt-1 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted motion-reduce:transform-none`,"aria-hidden":`true`})]},n))}),(0,Q.jsxs)(`div`,{className:`grid items-start gap-10 lg:grid-cols-2 lg:gap-8`,children:[(0,Q.jsx)(wt,{title:t.recent,hint:t.recentHint,action:(0,Q.jsx)(M,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Oe(`understanding`),children:t.seeAll}),children:Qe.length?(0,Q.jsx)(`div`,{children:Ie(Qe.slice(0,3),e).map(({label:e,items:t})=>(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h3`,{className:`px-5 pb-1 pt-4 text-xs font-medium text-fg-muted`,children:e}),(0,Q.jsx)(`div`,{children:t.map(jt)})]},e))}):(0,Q.jsx)(Tt,{icon:(0,Q.jsx)(Se,{className:`size-5`}),children:t.emptyGroup})}),(0,Q.jsx)(wt,{title:t.howWeWork,hint:t.howWeWorkHint,children:Xe.length||Ze.length?(0,Q.jsxs)(Q.Fragment,{children:[Xe.slice(0,3).map(t=>(0,Q.jsx)(Ot,{rule:t,language:e,busy:h===t.id,onToggle:()=>void Me(t.id,()=>fe(t.id,t.status===`active`?`disabled`:`active`))},t.id)),Ze.slice(0,2).map(t=>(0,Q.jsx)(kt,{suggestion:t,language:e,busy:h===t.id,onConfirm:()=>void Me(t.id,()=>he(t))},t.id))]}):(0,Q.jsx)(Tt,{icon:(0,Q.jsx)(we,{className:`size-5`}),children:t.noRules})})]}),(0,Q.jsx)(wt,{title:t.workMemory,hint:t.workMemoryHint,action:(0,Q.jsx)(M,{variant:`ghost`,className:`h-8 shrink-0`,onClick:()=>Oe(`knowledge`),children:t.seeAll}),children:lt.length?(0,Q.jsx)(`div`,{"data-testid":`memory-summary-grid`,className:`grid gap-3 bg-surface-base ${dt}`,children:ut.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,className:`group flex min-h-28 cursor-pointer items-start justify-between rounded-2xl bg-surface-panel px-5 py-5 text-left transition-colors hover:bg-surface-hover focus-visible:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,onClick:()=>xt(t),"aria-label":`${St(t,e)}: ${n}`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{className:`block text-2xl font-semibold tabular-nums text-fg`,children:n}),(0,Q.jsx)(`span`,{className:`mt-1 block text-sm text-fg-muted`,children:St(t,e)})]}),(0,Q.jsx)(H,{className:`mt-1 size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-fg-muted motion-reduce:transform-none`,"aria-hidden":`true`})]},t))}):(0,Q.jsx)(Tt,{icon:(0,Q.jsx)(ce,{className:`size-5`}),children:t.noKnowledge})}),(0,Q.jsx)(`footer`,{className:`flex items-center gap-4 px-1 pb-2 text-xs text-fg-subtle`,children:(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,Q.jsx)(pe,{className:`size-3.5`,"aria-hidden":`true`}),Nt]})})]}):null,m===`understanding`?(0,Q.jsxs)(`div`,{id:`understanding-panel-understanding`,role:`tabpanel`,"aria-labelledby":`understanding-tab-understanding`,className:`space-y-10`,children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(Se,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`,"aria-hidden":`true`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:t.aboutYouTitle}),(0,Q.jsx)(`p`,{className:`mt-1 max-w-3xl text-sm leading-6 text-fg-muted`,children:t.aboutYouHint})]})]}),(0,Q.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.understandingFilterHint,children:yt.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":Y===e.id,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${Y===e.id?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ge(e.id),children:[e.label,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:e.count})]},e.id))})]}),rt.length?rt.map(({key:e,title:t,icon:n,items:r})=>(0,Q.jsx)(wt,{title:t,action:(0,Q.jsx)(n,{className:`size-4 text-fg-subtle`,"aria-hidden":`true`}),children:(0,Q.jsx)(`div`,{children:r.map(jt)})},e)):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(Tt,{icon:(0,Q.jsx)(Se,{className:`size-5`}),children:t.emptyGroup})})]}):null,m===`knowledge`?(0,Q.jsxs)(`div`,{id:`understanding-panel-knowledge`,role:`tabpanel`,"aria-labelledby":`understanding-tab-knowledge`,className:`space-y-8`,children:[(0,Q.jsxs)(`div`,{className:`px-1 pt-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,Q.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,Q.jsx)(`h2`,{className:`font-semibold text-fg`,children:_e===`all`?t.allMemory:St(_e,e)}),(0,Q.jsxs)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:[tt.length,` `,t.items,` · `,t.memoryLibraryHint]})]}),(0,Q.jsxs)(`label`,{className:`relative block sm:w-80`,children:[(0,Q.jsx)(b,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`}),(0,Q.jsx)(`span`,{className:`sr-only`,children:t.searchPlaceholder}),(0,Q.jsx)(`input`,{type:`search`,value:P,onChange:e=>{F(e.target.value),V(24)},placeholder:t.searchPlaceholder,className:`h-10 w-full rounded-xl border border-edge bg-surface-base pl-9 pr-3 text-sm text-fg outline-none transition placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`})]})]}),(0,Q.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,role:`group`,"aria-label":t.memoryFilterHint,children:[(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":_e===`all`,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${_e===`all`?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ve(`all`),children:[t.allMemory,(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:$e.length})]}),lt.map(({kind:t,count:n})=>(0,Q.jsxs)(`button`,{type:`button`,"aria-pressed":_e===t,className:`touch-target inline-flex min-h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${_e===t?`bg-surface-active text-fg`:`text-fg-muted hover:bg-surface-hover hover:text-fg`}`,onClick:()=>ve(t),children:[St(t,e),(0,Q.jsx)(`span`,{className:`tabular-nums text-fg-subtle`,children:n})]},t))]})]}),nt.length?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`space-y-8`,children:mt.map(({kind:t,items:n,totalCount:r})=>(0,Q.jsxs)(`section`,{className:`overflow-hidden rounded-2xl bg-surface-panel`,children:[(0,Q.jsxs)(`header`,{className:`flex items-center justify-between px-5 pb-1 pt-4 sm:px-6`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:St(t,e)}),(0,Q.jsx)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:r})]}),(0,Q.jsx)(`div`,{children:n.map(t=>(0,Q.jsx)(At,{item:t,language:e,busy:!!h,expanded:ne===t.id,onToggle:()=>U(e=>e===t.id?void 0:t.id),editing:D===`knowledge:${t.id}`,draft:k,onDraftChange:A,onEdit:()=>{O(`knowledge:${t.id}`),A(t.content)},onCancel:()=>{O(void 0),A(``)},onDelete:()=>void Me(t.id,()=>le(t.id)),onReview:(e,n)=>void Me(t.id,async()=>{await oe(t,e,n),O(void 0),A(``)})},t.id))})]},t))}),nt.length>z?(0,Q.jsx)(`div`,{className:`flex justify-center pt-2`,children:(0,Q.jsx)(M,{onClick:()=>V(e=>e+24),children:t.showMore})}):null]}):(0,Q.jsx)(`div`,{className:`rounded-2xl bg-surface-panel`,children:(0,Q.jsx)(Tt,{icon:(0,Q.jsx)(b,{className:`size-5`}),children:P.trim()?t.noKnowledgeMatch:t.noKnowledge})})]}):null,(0,Q.jsx)(Et,{open:W,profile:Be,language:e,saving:h===`profile`,onOpenChange:G,onSave:e=>void Pe(e)}),(0,Q.jsx)(Dt,{open:K,priority:$,title:qe??``,outcome:Je?.desiredOutcome,language:e,saving:h===($?`priority:${$.id}`:`priority:create`),onOpenChange:J,onSave:e=>$?void Fe($,e):void Le(e),onEnd:$?()=>void Re($):void 0})]})}export{jt as UserModelPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{
|
|
1
|
+
import"./rolldown-runtime-aKtaBQYM.js";import{a as e,n as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{Yo as i}from"./index-Cr4SINLG.js";import{u as a}from"./voice-config-api-BvzxINUk.js";var o=t();e();var s=n();function c(e){let t=(0,o.c)(15),{kind:n,providerId:c,fieldId:u,value:d,onChange:f,labels:p,placeholder:m,className:h}=e,g=m===void 0?`sk-...`:m,_;t[0]!==n||t[1]!==c?(_=()=>a({kind:n,provider:c}).then(l),t[0]=n,t[1]=c,t[2]=_):_=t[2];let v=_,y;t[3]===h?y=t[4]:(y=r(`flex min-w-0 flex-col gap-1.5`,h),t[3]=h,t[4]=y);let b;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==g||t[9]!==v||t[10]!==d?(b=(0,s.jsx)(i,{id:u,value:d,onChange:f,placeholder:g,labels:p,reveal:v,loadFailedLabel:p.loadFailed,maskedHelp:p.maskedHelp,notInConfigFile:p.notInConfigFile,inputClassName:`text-xs`}),t[5]=u,t[6]=p,t[7]=f,t[8]=g,t[9]=v,t[10]=d,t[11]=b):b=t[11];let x;return t[12]!==y||t[13]!==b?(x=(0,s.jsx)(`div`,{className:y,children:b}),t[12]=y,t[13]=b,t[14]=x):x=t[14],x}function l(e){return e.apiKey??null}export{c as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,r as t}from"./locale-store-BSkKhYkc.js";import{n}from"./gateway-config-swr-BYMrbKZE.js";async function r(){return(await e(t(`/api/voice/realtime/status`))).payload}async function i(n){let r=await e(t(`/api/voice/realtime/preview`),{method:`POST`,signal:n});if(r.payload.sampleRate!==24e3)throw Error(`Unsupported preview sample rate`);return Uint8Array.from(atob(r.payload.audio),e=>e.charCodeAt(0)).buffer}async function a(n,r,i){let a=new URLSearchParams({provider:n,model:r});return i&&a.set(`purpose`,i),(await e(t(`/api/voice/tts-voices?${a.toString()}`))).payload?.voices??[]}function o(){return{enabled:!1,provider:`openai`,providers:{alibaba:{model:`qwen-audio-3.0-asr-flash`},openai:{model:`gpt-4o-mini-transcribe`}},fallback:{enabled:!1,order:[]}}}function s(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,providers:{alibaba:{model:`qwen-tts`,voice:`Cherry`},openai:{model:`tts-1`,voice:`alloy`},edge:{voice:`zh-CN-XiaoxiaoNeural`,lang:`zh-CN`},minimax:{model:`speech-2.8-hd`,voice:`male-qn-qingse`}}}}function c(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function l(e){return typeof e==`string`&&e.trim().length>0?e.trim():`openai`}function u(e){let t=o();if(!c(e))return t;let n=l(e.provider),r=t.fallback??{enabled:!1,order:[]};if(c(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):r.order;r={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:r.enabled,order:t.length?t:r.order}}let i={...t.providers??{},...c(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,c(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,providers:i,fallback:r}}function d(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function f(e){let t=s();if(!c(e))return t;let n=d(e.provider),r=e.trigger===`off`||e.trigger===`always`||e.trigger===`inbound`||e.trigger===`tagged`?e.trigger:`inbound`,i={...t.providers??{},...c(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,c(t)?{...t}:{}])):{}};return{enabled:!!e.enabled,provider:n,trigger:r,maxTextLength:typeof e.maxTextLength==`number`&&Number.isFinite(e.maxTextLength)?e.maxTextLength:t.maxTextLength,timeoutMs:typeof e.timeoutMs==`number`&&Number.isFinite(e.timeoutMs)?e.timeoutMs:t.timeoutMs,providers:i}}function p(e){return{...e}}function m(e){return{...e}}function h(e){let t=c(e)?e:{},n=c(t.voice)?t.voice:{},r=c(n.input)?n.input:{},i=c(r.refinement)?r.refinement:{},a=c(n.realtime)?n.realtime:{},o=i.mode===`punctuation`||i.mode===`light`||i.mode===`custom`?i.mode:`off`;return{stt:u(t.stt),tts:f(t.tts),voice:{languageMode:n.languageMode===`manual`?`manual`:`auto`,language:n.language===`zh`?`zh`:`en`,input:{refinement:{mode:o,...typeof i.model==`string`&&i.model.trim()?{model:i.model.trim()}:{},...typeof i.customInstruction==`string`?{customInstruction:i.customInstruction}:{}}},realtime:{enabled:a.enabled===!0,defaultEngine:a.defaultEngine===`omni`?`omni`:`agent`,silenceDurationMs:typeof a.silenceDurationMs==`number`?a.silenceDurationMs:1200,idleTimeoutMs:typeof a.idleTimeoutMs==`number`?a.idleTimeoutMs:6e4,maxDictationMs:typeof a.maxDictationMs==`number`?a.maxDictationMs:6e5,maxConversationMs:typeof a.maxConversationMs==`number`?a.maxConversationMs:36e5,bargeIn:a.bargeIn!==!1,...c(a.stt)&&a.stt.provider===`xopc-cloud`&&typeof a.stt.model==`string`?{stt:{provider:`xopc-cloud`,model:a.stt.model}}:{},...c(a.tts)&&(a.tts.provider===`alibaba`||a.tts.provider===`xopc-cloud`)?{tts:{provider:a.tts.provider,...typeof a.tts.model==`string`?{model:a.tts.model}:{},...typeof a.tts.voice==`string`?{voice:a.tts.voice}:{}}}:{},...c(a.omni)?{omni:{...a.omni}}:{}}}}}async function g(){return h((await e(t(`/api/config`))).payload?.config??{})}async function _(r){await e(t(`/api/config`),{method:`PATCH`,body:JSON.stringify({stt:p(r.stt),tts:m(r.tts),voice:r.voice})}),r.voice.languageMode===`auto`&&await e(t(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:r.voice.language})}),typeof window<`u`&&window.dispatchEvent(new Event(`voice-config-changed`)),n()}async function v(){let n=await e(t(`/api/voice/models`));if(!n.payload?.models)throw Error(`Missing voice models payload`);return n.payload.models}async function y(){let n=await e(t(`/api/voice/providers`));if(!n.payload?.providers)throw Error(`Missing voice providers payload`);return n.payload}async function b(){let n=await e(t(`/api/voice/stt-providers`));if(!n.payload?.providers)throw Error(`Missing STT providers payload`);return n.payload}async function x(n,r){let i=await e(t(`/api/voice/tts-test`),{method:`POST`,signal:r,body:JSON.stringify(n)});if(i.ok===!1){let e=typeof i.error==`string`?i.error:i.error?.message;throw Error(e||`TTS test failed`)}if(!i.payload||typeof i.payload.audio!=`string`||!i.payload.audio.trim())throw Error(`TTS test returned no audio. Check the selected voice engine and try again.`);return i.payload}async function S(n){let r=await e(t(`/api/voice/reveal-api-key`),{method:`POST`,body:JSON.stringify(n)});if(!r.payload)throw Error(`Missing reveal payload`);return r.payload}export{g as a,_ as c,x as d,y as i,i as l,a as n,b as o,v as r,h as s,r as t,S as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DPHK1VkS.js";var t=e(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./x-B_N4OPjy.js";import{
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./x-B_N4OPjy.js";import{t as a}from"./messages-D0G_sZvA.js";import{n as o}from"./locale-store-BSkKhYkc.js";import{a as s,i as c,o as l,r as u,s as d,t as f}from"./dist-BGTk37IG.js";import{t as p}from"./button-CS04eWY9.js";import{X as m,es as h,it as g}from"./index-Cr4SINLG.js";var _=n(),v=e(t(),1),y=r(),b=180;function x(e){let t=(0,_.c)(40),{requestedOpen:n,onExited:r}=e,x=o(C),w=g(S),[T,E]=(0,v.useState)(!0),D=(0,v.useRef)(!1),O=(0,v.useRef)(null),k;t[0]===x?k=t[1]:(k=a(x),t[0]=x,t[1]=k);let A=k.onboarding.workDiscovery,j=w?x===`zh`?`在后台继续`:`Continue in background`:x===`zh`?`稍后再说`:`Maybe later`,M;t[2]===r?M=t[3]:(M=()=>{if(D.current)return;D.current=!0,E(!1);let e=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:b;O.current=window.setTimeout(r,e)},t[2]=r,t[3]=M);let N=M,P,F;t[4]!==N||t[5]!==n?(P=()=>{n||N()},F=[N,n],t[4]=N,t[5]=n,t[6]=P,t[7]=F):(P=t[6],F=t[7]),(0,v.useEffect)(P,F);let I,L;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>()=>{O.current!==null&&window.clearTimeout(O.current)},L=[],t[8]=I,t[9]=L):(I=t[8],L=t[9]),(0,v.useEffect)(I,L);let R;t[10]===N?R=t[11]:(R=e=>{e||N()},t[10]=N,t[11]=R);let z;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,y.jsx)(s,{className:`xopc-dialog-overlay fixed inset-0 z-[75] bg-scrim backdrop-blur-[1px]`}),t[12]=z):z=t[12];let B;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,y.jsx)(h,{className:`size-7 shrink-0`,"aria-hidden":!0}),t[13]=B):B=t[13];let V;t[14]===A.title?V=t[15]:(V=(0,y.jsx)(d,{className:`truncate text-sm font-semibold text-fg`,children:A.title}),t[14]=A.title,t[15]=V);let H;t[16]===A.subtitle?H=t[17]:(H=(0,y.jsx)(c,{className:`sr-only`,children:A.subtitle}),t[16]=A.subtitle,t[17]=H);let U;t[18]!==V||t[19]!==H?(U=(0,y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[B,V,H]}),t[18]=V,t[19]=H,t[20]=U):U=t[20];let W;t[21]===j?W=t[22]:(W=(0,y.jsx)(`span`,{className:`hidden text-xs sm:inline`,children:j}),t[21]=j,t[22]=W);let G;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,y.jsx)(i,{className:`size-4`,"aria-hidden":!0}),t[23]=G):G=t[23];let K;t[24]!==j||t[25]!==N||t[26]!==W?(K=(0,y.jsxs)(p,{type:`button`,variant:`ghost`,className:`h-9 shrink-0 gap-1.5 px-2.5 text-fg-muted`,title:j,"aria-label":j,onClick:N,children:[W,G]}),t[24]=j,t[25]=N,t[26]=W,t[27]=K):K=t[27];let q;t[28]!==U||t[29]!==K?(q=(0,y.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between gap-4 border-b border-edge bg-surface-panel px-4 sm:px-5`,children:[U,K]}),t[28]=U,t[29]=K,t[30]=q):q=t[30];let J;t[31]===N?J=t[32]:(J=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,y.jsx)(m,{embedded:!0,onRequestClose:N})}),t[31]=N,t[32]=J);let Y;t[33]!==q||t[34]!==J?(Y=(0,y.jsxs)(l,{children:[z,(0,y.jsx)(u,{className:`xopc-work-discovery-dialog pointer-events-none fixed inset-0 z-[76] flex items-center justify-center p-3 outline-none sm:p-6`,children:(0,y.jsxs)(`section`,{className:`xopc-work-discovery-panel pointer-events-auto flex h-[min(47.5rem,calc(100dvh-1.5rem))] w-[min(45rem,calc(100vw-1.5rem))] flex-col overflow-hidden rounded-xl border border-edge bg-surface-base shadow-float sm:h-[min(47.5rem,calc(100dvh-3rem))] sm:w-[min(45rem,calc(100vw-3rem))]`,children:[q,J]})})]}),t[33]=q,t[34]=J,t[35]=Y):Y=t[35];let X;return t[36]!==T||t[37]!==Y||t[38]!==R?(X=(0,y.jsx)(f,{open:T,onOpenChange:R,children:Y}),t[36]=T,t[37]=Y,t[38]=R,t[39]=X):X=t[39],X}function S(e){return e.status===`running`}function C(e){return e.language}export{x as WorkDiscoveryOverlay};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./createLucideIcon-DPHK1VkS.js";import{n as a,r as o}from"./popover-select-DcsFzD_i.js";import{t as s}from"./eye-CABVeTq0.js";import{t as c}from"./markdown-view-DXubGEic.js";import{t as l}from"./x-B_N4OPjy.js";import{t as u}from"./messages-D0G_sZvA.js";import{t as d}from"./cn-JdwAhgNB.js";import{i as f,r as p}from"./locale-store-BSkKhYkc.js";import{a as m,n as h,o as g,r as _,s as v,t as y}from"./dist-BGTk37IG.js";import{t as b}from"./button-CS04eWY9.js";import{Ic as x,Kr as S,Mc as C,Rc as w,Vr as T,Wl as E,di as D,pl as O,qc as ee,ti as k,ui as A}from"./index-Cr4SINLG.js";var j=i(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),M=i(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),N=e(t(),1),P=n();function F(e){if(!e.trim())return null;try{return JSON.parse(e)}catch{return null}}function I(e){return typeof e.message==`string`&&e.message.trim()?e.message:typeof e.error==`string`&&e.error.trim()?e.error:e.error&&typeof e.error==`object`&&typeof e.error.message==`string`?e.error.message:`AI suggestion failed`}function L(e,t={}){let n=F(e.split(`
|
|
2
|
+
`).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trimStart()).join(`
|
|
3
|
+
`));if(!n)return null;if(n.type===`text_delta`&&typeof n.delta==`string`)return t.onDelta?.(n.delta),null;if(n.type===`thinking_delta`&&typeof n.delta==`string`)return t.onThinkingDelta?.(n.delta),null;if(n.type===`done`&&typeof n.text==`string`)return n.text;if(n.type===`error`)throw Error(I(n));return null}async function R(e,t={}){let n=await f(p(`/api/ai/text-assist`),{method:`POST`,headers:{Accept:`text/event-stream`},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({})),t=typeof e.error==`string`?e.error:e.error?.message;throw Error(t||`AI suggestion failed (${n.status})`)}if(!n.body){let e=await n.json().catch(()=>null);if(e?.text)return e;throw Error(`AI suggestion stream is empty`)}let r=n.body.getReader(),i=new TextDecoder,a=``,o=``,s=``;for(;;){let{done:e,value:n}=await r.read();if(n){a+=i.decode(n,{stream:!e});let r=a.split(/\r?\n\r?\n/);a=r.pop()??``;for(let e of r){let n=L(e,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});n!==null&&(o=n)}}if(e)break}if(a.trim()){let e=L(a,{onDelta:e=>{o+=e,t.onDelta?.(e)},onThinkingDelta:e=>{s+=e,t.onThinkingDelta?.(e)}});e!==null&&(o=e)}let c=o.trim();if(!c)throw Error(`AI returned an empty suggestion`);return{text:c,thinking:s.trim()||void 0}}function te(){let[e,t]=(0,N.useState)(``),[n,r]=(0,N.useState)(``),[i,a]=(0,N.useState)(!1),[o,s]=(0,N.useState)(null);return{suggestion:e,thinking:n,loading:i,error:o,generate:(0,N.useCallback)(async e=>{a(!0),s(null),t(``),r(``);try{let n=await R(e,{onDelta:e=>{t(t=>t+e)},onThinkingDelta:e=>{r(t=>t+e)}});return t(n.text),r(n.thinking??``),n.text}catch(e){return s(e instanceof Error?e.message:`AI suggestion failed`),null}finally{a(!1)}},[]),reset:(0,N.useCallback)(()=>{t(``),r(``),s(null),a(!1)},[])}}var z=r(),ne=5;function re(e){return e.startsWith(`zh`)?{title:`AI 优化文案`,buttonTitle:`优化文案`,current:`当前内容`,suggestion:`AI 建议`,editedSuggestion:`审核并编辑建议`,thinking:`模型思考`,thinkingLoading:`思考中`,edit:`编辑`,preview:`预览`,loading:`正在生成建议...`,empty:`暂无内容`,generate:`生成建议`,regenerate:`重新生成`,applyCurrent:`应用当前内容`,replace:`替换`,append:`追加`,cancel:`取消`,close:`关闭`}:{title:`AI text assist`,buttonTitle:`Improve text`,current:`Current`,suggestion:`Suggestion`,editedSuggestion:`Review and edit suggestion`,thinking:`Model thinking`,thinkingLoading:`Thinking`,edit:`Edit`,preview:`Preview`,loading:`Generating suggestion...`,empty:`No content`,generate:`Generate suggestion`,regenerate:`Regenerate`,applyCurrent:`Apply current`,replace:`Replace`,append:`Append`,cancel:`Cancel`,close:`Close`}}function B(e){let t=(0,P.c)(239),{value:n,onApply:r,fieldId:i,fieldLabel:a,scenario:o,format:u,intent:f,locale:p,context:S,disabled:C,className:w,showLabel:T}=e,D=o===void 0?`generic.text`:o,O=u===void 0?`plain`:u,k=f===void 0?`improve`:f,A=T===void 0?!0:T,[M,F]=(0,N.useState)(!1),[I,L]=(0,N.useState)(n),[R,B]=(0,N.useState)(`preview`),[V,H]=(0,N.useState)(``),[U,W]=(0,N.useState)(`edit`),[G,K]=(0,N.useState)(!0),[oe,se]=(0,N.useState)(!1),[q,ce]=(0,N.useState)(null),le=(0,N.useRef)(null),ue=(0,N.useRef)(!0),{suggestion:de,thinking:J,loading:Y,error:X,generate:fe,reset:pe}=te(),me;t[0]===p?me=t[1]:(me=re(p),t[0]=p,t[1]=me);let Z=me,he;t[2]!==Y||t[3]!==J?(he=Y&&J.trim().length>0,t[2]=Y,t[3]=J,t[4]=he):he=t[4];let Q=he,ge,_e;t[5]!==M||t[6]!==n?(ge=()=>{M||L(n)},_e=[M,n],t[5]=M,t[6]=n,t[7]=ge,t[8]=_e):(ge=t[7],_e=t[8]),(0,N.useEffect)(ge,_e);let ve,ye;t[9]===de?(ve=t[10],ye=t[11]):(ye=()=>{H(de)},ve=[de],t[9]=de,t[10]=ve,t[11]=ye),(0,N.useEffect)(ye,ve);let be,xe;t[12]===J?(be=t[13],xe=t[14]):(be=()=>{J.trim()&&K(!0)},xe=[J],t[12]=J,t[13]=be,t[14]=xe),(0,N.useEffect)(be,xe);let Se;t[15]!==Q||t[16]!==G?(Se=()=>{let e=le.current;!e||!Q||!G||ue.current&&(e.scrollTop=e.scrollHeight)},t[15]=Q,t[16]=G,t[17]=Se):Se=t[17];let Ce;t[18]!==Q||t[19]!==J||t[20]!==G?(Ce=[Q,J,G],t[18]=Q,t[19]=J,t[20]=G,t[21]=Ce):Ce=t[21],(0,N.useLayoutEffect)(Se,Ce);let we;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(we=()=>{let e=le.current;e&&(ue.current=e.scrollHeight-e.scrollTop-e.clientHeight<=ne)},t[22]=we):we=t[22];let Te=we,Ee;t[23]!==S||t[24]!==i||t[25]!==a||t[26]!==O||t[27]!==fe||t[28]!==k||t[29]!==p||t[30]!==D?(Ee=async e=>{W(`edit`),K(!0),ue.current=!0,await fe({intent:k,scenario:D,input:e,locale:p,field:{id:i,label:a,format:O},context:S})},t[23]=S,t[24]=i,t[25]=a,t[26]=O,t[27]=fe,t[28]=k,t[29]=p,t[30]=D,t[31]=Ee):Ee=t[31];let De=Ee,Oe;t[32]!==pe||t[33]!==n?(Oe=e=>{se(!!e.currentTarget.closest(`[role="dialog"]`)),ce(document.querySelector(`.app-main-surface`)),L(n),B(`preview`),H(``),W(`edit`),K(!0),pe(),F(!0)},t[32]=pe,t[33]=n,t[34]=Oe):Oe=t[34];let ke=Oe,Ae;t[35]!==I||t[36]!==De?(Ae=async()=>{await De(I)},t[35]=I,t[36]=De,t[37]=Ae):Ae=t[37];let je=Ae,Me;t[38]!==pe||t[39]!==n?(Me=()=>{F(!1),L(n),B(`preview`),H(``),W(`edit`),K(!0),pe()},t[38]=pe,t[39]=n,t[40]=Me):Me=t[40];let $=Me,Ne;t[41]!==$||t[42]!==I||t[43]!==r?(Ne=()=>{r(I),$()},t[41]=$,t[42]=I,t[43]=r,t[44]=Ne):Ne=t[44];let Pe=Ne,Fe;t[45]!==$||t[46]!==V||t[47]!==r?(Fe=()=>{V.trim()&&(r(V),$())},t[45]=$,t[46]=V,t[47]=r,t[48]=Fe):Fe=t[48];let Ie=Fe,Le;t[49]!==$||t[50]!==I||t[51]!==V||t[52]!==r?(Le=()=>{if(!V.trim())return;let e=I.trimEnd();r(e?`${e}\n\n${V}`:V),$()},t[49]=$,t[50]=I,t[51]=V,t[52]=r,t[53]=Le):Le=t[53];let Re=Le,ze;t[54]!==V||t[55]!==X||t[56]!==Y?(ze=!Y&&!X&&V.trim().length>0,t[54]=V,t[55]=X,t[56]=Y,t[57]=ze):ze=t[57];let Be=ze,Ve=I!==n,He;t[58]!==V||t[59]!==X||t[60]!==J?(He=V.trim().length>0||J.trim().length>0||!!X,t[58]=V,t[59]=X,t[60]=J,t[61]=He):He=t[61];let Ue=He,We=!A&&`size-7 p-0`,Ge;t[62]!==w||t[63]!==We?(Ge=d(`h-7 gap-1 px-2 text-xs`,We,w),t[62]=w,t[63]=We,t[64]=Ge):Ge=t[64];let Ke=C||Y,qe;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(qe=(0,z.jsx)(x,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0}),t[65]=qe):qe=t[65];let Je=A?Z.buttonTitle:null,Ye;t[66]!==Z.buttonTitle||t[67]!==ke||t[68]!==Ge||t[69]!==Ke||t[70]!==Je?(Ye=(0,z.jsxs)(b,{type:`button`,variant:`ghost`,className:Ge,title:Z.buttonTitle,"aria-label":Z.buttonTitle,disabled:Ke,onClick:ke,children:[qe,Je]}),t[66]=Z.buttonTitle,t[67]=ke,t[68]=Ge,t[69]=Ke,t[70]=Je,t[71]=Ye):Ye=t[71];let Xe;t[72]===$?Xe=t[73]:(Xe=e=>e?F(!0):$(),t[72]=$,t[73]=Xe);let Ze=q??void 0,Qe=oe?`bg-transparent`:`bg-scrim`,$e;t[74]===Qe?$e=t[75]:($e=d(`xopc-dialog-overlay absolute inset-0 z-[80]`,Qe),t[74]=Qe,t[75]=$e);let et;t[76]===$e?et=t[77]:(et=(0,z.jsx)(m,{className:$e}),t[76]=$e,t[77]=et);let tt;t[78]===Z.title?tt=t[79]:(tt=(0,z.jsx)(v,{className:`text-base font-semibold text-fg`,children:Z.title}),t[78]=Z.title,t[79]=tt);let nt;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,z.jsx)(l,{className:`size-5`,strokeWidth:1.75}),t[80]=nt):nt=t[80];let rt;t[81]===Z.close?rt=t[82]:(rt=(0,z.jsx)(h,{asChild:!0,children:(0,z.jsx)(b,{type:`button`,variant:`ghost`,className:`size-9 shrink-0 p-0`,"aria-label":Z.close,children:nt})}),t[81]=Z.close,t[82]=rt);let it;t[83]!==tt||t[84]!==rt?(it=(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-b border-edge px-4 py-3`,children:[tt,rt]}),t[83]=tt,t[84]=rt,t[85]=it):it=t[85];let at;t[86]===Z.current?at=t[87]:(at=(0,z.jsx)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:Z.current}),t[86]=Z.current,t[87]=at);let ot=R===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,st;t[88]===ot?st=t[89]:(st=d(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,ot),t[88]=ot,t[89]=st);let ct,lt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ct=()=>B(`edit`),lt=(0,z.jsx)(j,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[90]=ct,t[91]=lt):(ct=t[90],lt=t[91]);let ut;t[92]!==Z.edit||t[93]!==st?(ut=(0,z.jsxs)(`button`,{type:`button`,className:st,onClick:ct,children:[lt,Z.edit]}),t[92]=Z.edit,t[93]=st,t[94]=ut):ut=t[94];let dt=R===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,ft;t[95]===dt?ft=t[96]:(ft=d(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,dt),t[95]=dt,t[96]=ft);let pt,mt;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>B(`preview`),mt=(0,z.jsx)(s,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[97]=pt,t[98]=mt):(pt=t[97],mt=t[98]);let ht;t[99]!==Z.preview||t[100]!==ft?(ht=(0,z.jsxs)(`button`,{type:`button`,className:ft,onClick:pt,children:[mt,Z.preview]}),t[99]=Z.preview,t[100]=ft,t[101]=ht):ht=t[101];let gt;t[102]!==ut||t[103]!==ht?(gt=(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,children:[ut,ht]}),t[102]=ut,t[103]=ht,t[104]=gt):gt=t[104];let _t;t[105]!==at||t[106]!==gt?(_t=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[at,gt]}),t[105]=at,t[106]=gt,t[107]=_t):_t=t[107];let vt;t[108]!==I||t[109]!==R||t[110]!==O||t[111]!==Z.current||t[112]!==Z.empty?(vt=R===`preview`?(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:O===`markdown`?(0,z.jsx)(c,{content:I||Z.empty,compact:!0,className:`text-sm`}):(0,z.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:I||Z.empty})}):(0,z.jsx)(`textarea`,{className:`min-h-0 flex-1 resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25`,value:I,onChange:e=>L(e.currentTarget.value),placeholder:Z.empty,"aria-label":Z.current}),t[108]=I,t[109]=R,t[110]=O,t[111]=Z.current,t[112]=Z.empty,t[113]=vt):vt=t[113];let yt;t[114]!==_t||t[115]!==vt?(yt=(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[_t,vt]}),t[114]=_t,t[115]=vt,t[116]=yt):yt=t[116];let bt;t[117]===Z.editedSuggestion?bt=t[118]:(bt=(0,z.jsx)(`span`,{children:Z.editedSuggestion}),t[117]=Z.editedSuggestion,t[118]=bt);let xt;t[119]!==Z.loading||t[120]!==Y?(xt=Y?(0,z.jsx)(`span`,{className:`ml-2 font-normal`,children:Z.loading}):null,t[119]=Z.loading,t[120]=Y,t[121]=xt):xt=t[121];let St;t[122]!==bt||t[123]!==xt?(St=(0,z.jsxs)(`div`,{className:`min-w-0 text-xs font-medium text-fg-muted`,children:[bt,xt]}),t[122]=bt,t[123]=xt,t[124]=St):St=t[124];let Ct=U===`edit`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,wt;t[125]===Ct?wt=t[126]:(wt=d(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ct),t[125]=Ct,t[126]=wt);let Tt,Et;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(Tt=()=>W(`edit`),Et=(0,z.jsx)(j,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[127]=Tt,t[128]=Et):(Tt=t[127],Et=t[128]);let Dt;t[129]!==Z.edit||t[130]!==wt?(Dt=(0,z.jsxs)(`button`,{type:`button`,className:wt,onClick:Tt,children:[Et,Z.edit]}),t[129]=Z.edit,t[130]=wt,t[131]=Dt):Dt=t[131];let Ot=U===`preview`?`bg-surface-panel text-fg shadow-surface`:`text-fg-muted hover:bg-surface-hover`,kt;t[132]===Ot?kt=t[133]:(kt=d(`inline-flex h-7 items-center gap-1.5 rounded-md px-2 text-xs font-medium`,Ot),t[132]=Ot,t[133]=kt);let At,jt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(At=()=>W(`preview`),jt=(0,z.jsx)(s,{className:`size-3.5 shrink-0`,strokeWidth:1.75,"aria-hidden":!0}),t[134]=At,t[135]=jt):(At=t[134],jt=t[135]);let Mt;t[136]!==Z.preview||t[137]!==kt?(Mt=(0,z.jsxs)(`button`,{type:`button`,className:kt,onClick:At,children:[jt,Z.preview]}),t[136]=Z.preview,t[137]=kt,t[138]=Mt):Mt=t[138];let Nt;t[139]!==Dt||t[140]!==Mt?(Nt=(0,z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 rounded-lg border border-edge bg-surface-inset p-0.5`,children:[Dt,Mt]}),t[139]=Dt,t[140]=Mt,t[141]=Nt):Nt=t[141];let Pt;t[142]!==St||t[143]!==Nt?(Pt=(0,z.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[St,Nt]}),t[142]=St,t[143]=Nt,t[144]=Pt):Pt=t[144];let Ft=Q?`opacity-100`:`pointer-events-none opacity-0`,It;t[145]===Ft?It=t[146]:(It=d(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Ft),t[145]=Ft,t[146]=It);let Lt=!Q,Rt;t[147]===Symbol.for(`react.memo_cache_sentinel`)?(Rt=()=>K(ie),t[147]=Rt):Rt=t[147];let zt;t[148]!==Z.thinkingLoading||t[149]!==Y?(zt=Y?(0,z.jsxs)(`span`,{className:`ml-1 font-normal`,children:[`· `,Z.thinkingLoading]}):null,t[148]=Z.thinkingLoading,t[149]=Y,t[150]=zt):zt=t[150];let Bt;t[151]!==Z.thinking||t[152]!==zt?(Bt=(0,z.jsxs)(`span`,{className:`min-w-0 truncate`,children:[Z.thinking,zt]}),t[151]=Z.thinking,t[152]=zt,t[153]=Bt):Bt=t[153];let Vt=G&&`rotate-180`,Ht;t[154]===Vt?Ht=t[155]:(Ht=d(`size-3.5 shrink-0 transition-transform`,Vt),t[154]=Vt,t[155]=Ht);let Ut;t[156]===Ht?Ut=t[157]:(Ut=(0,z.jsx)(E,{className:Ht,strokeWidth:1.75,"aria-hidden":!0}),t[156]=Ht,t[157]=Ut);let Wt;t[158]!==Bt||t[159]!==Ut?(Wt=(0,z.jsxs)(`button`,{type:`button`,className:`flex shrink-0 items-center justify-between gap-2 px-2.5 py-2 text-left text-xs font-medium text-fg-muted hover:text-fg`,onClick:Rt,children:[Bt,Ut]}),t[158]=Bt,t[159]=Ut,t[160]=Wt):Wt=t[160];let Gt;t[161]!==J||t[162]!==G?(Gt=G?(0,z.jsx)(`pre`,{ref:le,className:`min-h-0 flex-1 overflow-auto border-t border-edge px-2.5 py-2 whitespace-pre-wrap text-xs leading-5 text-fg-muted`,onScroll:Te,children:J}):null,t[161]=J,t[162]=G,t[163]=Gt):Gt=t[163];let Kt;t[164]!==Wt||t[165]!==Gt?(Kt=(0,z.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col rounded-lg border border-edge bg-surface-inset/70`,children:[Wt,Gt]}),t[164]=Wt,t[165]=Gt,t[166]=Kt):Kt=t[166];let qt;t[167]!==It||t[168]!==Lt||t[169]!==Kt?(qt=(0,z.jsx)(`div`,{className:It,"aria-hidden":Lt,children:Kt}),t[167]=It,t[168]=Lt,t[169]=Kt,t[170]=qt):qt=t[170];let Jt=Q?`pointer-events-none opacity-0`:`opacity-100`,Yt;t[171]===Jt?Yt=t[172]:(Yt=d(`absolute inset-0 min-h-0 transition-opacity duration-200 ease-out motion-reduce:transition-none`,Jt),t[171]=Jt,t[172]=Yt);let Xt;t[173]!==V||t[174]!==X||t[175]!==O||t[176]!==Z.empty||t[177]!==Z.loading||t[178]!==Z.suggestion||t[179]!==Y||t[180]!==U?(Xt=X?(0,z.jsx)(`pre`,{className:`h-full min-h-0 overflow-auto whitespace-pre-wrap rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg-muted`,children:X}):U===`preview`?(0,z.jsx)(`div`,{className:`h-full min-h-0 overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg`,children:Y&&!V.trim()?(0,z.jsx)(`p`,{className:`text-sm text-fg-muted`,children:Z.loading}):O===`markdown`?(0,z.jsx)(c,{content:V||Z.empty,compact:!0,className:`text-sm`}):(0,z.jsx)(`pre`,{className:`whitespace-pre-wrap text-sm leading-6 text-fg`,children:V||Z.empty})}):(0,z.jsx)(`textarea`,{className:`h-full min-h-0 w-full resize-none overflow-auto rounded-lg border border-edge bg-surface-base p-3 text-sm leading-6 text-fg outline-none focus:border-accent focus:ring-2 focus:ring-accent/25 disabled:text-fg-muted`,value:V,onChange:e=>H(e.currentTarget.value),disabled:Y,placeholder:Y?Z.loading:Z.empty,"aria-label":Z.suggestion}),t[173]=V,t[174]=X,t[175]=O,t[176]=Z.empty,t[177]=Z.loading,t[178]=Z.suggestion,t[179]=Y,t[180]=U,t[181]=Xt):Xt=t[181];let Zt;t[182]!==Yt||t[183]!==Xt?(Zt=(0,z.jsx)(`div`,{className:Yt,children:Xt}),t[182]=Yt,t[183]=Xt,t[184]=Zt):Zt=t[184];let Qt;t[185]!==qt||t[186]!==Zt?(Qt=(0,z.jsxs)(`div`,{className:`relative min-h-0 flex-1 overflow-hidden`,children:[qt,Zt]}),t[185]=qt,t[186]=Zt,t[187]=Qt):Qt=t[187];let $t;t[188]!==Pt||t[189]!==Qt?($t=(0,z.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden`,children:[Pt,Qt]}),t[188]=Pt,t[189]=Qt,t[190]=$t):$t=t[190];let en;t[191]!==yt||t[192]!==$t?(en=(0,z.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-1 gap-3 overflow-hidden p-4 md:grid-cols-2`,children:[yt,$t]}),t[191]=yt,t[192]=$t,t[193]=en):en=t[193];let tn;t[194]!==$||t[195]!==Z.cancel?(tn=(0,z.jsx)(b,{type:`button`,variant:`secondary`,onClick:$,children:Z.cancel}),t[194]=$,t[195]=Z.cancel,t[196]=tn):tn=t[196];let nn=!Ve,rn;t[197]!==Pe||t[198]!==Z.applyCurrent||t[199]!==nn?(rn=(0,z.jsx)(b,{type:`button`,variant:`secondary`,disabled:nn,onClick:Pe,children:Z.applyCurrent}),t[197]=Pe,t[198]=Z.applyCurrent,t[199]=nn,t[200]=rn):rn=t[200];let an;t[201]===je?an=t[202]:(an=()=>void je(),t[201]=je,t[202]=an);let on;t[203]===Ue?on=t[204]:(on=Ue?(0,z.jsx)(ee,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}):(0,z.jsx)(x,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[203]=Ue,t[204]=on);let sn=Ue?Z.regenerate:Z.generate,cn;t[205]!==Y||t[206]!==an||t[207]!==on||t[208]!==sn?(cn=(0,z.jsxs)(b,{type:`button`,variant:`secondary`,disabled:Y,onClick:an,children:[on,sn]}),t[205]=Y,t[206]=an,t[207]=on,t[208]=sn,t[209]=cn):cn=t[209];let ln=!Be,un;t[210]!==Re||t[211]!==Z.append||t[212]!==ln?(un=(0,z.jsx)(b,{type:`button`,variant:`secondary`,disabled:ln,onClick:Re,children:Z.append}),t[210]=Re,t[211]=Z.append,t[212]=ln,t[213]=un):un=t[213];let dn=!Be,fn;t[214]!==Ie||t[215]!==Z.replace||t[216]!==dn?(fn=(0,z.jsx)(b,{type:`button`,variant:`primary`,disabled:dn,onClick:Ie,children:Z.replace}),t[214]=Ie,t[215]=Z.replace,t[216]=dn,t[217]=fn):fn=t[217];let pn;t[218]!==fn||t[219]!==tn||t[220]!==rn||t[221]!==cn||t[222]!==un?(pn=(0,z.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-4 py-3`,children:[tn,rn,cn,un,fn]}),t[218]=fn,t[219]=tn,t[220]=rn,t[221]=cn,t[222]=un,t[223]=pn):pn=t[223];let mn;t[224]!==pn||t[225]!==it||t[226]!==en?(mn=(0,z.jsx)(`div`,{className:`absolute inset-0 z-[80] flex items-center justify-center p-4 pointer-events-none`,children:(0,z.jsxs)(_,{className:`xopc-dialog-content-pane pointer-events-auto flex h-[min(78vh,38rem)] w-full max-w-4xl flex-col overflow-hidden rounded-2xl border border-edge bg-surface-overlay shadow-popover outline-none`,onOpenAutoFocus:ae,children:[it,en,pn]})}),t[224]=pn,t[225]=it,t[226]=en,t[227]=mn):mn=t[227];let hn;t[228]!==mn||t[229]!==Ze||t[230]!==et?(hn=(0,z.jsxs)(g,{container:Ze,children:[et,mn]}),t[228]=mn,t[229]=Ze,t[230]=et,t[231]=hn):hn=t[231];let gn;t[232]!==M||t[233]!==hn||t[234]!==Xe?(gn=(0,z.jsx)(y,{open:M,onOpenChange:Xe,children:hn}),t[232]=M,t[233]=hn,t[234]=Xe,t[235]=gn):gn=t[235];let _n;return t[236]!==gn||t[237]!==Ye?(_n=(0,z.jsxs)(z.Fragment,{children:[Ye,gn]}),t[236]=gn,t[237]=Ye,t[238]=_n):_n=t[238],_n}function ie(e){return!e}function ae(e){return e.preventDefault()}function V(e){return!!(e&&e.type===`object`&&e.properties&&!Array.isArray(e.properties))}function H(e){let t=e.properties??{},n=new Set(e.required??[]);return Object.entries(t).map(([e,t])=>({key:e,schema:t,required:n.has(e)}))}function U(e,t){return!V(e)||!e?!0:H(e).every(e=>{if(!e.required)return!0;let n=t[e.key];return n==null?!1:typeof n==`string`?n.trim().length>0:!0})}function W(e,t){if(e)return V(e.inputSchema)?Object.keys(t.schemaInput).length>0?t.schemaInput:void 0:T(t.argValues)}function G(e,t,n){let r=u(t).workflows;if(!e)return r.noInputSummary;let i=D(e,t);if(V(e.inputSchema)&&Object.keys(n.schemaInput).length>0)return Object.entries(n.schemaInput).map(([e,t])=>`${e}: ${String(t)}`).join(` · `);let a=Object.values(n.argValues).map(e=>e.trim()).filter(Boolean),o=n.goal.trim()||i.description;return o&&a.unshift(o),a.length>0?a.join(` · `):r.noInputSummary}function K(e,t,n=!0){return e?n?V(e.inputSchema)?U(e.inputSchema,t.schemaInput)?{valid:!0}:{valid:!1,reason:`schema-required`}:{valid:(k[e.name]??[]).every(e=>!e.required||!!t.argValues[e.key]?.trim())}:{valid:!1,reason:`raw-json`}:{valid:!1}}function oe(e,t){return e[t]??t}function se(e,t){let n=k[e]??[];if(n.length===0)return{};let r=t&&typeof t==`object`&&!Array.isArray(t)?t:{},i={};for(let e of n){let t=r[e.key];t!=null&&(i[e.key]=String(t))}return i}function q(e){let t=(0,P.c)(12),{examples:n,labels:r,onSelect:i}=e;if(n.length===0)return null;let a;t[0]===r.examplePrompts?a=t[1]:(a=(0,z.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.examplePrompts}),t[0]=r.examplePrompts,t[1]=a);let o;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge bg-surface-base/50 px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover`,children:e.text},`${e.field}:${e.text}`),t[5]=i,t[6]=e),o=n.map(e),t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;t[7]===o?s=t[8]:(s=(0,z.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,z.jsxs)(`div`,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c}function ce(e){let t=(0,P.c)(34),{workflowName:n,language:r,argValues:i,onArgValuesChange:a,goal:o,onGoalChange:s,examplePrompts:c,showGoal:l,inputClassName:f,aiAssist:p}=e,m;t[0]===c?m=t[1]:(m=c===void 0?[]:c,t[0]=c,t[1]=m);let h=m,g=l===void 0?!0:l,_,v,y,b,x,S,C;if(t[2]!==p||t[3]!==i||t[4]!==h||t[5]!==o||t[6]!==f||t[7]!==r||t[8]!==a||t[9]!==s||t[10]!==g||t[11]!==n){y=u(r).workflows;let e=k[n]??[];v=e.length>0;let c=d(`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,f),l;t[19]!==i||t[20]!==a||t[21]!==s?(l=e=>{A(e,s,e=>{a(e(i))})},t[19]=i,t[20]=a,t[21]=s,t[22]=l):l=t[22],_=l,b=`flex flex-col gap-3`,x=e.map(e=>{let t=oe(y.args,e.labelKey),o=oe(y.args,e.placeholderKey),s=i[e.key]??``;return(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-xs font-medium text-fg-muted`,children:[t,e.required?` *`:``]}),e.multiline&&p?(0,z.jsx)(B,{value:s,onApply:t=>a({...i,[e.key]:t}),fieldId:`workflow.arg.${e.key}`,fieldLabel:t,scenario:p.argScenario??`workflow.arg`,locale:r,context:{...p.context,workflowName:n,workflowArgs:i,fieldKey:e.key},disabled:p.disabled,showLabel:!1}):null]}),e.multiline?(0,z.jsx)(`textarea`,{value:s,onChange:t=>a({...i,[e.key]:t.target.value}),placeholder:o,className:d(c,`min-h-20 resize-y`)}):(0,z.jsx)(`input`,{value:s,onChange:t=>a({...i,[e.key]:t.target.value}),placeholder:o,className:c})]},e.key)}),S=v&&h.length>0?(0,z.jsx)(q,{examples:h,labels:y,onSelect:_}):null,C=g?(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:y.goalLabel}),p?(0,z.jsx)(B,{value:o,onApply:s,fieldId:`workflow.goal`,fieldLabel:y.goalLabel,scenario:p.goalScenario??`cron.workflowGoal`,locale:r,context:{...p.context,workflowName:n,workflowArgs:i},disabled:p.disabled,showLabel:!1}):null]}),(0,z.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),placeholder:y.goalPlaceholder,className:d(c,`min-h-20 resize-y`)})]}):null,t[2]=p,t[3]=i,t[4]=h,t[5]=o,t[6]=f,t[7]=r,t[8]=a,t[9]=s,t[10]=g,t[11]=n,t[12]=_,t[13]=v,t[14]=y,t[15]=b,t[16]=x,t[17]=S,t[18]=C}else _=t[12],v=t[13],y=t[14],b=t[15],x=t[16],S=t[17],C=t[18];let w;t[23]!==_||t[24]!==h||t[25]!==v||t[26]!==y?(w=!v&&h.length>0?(0,z.jsx)(q,{examples:h,labels:y,onSelect:_}):null,t[23]=_,t[24]=h,t[25]=v,t[26]=y,t[27]=w):w=t[27];let T;return t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==C||t[32]!==w?(T=(0,z.jsxs)(`div`,{className:b,children:[x,S,C,w]}),t[28]=b,t[29]=x,t[30]=S,t[31]=C,t[32]=w,t[33]=T):T=t[33],T}var le=`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`;function ue({schema:e,value:t,onChange:n,labels:r,aiAssist:i,onValidChange:a}){let o=(0,N.useMemo)(()=>H(e),[e]),[s,c]=(0,N.useState)(!1),[l,u]=(0,N.useState)(()=>JSON.stringify(t,null,2)),[f,p]=(0,N.useState)(null);if(o.length===0)return null;let m=(e,r)=>{let i={...t,[e]:r};(r===``||r===void 0)&&delete i[e],n(i),s&&u(JSON.stringify(i,null,2))},h=e=>{u(e);try{let t=e.trim()?JSON.parse(e):{};if(!t||typeof t!=`object`||Array.isArray(t)){p(r.rawJsonInvalid),a?.(!1);return}p(null),n(t),a?.(!0,t)}catch{p(r.rawJsonInvalid),a?.(!1)}};return(0,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel/70 p-4 shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,z.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:r.inputSchemaHeading}),(0,z.jsx)(`button`,{type:`button`,className:`text-xs font-medium text-accent-fg hover:underline`,onClick:()=>{let e=!s;c(e),e&&(u(JSON.stringify(t,null,2)),p(null),a?.(!0))},children:r.rawJson})]}),s?(0,z.jsxs)(`div`,{className:`mt-3`,children:[(0,z.jsx)(`textarea`,{value:l,onChange:e=>h(e.target.value),spellCheck:!1,className:d(le,`min-h-40 font-mono text-xs leading-5`)}),f?(0,z.jsx)(`p`,{className:`mt-1 text-xs text-red-600 dark:text-red-300`,children:f}):null]}):(0,z.jsx)(`div`,{className:`mt-3 grid gap-3`,children:o.map(e=>(0,z.jsx)(de,{field:e,value:t[e.key],labels:r,aiAssist:i,allValues:t,onChange:t=>m(e.key,t)},e.key))})]})}function de(e){let t=(0,P.c)(30),{field:n,value:r,labels:i,aiAssist:s,allValues:c,onChange:l}=e,u=n.schema.title||n.key,f=typeof n.schema.description==`string`?n.schema.description:void 0,p=Array.isArray(n.schema.type)?n.schema.type[0]:n.schema.type,m;t[0]===n.schema.enum?m=t[1]:(m=Array.isArray(n.schema.enum)?n.schema.enum:[],t[0]=n.schema.enum,t[1]=m);let h=m,g=!!s&&!h.length&&(p===`string`||!p),_=String(u),v=n.required?` *`:``,y;t[2]!==_||t[3]!==v?(y=(0,z.jsxs)(`span`,{className:`text-xs font-medium text-fg`,children:[_,v]}),t[2]=_,t[3]=v,t[4]=y):y=t[4];let b;t[5]!==s||t[6]!==c||t[7]!==n.key||t[8]!==n.schema||t[9]!==l||t[10]!==g||t[11]!==u||t[12]!==r?(b=g&&s?(0,z.jsx)(B,{value:typeof r==`string`?r:r==null?``:String(r),onApply:l,fieldId:`workflow.schema.${n.key}`,fieldLabel:String(u),scenario:s.scenario??`workflow.arg`,locale:s.locale,context:{...s.context,fieldKey:n.key,fieldSchema:n.schema,inputValues:c},disabled:s.disabled,showLabel:!1}):null,t[5]=s,t[6]=c,t[7]=n.key,t[8]=n.schema,t[9]=l,t[10]=g,t[11]=u,t[12]=r,t[13]=b):b=t[13];let x;t[14]!==y||t[15]!==b?(x=(0,z.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[y,b]}),t[14]=y,t[15]=b,t[16]=x):x=t[16];let S;t[17]===f?S=t[18]:(S=f?(0,z.jsx)(`p`,{className:`mt-0.5 text-xs leading-5 text-fg-subtle`,children:f}):null,t[17]=f,t[18]=S);let C;t[19]!==f||t[20]!==h||t[21]!==i||t[22]!==l||t[23]!==p||t[24]!==r?(C=h.length>0?(0,z.jsxs)(a,{value:r==null?``:String(r),onChange:e=>l(e.target.value),className:le,children:[(0,z.jsx)(o,{value:``}),h.map(J)]}):p===`boolean`?(0,z.jsxs)(a,{value:typeof r==`boolean`?String(r):``,onChange:e=>l(e.target.value===``?void 0:e.target.value===`true`),className:le,children:[(0,z.jsx)(o,{value:``}),(0,z.jsx)(o,{value:`true`,children:i.booleanTrue}),(0,z.jsx)(o,{value:`false`,children:i.booleanFalse})]}):p===`number`||p===`integer`?(0,z.jsx)(`input`,{type:`number`,value:typeof r==`number`||typeof r==`string`?String(r):``,onChange:e=>l(e.target.value===``?void 0:Number(e.target.value)),className:le}):(0,z.jsx)(`textarea`,{value:typeof r==`string`?r:r==null?``:String(r),onChange:e=>l(e.target.value),className:d(le,f&&f.length>80?`min-h-20 resize-y`:`min-h-10 resize-y`)}),t[19]=f,t[20]=h,t[21]=i,t[22]=l,t[23]=p,t[24]=r,t[25]=C):C=t[25];let w;return t[26]!==x||t[27]!==S||t[28]!==C?(w=(0,z.jsxs)(`div`,{className:`block`,children:[x,S,C]}),t[26]=x,t[27]=S,t[28]=C,t[29]=w):w=t[29],w}function J(e){return(0,z.jsx)(o,{value:String(e),children:String(e)},String(e))}function Y(e){let t=(0,P.c)(12),{examples:n,labels:r,onSelect:i}=e;if(n.length===0)return null;let a;t[0]===r.examplePrompts?a=t[1]:(a=(0,z.jsx)(`div`,{className:`text-xs font-medium text-fg-muted`,children:r.examplePrompts}),t[0]=r.examplePrompts,t[1]=a);let o;if(t[2]!==n||t[3]!==i){let e;t[5]===i?e=t[6]:(e=e=>(0,z.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:`rounded-lg border border-edge bg-surface-base/50 px-3 py-2 text-left text-xs text-fg-muted hover:bg-surface-hover`,children:e.text},`${e.field}:${e.text}`),t[5]=i,t[6]=e),o=n.map(e),t[2]=n,t[3]=i,t[4]=o}else o=t[4];let s;t[7]===o?s=t[8]:(s=(0,z.jsx)(`div`,{className:`mt-2 flex flex-col gap-1.5`,children:o}),t[7]=o,t[8]=s);let c;return t[9]!==a||t[10]!==s?(c=(0,z.jsxs)(`div`,{children:[a,s]}),t[9]=a,t[10]=s,t[11]=c):c=t[11],c}function X(e){let t=(0,P.c)(114),{definition:n,language:r,value:i,onChange:a,aiAssist:o,inputClassName:s,onValidityChange:c}=e,l;t[0]===r?l=t[1]:(l=u(r),t[0]=r,t[1]=l);let f=l.workflows,p;t[2]!==n||t[3]!==r?(p=D(n,r),t[2]=n,t[3]=r,t[4]=p):p=t[4];let m=p,[h,g]=(0,N.useState)(!0),_;t[5]===m.examplePrompts?_=t[6]:(_=m.examplePrompts??[],t[5]=m.examplePrompts,t[6]=_);let v=_,y;t[7]===n.inputSchema?y=t[8]:(y=V(n.inputSchema),t[7]=n.inputSchema,t[8]=y);let b=y,x,S,C,w,T,E,O,ee,k,A;if(t[9]!==o||t[10]!==n||t[11]!==v||t[12]!==b||t[13]!==s||t[14]!==f||t[15]!==r||t[16]!==m.description||t[17]!==a||t[18]!==c||t[19]!==h||t[20]!==i){T=Symbol.for(`react.early_return_sentinel`);bb0:{let e=d(`mt-1.5 w-full rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,s),l;t[31]!==n||t[32]!==a||t[33]!==c||t[34]!==h?(l=(e,t)=>{let r=t===void 0?h:t;a(e),c?.(K(n,e,r))},t[31]=n,t[32]=a,t[33]=c,t[34]=h,t[35]=l):l=t[35];let u=l,p;t[36]!==u||t[37]!==i?(p=e=>u({...i,goal:e}),t[36]=u,t[37]=i,t[38]=p):p=t[38];let _=p,y;t[39]!==u||t[40]!==i?(y=e=>u({...i,schemaInput:e}),t[39]=u,t[40]=i,t[41]=y):y=t[41];let D=y,j;t[42]!==u||t[43]!==i?(j=e=>u({...i,argValues:e}),t[42]=u,t[43]=i,t[44]=j):j=t[44];let M=j,N;if(t[45]!==_||t[46]!==D||t[47]!==i.schemaInput?(N=e=>{if(e.field===`goal`){_(e.text);return}D({...i.schemaInput,[e.field]:e.text})},t[45]=_,t[46]=D,t[47]=i.schemaInput,t[48]=N):N=t[48],x=N,!b){let e;t[49]!==o||t[50]!==n.id||t[51]!==n.name||t[52]!==n.title||t[53]!==m.description?(e=o?{disabled:o.disabled,argScenario:o.inputScenario??`workflow.arg`,goalScenario:o.goalScenario??`workflow.goal`,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description}}:void 0,t[49]=o,t[50]=n.id,t[51]=n.name,t[52]=n.title,t[53]=m.description,t[54]=e):e=t[54];let a;t[55]!==n.name||t[56]!==v||t[57]!==s||t[58]!==r||t[59]!==M||t[60]!==_||t[61]!==e||t[62]!==i.argValues||t[63]!==i.goal?(a=(0,z.jsx)(ce,{workflowName:n.name,language:r,argValues:i.argValues,onArgValuesChange:M,goal:i.goal,onGoalChange:_,examplePrompts:v,inputClassName:s,aiAssist:e}),t[55]=n.name,t[56]=v,t[57]=s,t[58]=r,t[59]=M,t[60]=_,t[61]=e,t[62]=i.argValues,t[63]=i.goal,t[64]=a):a=t[64],T=a;break bb0}C=`flex flex-col gap-3`,t[65]!==o||t[66]!==n||t[67]!==f.booleanFalse||t[68]!==f.booleanTrue||t[69]!==f.inputSchemaHeading||t[70]!==f.rawJson||t[71]!==f.rawJsonInvalid||t[72]!==r||t[73]!==m.description||t[74]!==c||t[75]!==D||t[76]!==i?(w=n.inputSchema?(0,z.jsx)(ue,{schema:n.inputSchema,value:i.schemaInput,onChange:D,onValidChange:(e,t)=>{g(e),c?.(K(n,t?{...i,schemaInput:t}:i,e))},aiAssist:o?{locale:r,disabled:o.disabled,scenario:o.inputScenario??`workflow.arg`,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description}}:void 0,labels:{inputSchemaHeading:f.inputSchemaHeading,rawJson:f.rawJson,rawJsonInvalid:f.rawJsonInvalid,booleanTrue:f.booleanTrue,booleanFalse:f.booleanFalse}}):null,t[65]=o,t[66]=n,t[67]=f.booleanFalse,t[68]=f.booleanTrue,t[69]=f.inputSchemaHeading,t[70]=f.rawJson,t[71]=f.rawJsonInvalid,t[72]=r,t[73]=m.description,t[74]=c,t[75]=D,t[76]=i,t[77]=w):w=t[77],A=`flex flex-col gap-1`;let P;t[78]===f.goalLabel?P=t[79]:(P=(0,z.jsx)(`span`,{className:`text-xs font-medium text-fg-muted`,children:f.goalLabel}),t[78]=f.goalLabel,t[79]=P);let F;t[80]!==o||t[81]!==n.id||t[82]!==n.name||t[83]!==n.title||t[84]!==f.goalLabel||t[85]!==r||t[86]!==m.description||t[87]!==_||t[88]!==i.goal||t[89]!==i.schemaInput?(F=o?(0,z.jsx)(B,{value:i.goal,onApply:_,fieldId:`workflow.goal`,fieldLabel:f.goalLabel,scenario:o.goalScenario??`workflow.goal`,locale:r,context:{...o.context,workflowId:n.id,workflowName:n.name,workflowTitle:n.title,workflowDescription:m.description,workflowInput:i.schemaInput},disabled:o.disabled,showLabel:!1}):null,t[80]=o,t[81]=n.id,t[82]=n.name,t[83]=n.title,t[84]=f.goalLabel,t[85]=r,t[86]=m.description,t[87]=_,t[88]=i.goal,t[89]=i.schemaInput,t[90]=F):F=t[90],t[91]!==P||t[92]!==F?(S=(0,z.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[P,F]}),t[91]=P,t[92]=F,t[93]=S):S=t[93],E=i.goal,t[94]===_?O=t[95]:(O=e=>_(e.target.value),t[94]=_,t[95]=O),ee=f.goalPlaceholder,k=d(e,`min-h-20 resize-y`)}t[9]=o,t[10]=n,t[11]=v,t[12]=b,t[13]=s,t[14]=f,t[15]=r,t[16]=m.description,t[17]=a,t[18]=c,t[19]=h,t[20]=i,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=O,t[28]=ee,t[29]=k,t[30]=A}else x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],O=t[27],ee=t[28],k=t[29],A=t[30];if(T!==Symbol.for(`react.early_return_sentinel`))return T;let j;t[96]!==E||t[97]!==O||t[98]!==ee||t[99]!==k?(j=(0,z.jsx)(`textarea`,{value:E,onChange:O,placeholder:ee,className:k}),t[96]=E,t[97]=O,t[98]=ee,t[99]=k,t[100]=j):j=t[100];let M;t[101]!==S||t[102]!==j||t[103]!==A?(M=(0,z.jsxs)(`div`,{className:A,children:[S,j]}),t[101]=S,t[102]=j,t[103]=A,t[104]=M):M=t[104];let F;t[105]!==x||t[106]!==v||t[107]!==f?(F=(0,z.jsx)(Y,{examples:v,labels:f,onSelect:x}),t[105]=x,t[106]=v,t[107]=f,t[108]=F):F=t[108];let I;return t[109]!==C||t[110]!==w||t[111]!==M||t[112]!==F?(I=(0,z.jsxs)(`div`,{className:C,children:[w,M,F]}),t[109]=C,t[110]=w,t[111]=M,t[112]=F,t[113]=I):I=t[113],I}function fe(e,t){let n=e.metadata.estimatedAgents;return n?n.min===n.max?S(t.agentScaleExact,{count:n.min}):S(t.agentScaleRange,{min:n.min,max:n.max}):S(t.agentScaleExact,{count:e.defaults.maxSubagents})}function pe(e){let t=(0,P.c)(41),{definition:n,language:r,value:i,onChange:a,mode:o,badgeLabel:s,aiAssist:c,inputClassName:l,showTimeout:f,defaultAdvancedOpen:p,onValidityChange:m}=e,h=f===void 0?!1:f,g=p===void 0?!1:p,_=u(r).workflows,[v,y]=(0,N.useState)(g),b;t[0]!==n||t[1]!==r?(b=D(n,r),t[0]=n,t[1]=r,t[2]=b):b=t[2];let x=b,T;t[3]!==n.defaults||t[4]!==i.concurrency?(T=i.concurrency.trim()?Number(i.concurrency):n.defaults.concurrency,t[3]=n.defaults,t[4]=i.concurrency,t[5]=T):T=t[5];let ee=T,k;t[6]!==n.defaults||t[7]!==i.maxSubagents?(k=i.maxSubagents.trim()?Number(i.maxSubagents):n.defaults.maxSubagents,t[6]=n.defaults,t[7]=i.maxSubagents,t[8]=k):k=t[8];let A=k,j;t[9]!==n||t[10]!==r||t[11]!==i?(j=G(n,r,i),t[9]=n,t[10]=r,t[11]=i,t[12]=j):j=t[12];let F=j,I=s??_.readyToStart,L;t[13]!==a||t[14]!==i?(L=e=>a({...i,...e}),t[13]=a,t[14]=i,t[15]=L):L=t[15];let R=L,te=o===`automation`&&`rounded-xl bg-surface-panel/70 p-3 shadow-surface`,ne;t[16]===te?ne=t[17]:(ne=d(`space-y-4`,te),t[16]=te,t[17]=ne);let re=F||x.description,B;t[18]===re?B=t[19]:(B=(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:re}),t[18]=re,t[19]=B);let ie;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,z.jsx)(O,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[20]=ie):ie=t[20];let ae;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,z.jsx)(M,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[21]=ae):ae=t[21];let V;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,z.jsx)(w,{className:`size-3.5 shrink-0 text-fg-subtle`,"aria-hidden":!0}),t[22]=V):V=t[22];let H;t[23]!==a||t[24]!==i?(H=e=>a({...i,...e}),t[23]=a,t[24]=i,t[25]=H):H=t[25];let U;t[26]===m?U=t[27]:(U=e=>{m?.(e)},t[26]=m,t[27]=U);let W;t[28]!==c||t[29]!==n||t[30]!==l||t[31]!==r||t[32]!==H||t[33]!==U||t[34]!==i?(W=(0,z.jsx)(X,{definition:n,language:r,value:i,onChange:H,onValidityChange:U,aiAssist:c,inputClassName:l}),t[28]=c,t[29]=n,t[30]=l,t[31]=r,t[32]=H,t[33]=U,t[34]=i,t[35]=W):W=t[35];let K;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(K=()=>y(me),t[36]=K):K=t[36];let oe=_.advancedSettings,se=v&&`rotate-180`,q;t[37]===se?q=t[38]:(q=d(`size-4 transition-transform`,se),t[37]=se,t[38]=q);let ce;return t[39]===q?ce=t[40]:(ce=(0,z.jsx)(E,{className:q}),t[39]=q,t[40]=ce),(0,z.jsxs)(`div`,{className:ne,children:[(0,z.jsxs)(`section`,{className:`rounded-2xl bg-surface-panel p-4 shadow-surface`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,z.jsxs)(`div`,{className:`min-w-0`,children:[(0,z.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:_.runPlanPreview}),B]}),(0,z.jsx)(`span`,{className:`shrink-0 rounded-full bg-accent-soft px-2 py-1 text-[11px] font-medium text-accent-fg`,children:I})]}),(0,z.jsxs)(`div`,{className:`mt-4 grid gap-2 text-xs text-fg-muted sm:grid-cols-3`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[ie,(0,z.jsx)(`span`,{children:S(_.phaseCount,{count:n.phases.length})})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[ae,(0,z.jsx)(`span`,{children:fe(n,_)})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 rounded-xl bg-surface-panel px-2.5 py-2`,children:[V,(0,z.jsx)(`span`,{children:S(_.runLimitsSummary,{concurrency:ee,max:A})})]})]}),n.phases.length>0?(0,z.jsxs)(`div`,{className:`mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] font-medium uppercase tracking-wide text-fg-subtle`,children:[(0,z.jsx)(C,{className:`size-3.5`,"aria-hidden":!0}),_.startPlanPhases]}),(0,z.jsx)(`div`,{className:`mt-2 flex flex-wrap items-center gap-1.5`,children:n.phases.map(Z)})]}):null]}),W,(0,z.jsxs)(`div`,{className:`rounded-xl border border-edge`,children:[(0,z.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between px-3 py-2.5 text-left text-sm text-fg`,onClick:K,children:[oe,ce]}),v?(0,z.jsxs)(`div`,{className:`grid gap-3 border-t border-edge px-3 pb-3 pt-3 sm:grid-cols-2`,children:[(0,z.jsx)(`input`,{value:i.concurrency,onChange:e=>R({concurrency:e.target.value}),placeholder:S(_.concurrencyPlaceholder,{default:n.defaults.concurrency}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),(0,z.jsx)(`input`,{value:i.maxSubagents,onChange:e=>R({maxSubagents:e.target.value}),placeholder:S(_.maxSubagentsPlaceholder,{default:n.defaults.maxSubagents}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}),h?(0,z.jsx)(`input`,{value:i.timeoutSeconds??``,onChange:e=>R({timeoutSeconds:e.target.value}),placeholder:S(_.timeoutSecondsPlaceholder,{default:n.defaults.timeoutSec}),inputMode:`numeric`,className:`rounded-xl border border-edge bg-surface-base px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`}):null]}):null]})]})}function me(e){return!e}function Z(e,t){return(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[t>0?(0,z.jsx)(`span`,{className:`text-fg-subtle`,children:`→`}):null,(0,z.jsx)(`span`,{className:`rounded-lg border border-edge-subtle bg-surface-panel px-2 py-1 text-[11px] text-fg-muted`,children:e.title})]},e.id)}export{B as a,K as i,se as n,M as o,W as r,pe as t};
|