@xopcai/xopc 0.0.191 → 0.0.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DstnJCS5.js → activity-store-BwmdJ5pv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DvEkT222.js → agent-avatar-dicebear-DmNq0t2n.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BOo1rVn9.js +68 -0
- package/dist/gateway/static/root/assets/{api-BTL9kayv.js → api-BM1hNzjw.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-COpP_pKN.js → app-management-settings-panel-B3xStqSX.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DTVNUEDq.js → appearance-settings-DglyenDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DC9qPFTx.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-IpX6VA0o.js → archive-plugin-DvtcrBss.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CKVFNUi1.js → attachment-load-CALdq4xM.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BIGGKb0T.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BrfvfOS4.js → binary-plugins-GaVuvrDI.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D9sEfg32.js → block-editor-C2KrMYa_.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-CPW_E-xj.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BixZ5lCR.js → browser-workflow-inputs-FfEEjhIS.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-YEFuodJI.js → browser-workflows-page-DFP9_UQk.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CsD8aGHU.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-api-BoOzFotX.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-NCeyWH6Z.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BThDGiO3.js → channel-recipient-api-_8IiTxRB.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CknzwxNC.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +1 -0
- package/dist/gateway/static/root/assets/{code-editor-D4_k-6QN.js → code-editor-dFzqyDXS.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BMMqC0_9.js → connectors-api-vaSrhPF8.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DEGE7xp_.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-Bm8koRoD.js → cron-expression-BjFuXlGY.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-DOdkHdPv.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CMG3mcaJ.js → desktop-pet-Dz-Yf8Uu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-D8aaPb0x.js → desktop-pet-settings-C8EHFEtd.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C95yW03b.js → directory-picker-path-field-DKbfmZlZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DsG7Z9lV.js → extension-debug-page-Dq0xsr_e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CUAXEbAt.js → extension-page-IgSLUyWP.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-VC-8Pjn2.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DL70Nakc.js → gateway-config-api-CH2R7yqo.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BgDxQ08c.js → gateway-settings-DLQJWaBQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-EO9mKvzE.js → gateway-startup-retry--2njcDpC.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-BX7q55uZ.js → heartbeat-settings-43loWoGb.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DqvpI6LC.js +3 -0
- package/dist/gateway/static/root/assets/html-workspace-editor-bXK5tq64.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-Bu7PyVSh.js → image-generation-api-Cki7jfEV.js} +1 -1
- package/dist/gateway/static/root/assets/index-BpkdvHH0.js +150 -0
- package/dist/gateway/static/root/assets/index-CFVjH-EK.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Dt6wS5zW.js → keyboard-shortcuts-settings-DJDZes_8.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CvNQM6qm.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DcD3-N00.js → local-apps-page-C2ajOn1D.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-deR2zRaE.js → locale-store-Bjvw7jtg.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BLm5yWqQ.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B6EVkJQy.js → management-settings--_eXnFVr.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-editor-BvUebh3C.js → markdown-editor-TWGaF7Xa.js} +2 -2
- package/dist/gateway/static/root/assets/{markdown-split-CHUjCnBh.js → markdown-split-iL2oi-x2.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DRrtI2O0.js → media-plugins-BIbkLVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DQ5X6cXp.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-fermYvpI.js → notes-page-xFxaZ6gT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-PAftxL3V.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-BO262zuu.js → page-tabs-CROi9zm1.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-yZYTy-2e.js → preview-open-alternatives-BwYcPjOM.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dgy8XWhR.js → product-open-page-BezeuVFd.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CCdfZcw-.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DOG9zm5e.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DQBFgveI.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bs6tpSyX.js +5 -0
- package/dist/gateway/static/root/assets/{schema-form-DdE4gtw_.js → schema-form-CWoSjz9s.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Db6L6M2H.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcO2bd6q.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CiYU8AvV.js → settings-form-section-BJaMEHsX.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bv03cWib.js → settings-loading-skeleton-sn4k17x7.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-D2hfeFPX.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-layout-t_Ox1slk.js → settings-page-layout-CLtUsWsu.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-UmQC_uZ1.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DF8gW6bo.js → share-preview-page-BJ58AluH.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BZKn6Fdc.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Cx3i24w_.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DjUllGtk.js +2 -0
- package/dist/gateway/static/root/assets/skills-page.utils-CZYIuE26.js +1 -0
- package/dist/gateway/static/root/assets/style-TIDOdKy0.js +7 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DUrgdQMk.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BGG2cFe9.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DnBOcGXi.js → theme-store-DtxpMC5S.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-4XBsLEuv.js → typed-models-lib-CRNMvvFX.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BN2QgFGn.js → use-autosave-Dle3-zdQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BLLmw5S1.js +1 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror--gTq3YAI.js → vendor-codemirror-DRr7hFaD.js} +16 -16
- package/dist/gateway/static/root/assets/voice-api-key-field-BrWH0dCl.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-nmEAafFl.js → work-discovery-overlay-BZ1l9CFM.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BnPF2vx7.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BnNWBDwz.js → workflow-run-setup-panel-BK6e9yzK.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Bp5JxQJa.js +5 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/gateway/static/root/notification-sw.js +15 -0
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +2 -0
- package/dist/src/agent/agent-manager.js +76 -0
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -12
- package/dist/src/agent/embedded/run-for-session.js +3 -0
- package/dist/src/agent/embedded/run-turn.js +4 -1
- package/dist/src/agent/embedded/session-runner.js +3 -4
- package/dist/src/agent/embedded/types.d.ts +10 -1
- package/dist/src/agent/embedded/xopc-stream-bridge.js +3 -2
- package/dist/src/agent/external-tools/mcp-provider.d.ts +1 -0
- package/dist/src/agent/external-tools/mcp-provider.js +21 -6
- package/dist/src/agent/image/generation/provider-registry.js +1 -0
- package/dist/src/agent/image/generation/providers/dashscope.js +20 -0
- package/dist/src/agent/image/generation/providers/fal.d.ts +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +12 -6
- package/dist/src/agent/image/generation/providers/google.js +8 -0
- package/dist/src/agent/image/generation/providers/minimax.js +20 -0
- package/dist/src/agent/image/generation/providers/openai.js +36 -26
- package/dist/src/agent/image/generation/types.d.ts +13 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.d.ts +1 -0
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +2 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +5 -1
- package/dist/src/agent/mcp/bundle-mcp-policy.js +11 -3
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +3 -2
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +2 -1
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.d.ts +2 -1
- package/dist/src/agent/mcp/mcp-transport.js +22 -4
- package/dist/src/agent/memory/compaction.js +19 -17
- package/dist/src/agent/memory/context-budget.js +2 -3
- package/dist/src/agent/memory/understanding/service.d.ts +1 -0
- package/dist/src/agent/memory/understanding/service.js +49 -20
- package/dist/src/agent/memory/understanding/types.d.ts +1 -0
- package/dist/src/agent/memory/user-context-coordinator.js +6 -0
- package/dist/src/agent/orchestration/agent-orchestrator.js +15 -1
- package/dist/src/agent/service/direct-turn-helpers.js +14 -5
- package/dist/src/agent/skills/index.d.ts +1 -1
- package/dist/src/agent/skills/index.js +2 -2
- package/dist/src/agent/skills/installer.d.ts +3 -10
- package/dist/src/agent/skills/installer.js +99 -156
- package/dist/src/agent/skills/marketplace/adapter.types.d.ts +3 -1
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +30 -6
- package/dist/src/agent/skills/marketplace/adapters/skillhub/adapter.js +21 -4
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +7 -4
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +3 -0
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +7 -1
- package/dist/src/agent/skills/marketplace/search.d.ts +2 -2
- package/dist/src/agent/skills/marketplace/search.js +52 -21
- package/dist/src/agent/skills/skills-marketplace.d.ts +1 -1
- package/dist/src/agent/skills/skills-marketplace.js +2 -2
- package/dist/src/agent/skills/types.d.ts +0 -8
- package/dist/src/agent/tools/exec-command.d.ts +1 -0
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +17 -2
- package/dist/src/agent/tools/managed-job-tool.d.ts +1 -1
- package/dist/src/agent/tools/managed-job-tool.js +3 -2
- package/dist/src/agent/tools/skill-install-tool.d.ts +2 -2
- package/dist/src/agent/tools/skill-install-tool.js +8 -4
- package/dist/src/agent/tools/skills-marketplace-search-tool.js +3 -2
- package/dist/src/agent/tools/workflow-tool.d.ts +1 -0
- package/dist/src/agent/tools/workflow-tool.js +14 -4
- package/dist/src/agent-manifest/schema.d.ts +20 -0
- package/dist/src/agent-manifest/schema.js +6 -1
- package/dist/src/auth/oauth/xopc-cloud.js +163 -7
- package/dist/src/browser/providers/cloakbrowser.js +1 -1
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/doctor/checks/node-version.js +3 -3
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +36 -0
- package/dist/src/cli/commands/doctor/flow.js +2 -0
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/models.js +0 -1
- package/dist/src/cli/commands/onboard/model.d.ts +16 -1
- package/dist/src/cli/commands/onboard/model.js +65 -4
- package/dist/src/cli/commands/onboard.js +13 -1
- package/dist/src/cli/commands/runtime.d.ts +1 -0
- package/dist/src/cli/commands/runtime.js +77 -0
- package/dist/src/cli/commands/setup.js +15 -1
- package/dist/src/cli/commands/skills.js +7 -4
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/schema.d.ts +125 -0
- package/dist/src/config/schema.js +77 -2
- package/dist/src/config/voice.d.ts +6 -0
- package/dist/src/config/voice.js +17 -0
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/types/providers.d.ts +4 -0
- package/dist/src/gateway/capability-presets-admin.d.ts +9 -0
- package/dist/src/gateway/capability-presets-admin.js +24 -6
- package/dist/src/gateway/chat-stream/mapper.js +8 -4
- package/dist/src/gateway/chat-stream/protocol.d.ts +10 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/routes/commands-skills.js +2 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +2 -3
- package/dist/src/gateway/hono/routes/runtime-tools.d.ts +3 -0
- package/dist/src/gateway/hono/routes/runtime-tools.js +142 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +2 -1
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/voice.js +43 -2
- package/dist/src/gateway/hono/routes/you.js +22 -25
- package/dist/src/gateway/image-generation-setup.d.ts +2 -3
- package/dist/src/gateway/image-generation-setup.js +39 -8
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/marketplace-service.d.ts +1 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +21 -8
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-global.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/providers/extension-stream-bridge.js +8 -7
- package/dist/src/providers/model-catalog-store.d.ts +24 -4
- package/dist/src/providers/model-catalog-store.js +11 -0
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/prompt-cache-payload.d.ts +13 -0
- package/dist/src/providers/prompt-cache-payload.js +110 -0
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-model-source.js +52 -6
- package/dist/src/runtime-tools/archive.d.ts +8 -0
- package/dist/src/runtime-tools/archive.js +99 -0
- package/dist/src/runtime-tools/bootstrap.d.ts +16 -0
- package/dist/src/runtime-tools/bootstrap.js +33 -0
- package/dist/src/runtime-tools/catalog.d.ts +19 -0
- package/dist/src/runtime-tools/catalog.js +59 -0
- package/dist/src/runtime-tools/command.d.ts +15 -0
- package/dist/src/runtime-tools/command.js +59 -0
- package/dist/src/runtime-tools/download-source.d.ts +24 -0
- package/dist/src/runtime-tools/download-source.js +125 -0
- package/dist/src/runtime-tools/downloader.d.ts +21 -0
- package/dist/src/runtime-tools/downloader.js +137 -0
- package/dist/src/runtime-tools/environment.d.ts +20 -0
- package/dist/src/runtime-tools/environment.js +113 -0
- package/dist/src/runtime-tools/errors.d.ts +10 -0
- package/dist/src/runtime-tools/errors.js +14 -0
- package/dist/src/runtime-tools/index.d.ts +7 -0
- package/dist/src/runtime-tools/index.js +7 -0
- package/dist/src/runtime-tools/install-lock.d.ts +1 -0
- package/dist/src/runtime-tools/install-lock.js +50 -0
- package/dist/src/runtime-tools/manager.d.ts +20 -0
- package/dist/src/runtime-tools/manager.js +641 -0
- package/dist/src/runtime-tools/manifest-store.d.ts +3 -0
- package/dist/src/runtime-tools/manifest-store.js +26 -0
- package/dist/src/runtime-tools/network.d.ts +9 -0
- package/dist/src/runtime-tools/network.js +41 -0
- package/dist/src/runtime-tools/offline-bundle.d.ts +16 -0
- package/dist/src/runtime-tools/offline-bundle.js +41 -0
- package/dist/src/runtime-tools/paths.d.ts +7 -0
- package/dist/src/runtime-tools/paths.js +22 -0
- package/dist/src/runtime-tools/probe.d.ts +7 -0
- package/dist/src/runtime-tools/probe.js +71 -0
- package/dist/src/runtime-tools/prune.d.ts +10 -0
- package/dist/src/runtime-tools/prune.js +93 -0
- package/dist/src/runtime-tools/types.d.ts +70 -0
- package/dist/src/runtime-tools/types.js +1 -0
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +42 -20
- package/dist/src/tasks/home-query-service.js +1 -5
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/project-operating-view-service.d.ts +2 -1
- package/dist/src/tasks/project-operating-view-service.js +6 -4
- package/dist/src/tasks/task-dependency-service.d.ts +2 -1
- package/dist/src/tasks/task-dependency-service.js +15 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/user-context/domain.d.ts +2 -1
- package/dist/src/user-context/domain.js +12 -1
- package/dist/src/user-context/manual-understanding.js +8 -10
- package/dist/src/user-context/planner.js +1 -6
- package/dist/src/user-context/sources/activity-clustering.d.ts +5 -0
- package/dist/src/user-context/sources/activity-clustering.js +130 -0
- package/dist/src/user-context/sources/catalog.js +26 -0
- package/dist/src/user-context/sources/local-source-contract.d.ts +3 -0
- package/dist/src/user-context/sources/local-source-contract.js +15 -0
- package/dist/src/user-context/sources/repository.js +7 -1
- package/dist/src/user-context/sources/types.d.ts +7 -1
- package/dist/src/user-context/understanding.d.ts +15 -0
- package/dist/src/user-context/understanding.js +24 -0
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/voice/metadata/builtin.js +99 -32
- package/dist/src/voice/metadata/types.d.ts +3 -0
- package/dist/src/voice/stt/availability.js +4 -1
- package/dist/src/voice/stt/config-slice.d.ts +0 -2
- package/dist/src/voice/stt/config-slice.js +1 -6
- package/dist/src/voice/stt/factory.js +2 -2
- package/dist/src/voice/stt/index.d.ts +2 -3
- package/dist/src/voice/stt/list-providers.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.d.ts +0 -19
- package/dist/src/voice/stt/providers/alibaba-transcription.js +59 -132
- package/dist/src/voice/stt/providers/index.d.ts +1 -0
- package/dist/src/voice/stt/providers/index.js +2 -1
- package/dist/src/voice/stt/providers/openai-transcription.d.ts +2 -2
- package/dist/src/voice/stt/providers/openai-transcription.js +4 -4
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.d.ts +2 -0
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +49 -0
- package/dist/src/voice/stt/types.js +2 -2
- package/dist/src/voice/tts/providers/index.d.ts +1 -0
- package/dist/src/voice/tts/providers/index.js +2 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.d.ts +2 -0
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +113 -0
- package/dist/src/voice/tts/types.d.ts +1 -1
- package/dist/src/work-discovery/analyzer.js +9 -4
- package/dist/src/work-discovery/candidate-discovery.d.ts +1 -0
- package/dist/src/work-discovery/candidate-discovery.js +3 -3
- package/dist/src/work-discovery/index.js +2 -2
- package/dist/src/work-discovery/service.d.ts +2 -1
- package/dist/src/work-discovery/service.js +126 -37
- package/dist/src/work-discovery/types.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +8 -0
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-CXyivfqY.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-DsE67BSO.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-D0TVev47.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DpZzq8j2.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B9Cmcuff.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-BB8t4Ja7.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C_EpuQtk.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-CvzD5qSv.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-BKrm7tJ9.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-CsR7QOJo.js +0 -1
- package/dist/gateway/static/root/assets/home-page-C08Nen5T.js +0 -3
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +0 -1
- package/dist/gateway/static/root/assets/index-B-_CEvIX.js +0 -150
- package/dist/gateway/static/root/assets/index-D6e3tPL-.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BQVC0tWq.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-D6yvW-E4.js +0 -2
- package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-BVCwabjq.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CS4Ujor7.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DMtPC8c4.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BpfHZT88.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BZkyrJBM.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlK0A4l.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-C-LdINFj.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-HRG_lK4_.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-v_iLhxxa.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-S-bjtsXX.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BiNBfaX5.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-DlnGtvAH.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-Bv7GXFc6.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BhQcOpnx.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-PtcY7BoJ.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DnhJtC5l.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C5Kwe_bc.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Z_qzaohv.js +0 -11
- /package/dist/gateway/static/root/assets/{workflows-page-DLioOiRN.css → style-DLioOiRN.css} +0 -0
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-DT31yWkU.js","assets/rolldown-runtime-aKtaBQYM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./preload-helper-zJ_50EbN.js";import{c as a,f as o,l as s}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as c}from"./cn-JdwAhgNB.js";import{t as l}from"./messages-B4XqB8I6.js";import{l as u,n as d}from"./locale-store-deR2zRaE.js";import{t as f}from"./config-reload-event-Bjh2zoKp.js";import{Ai as p,Co as m,Do as h,Ds as g,Eo as _,Fr as v,Jl as y,Kl as b,Lo as x,Ls as S,Nc as C,Oi as w,Oo as T,Os as E,Qs as D,So as O,Wi as k,Xa as A,Xc as j,Xl as M,Ya as N,Yl as P,as as F,ds as I,lc as L,ms as R,wo as z,xl as B,yl as V}from"./index-B-_CEvIX.js";import{t as H}from"./page-tabs-BO262zuu.js";import{t as U}from"./skill-reload-api-S-bjtsXX.js";import{_ as W,a as G,c as ee,d as te,f as K,g as q,h as ne,i as re,l as ie,m as ae,n as oe,o as se,p as ce,r as le,s as ue,t as de,u as fe}from"./skills-page.utils-DlnGtvAH.js";var J=n(),Y=e(t(),1),X=r(),pe=(0,Y.memo)(function(e){let t=(0,J.c)(23),{loading:n,onReloadClick:r,searchQuery:i,setSearchQuery:a,mainTab:o,sk:s,setPendingFile:c,setInstallOpen:l}=e,u;t[0]!==n||t[1]!==r||t[2]!==s.reloadDiskAria||t[3]!==s.reloadRuntime?(u=(0,X.jsx)(k,{className:`size-9 shrink-0 p-0`,loading:n,label:s.reloadDiskAria,title:s.reloadRuntime,onClick:r}),t[0]=n,t[1]=r,t[2]=s.reloadDiskAria,t[3]=s.reloadRuntime,t[4]=u):u=t[4];let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(D,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-disabled`,strokeWidth:1.75,"aria-hidden":!0}),t[5]=d):d=t[5];let f;t[6]===a?f=t[7]:(f=e=>a(e.target.value),t[6]=a,t[7]=f);let p=o===`marketplace`?s.marketplaceSearchPackages:s.searchPlaceholder,m;t[8]!==i||t[9]!==f||t[10]!==p?(m=(0,X.jsxs)(`label`,{className:`relative flex min-h-9 min-w-0 max-w-sm cursor-text items-center rounded-pill border border-edge bg-surface-base py-1.5 pl-9 pr-3 shadow-surface dark:bg-surface-hover/40 sm:max-w-md`,children:[d,(0,X.jsx)(`input`,{type:`search`,enterKeyHint:`search`,value:i,onChange:f,placeholder:p,autoComplete:`off`,spellCheck:!1,className:`min-w-0 flex-1 appearance-none border-0 bg-transparent py-0.5 text-sm leading-normal text-fg caret-current placeholder:text-fg-disabled focus:border-0 focus:shadow-none focus:outline-none focus:ring-0 focus-visible:outline-none`})]}),t[8]=i,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]!==l||t[13]!==c?(h=()=>{c(null),l(!0)},t[12]=l,t[13]=c,t[14]=h):h=t[14];let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,X.jsx)(L,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),t[15]=g):g=t[15];let _;t[16]!==s.installCta||t[17]!==h?(_=(0,X.jsxs)(I,{type:`button`,variant:`primary`,className:`shrink-0 gap-2`,onClick:h,children:[g,s.installCta]}),t[16]=s.installCta,t[17]=h,t[18]=_):_=t[18];let v;return t[19]!==u||t[20]!==m||t[21]!==_?(v=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center justify-end gap-2`,children:[u,m,_]}),t[19]=u,t[20]=m,t[21]=_,t[22]=v):v=t[22],v}),Z=`animate-pulse motion-reduce:animate-none rounded-md bg-surface-hover dark:bg-surface-active/50`;function me(){let e=(0,J.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(`div`,{className:c(`h-4 min-w-0 flex-1`,Z)}),e[0]=t):t=e[0];let n,r,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[t,(0,X.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,X.jsx)(`div`,{className:c(`size-8 shrink-0 rounded-lg`,Z)}),(0,X.jsx)(`div`,{className:c(`h-8 w-[4.5rem] shrink-0 rounded-lg`,Z)})]})]}),r=(0,X.jsx)(`div`,{className:c(`h-3 w-full`,Z)}),i=(0,X.jsx)(`div`,{className:c(`h-3 w-[92%]`,Z)}),e[1]=n,e[2]=r,e[3]=i):(n=e[1],r=e[2],i=e[3]);let a;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,X.jsx)(`div`,{className:`flex h-full min-h-[10.5rem] flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,"aria-hidden":!0,children:(0,X.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start gap-3`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[n,r,i,(0,X.jsxs)(`div`,{className:`mt-auto space-y-1 pt-0.5`,children:[(0,X.jsx)(`div`,{className:c(`h-3 w-full`,Z)}),(0,X.jsx)(`div`,{className:c(`h-2.5 w-4/5`,Z)})]})]})})}),e[4]=a):a=e[4],a}function he(){let e=(0,J.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(me,{}),e[0]=t):t=e[0],t}var ge=new Set([`installed`,`marketplace`]),_e=new Set([`all`,`builtin`,`installed`,`global`,`workspace`,`extra`]),ve=new Set([`all`,`enabled`,`disabled`]),ye=`mprov`,be=[`s0`,`s1`,`s2`,`s3`,`s4`,`s5`],xe=[`business`,`creative`,`documents`,`engineering`,`tools`];function Se(e){let t=(0,J.c)(27),{sk:n,loading:r,catalog:i,filteredCatalog:a,builtinCategories:o,builtinCategoryFilter:s,setBuiltinCategoryFilter:l,catalogDisplayRows:u,catalogStatusFilter:d,resolveSkillEnabled:f,categoryLabel:p,sourceLabel:m,openSkillDetail:h,onSkillToggle:g,onUseSkillInChat:_,usingSkillInChatName:v,togglingSkillName:x}=e;if(r){let e=n.loading,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=be.map(Ce),t[0]=r):r=t[0];let i;return t[1]===n.loading?i=t[2]:(i=(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,"aria-busy":`true`,"aria-label":e,children:r}),t[1]=n.loading,t[2]=i),i}if(i.length===0){let e;return t[3]===n.empty?e=t[4]:(e=(0,X.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:n.empty}),t[3]=n.empty,t[4]=e),e}if(a.length===0){let e;return t[5]===n.noSearchResults?e=t[6]:(e=(0,X.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:n.noSearchResults}),t[5]=n.noSearchResults,t[6]=e),e}let S;t[7]!==o||t[8]!==s||t[9]!==p||t[10]!==l||t[11]!==n?(S=o.length>1?(0,X.jsx)(H,{items:[{id:``,label:n.marketplaceCategoryAll},...o.map(e=>({id:e,label:p(e),title:p(e)}))],activeTab:s,onChange:l,ariaLabel:n.marketplaceCategoriesAria,tabIdPrefix:`skills-builtin-category-tab`,className:`gap-2 pt-0.5 [scrollbar-width:thin]`,buttonClassName:`max-w-[14rem] truncate rounded-full border px-3 py-1.5 text-xs`,selectedClassName:`border-fg bg-fg text-surface-panel dark:border-fg dark:bg-fg dark:text-surface-base`,unselectedClassName:`border-edge bg-surface-panel text-fg-muted hover:border-edge-strong hover:text-fg dark:border-edge dark:bg-surface-hover/40`}):null,t[7]=o,t[8]=s,t[9]=p,t[10]=l,t[11]=n,t[12]=S):S=t[12];let C;t[13]!==u||t[14]!==d||t[15]!==g||t[16]!==_||t[17]!==h||t[18]!==f||t[19]!==n||t[20]!==m||t[21]!==x||t[22]!==v?(C=u.length===0?(0,X.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge py-16 text-center text-sm text-fg-muted`,children:d===`disabled`?n.noDisabledSkills:n.noSearchResults}):(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:u.map(e=>{let t=f(e);return(0,X.jsxs)(`article`,{className:c(`group flex h-full flex-col rounded-xl bg-surface-panel p-4 shadow-surface transition-colors`,t?`hover:bg-surface-hover`:`bg-amber-50/30 hover:bg-amber-50/50 dark:bg-amber-950/20`),children:[(0,X.jsx)(`button`,{type:`button`,className:c(`flex min-h-0 w-full flex-1 cursor-pointer flex-col rounded-lg text-left outline-none`,F.focusRingPanel),"aria-labelledby":`catalog-skill-title-${e.directoryId}`,onClick:()=>void h(e),children:(0,X.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,X.jsx)(`h3`,{id:`catalog-skill-title-${e.directoryId}`,className:`min-w-0 flex-1 truncate text-[15px] font-semibold leading-snug tracking-tight text-fg`,children:e.name}),(0,X.jsxs)(`span`,{className:c(`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-medium`,t?`border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:`border-amber-500/30 bg-amber-500/10 text-amber-800 dark:text-amber-200`),children:[t?(0,X.jsx)(b,{className:`size-3`,"aria-hidden":!0}):(0,X.jsx)(y,{className:`size-3`,"aria-hidden":!0}),t?n.statusEnabled:n.statusDisabled]})]}),(0,X.jsx)(`p`,{className:`line-clamp-2 text-sm leading-relaxed text-fg-muted`,title:e.description?e.description:void 0,children:e.description||`—`}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 text-[11px] text-fg-subtle`,children:[(0,X.jsx)(`span`,{className:`rounded-md bg-surface-hover/60 px-2 py-0.5 dark:bg-surface-active/50`,children:m(e)}),e.managed?(0,X.jsxs)(`span`,{className:`rounded-md bg-surface-hover/60 px-2 py-0.5 dark:bg-surface-active/50`,children:[n.col.managed,`: `,n.yes]}):null,e.hub?(0,X.jsxs)(`span`,{className:`max-w-full break-all rounded-md bg-surface-hover/60 px-2 py-0.5 font-mono text-[10px] leading-snug dark:bg-surface-active/50 line-clamp-2`,title:`${e.hub.source}${e.hub.ref?`\nref: ${e.hub.ref}`:``}\nupdated: ${e.hub.updatedAt}`,children:[n.hubRemote,` ·`,` `,e.hub.kind===`git`?n.hubKindGit:n.hubKindArchive,` ·`,` `,e.hub.source.length>48?`${e.hub.source.slice(0,48)}…`:e.hub.source]}):null]})]})})}),(0,X.jsx)(`div`,{role:`group`,className:`mt-3 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:t?(0,X.jsx)(I,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:v===e.name||x===e.name,onClick:()=>void _({name:e.name,source:`catalog`}),children:v===e.name?n.previewUseInChatBusy:n.previewUseInChat}):(0,X.jsx)(I,{type:`button`,variant:`primary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:x===e.name,onClick:()=>void g(e.name,!0),children:x===e.name?n.uploading:n.detailModalEnable})})]},`${e.directoryId}-${e.path}`)})}),t[13]=u,t[14]=d,t[15]=g,t[16]=_,t[17]=h,t[18]=f,t[19]=n,t[20]=m,t[21]=x,t[22]=v,t[23]=C):C=t[23];let w;return t[24]!==S||t[25]!==C?(w=(0,X.jsxs)(X.Fragment,{children:[S,C]}),t[24]=S,t[25]=C,t[26]=w):w=t[26],w}function Ce(e){return(0,X.jsx)(he,{},e)}function we(e){let t=(0,J.c)(32),{sk:n,confirmOpen:r,setConfirmOpen:i,confirmId:a,setConfirmId:o,runDelete:s}=e,c;t[0]!==o||t[1]!==i?(c=e=>{i(e),e||o(null)},t[0]=o,t[1]=i,t[2]=c):c=t[2];let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[3]=l):l=t[3];let u;t[4]===n.deleteTitle?u=t[5]:(u=(0,X.jsx)(T,{className:`text-base font-semibold text-fg`,children:n.deleteTitle}),t[4]=n.deleteTitle,t[5]=u);let d;t[6]!==a||t[7]!==n.deleteMessage?(d=a?le(n.deleteMessage,{id:a}):``,t[6]=a,t[7]=n.deleteMessage,t[8]=d):d=t[8];let f;t[9]===d?f=t[10]:(f=(0,X.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:d}),t[9]=d,t[10]=f);let p;t[11]===i?p=t[12]:(p=()=>i(!1),t[11]=i,t[12]=p);let m;t[13]!==n.cancel||t[14]!==p?(m=(0,X.jsx)(I,{type:`button`,variant:`secondary`,onClick:p,children:n.cancel}),t[13]=n.cancel,t[14]=p,t[15]=m):m=t[15];let g;t[16]===s?g=t[17]:(g=()=>void s(),t[16]=s,t[17]=g);let v;t[18]!==n.deleteConfirm||t[19]!==g?(v=(0,X.jsx)(I,{type:`button`,variant:`primary`,className:`bg-red-600 hover:bg-red-700`,onClick:g,children:n.deleteConfirm}),t[18]=n.deleteConfirm,t[19]=g,t[20]=v):v=t[20];let y;t[21]!==m||t[22]!==v?(y=(0,X.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[m,v]}),t[21]=m,t[22]=v,t[23]=y):y=t[23];let b;t[24]!==y||t[25]!==u||t[26]!==f?(b=(0,X.jsxs)(h,{children:[l,(0,X.jsxs)(z,{className:`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] w-[min(100%-2rem,24rem)] -translate-x-1/2 -translate-y-1/2 rounded-xl border border-edge bg-surface-panel p-4 shadow-popover dark:border-edge`,children:[u,f,y]})]}),t[24]=y,t[25]=u,t[26]=f,t[27]=b):b=t[27];let x;return t[28]!==r||t[29]!==c||t[30]!==b?(x=(0,X.jsx)(O,{open:r,onOpenChange:c,children:b}),t[28]=r,t[29]=c,t[30]=b,t[31]=x):x=t[31],x}function Q(e){let t=(0,J.c)(7),{label:n,children:r}=e;if(r==null||r===!1)return null;let i;t[0]===n?i=t[1]:(i=(0,X.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,X.jsx)(`div`,{className:`mt-1.5 min-w-0 text-sm text-fg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,X.jsxs)(`div`,{className:`mt-3 border-t border-edge-subtle pt-3 dark:border-edge/60`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function Te(e){let t=(0,J.c)(118),{preview:n,sk:r}=e,i=n.metadata,a=n.toolConditions,o=!!a&&(a.requiresTools.length>0||a.requiresToolsets.length>0||a.fallbackForTools.length>0||a.fallbackForToolsets.length>0),s=i.requires,l=s&&((s.bins?.length??0)>0||(s.env?.length??0)>0||(s.anyBins?.length??0)>0),u,d,f,m,h,g,_,v,y,b,x,S,C,w,T;if(t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==i.emoji||t[4]!==i.homepage||t[5]!==i.install||t[6]!==i.os||t[7]!==n.description||t[8]!==n.disableModelInvocation||t[9]!==n.requiredEnvVarNames||t[10]!==s||t[11]!==r.detailEnvVarsLabel||t[12]!==r.detailHomepageLabel||t[13]!==r.detailInstallLabel||t[14]!==r.detailNotInjectedNote||t[15]!==r.detailPlatformsLabel||t[16]!==r.detailRequiresAnyBins||t[17]!==r.detailRequiresBins||t[18]!==r.detailRequiresEnv||t[19]!==r.detailRequiresLabel||t[20]!==r.detailSummaryHeading||t[21]!==r.detailToolGatingLabel||t[22]!==r.detailToolsFallbackList||t[23]!==r.detailToolsRequiresList||t[24]!==r.detailToolsetsFallbackList||t[25]!==r.detailToolsetsRequiresList){let e=i.install?.filter(Oe)??[],p=n.requiredEnvVarNames?.filter(De)??[];_=`space-y-6`,h=`skill-detail-summary-heading`,t[41]===r.detailSummaryHeading?g=t[42]:(g=(0,X.jsx)(`h3`,{id:`skill-detail-summary-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:r.detailSummaryHeading}),t[41]=r.detailSummaryHeading,t[42]=g),y=`rounded-xl border border-edge bg-surface-base px-4 py-3 dark:bg-surface-hover/25`,t[43]===i.emoji?b=t[44]:(b=i.emoji?.trim()?(0,X.jsx)(`p`,{className:`text-2xl leading-none`,"aria-hidden":!0,children:i.emoji.trim()}):null,t[43]=i.emoji,t[44]=b);let E;t[45]===i.emoji?E=t[46]:(E=i.emoji?.trim()?`mt-2`:``,t[45]=i.emoji,t[46]=E);let D;t[47]===E?D=t[48]:(D=c(`text-sm leading-relaxed text-fg`,E),t[47]=E,t[48]=D),t[49]!==n.description||t[50]!==D?(x=(0,X.jsx)(`p`,{className:D,children:n.description}),t[49]=n.description,t[50]=D,t[51]=x):x=t[51],t[52]!==n.disableModelInvocation||t[53]!==r.detailNotInjectedNote?(S=n.disableModelInvocation?(0,X.jsx)(`p`,{className:`mt-3 rounded-lg border border-amber-200/80 bg-amber-50/90 px-3 py-2 text-xs leading-snug text-amber-950 dark:border-amber-900/50 dark:bg-amber-950/40 dark:text-amber-100`,children:r.detailNotInjectedNote}):null,t[52]=n.disableModelInvocation,t[53]=r.detailNotInjectedNote,t[54]=S):S=t[54];let O;t[55]===i.homepage?O=t[56]:(O=i.homepage?.trim()?(0,X.jsx)(`a`,{href:i.homepage.trim(),target:`_blank`,rel:`noopener noreferrer`,className:`break-all text-accent underline-offset-2 hover:underline`,children:i.homepage.trim()}):null,t[55]=i.homepage,t[56]=O),t[57]!==r.detailHomepageLabel||t[58]!==O?(C=(0,X.jsx)(Q,{label:r.detailHomepageLabel,children:O}),t[57]=r.detailHomepageLabel,t[58]=O,t[59]=C):C=t[59];let k;t[60]===i.os?k=t[61]:(k=i.os&&i.os.length>0?(0,X.jsx)(`span`,{className:`font-mono text-xs text-fg-muted`,children:i.os.join(`, `)}):null,t[60]=i.os,t[61]=k),t[62]!==r.detailPlatformsLabel||t[63]!==k?(w=(0,X.jsx)(Q,{label:r.detailPlatformsLabel,children:k}),t[62]=r.detailPlatformsLabel,t[63]=k,t[64]=w):w=t[64];let A;t[65]!==l||t[66]!==s||t[67]!==r.detailRequiresAnyBins||t[68]!==r.detailRequiresBins||t[69]!==r.detailRequiresEnv?(A=l&&s?(0,X.jsxs)(`ul`,{className:`list-inside list-disc space-y-1 text-sm text-fg-muted`,children:[s.bins&&s.bins.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresBins,`: `]}),s.bins.join(`, `)]}):null,s.env&&s.env.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresEnv,`: `]}),(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:s.env.join(`, `)})]}):null,s.anyBins&&s.anyBins.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`text-fg`,children:[r.detailRequiresAnyBins,`: `]}),s.anyBins.join(`, `)]}):null]}):null,t[65]=l,t[66]=s,t[67]=r.detailRequiresAnyBins,t[68]=r.detailRequiresBins,t[69]=r.detailRequiresEnv,t[70]=A):A=t[70],t[71]!==r.detailRequiresLabel||t[72]!==A?(T=(0,X.jsx)(Q,{label:r.detailRequiresLabel,children:A}),t[71]=r.detailRequiresLabel,t[72]=A,t[73]=T):T=t[73];let j=e.length>0?(0,X.jsx)(`ul`,{className:`list-inside list-decimal space-y-1.5 text-sm text-fg-muted`,children:e.map(Ee)}):null;t[74]!==r.detailInstallLabel||t[75]!==j?(f=(0,X.jsx)(Q,{label:r.detailInstallLabel,children:j}),t[74]=r.detailInstallLabel,t[75]=j,t[76]=f):f=t[76];let M;t[77]!==a||t[78]!==o||t[79]!==r.detailToolsFallbackList||t[80]!==r.detailToolsRequiresList||t[81]!==r.detailToolsetsFallbackList||t[82]!==r.detailToolsetsRequiresList?(M=o&&a?(0,X.jsxs)(`ul`,{className:`mt-1 space-y-2 text-sm text-fg-muted`,children:[a.requiresTools.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsRequiresList,`: `]}),a.requiresTools.join(`, `)]}):null,a.requiresToolsets.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsetsRequiresList,`: `]}),a.requiresToolsets.join(`, `)]}):null,a.fallbackForTools.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsFallbackList,`: `]}),a.fallbackForTools.join(`, `)]}):null,a.fallbackForToolsets.length>0?(0,X.jsxs)(`li`,{children:[(0,X.jsxs)(`span`,{className:`font-medium text-fg`,children:[r.detailToolsetsFallbackList,`: `]}),a.fallbackForToolsets.join(`, `)]}):null]}):null,t[77]=a,t[78]=o,t[79]=r.detailToolsFallbackList,t[80]=r.detailToolsRequiresList,t[81]=r.detailToolsetsFallbackList,t[82]=r.detailToolsetsRequiresList,t[83]=M):M=t[83],t[84]!==r.detailToolGatingLabel||t[85]!==M?(m=(0,X.jsx)(Q,{label:r.detailToolGatingLabel,children:M}),t[84]=r.detailToolGatingLabel,t[85]=M,t[86]=m):m=t[86],u=Q,d=r.detailEnvVarsLabel,v=p.length>0?(0,X.jsx)(`span`,{className:`font-mono text-xs text-fg-muted`,children:p.join(`, `)}):null,t[0]=a,t[1]=l,t[2]=o,t[3]=i.emoji,t[4]=i.homepage,t[5]=i.install,t[6]=i.os,t[7]=n.description,t[8]=n.disableModelInvocation,t[9]=n.requiredEnvVarNames,t[10]=s,t[11]=r.detailEnvVarsLabel,t[12]=r.detailHomepageLabel,t[13]=r.detailInstallLabel,t[14]=r.detailNotInjectedNote,t[15]=r.detailPlatformsLabel,t[16]=r.detailRequiresAnyBins,t[17]=r.detailRequiresBins,t[18]=r.detailRequiresEnv,t[19]=r.detailRequiresLabel,t[20]=r.detailSummaryHeading,t[21]=r.detailToolGatingLabel,t[22]=r.detailToolsFallbackList,t[23]=r.detailToolsRequiresList,t[24]=r.detailToolsetsFallbackList,t[25]=r.detailToolsetsRequiresList,t[26]=u,t[27]=d,t[28]=f,t[29]=m,t[30]=h,t[31]=g,t[32]=_,t[33]=v,t[34]=y,t[35]=b,t[36]=x,t[37]=S,t[38]=C,t[39]=w,t[40]=T}else u=t[26],d=t[27],f=t[28],m=t[29],h=t[30],g=t[31],_=t[32],v=t[33],y=t[34],b=t[35],x=t[36],S=t[37],C=t[38],w=t[39],T=t[40];let E;t[87]!==u||t[88]!==d||t[89]!==v?(E=(0,X.jsx)(u,{label:d,children:v}),t[87]=u,t[88]=d,t[89]=v,t[90]=E):E=t[90];let D;t[91]!==f||t[92]!==m||t[93]!==E||t[94]!==y||t[95]!==b||t[96]!==x||t[97]!==S||t[98]!==C||t[99]!==w||t[100]!==T?(D=(0,X.jsxs)(`div`,{className:y,children:[b,x,S,C,w,T,f,m,E]}),t[91]=f,t[92]=m,t[93]=E,t[94]=y,t[95]=b,t[96]=x,t[97]=S,t[98]=C,t[99]=w,t[100]=T,t[101]=D):D=t[101];let O;t[102]!==h||t[103]!==g||t[104]!==D?(O=(0,X.jsxs)(`section`,{"aria-labelledby":h,children:[g,D]}),t[102]=h,t[103]=g,t[104]=D,t[105]=O):O=t[105];let k;t[106]===r.detailInstructionsHeading?k=t[107]:(k=(0,X.jsx)(`h3`,{id:`skill-detail-instructions-heading`,className:`mb-2 text-xs font-semibold uppercase tracking-wide text-fg-muted`,children:r.detailInstructionsHeading}),t[106]=r.detailInstructionsHeading,t[107]=k);let A;t[108]!==n.bodyMarkdown||t[109]!==r.detailNoInstructionsBody?(A=n.bodyMarkdown.trim()?(0,X.jsx)(`div`,{className:`markdown-content min-w-0 break-words`,children:(0,X.jsx)(p,{content:n.bodyMarkdown})}):(0,X.jsx)(`p`,{className:`text-sm italic text-fg-muted`,children:r.detailNoInstructionsBody}),t[108]=n.bodyMarkdown,t[109]=r.detailNoInstructionsBody,t[110]=A):A=t[110];let j;t[111]!==k||t[112]!==A?(j=(0,X.jsxs)(`section`,{"aria-labelledby":`skill-detail-instructions-heading`,children:[k,A]}),t[111]=k,t[112]=A,t[113]=j):j=t[113];let M;return t[114]!==_||t[115]!==O||t[116]!==j?(M=(0,X.jsxs)(`div`,{className:_,children:[O,j]}),t[114]=_,t[115]=O,t[116]=j,t[117]=M):M=t[117],M}function Ee(e,t){return(0,X.jsx)(`li`,{className:`[overflow-wrap:anywhere]`,children:(0,X.jsx)(`span`,{className:`text-fg`,children:oe(e)})},e.id||`${e.kind}-${t}`)}function De(e){return e.trim()}function Oe(e){return e&&typeof e.kind==`string`}var ke=[{id:`s0`,width:`w-[92%]`},{id:`s1`,width:`w-full`},{id:`s2`,width:`w-4/5`},{id:`s3`,width:`w-[92%]`},{id:`s4`,width:`w-full`},{id:`s5`,width:`w-4/5`},{id:`s6`,width:`w-[92%]`},{id:`s7`,width:`w-full`},{id:`s8`,width:`w-4/5`},{id:`s9`,width:`w-[92%]`}];function Ae(e){let t=(0,J.c)(81),{sk:n,detailOpen:r,setDetailOpen:i,detailSource:a,setDetailSource:o,detailTitle:s,setDetailTitle:l,detailCatalogPreview:u,setDetailCatalogPreview:d,detailMarketplacePreview:f,setDetailMarketplacePreview:p,detailLoading:v,detailError:y,setDetailError:b,detailEnabled:x,detailDirectoryId:S,detailManaged:C,detailExternalUrl:w,usingSkillInChatName:D,installingMarketName:k,togglingSkillName:A,isSkillInstalledByName:M,onUseSkillInChat:N,onMarketInstall:P,onSkillToggle:L,setConfirmId:V,setConfirmOpen:H}=e,U;t[0]!==d||t[1]!==b||t[2]!==p||t[3]!==i||t[4]!==o||t[5]!==l?(U=e=>{i(e),e||(o(`catalog`),d(null),p(null),b(null),l(``))},t[0]=d,t[1]=b,t[2]=p,t[3]=i,t[4]=o,t[5]=l,t[6]=U):U=t[6];let W;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,X.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[7]=W):W=t[7];let G;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(G=c(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] flex h-[min(88vh,44rem)] max-h-[min(92vh,56rem)] w-[min(100%-2rem,min(92vw,56rem))]`,`-translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-2xl border border-edge bg-surface-panel shadow-float dark:border-edge`),t[8]=G):G=t[8];let ee=s||`?`,te;t[9]===ee?te=t[10]:(te=(0,X.jsx)(ue,{name:ee}),t[9]=ee,t[10]=te);let K=s||`—`,q;t[11]===K?q=t[12]:(q=(0,X.jsx)(T,{className:`min-w-0 flex-1 truncate text-base font-semibold text-fg`,children:K}),t[11]=K,t[12]=q);let ne;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ne=c(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.focusRingPanel),t[13]=ne):ne=t[13];let re;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,X.jsx)(R,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[14]=re):re=t[14];let ie;t[15]===n.detailCloseAria?ie=t[16]:(ie=(0,X.jsx)(m,{asChild:!0,children:(0,X.jsx)(`button`,{type:`button`,className:ne,"aria-label":n.detailCloseAria,children:re})}),t[15]=n.detailCloseAria,t[16]=ie);let ae;t[17]!==te||t[18]!==q||t[19]!==ie?(ae=(0,X.jsxs)(`div`,{className:`group flex min-h-[3.25rem] shrink-0 items-center gap-3 border-b border-edge px-4 py-3`,children:[te,q,ie]}),t[17]=te,t[18]=q,t[19]=ie,t[20]=ae):ae=t[20];let oe;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,X.jsx)(j,{className:`mt-0.5 size-4 shrink-0 text-blue-600 dark:text-blue-400`,strokeWidth:1.75,"aria-hidden":!0}),t[21]=oe):oe=t[21];let se=a===`store`&&f?n.detailModalBanner:a===`store`?n.detailModalBannerStore:n.detailModalBanner,ce;t[22]===se?ce=t[23]:(ce=(0,X.jsxs)(`div`,{className:`flex min-h-[3.25rem] shrink-0 items-start gap-2 border-b border-blue-200/80 bg-blue-50/95 px-4 py-2.5 text-sm text-fg dark:border-blue-900/50 dark:bg-blue-950/45`,children:[oe,(0,X.jsx)(`p`,{className:`min-w-0 leading-relaxed`,children:se})]}),t[22]=se,t[23]=ce);let le;t[24]!==u||t[25]!==x||t[26]!==y||t[27]!==v||t[28]!==f||t[29]!==a||t[30]!==n?(le=(0,X.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto p-4`,children:v?(0,X.jsx)(`div`,{className:`flex h-full min-h-[14rem] flex-col gap-2.5 py-1`,"aria-busy":`true`,"aria-label":n.loading,children:ke.map(je)}):y?(0,X.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:y}):a===`catalog`&&u?(0,X.jsxs)(X.Fragment,{children:[x?null:(0,X.jsxs)(`div`,{className:`mb-4 flex items-start gap-2 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2.5 text-sm text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-100`,children:[(0,X.jsx)(g,{className:`mt-0.5 size-4 shrink-0 text-amber-600 dark:text-amber-300`,strokeWidth:1.75,"aria-hidden":!0}),(0,X.jsx)(`p`,{className:`leading-relaxed`,children:n.detailDisabledNotice})]}),(0,X.jsx)(Te,{preview:u,sk:n})]}):a===`store`&&f?(0,X.jsx)(Te,{preview:f,sk:n}):(0,X.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:n.detailLoadFailed})}),t[24]=u,t[25]=x,t[26]=y,t[27]=v,t[28]=f,t[29]=a,t[30]=n,t[31]=le):le=t[31];let de;t[32]!==w||t[33]!==a||t[34]!==n.marketplaceOpenExternal||t[35]!==n.marketplaceOpenExternalAria?(de=a===`store`&&w?(0,X.jsxs)(`a`,{href:w,target:`_blank`,rel:`noopener noreferrer`,className:c(`inline-flex h-9 items-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 text-sm font-medium text-fg-muted`,`hover:bg-surface-hover hover:text-fg dark:border-edge`,F.focusRingPanel),"aria-label":n.marketplaceOpenExternalAria,title:n.marketplaceOpenExternal,children:[(0,X.jsx)(B,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:n.marketplaceOpenExternal})]}):null,t[32]=w,t[33]=a,t[34]=n.marketplaceOpenExternal,t[35]=n.marketplaceOpenExternalAria,t[36]=de):de=t[36];let fe;t[37]!==S||t[38]!==C||t[39]!==a||t[40]!==V||t[41]!==H||t[42]!==n.delete?(fe=a===`catalog`&&C&&S?(0,X.jsxs)(I,{type:`button`,variant:`ghost`,className:`gap-1.5 text-red-600 hover:bg-red-50 hover:text-red-700 dark:text-red-400 dark:hover:bg-red-950/40 dark:hover:text-red-300`,onClick:()=>{V(S),H(!0)},children:[(0,X.jsx)(E,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),n.delete]}):null,t[37]=S,t[38]=C,t[39]=a,t[40]=V,t[41]=H,t[42]=n.delete,t[43]=fe):fe=t[43];let Y;t[44]!==de||t[45]!==fe?(Y=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[de,fe]}),t[44]=de,t[45]=fe,t[46]=Y):Y=t[46];let pe;t[47]!==x||t[48]!==v||t[49]!==a||t[50]!==s||t[51]!==k||t[52]!==M||t[53]!==P||t[54]!==L||t[55]!==N||t[56]!==i||t[57]!==n.cancel||t[58]!==n.detailModalDisable||t[59]!==n.detailModalEnable||t[60]!==n.marketplaceInstall||t[61]!==n.marketplaceReinstall||t[62]!==n.previewUseInChat||t[63]!==n.previewUseInChatBusy||t[64]!==n.uploading||t[65]!==n.useRequiresEnabled||t[66]!==A||t[67]!==D?(pe=(0,X.jsx)(`div`,{className:`flex items-center gap-2`,children:a===`store`?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(I,{type:`button`,variant:`ghost`,onClick:()=>i(!1),children:n.cancel}),(0,X.jsx)(I,{type:`button`,variant:`secondary`,disabled:!s||v||D===s||k===s,onClick:()=>void N(),children:D===s?n.previewUseInChatBusy:n.previewUseInChat}),(0,X.jsx)(I,{type:`button`,variant:M(s)?`secondary`:`primary`,disabled:!s||k===s,onClick:()=>{s&&P(s,{useDetailProvider:!0})},children:k===s?n.uploading:M(s)?n.marketplaceReinstall:n.marketplaceInstall})]}):(0,X.jsxs)(X.Fragment,{children:[x?(0,X.jsx)(I,{type:`button`,variant:`secondary`,disabled:!s||A===s,onClick:()=>{s&&L(s,!1)},children:A===s?n.uploading:n.detailModalDisable}):(0,X.jsx)(I,{type:`button`,variant:`primary`,disabled:!s||A===s,onClick:()=>{s&&L(s,!0)},children:A===s?n.uploading:n.detailModalEnable}),(0,X.jsx)(I,{type:`button`,variant:`secondary`,disabled:!s||!x||v||D===s||A===s,title:x?void 0:n.useRequiresEnabled,onClick:()=>void N(),children:D===s?n.previewUseInChatBusy:n.previewUseInChat})]})}),t[47]=x,t[48]=v,t[49]=a,t[50]=s,t[51]=k,t[52]=M,t[53]=P,t[54]=L,t[55]=N,t[56]=i,t[57]=n.cancel,t[58]=n.detailModalDisable,t[59]=n.detailModalEnable,t[60]=n.marketplaceInstall,t[61]=n.marketplaceReinstall,t[62]=n.previewUseInChat,t[63]=n.previewUseInChatBusy,t[64]=n.uploading,t[65]=n.useRequiresEnabled,t[66]=A,t[67]=D,t[68]=pe):pe=t[68];let Z;t[69]!==Y||t[70]!==pe?(Z=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-2 border-t border-edge px-4 py-3`,children:[Y,pe]}),t[69]=Y,t[70]=pe,t[71]=Z):Z=t[71];let me;t[72]!==ae||t[73]!==ce||t[74]!==le||t[75]!==Z?(me=(0,X.jsxs)(h,{children:[W,(0,X.jsxs)(z,{className:G,children:[ae,ce,le,Z]})]}),t[72]=ae,t[73]=ce,t[74]=le,t[75]=Z,t[76]=me):me=t[76];let he;return t[77]!==r||t[78]!==U||t[79]!==me?(he=(0,X.jsx)(O,{open:r,onOpenChange:U,children:me}),t[77]=r,t[78]=U,t[79]=me,t[80]=he):he=t[80],he}function je(e){return(0,X.jsx)(`div`,{className:c(`h-4 animate-pulse rounded-md bg-surface-hover dark:bg-surface-active/50`,e.width)},e.id)}function Me(e){let t=(0,J.c)(67),{sk:n,installOpen:r,setInstallOpen:i,pendingFile:a,setPendingFile:o,dropActive:s,setDropActive:l,uploading:u,onModalDragOver:d,onModalDragLeave:f,onModalDrop:p,onFileInputChange:g,onInstallSubmit:v}=e,y;t[0]!==l||t[1]!==i||t[2]!==o?(y=e=>{i(e),e||(o(null),l(!1))},t[0]=l,t[1]=i,t[2]=o,t[3]=y):y=t[3];let b;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,X.jsx)(_,{className:`xopc-dialog-overlay fixed inset-0 z-[60] bg-scrim`}),t[4]=b):b=t[4];let x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=c(`xopc-dialog-content fixed left-1/2 top-1/2 z-[60] max-h-[min(100vh-2rem,44rem)] w-[min(100%-2rem,min(92vw,48rem))] -translate-x-1/2 -translate-y-1/2 overflow-y-auto`,`rounded-2xl border border-edge bg-surface-panel p-6 shadow-float dark:border-edge`),t[5]=x):x=t[5];let S;t[6]===n.installModalTitle?S=t[7]:(S=(0,X.jsx)(T,{className:`text-base font-semibold text-fg`,children:n.installModalTitle}),t[6]=n.installModalTitle,t[7]=S);let C;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=c(`rounded-lg p-1.5 text-fg-muted hover:bg-surface-hover hover:text-fg`,F.focusRingPanel),t[8]=C):C=t[8];let w;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,X.jsx)(R,{className:`size-5`,strokeWidth:1.75,"aria-hidden":!0}),t[9]=w):w=t[9];let E;t[10]===n.installClose?E=t[11]:(E=(0,X.jsx)(`span`,{className:`sr-only`,children:n.installClose}),t[10]=n.installClose,t[11]=E);let D;t[12]!==n.installClose||t[13]!==E?(D=(0,X.jsx)(m,{asChild:!0,children:(0,X.jsxs)(`button`,{type:`button`,className:C,"aria-label":n.installClose,children:[w,E]})}),t[12]=n.installClose,t[13]=E,t[14]=D):D=t[14];let k;t[15]!==S||t[16]!==D?(k=(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[S,D]}),t[15]=S,t[16]=D,t[17]=k):k=t[17];let A=s?`border-accent bg-accent-soft/60 dark:bg-blue-950/40`:`border-edge bg-surface-base dark:bg-surface-hover/30`,j;t[18]===A?j=t[19]:(j=c(`mt-4 flex min-h-[11rem] cursor-pointer flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed px-6 py-12 text-center transition-colors`,A),t[18]=A,t[19]=j);let M;t[20]!==g||t[21]!==n.installModalDropHint||t[22]!==u?(M=(0,X.jsx)(`input`,{type:`file`,accept:`.zip,.md,application/zip,text/markdown`,className:`sr-only`,"aria-label":n.installModalDropHint,disabled:u,onChange:g}),t[20]=g,t[21]=n.installModalDropHint,t[22]=u,t[23]=M):M=t[23];let N;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,X.jsx)(V,{className:`size-12 text-fg-subtle`,strokeWidth:1.25,"aria-hidden":!0}),t[24]=N):N=t[24];let P;t[25]===n.installModalDropHint?P=t[26]:(P=(0,X.jsx)(`span`,{className:`text-sm text-fg-muted`,children:n.installModalDropHint}),t[25]=n.installModalDropHint,t[26]=P);let I;t[27]===a?I=t[28]:(I=a?(0,X.jsx)(`span`,{className:`text-xs font-medium text-fg`,children:a.name}):null,t[27]=a,t[28]=I);let L;t[29]!==f||t[30]!==d||t[31]!==p||t[32]!==j||t[33]!==M||t[34]!==P||t[35]!==I?(L=(0,X.jsxs)(`label`,{className:j,onDragLeave:f,onDragOver:d,onDrop:p,children:[M,N,P,I]}),t[29]=f,t[30]=d,t[31]=p,t[32]=j,t[33]=M,t[34]=P,t[35]=I,t[36]=L):L=t[36];let B;t[37]===n.installModalReqTitle?B=t[38]:(B=(0,X.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:n.installModalReqTitle}),t[37]=n.installModalReqTitle,t[38]=B);let H;t[39]===n.installModalReq1?H=t[40]:(H=(0,X.jsx)(`li`,{children:n.installModalReq1}),t[39]=n.installModalReq1,t[40]=H);let U;t[41]===n.installModalReq2?U=t[42]:(U=(0,X.jsx)(`li`,{children:n.installModalReq2}),t[41]=n.installModalReq2,t[42]=U);let W;t[43]!==H||t[44]!==U?(W=(0,X.jsxs)(`ul`,{className:`list-inside list-disc space-y-1 text-sm text-fg-muted`,children:[H,U]}),t[43]=H,t[44]=U,t[45]=W):W=t[45];let G;t[46]!==B||t[47]!==W?(G=(0,X.jsxs)(`div`,{className:`mt-5 space-y-2`,children:[B,W]}),t[46]=B,t[47]=W,t[48]=G):G=t[48];let ee=!a||u,te=!a||u?`cursor-not-allowed bg-surface-active text-fg-disabled`:`bg-accent text-white hover:bg-accent-hover`,K;t[49]===te?K=t[50]:(K=c(`mt-6 flex w-full items-center justify-center rounded-xl py-3 text-sm font-semibold`,`transition-colors`,te,F.focusRingPanel),t[49]=te,t[50]=K);let q;t[51]===v?q=t[52]:(q=()=>void v(),t[51]=v,t[52]=q);let ne=u?n.uploading:n.installAction,re;t[53]!==ee||t[54]!==K||t[55]!==q||t[56]!==ne?(re=(0,X.jsx)(`button`,{type:`button`,disabled:ee,className:K,onClick:q,children:ne}),t[53]=ee,t[54]=K,t[55]=q,t[56]=ne,t[57]=re):re=t[57];let ie;t[58]!==L||t[59]!==G||t[60]!==re||t[61]!==k?(ie=(0,X.jsxs)(h,{children:[b,(0,X.jsxs)(z,{className:x,children:[k,L,G,re]})]}),t[58]=L,t[59]=G,t[60]=re,t[61]=k,t[62]=ie):ie=t[62];let ae;return t[63]!==r||t[64]!==y||t[65]!==ie?(ae=(0,X.jsx)(O,{open:r,onOpenChange:y,children:ie}),t[63]=r,t[64]=y,t[65]=ie,t[66]=ae):ae=t[66],ae}function Ne(e){let t=(0,J.c)(66),{sk:n,mpCategories:r,mpCategoriesLoading:i,mpCategoriesError:a,mpPayload:o,mpLoading:s,mpError:l,marketCategoryId:u,setMarketCategoryId:d,marketPage:f,setMarketPage:p,isSkillInstalledByName:m,openMarketplaceDetail:h,onMarketInstall:g,installingMarketName:_,onUseSkillInChat:v,usingSkillInChatName:y,searchInputActive:x,searchQuery:w,setSearchQuery:T,registeredProviders:E,marketBrowseProvider:D,setMarketBrowseProvider:O}=e,k=!x,A,j,N;if(t[0]!==_||t[1]!==m||t[2]!==D||t[3]!==u||t[4]!==f||t[5]!==r||t[6]!==a||t[7]!==i||t[8]!==l||t[9]!==s||t[10]!==o||t[11]!==g||t[12]!==v||t[13]!==h||t[14]!==E||t[15]!==x||t[16]!==w||t[17]!==O||t[18]!==d||t[19]!==p||t[20]!==T||t[21]!==k||t[22]!==n.loading||t[23]!==n.marketplaceAuthor||t[24]!==n.marketplaceCategoriesAria||t[25]!==n.marketplaceCategoryAll||t[26]!==n.marketplaceDownloads||t[27]!==n.marketplaceEmpty||t[28]!==n.marketplaceEmptySearch||t[29]!==n.marketplaceEmptySearchClear||t[30]!==n.marketplaceEmptySearchTryProvider||t[31]!==n.marketplaceInstall||t[32]!==n.marketplaceInstalled||t[33]!==n.marketplacePageNext||t[34]!==n.marketplacePagePrev||t[35]!==n.marketplacePageStatus||t[36]!==n.marketplaceVersion||t[37]!==n.previewUseInChat||t[38]!==n.previewUseInChatBusy||t[39]!==n.uploading||t[40]!==y){let e;t[44]===D?e=t[45]:(e=e=>e.id!==D,t[44]=D,t[45]=e);let L=E.filter(e),R=w.trim(),z;t[46]===n.marketplaceCategoryAll?z=t[47]:(z={id:``,label:n.marketplaceCategoryAll},t[46]=n.marketplaceCategoryAll,t[47]=z);let B;t[48]!==r||t[49]!==z?(B=[z,...r.map(Le)],t[48]=r,t[49]=z,t[50]=B):B=t[50];let V=B;t[51]!==V||t[52]!==u||t[53]!==r.length||t[54]!==i||t[55]!==d||t[56]!==k||t[57]!==n.marketplaceCategoriesAria?(A=k?r.length>0?(0,X.jsx)(H,{items:V,activeTab:u,onChange:d,ariaLabel:n.marketplaceCategoriesAria,tabIdPrefix:`skills-marketplace-category-tab`,className:`min-h-[2.75rem] items-center gap-2 pt-0.5 [scrollbar-width:thin]`,buttonClassName:`max-w-[14rem] truncate rounded-full border px-3 py-1.5 text-xs`,selectedClassName:`border-fg bg-fg text-surface-panel dark:border-fg dark:bg-fg dark:text-surface-base`,unselectedClassName:`border-edge bg-surface-panel text-fg-muted hover:border-edge-strong hover:text-fg dark:border-edge dark:bg-surface-hover/40`}):i?(0,X.jsx)(`div`,{className:`-mx-1 flex min-h-[2.75rem] items-center gap-2 overflow-x-auto px-1 pb-1 pt-0.5 [scrollbar-width:thin]`,"aria-hidden":!0,children:[`p0`,`p1`,`p2`,`p3`,`p4`].map(Ie)}):null:null,t[51]=V,t[52]=u,t[53]=r.length,t[54]=i,t[55]=d,t[56]=k,t[57]=n.marketplaceCategoriesAria,t[58]=A):A=t[58],t[59]!==a||t[60]!==k?(j=k&&a?(0,X.jsx)(`p`,{className:`text-xs text-red-600 dark:text-red-400`,role:`alert`,children:a}):null,t[59]=a,t[60]=k,t[61]=j):j=t[61],N=!o&&!l?(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,"aria-busy":`true`,"aria-label":n.loading,children:be.map(Fe)}):l&&!o?(0,X.jsx)(`div`,{className:`rounded-xl border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:l}):o?(0,X.jsxs)(`div`,{className:`relative`,children:[s?(0,X.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-[1] flex justify-center bg-surface-panel/40 pt-[min(28vh,7.5rem)] backdrop-blur-[1px] motion-reduce:backdrop-blur-none dark:bg-surface-base/35`,"aria-busy":`true`,"aria-label":n.loading,children:(0,X.jsx)(C,{className:`size-8 shrink-0 animate-spin text-accent motion-reduce:animate-none`,strokeWidth:2,"aria-hidden":!0})}):null,o.items.length===0?(0,X.jsxs)(`div`,{className:`flex flex-col items-center gap-3 rounded-2xl border border-dashed border-edge py-12 text-center text-sm text-fg-muted`,children:[(0,X.jsx)(`p`,{className:`px-4`,children:x&&R?le(n.marketplaceEmptySearch,{query:R}):n.marketplaceEmpty}),x?(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[L.map(e=>(0,X.jsx)(I,{type:`button`,variant:`secondary`,className:`h-8 px-3 text-xs`,onClick:()=>O(e.id),children:le(n.marketplaceEmptySearchTryProvider,{provider:e.displayName})},e.id)),(0,X.jsx)(I,{type:`button`,variant:`ghost`,className:`h-8 px-3 text-xs`,onClick:()=>T(``),children:n.marketplaceEmptySearchClear})]}):null]}):(0,X.jsx)(`div`,{className:c(`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3`,s&&`pointer-events-none opacity-[0.52] motion-reduce:opacity-100`),children:o.items.map(e=>{let t=re(e,e.providerId??D),r=m(t);return(0,X.jsxs)(`article`,{className:c(`group flex h-full flex-col rounded-xl bg-surface-panel p-4 shadow-surface`,`transition-colors hover:bg-surface-hover`),children:[(0,X.jsx)(`button`,{type:`button`,className:c(`flex min-h-0 w-full flex-1 cursor-pointer flex-col rounded-lg text-left outline-none`,F.focusRingPanel),"aria-labelledby":`mp-skill-title-${e.id}`,onClick:()=>void h(t,e.name,e.providerId??void 0),children:(0,X.jsx)(`div`,{className:`flex items-start gap-3`,children:(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2`,children:[(0,X.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,X.jsx)(`h3`,{id:`mp-skill-title-${e.id}`,className:`min-w-0 flex-1 truncate text-[15px] font-semibold leading-snug tracking-tight text-fg`,children:e.name}),r?(0,X.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-2 py-0.5 text-[11px] font-medium text-emerald-700 dark:text-emerald-300`,children:[(0,X.jsx)(b,{className:`size-3`,"aria-hidden":!0}),n.marketplaceInstalled]}):null]}),(0,X.jsx)(`p`,{className:`line-clamp-2 text-sm leading-relaxed text-fg-muted`,title:e.description?e.description:void 0,children:e.description||`—`}),(0,X.jsxs)(`div`,{className:`mt-auto min-h-[2.625rem] space-y-1 text-[11px] leading-snug text-fg-muted`,children:[(0,X.jsxs)(`p`,{className:`line-clamp-1`,title:`${n.marketplaceAuthor}: ${e.author.username} · ${n.marketplaceDownloads}: ${e.downloads}${e.stars!=null&&e.stars>0?` · ★${e.stars}`:``}${r?` · ${n.marketplaceInstalled}`:``}`,children:[(0,X.jsx)(`span`,{className:`text-fg-subtle`,children:n.marketplaceAuthor}),` `,(0,X.jsx)(`span`,{className:`text-fg`,children:e.author.username}),(0,X.jsx)(`span`,{className:`text-fg-subtle`,children:` · `}),(0,X.jsxs)(`span`,{children:[n.marketplaceDownloads,`: `,e.downloads]}),e.stars!=null&&e.stars>0?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{className:`text-fg-subtle`,children:` · `}),(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-fg-muted`,children:[(0,X.jsx)(S,{className:`size-3 shrink-0 text-amber-600 dark:text-amber-400`,strokeWidth:2,"aria-hidden":!0}),e.stars]})]}):null]}),e.latestVersion?(0,X.jsxs)(`p`,{className:`line-clamp-1 min-h-[1.125rem] font-mono text-[10px] text-fg-subtle`,title:`${n.marketplaceVersion}: ${e.latestVersion}`,children:[n.marketplaceVersion,`: `,e.latestVersion]}):null]})]})})}),(0,X.jsx)(`div`,{role:`group`,className:`mt-3 flex items-center justify-end gap-1 border-t border-edge-subtle pt-3`,children:r?(0,X.jsx)(I,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:s||y===t,onClick:()=>void v({name:t,source:`store`,providerOverride:e.providerId??null}),children:y===t?n.previewUseInChatBusy:n.previewUseInChat}):(0,X.jsx)(I,{type:`button`,variant:`primary`,className:`h-8 shrink-0 whitespace-nowrap px-2.5 text-xs font-medium`,disabled:s||_===t,onClick:()=>void g(t,{providerOverride:e.providerId??null}),children:_===t?n.uploading:n.marketplaceInstall})})]},e.id)})}),o.items.length>0?(0,X.jsxs)(`div`,{className:`mt-3 flex flex-col items-center justify-between gap-3 sm:flex-row`,children:[(0,X.jsx)(`p`,{className:`text-center text-xs text-fg-muted sm:text-left`,children:le(n.marketplacePageStatus,{page:o.meta.page,totalPages:o.meta.totalPages,total:o.meta.total})}),(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsxs)(I,{type:`button`,variant:`ghost`,className:`h-9 gap-1 px-2`,disabled:s||f<=1,"aria-label":n.marketplacePagePrev,onClick:()=>p(Pe),children:[(0,X.jsx)(M,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:n.marketplacePagePrev})]}),(0,X.jsxs)(I,{type:`button`,variant:`ghost`,className:`h-9 gap-1 px-2`,disabled:s||f>=o.meta.totalPages,"aria-label":n.marketplacePageNext,onClick:()=>p(e=>Math.min(o.meta.totalPages,e+1)),children:[(0,X.jsx)(`span`,{className:`sr-only sm:not-sr-only`,children:n.marketplacePageNext}),(0,X.jsx)(P,{className:`size-4`,strokeWidth:1.75,"aria-hidden":!0})]})]})]}):null]}):null,t[0]=_,t[1]=m,t[2]=D,t[3]=u,t[4]=f,t[5]=r,t[6]=a,t[7]=i,t[8]=l,t[9]=s,t[10]=o,t[11]=g,t[12]=v,t[13]=h,t[14]=E,t[15]=x,t[16]=w,t[17]=O,t[18]=d,t[19]=p,t[20]=T,t[21]=k,t[22]=n.loading,t[23]=n.marketplaceAuthor,t[24]=n.marketplaceCategoriesAria,t[25]=n.marketplaceCategoryAll,t[26]=n.marketplaceDownloads,t[27]=n.marketplaceEmpty,t[28]=n.marketplaceEmptySearch,t[29]=n.marketplaceEmptySearchClear,t[30]=n.marketplaceEmptySearchTryProvider,t[31]=n.marketplaceInstall,t[32]=n.marketplaceInstalled,t[33]=n.marketplacePageNext,t[34]=n.marketplacePagePrev,t[35]=n.marketplacePageStatus,t[36]=n.marketplaceVersion,t[37]=n.previewUseInChat,t[38]=n.previewUseInChatBusy,t[39]=n.uploading,t[40]=y,t[41]=A,t[42]=j,t[43]=N}else A=t[41],j=t[42],N=t[43];let L;return t[62]!==A||t[63]!==j||t[64]!==N?(L=(0,X.jsxs)(X.Fragment,{children:[A,j,N]}),t[62]=A,t[63]=j,t[64]=N,t[65]=L):L=t[65],L}function Pe(e){return Math.max(1,e-1)}function Fe(e){return(0,X.jsx)(me,{},e)}function Ie(e){return(0,X.jsx)(`div`,{className:`h-8 w-[4.5rem] shrink-0 animate-pulse rounded-full bg-surface-hover motion-reduce:animate-none dark:bg-surface-active/50`},e)}function Le(e){return{id:e.id,label:e.label,title:e.label}}function Re(e){let t=(0,J.c)(130),{vm:n}=e,{sk:r,hasToken:i,error:a,actionFeedback:o,skillDiagnostics:s,mainTab:l,setMainTab:u,sourceFilter:d,setSourceFilter:f,builtinTabStats:p,userTabStats:m,catalogDisabledCount:h,catalogStatusFilter:g,setCatalogStatusFilter:_,marketSort:v,setMarketSort:y,marketBrowseProvider:b,setMarketBrowseProvider:S,registeredProviders:C,inSettingsShell:w,searchInputActive:T,resultTab:E,setResultTab:D,aggregatedTabCounts:O,aggregatedProviderStatus:k}=n,A,j,M,N,P,F,I,L;if(t[0]!==o||t[1]!==k||t[2]!==O||t[3]!==p||t[4]!==a||t[5]!==i||t[6]!==C||t[7]!==r.diagnosticsHint||t[8]!==r.diagnosticsTitle||t[9]!==r.marketplaceLoadFailed||t[10]!==r.marketplaceResultsTabAll||t[11]!==r.needToken||t[12]!==r.tabDiscover||t[13]!==r.tabInstalled||t[14]!==s||t[15]!==m||t[16]!==n){L=Symbol.for(`react.early_return_sentinel`);bb0:{let e=de(s);if(!i){let e;t[25]===n?e=t[26]:(e=(0,X.jsx)(He,{vm:n}),t[25]=n,t[26]=e);let i;t[27]===r.needToken?i=t[28]:(i=(0,X.jsx)(`div`,{className:`w-full px-3 py-16 text-center text-sm text-fg-muted sm:px-5 xl:px-6`,children:r.needToken}),t[27]=r.needToken,t[28]=i);let a;t[29]!==e||t[30]!==i?(a=(0,X.jsxs)(X.Fragment,{children:[e,i]}),t[29]=e,t[30]=i,t[31]=a):a=t[31],L=a;break bb0}let l=p.total+m.total,u;t[32]!==l||t[33]!==r.tabInstalled?(u={id:`installed`,label:r.tabInstalled,count:l},t[32]=l,t[33]=r.tabInstalled,t[34]=u):u=t[34];let d;t[35]===r.tabDiscover?d=t[36]:(d={id:`marketplace`,label:r.tabDiscover},t[35]=r.tabDiscover,t[36]=d);let f;t[37]!==u||t[38]!==d?(f=[u,d],t[37]=u,t[38]=d,t[39]=f):f=t[39],A=f;let h;t[40]===C?h=t[41]:(h=[`all`,...C.map(Ve)],t[40]=C,t[41]=h);let g=h,_;t[42]!==k||t[43]!==O||t[44]!==C||t[45]!==r.marketplaceLoadFailed||t[46]!==r.marketplaceResultsTabAll||t[47]!==g?(_=g.map(e=>{let t=e===`all`?r.marketplaceResultsTabAll:C.find(t=>t.id===e)?.displayName??e,n=O[e]??0,i=e===`all`?null:k[e];return{id:e,label:t,title:i===`error`?`${t} · ${r.marketplaceLoadFailed}`:void 0,suffix:i===`loading`?(0,X.jsx)(`span`,{className:`inline-block size-1.5 animate-pulse rounded-full bg-fg-muted/60 motion-reduce:animate-none`,"aria-hidden":!0}):i===`error`?(0,X.jsx)(`span`,{className:`inline-block size-1.5 rounded-full bg-red-500`,"aria-hidden":!0}):(0,X.jsx)(`span`,{className:`tabular-nums opacity-70`,children:n})}}),t[42]=k,t[43]=O,t[44]=C,t[45]=r.marketplaceLoadFailed,t[46]=r.marketplaceResultsTabAll,t[47]=g,t[48]=_):_=t[48],j=_,t[49]===n?I=t[50]:(I=(0,X.jsx)(He,{vm:n}),t[49]=n,t[50]=I),F=`flex min-h-0 min-w-0 flex-1 flex-col bg-surface-panel`,M=`flex w-full flex-col gap-6 px-3 py-6 sm:px-5 xl:px-6`,t[51]!==o||t[52]!==a?(N=o?(0,X.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:c(`rounded-xl border px-3 py-2 text-sm`,o.kind===`success`?`border-emerald-200 bg-emerald-50 text-emerald-800 dark:border-emerald-900/40 dark:bg-emerald-950/40 dark:text-emerald-200`:`border-red-200 bg-red-50 text-red-800 dark:border-red-900/50 dark:bg-red-950/40 dark:text-red-200`),children:o.message}):a?(0,X.jsx)(`div`,{className:`rounded-xl border border-edge bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-edge dark:bg-red-950/40 dark:text-red-300`,role:`alert`,children:a}):null,t[51]=o,t[52]=a,t[53]=N):N=t[53],P=e.length>0?(0,X.jsxs)(`div`,{className:`rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-200`,role:`status`,children:[(0,X.jsx)(`div`,{className:`font-medium`,children:le(r.diagnosticsTitle,{count:e.length})}),(0,X.jsx)(`p`,{className:`mt-1 text-xs opacity-80`,children:r.diagnosticsHint}),(0,X.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.slice(0,3).map(Be)})]}):null}t[0]=o,t[1]=k,t[2]=O,t[3]=p,t[4]=a,t[5]=i,t[6]=C,t[7]=r.diagnosticsHint,t[8]=r.diagnosticsTitle,t[9]=r.marketplaceLoadFailed,t[10]=r.marketplaceResultsTabAll,t[11]=r.needToken,t[12]=r.tabDiscover,t[13]=r.tabInstalled,t[14]=s,t[15]=m,t[16]=n,t[17]=A,t[18]=j,t[19]=M,t[20]=N,t[21]=P,t[22]=F,t[23]=I,t[24]=L}else A=t[17],j=t[18],M=t[19],N=t[20],P=t[21],F=t[22],I=t[23],L=t[24];if(L!==Symbol.for(`react.early_return_sentinel`))return L;let R;t[54]!==w||t[55]!==n.loading||t[56]!==n.mainTab||t[57]!==n.onReloadClick||t[58]!==n.searchQuery||t[59]!==n.setInstallOpen||t[60]!==n.setPendingFile||t[61]!==n.setSearchQuery||t[62]!==n.sk?(R=w?(0,X.jsx)(`div`,{className:`flex flex-col gap-3 border-b border-edge-subtle pb-4 dark:border-edge-subtle sm:flex-row sm:flex-wrap sm:items-center sm:justify-end`,children:(0,X.jsx)(pe,{loading:n.loading,onReloadClick:n.onReloadClick,searchQuery:n.searchQuery,setSearchQuery:n.setSearchQuery,mainTab:n.mainTab,sk:n.sk,setPendingFile:n.setPendingFile,setInstallOpen:n.setInstallOpen})}):null,t[54]=w,t[55]=n.loading,t[56]=n.mainTab,t[57]=n.onReloadClick,t[58]=n.searchQuery,t[59]=n.setInstallOpen,t[60]=n.setPendingFile,t[61]=n.setSearchQuery,t[62]=n.sk,t[63]=R):R=t[63];let z;t[64]!==l||t[65]!==A||t[66]!==u||t[67]!==r.skillsNavAria?(z=(0,X.jsx)(`div`,{className:`border-b border-edge-subtle pb-3 dark:border-edge-subtle`,children:(0,X.jsx)(H,{items:A,activeTab:l,onChange:u,ariaLabel:r.skillsNavAria,tabIdPrefix:`skills-tab`,panelIdPrefix:`skills-panel`,className:`flex-wrap`})}),t[64]=l,t[65]=A,t[66]=u,t[67]=r.skillsNavAria,t[68]=z):z=t[68];let B;t[69]!==h||t[70]!==g||t[71]!==l||t[72]!==b||t[73]!==v||t[74]!==C||t[75]!==E||t[76]!==j||t[77]!==T||t[78]!==_||t[79]!==S||t[80]!==y||t[81]!==D||t[82]!==f||t[83]!==r.discoverHeading||t[84]!==r.discoverHint||t[85]!==r.filterAll||t[86]!==r.filterDisabledOnly||t[87]!==r.filterEnabled||t[88]!==r.filterExtra||t[89]!==r.filterGlobal||t[90]!==r.filterInstalled||t[91]!==r.filterWorkspace||t[92]!==r.installedHeading||t[93]!==r.installedHint||t[94]!==r.marketplaceBrowseSwitchAria||t[95]!==r.marketplaceResultsTabsAria||t[96]!==r.marketplaceSortDownloads||t[97]!==r.marketplaceSortLabel||t[98]!==r.marketplaceSortNewest||t[99]!==r.sourceFilterAria||t[100]!==r.statusFilterAria||t[101]!==r.tabBuiltin||t[102]!==d?(B=l===`installed`?(0,X.jsx)(X.Fragment,{children:(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`text-balance text-sm font-semibold text-fg`,children:r.installedHeading}),(0,X.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:r.installedHint})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:justify-end`,children:[(0,X.jsx)(x,{value:d,placeholder:r.filterAll,ariaLabel:r.sourceFilterAria,options:[{value:`all`,label:r.filterAll},{value:`builtin`,label:r.tabBuiltin},{value:`installed`,label:r.filterInstalled},{value:`workspace`,label:r.filterWorkspace},{value:`global`,label:r.filterGlobal},{value:`extra`,label:r.filterExtra}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>f(e)}),(0,X.jsx)(x,{value:g,placeholder:r.filterAll,ariaLabel:r.statusFilterAria,options:[{value:`all`,label:r.filterAll},{value:`enabled`,label:r.filterEnabled},{value:`disabled`,label:le(r.filterDisabledOnly,{count:h})}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>_(e)})]})]})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`text-balance text-sm font-semibold text-fg`,children:r.discoverHeading}),(0,X.jsx)(`p`,{className:`mt-1 max-w-2xl text-sm text-fg-muted`,children:r.discoverHint})]}),(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2 sm:justify-end`,children:[T?null:(0,X.jsx)(x,{value:b??``,placeholder:r.marketplaceBrowseSwitchAria,ariaLabel:r.marketplaceBrowseSwitchAria,options:C.map(ze),allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:S}),(0,X.jsx)(x,{value:v,placeholder:r.marketplaceSortLabel,ariaLabel:r.marketplaceSortLabel,options:[{value:`downloads`,label:r.marketplaceSortDownloads},{value:`newest`,label:r.marketplaceSortNewest}],allowEmpty:!1,triggerClassName:`h-9 w-auto min-w-[9rem] bg-surface-panel text-xs shadow-surface`,align:`end`,onChange:e=>y(e)})]})]}),T?(0,X.jsx)(H,{items:j,activeTab:E,onChange:D,ariaLabel:r.marketplaceResultsTabsAria,tabIdPrefix:`skills-marketplace-results-tab`,panelIdPrefix:`skills-marketplace-results-panel`,className:`min-h-9 gap-1 overflow-x-auto rounded-lg border border-edge bg-surface-panel p-0.5 shadow-surface`,buttonClassName:`rounded-md px-2.5 py-1.5 text-xs`,selectedClassName:`bg-fg text-surface-panel dark:bg-fg dark:text-surface-base`,unselectedClassName:`text-fg-muted hover:text-fg`}):null]}),t[69]=h,t[70]=g,t[71]=l,t[72]=b,t[73]=v,t[74]=C,t[75]=E,t[76]=j,t[77]=T,t[78]=_,t[79]=S,t[80]=y,t[81]=D,t[82]=f,t[83]=r.discoverHeading,t[84]=r.discoverHint,t[85]=r.filterAll,t[86]=r.filterDisabledOnly,t[87]=r.filterEnabled,t[88]=r.filterExtra,t[89]=r.filterGlobal,t[90]=r.filterInstalled,t[91]=r.filterWorkspace,t[92]=r.installedHeading,t[93]=r.installedHint,t[94]=r.marketplaceBrowseSwitchAria,t[95]=r.marketplaceResultsTabsAria,t[96]=r.marketplaceSortDownloads,t[97]=r.marketplaceSortLabel,t[98]=r.marketplaceSortNewest,t[99]=r.sourceFilterAria,t[100]=r.statusFilterAria,t[101]=r.tabBuiltin,t[102]=d,t[103]=B):B=t[103];let V;t[104]!==l||t[105]!==n?(V=l===`marketplace`?(0,X.jsx)(Ne,{...n}):(0,X.jsx)(Se,{...n}),t[104]=l,t[105]=n,t[106]=V):V=t[106];let U;t[107]!==V||t[108]!==z||t[109]!==B?(U=(0,X.jsxs)(`section`,{className:`flex flex-col gap-5`,children:[z,B,V]}),t[107]=V,t[108]=z,t[109]=B,t[110]=U):U=t[110];let W;t[111]!==M||t[112]!==U||t[113]!==N||t[114]!==P||t[115]!==R?(W=(0,X.jsxs)(`div`,{className:M,children:[N,P,R,U]}),t[111]=M,t[112]=U,t[113]=N,t[114]=P,t[115]=R,t[116]=W):W=t[116];let G,ee,te;t[117]===n?(G=t[118],ee=t[119],te=t[120]):(G=(0,X.jsx)(Ae,{...n}),ee=(0,X.jsx)(Me,{...n}),te=(0,X.jsx)(we,{...n}),t[117]=n,t[118]=G,t[119]=ee,t[120]=te);let K;t[121]!==W||t[122]!==G||t[123]!==ee||t[124]!==te||t[125]!==F?(K=(0,X.jsxs)(`div`,{className:F,children:[W,G,ee,te]}),t[121]=W,t[122]=G,t[123]=ee,t[124]=te,t[125]=F,t[126]=K):K=t[126];let q;return t[127]!==K||t[128]!==I?(q=(0,X.jsxs)(X.Fragment,{children:[I,K]}),t[127]=K,t[128]=I,t[129]=q):q=t[129],q}function ze(e){return{value:e.id,label:e.displayName}}function Be(e,t){return(0,X.jsxs)(`li`,{className:`truncate`,children:[e.type,`: `,e.message]},`${e.path??e.skillName??`diagnostic`}-${t}`)}function Ve(e){return e.id}function He(e){let t=(0,J.c)(17),{vm:n}=e,{sk:r,hasToken:i,loading:a,onReloadClick:o,searchQuery:s,setSearchQuery:c,mainTab:l,setPendingFile:u,setInstallOpen:d,inSettingsShell:f}=n,p=A(We),m=A(Ue),h;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==s||t[4]!==d||t[5]!==u||t[6]!==c||t[7]!==r?(h=(0,X.jsx)(pe,{loading:a,onReloadClick:o,searchQuery:s,setSearchQuery:c,mainTab:l,sk:r,setPendingFile:u,setInstallOpen:d}),t[0]=a,t[1]=l,t[2]=o,t[3]=s,t[4]=d,t[5]=u,t[6]=c,t[7]=r,t[8]=h):h=t[8];let g=h,_,v;return t[9]!==m||t[10]!==i||t[11]!==f||t[12]!==p||t[13]!==r.title||t[14]!==g?(_=()=>!i||f?(m(),()=>m()):(p({startExtra:null,main:(0,X.jsx)(`div`,{className:`min-w-0`,children:(0,X.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:r.title})}),end:g}),()=>m()),v=[m,i,f,p,g,r.title],t[9]=m,t[10]=i,t[11]=f,t[12]=p,t[13]=r.title,t[14]=g,t[15]=_,t[16]=v):(_=t[15],v=t[16]),(0,Y.useLayoutEffect)(_,v),null}function Ue(e){return e.clearPageHeader}function We(e){return e.setPageHeader}async function Ge(t){let n=t.name.toLowerCase();if(n.endsWith(`.zip`))return t;if(n.endsWith(`skill.md`)){let n=(await i(async()=>{let{default:t}=await import(`./jszip.min-DT31yWkU.js`).then(t=>e(t.default,1));return{default:t}},__vite__mapDeps([0,1]))).default,r=new n;r.file(`SKILL.md`,await t.arrayBuffer());let a=await r.generateAsync({type:`blob`,compression:`DEFLATE`}),o=t.name.replace(/\.md$/i,``).replace(/\s+/g,`-`)||`skill`;return new File([a],`${o}.zip`,{type:`application/zip`})}throw Error(`invalid`)}function Ke(){let e=l(d(e=>e.language)).skills,t=!!u(e=>e.token),n=s(),[r,i]=o(),c=r.get(`mprov`)?.trim()||null,[p,m]=(0,Y.useState)(!1),[h,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(!1),b=r.get(`q`)??``,x=r.get(`tab`),S=r.get(`source`),C=r.get(`status`),T=ge.has(x)?x:`installed`,E=x===`builtin`?`builtin`:x===`user`?`installed`:null,D=_e.has(S)?S:E??`all`,O=ve.has(C)?C:`all`,[k,A]=(0,Y.useState)(b),[j]=w(k,250),M=j.trim(),P=k.trim().length>0,F=M.length>0,[I,L]=(0,Y.useState)(null),[R,z]=(0,Y.useState)(T),[B,V]=(0,Y.useState)(D),[H,re]=(0,Y.useState)(``),[oe,le]=(0,Y.useState)(O),[ue,de]=(0,Y.useState)(!1),[J,X]=(0,Y.useState)(null),[pe,Z]=(0,Y.useState)(!1),[me,he]=(0,Y.useState)(!1),[be,Se]=(0,Y.useState)(null),[Ce,we]=(0,Y.useState)(null),[Q,Te]=(0,Y.useState)({}),[Ee,De]=(0,Y.useState)(!1),[Oe,ke]=(0,Y.useState)(`catalog`),[Ae,je]=(0,Y.useState)(``),[Me,Ne]=(0,Y.useState)(null),[Pe,Fe]=(0,Y.useState)(null),[Ie,Le]=(0,Y.useState)(!1),[Re,ze]=(0,Y.useState)(null),[Be,Ve]=(0,Y.useState)(`downloads`),[He,Ue]=(0,Y.useState)(1),[We,Ke]=(0,Y.useState)(null),[qe,Je]=(0,Y.useState)(null),[Ye,Xe]=(0,Y.useState)(``),[$,Ze]=(0,Y.useState)(()=>c),[Qe,$e]=(0,Y.useState)(0),[et,tt]=(0,Y.useState)(0),[nt,rt]=(0,Y.useState)([]),it=(0,Y.useRef)(null),at=(0,Y.useRef)(c),ot=(0,Y.useRef)(null),st=(0,Y.useRef)(``),ct=(0,Y.useRef)(null),lt=(0,Y.useRef)(!1),[ut,dt]=(0,Y.useState)({query:``,byProvider:{}}),[ft,pt]=(0,Y.useState)(`all`),mt=(0,Y.useRef)(0),ht=(0,Y.useRef)(M);ht.current!==M&&(ht.current=M,pt(e=>e===`all`?e:`all`));let gt=N(()=>v().then(e=>(rt(e.diagnostics??[]),e.catalog.map(se))),[t,et],{enabled:t,initial:[],errorData:[]}),{data:_t,loading:vt,setData:yt}=gt,bt=N(async()=>{try{let{providers:e,current:t}=await K();return{providers:e.map(e=>({id:e.id,displayName:e.displayName})),current:t}}catch{try{return{providers:[],current:(await te()).provider}}catch{return{providers:[],current:`store`}}}},[t,Qe],{enabled:t,initial:{providers:[],current:null}}),xt=p||vt,St=bt.data.providers;(0,Y.useEffect)(()=>{let e=e=>{if(f(e.detail)===`skills`){if(lt.current){lt.current=!1;return}tt(e=>e+1)}else $e(e=>e+1)};return window.addEventListener(`config-reload`,e),()=>window.removeEventListener(`config-reload`,e)},[]);let Ct=r.toString(),wt=(0,Y.useRef)(Ct);if(wt.current!==Ct){wt.current=Ct;let e=r.get(`q`)??``,t=r.get(`tab`),n=r.get(`source`),i=r.get(`status`),a=ge.has(t)?t:`installed`,o=t===`builtin`?`builtin`:t===`user`?`installed`:null,s=_e.has(n)?n:o??`all`,c=ve.has(i)?i:`all`;A(t=>t===e?t:e),z(e=>e===a?e:a),V(e=>e===s?e:s),le(e=>e===c?e:c);let l=r.get(`mcat`)??``;Xe(a===`marketplace`?e=>e===l?e:l:``)}let Tt=(0,Y.useRef)(t);!t&&Tt.current&&(Ze(null),it.current=null),Tt.current=t,t&&c&&at.current!==c&&(at.current=c,Ze(c)),t&&c==null&&bt.data.current&&bt.data.current!==ot.current&&(ot.current=bt.data.current,Ze(e=>e??bt.data.current));let Et=`${M}|${Be}|${R}|${Ye}|${$??``}|${ft}`;st.current!==Et&&(st.current=Et,Ue(1)),R===`marketplace`&&$&&ct.current!=null&&ct.current!==$&&Xe(``),ct.current=$;let Dt=N(()=>ce({page:He,pageSize:20,sort:Be,category:Ye.trim()||void 0,provider:$}),[t,R,Ye,He,Be,F,$],{enabled:t&&R===`marketplace`&&!!$&&!F,initial:null,errorData:null});(0,Y.useEffect)(()=>{if(!t||!F||R!==`marketplace`||St.length===0)return;let n=++mt.current,r={};for(let e of St)r[e.id]={status:`loading`,rows:[]};dt({query:M,byProvider:r});let i=[],a=[];for(let t of St){let r=new AbortController;i.push(r);let o=window.setTimeout(()=>{r.abort(new DOMException(`Adapter timed out`,`TimeoutError`))},8e3);a.push(o),ce({provider:t.id,q:M,page:1,pageSize:40,sort:Be,signal:r.signal}).then(e=>{if(window.clearTimeout(o),n!==mt.current)return;let r=e.items.map(e=>({...e,providerId:t.id}));dt(e=>({...e,byProvider:{...e.byProvider,[t.id]:{status:`ok`,rows:r}}}))}).catch(r=>{if(window.clearTimeout(o),n!==mt.current)return;let i=r instanceof DOMException&&(r.name===`TimeoutError`||r.name===`AbortError`)?e.marketplaceLoadFailed:r instanceof Error?r.message:e.marketplaceLoadFailed;dt(e=>({...e,byProvider:{...e.byProvider,[t.id]:{status:`error`,rows:[],error:i}}}))})}return()=>{for(let e of a)window.clearTimeout(e);for(let e of i)e.abort()}},[t,R,F,M,St,Be,e.marketplaceLoadFailed]);let Ot=N(()=>ie({provider:$}).then(e=>e.items),[t,R,$],{enabled:t&&R===`marketplace`&&!!$,initial:[],errorData:[]}),kt=(0,Y.useMemo)(()=>{if(!F||ut.query!==M)return[];let e=St.map(e=>({id:e.id,rows:[...ut.byProvider[e.id]?.rows??[]]})),t=[];for(;e.some(e=>e.rows.length>0);)for(let n of e)n.rows.length>0&&t.push(n.rows.shift());let n=new Map;for(let e of t){let t=[(e.id??``).toLowerCase().trim(),(e.name??``).toLowerCase().trim(),(e.author?.username??``).toLowerCase().trim()].join(`|`),r=n.get(t);if(!r){n.set(t,{...e,additionalSources:[]});continue}if(e.providerId&&e.providerId!==r.providerId){let t=r.additionalSources??[];t.some(t=>t.providerId===e.providerId)||(t.push({providerId:e.providerId,sourceLabel:e.sourceLabel}),r.additionalSources=t)}}return Array.from(n.values())},[F,M,ut,St]),At=(0,Y.useMemo)(()=>{if(!F)return{};let e={all:kt.length};for(let t of St)e[t.id]=kt.filter(e=>e.providerId===t.id||(e.additionalSources??[]).some(e=>e.providerId===t.id)).length;return e},[F,kt,St]),jt=(0,Y.useMemo)(()=>F?ft===`all`?kt:kt.filter(e=>e.providerId===ft||(e.additionalSources??[]).some(e=>e.providerId===ft)):[],[F,kt,ft]),Mt=(0,Y.useMemo)(()=>{if(!F)return{};let e={};for(let t of St)e[t.id]=ut.byProvider[t.id]?.status??`loading`;return e},[F,ut,St]),Nt=(0,Y.useMemo)(()=>Object.values(Mt).some(e=>e===`loading`),[Mt]),Pt=(0,Y.useMemo)(()=>{if(!F)return!1;let e=Object.values(Mt);return e.length>0&&e.every(e=>e===`error`)},[F,Mt]),Ft=(0,Y.useMemo)(()=>{if(!F||kt.length===0&&Nt)return null;let e=jt.length,t=(He-1)*20;return{items:jt.slice(t,t+20),meta:{page:He,pageSize:20,total:e,totalPages:Math.max(1,Math.ceil(e/20))},provider:ft}},[F,kt,Nt,jt,He,ft]),It=R===`marketplace`?P?F?Ft:null:Dt.data:null,Lt=R===`marketplace`?P?F?Nt:!0:Dt.loading:!1,Rt=F?Pt?e.marketplaceLoadFailed:null:Dt.error instanceof Error?Dt.error.message:Dt.error?e.marketplaceLoadFailed:null,zt=R===`marketplace`?Ot.data:[],Bt=R===`marketplace`?Ot.loading:!1,Vt=Ot.error instanceof Error?Ot.error.message:Ot.error?e.marketplaceCategoriesFailed:null;Ye.trim()&&zt.length>0&&!zt.some(e=>e.id===Ye)&&Xe(``);let Ht=(0,Y.useCallback)(async t=>{let n=t?.silent===!0;n||m(!0),g(null);try{let e=await v();return rt(e.diagnostics??[]),yt(e.catalog.map(se)),{ok:!0}}catch(t){let n=t instanceof Error?t.message:e.loadFailed;return g(n),{ok:!1,message:n}}finally{n||m(!1)}},[yt,e.loadFailed]),Ut=!p&>.error?gt.error instanceof Error?gt.error.message:e.loadFailed:null,Wt=h??Ut;(0,Y.useEffect)(()=>{i(e=>{let t=new URLSearchParams(e);return M?t.set(`q`,M):t.delete(`q`),R===`marketplace`?t.set(`tab`,R):t.delete(`tab`),B===`all`?t.delete(`source`):t.set(`source`,B),R===`installed`&&oe!==`all`?t.set(`status`,oe):t.delete(`status`),R===`marketplace`&&Ye.trim()?t.set(`mcat`,Ye.trim()):t.delete(`mcat`),R===`marketplace`&&$?t.set(ye,$):t.delete(ye),t.toString()===e.toString()?e:t},{replace:!0})},[R,Ye,$,M,oe,i,B]);let Gt=(0,Y.useCallback)((e,t,n=5e3)=>{L({kind:e,message:t}),window.setTimeout(()=>L(null),n)},[]),Kt=(0,Y.useCallback)(t=>{let n=t.availability;if(!n)return e.installSuccess;let r=n.skillName||n.skillId;if(!n.loaded)return`Skill "${r}" installed, but it was not loaded. Check skill diagnostics.`;if(n.diagnostics.length>0)return`Skill "${r}" installed with ${n.diagnostics.length} diagnostic(s).`;if(n.enabled===!1)return`Skill "${r}" installed but disabled. Enable it before use.`;if(n.availableForDefaultAgent===!1){let e=n.unavailableReason||`unavailable`;return`Skill "${r}" installed but unavailable for agent "${n.defaultAgentId}" (${e}).`}return`Skill "${r}" installed and ready.`},[e.installSuccess]),qt=(0,Y.useCallback)(async t=>{ke(`catalog`),De(!0),je(t.name),Ne(null),Fe(null),ze(null),Le(!0);try{let e=await ae(t.name);Ne(e),je(e.name)}catch(t){Ne(null),ze(t instanceof Error?t.message:e.detailLoadFailed)}finally{Le(!1)}},[e.detailLoadFailed]),Jt=(0,Y.useCallback)(async t=>{let n=t.trim();if(n){ke(`catalog`),De(!0),je(n),Ne(null),Fe(null),ze(null),Le(!0);try{let e=await ae(n);Ne(e),je(e.name)}catch(t){Ne(null),ze(t instanceof Error?t.message:e.detailLoadFailed)}finally{Le(!1)}}},[e.detailLoadFailed]),Yt=(0,Y.useCallback)(async(t,n,r)=>{let i=r?.trim()||$;if(i){it.current=i,ke(`store`),De(!0),je(n?.trim()||t),Ne(null),Fe(null),ze(null),Le(!0);try{let e=await fe(t,{provider:i});je(e.name),Fe(e.skillDocPreview)}catch(t){Fe(null),ze(t instanceof Error?t.message:e.detailLoadFailed)}finally{Le(!1)}}},[$,e.detailLoadFailed]),Xt=(0,Y.useCallback)(async(t,n)=>{we(t),Te(e=>({...e,[t]:n})),L(null);try{return await q(t,n),await Ht({silent:!0}),!0}catch(n){return Te(e=>{let{[t]:n,...r}=e;return r}),Gt(`error`,n instanceof Error?n.message:e.skillToggleFailed),!1}finally{we(null),Te(e=>{let{[t]:n,...r}=e;return r})}},[Ht,Gt,e.skillToggleFailed]),Zt=(0,Y.useCallback)(async()=>{L(null),m(!0),g(null);try{await U()}catch(t){g(t instanceof Error?t.message:e.reloadFailed),m(!1);return}await Ht()},[Ht,e.reloadFailed]),Qt=(0,Y.useMemo)(()=>{let e=k.trim().toLowerCase();return e?_t.filter(t=>[t.name,t.description,t.directoryId,t.path,t.source,t.hub?.source,t.hub?.ref].filter(Boolean).join(` `).toLowerCase().includes(e)):_t},[_t,k]),$t=(0,Y.useMemo)(()=>{let e=_t.filter(e=>e.source===`builtin`);return{total:e.length,enabled:e.filter(e=>Q[e.name]??e.enabled).length}},[_t,Q]),en=(0,Y.useMemo)(()=>{let e=_t.filter(e=>e.source!==`builtin`);return{total:e.length,enabled:e.filter(e=>Q[e.name]??e.enabled).length}},[_t,Q]),tn=(0,Y.useMemo)(()=>Ae?_t.find(e=>e.name===Ae):void 0,[_t,Ae]),nn=tn==null?!0:Q[Ae]??tn.enabled,rn=tn?.directoryId??null,an=tn?.managed??!1,on=(0,Y.useMemo)(()=>Oe!==`store`||!Ae?null:G(it.current??$,Ae),[Oe,Ae,$]),sn=(0,Y.useMemo)(()=>{let e=Qt;return R===`installed`&&B!==`all`&&(e=B===`installed`?e.filter(e=>e.source!==`builtin`):e.filter(e=>e.source===B)),e},[Qt,R,B]),cn=(0,Y.useMemo)(()=>{let e=new Set,t=[];for(let n of sn){let r=n.category;!r||e.has(r)||(e.add(r),t.push(r))}return t.sort((e,t)=>{let n=xe.indexOf(e),r=xe.indexOf(t);return n>=0&&r>=0?n-r:n>=0?-1:r>=0?1:e.localeCompare(t)})},[sn]),ln=(0,Y.useCallback)(t=>e.categoryLabel?.[t]||t,[e.categoryLabel]),un=(0,Y.useMemo)(()=>H?sn.filter(e=>e.category===H):sn,[sn,H]);(0,Y.useEffect)(()=>{re(``)},[B]);let dn=(0,Y.useCallback)(e=>Q[e.name]??e.enabled,[Q]),fn=(0,Y.useMemo)(()=>un.filter(e=>!dn(e)).length,[un,dn]),pn=(0,Y.useMemo)(()=>{let e=un;return oe===`disabled`&&(e=e.filter(e=>!dn(e))),oe===`enabled`&&(e=e.filter(e=>dn(e))),[...e].toSorted((e,t)=>{let n=dn(e);return n===dn(t)?e.name.localeCompare(t.name,void 0,{sensitivity:`base`}):n?-1:1})},[un,oe,dn]),mn=async t=>{L(null),y(!0),g(null);try{let n;try{n=await Ge(t)}catch{g(e.invalidFile),Gt(`error`,e.invalidFile);return}let r=await W(n,{overwrite:!0});lt.current=!0,await Ht(),Gt(`success`,Kt(r)),de(!1),X(null),z(`installed`),V(`installed`),await Jt(r.availability?.skillName||r.skillId)}catch(t){g(t instanceof Error?t.message:e.uploadFailed),Gt(`error`,t instanceof Error?t.message:e.uploadFailed)}finally{y(!1)}},hn=()=>{J&&mn(J)},gn=e=>{let t=e.target.files?.[0];e.target.value=``,t&&X(t)},_n=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.types.includes(`Files`)&&(Z(!0),e.dataTransfer.dropEffect=`copy`)},vn=e=>{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||Z(!1)},yn=e=>{e.preventDefault(),e.stopPropagation(),Z(!1);let t=e.dataTransfer?.files?.[0];t&&X(t)},bn=t=>{if(t.origin===`agents-global`)return e.source.agentsGlobal;if(t.origin===`agents-workspace`)return e.source.agentsWorkspace;switch(t.source){case`builtin`:return e.source.builtin;case`workspace`:return e.source.workspace;case`global`:return e.source.global;case`extra`:return e.source.extra;default:return t.source}},xn=async()=>{let t=be,n=Ee&&Oe===`catalog`&&rn===t;if(he(!1),Se(null),t){L(null);try{await ee(t),lt.current=!0,await Ht(),n&&(De(!1),ke(`catalog`),je(``),Ne(null),Fe(null),ze(null))}catch(t){g(t instanceof Error?t.message:e.deleteFailed)}}},Sn=(0,Y.useCallback)(e=>_t.some(t=>t.name===e),[_t]),Cn=(0,Y.useCallback)(async t=>{let r=(t?.name??Ae).trim();if(!r)return;let i=t?.source??Oe;if(i===`catalog`){let e=_t.find(e=>e.name===r);if(e&&!(Q[e.name]??e.enabled))return}L(null);let a=i===`store`&&!Sn(r);Je(r);try{if(a){let e=t?.providerOverride?.trim()||it.current||$;await ne({name:r,overwrite:!1,...e?{provider:e}:{}}),lt.current=!0,await Ht({silent:!0})}De(!1),n(`/chat/new?skill=${encodeURIComponent(r)}`)}catch(t){Gt(`error`,t instanceof Error?t.message:e.uploadFailed)}finally{Je(null)}},[_t,Ae,Oe,Q,Sn,Ht,n,Gt,e.uploadFailed,$]),wn=(0,Y.useCallback)(async(t,n)=>{let r=Sn(t);if(!(r&&!window.confirm(e.marketplaceReinstallConfirm))){L(null),Ke(t);try{let e=n?.providerOverride?.trim()||(n?.useDetailProvider?it.current??$:$),i=await ne({name:t,overwrite:r,...e?{provider:e}:{}});lt.current=!0,await Ht({silent:!0}),Gt(`success`,Kt(i)),z(`installed`),V(`installed`),await Jt(i.availability?.skillName||i.skillId||t)}catch(t){Gt(`error`,t instanceof Error?t.message:e.uploadFailed)}finally{Ke(null)}}},[Sn,Kt,Ht,$,Jt,Gt,e.marketplaceReinstallConfirm,e.uploadFailed]),{pathname:Tn}=a();return{sk:e,hasToken:t,catalog:_t,loading:xt,error:Wt,uploading:_,searchQuery:k,setSearchQuery:A,actionFeedback:I,skillDiagnostics:nt,mainTab:R,setMainTab:z,sourceFilter:B,setSourceFilter:V,builtinCategoryFilter:H,setBuiltinCategoryFilter:re,installOpen:ue,setInstallOpen:de,pendingFile:J,setPendingFile:X,dropActive:pe,setDropActive:Z,confirmOpen:me,setConfirmOpen:he,confirmId:be,setConfirmId:Se,togglingSkillName:Ce,enabledOverride:Q,detailOpen:Ee,setDetailOpen:De,detailSource:Oe,setDetailSource:ke,detailTitle:Ae,setDetailTitle:je,detailCatalogPreview:Me,setDetailCatalogPreview:Ne,detailMarketplacePreview:Pe,setDetailMarketplacePreview:Fe,detailLoading:Ie,detailError:Re,setDetailError:ze,marketSort:Be,setMarketSort:Ve,marketPage:He,setMarketPage:Ue,mpLoading:Lt,mpError:Rt,mpPayload:It,searchActive:F,searchInputActive:P,resultTab:ft,setResultTab:pt,aggregatedTabCounts:At,aggregatedProviderStatus:Mt,aggregatedAllFailed:Pt,installingMarketName:We,usingSkillInChatName:qe,onUseSkillInChat:Cn,marketCategoryId:Ye,setMarketCategoryId:Xe,mpCategories:zt,mpCategoriesError:Vt,mpCategoriesLoading:Bt,marketBrowseProvider:$,setMarketBrowseProvider:Ze,registeredProviders:St,builtinTabStats:$t,userTabStats:en,detailEnabled:nn,detailDirectoryId:rn,detailManaged:an,detailExternalUrl:on,filteredCatalog:sn,builtinCategories:cn,categoryFilteredCatalog:un,catalogDisplayRows:pn,catalogDisabledCount:fn,catalogStatusFilter:oe,setCatalogStatusFilter:le,resolveSkillEnabled:dn,inSettingsShell:Tn.startsWith(`/settings/`),categoryLabel:ln,onReloadClick:Zt,openSkillDetail:qt,openMarketplaceDetail:Yt,onSkillToggle:Xt,onInstallSubmit:hn,onFileInputChange:gn,onModalDragOver:_n,onModalDragLeave:vn,onModalDrop:yn,sourceLabel:bn,runDelete:xn,onMarketInstall:wn,isSkillInstalledByName:Sn}}function qe(){let e=(0,J.c)(2),t=Ke(),n;return e[0]===t?n=e[1]:(n=(0,X.jsx)(Re,{vm:t}),e[0]=t,e[1]=n),n}export{qe as SkillsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./vendor-react-BOUWij0V.js";import{t as n}from"./cn-JdwAhgNB.js";import{l as r,o as i,r as a}from"./locale-store-deR2zRaE.js";import{Ir as o}from"./index-B-_CEvIX.js";import"./skill-reload-api-S-bjtsXX.js";async function s(e,t){let n=new FormData;n.append(`file`,e),t.skillId&&n.append(`skillId`,t.skillId),t.overwrite&&n.append(`overwrite`,`true`),n.append(`target`,t.target??`global`);let i=r.getState().token,o=new Headers;i&&o.set(`Authorization`,`Bearer ${i}`);let s=await fetch(a(`/api/skills/upload`),{method:`POST`,headers:o,body:n});s.status===401&&r.getState().onUnauthorized();let c=await s.json().catch(()=>({}));if(!s.ok)throw Error(c.error||`HTTP ${s.status}`);if(!c.payload?.skillId)throw Error(`Invalid response`);return c.payload}async function c(e,t){let n=t?`?target=${encodeURIComponent(t)}`:``,r=await i(a(`/api/skills/${encodeURIComponent(e)}${n}`),{method:`DELETE`});if(!r.ok)throw Error(await o(r))}async function l(e,t){let n=await i(a(`/api/skills/enabled`),{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({skillName:e,enabled:t})});if(!n.ok)throw Error(await o(n))}function u(e,t){t?.trim()&&e.set(`provider`,t.trim())}async function d(e){let t=new URLSearchParams;u(t,e?.provider);let n=t.toString(),r=await i(a(`/api/skills/marketplace/categories${n?`?${n}`:``}`),{cache:`no-store`});if(!r.ok)throw Error(await o(r));let s=await r.json();if(!s.payload||!Array.isArray(s.payload.items))throw Error(`Invalid response`);return{items:s.payload.items}}async function f(e){let t=new URLSearchParams;e.q?.trim()&&t.set(`q`,e.q.trim()),e.page!=null&&t.set(`page`,String(e.page)),e.pageSize!=null&&t.set(`pageSize`,String(e.pageSize)),e.sort&&t.set(`sort`,e.sort),e.category?.trim()&&t.set(`category`,e.category.trim()),u(t,e.provider);let n=t.toString(),r=await i(a(`/api/skills/marketplace${n?`?${n}`:``}`),{cache:`no-store`,signal:e.signal});if(!r.ok)throw Error(await o(r));let s=await r.json();if(!s.payload?.items||!s.payload.meta)throw Error(`Invalid response`);return s.payload}async function p(e,t){let n=encodeURIComponent(e),r=new URLSearchParams;u(r,t?.provider);let s=r.toString(),c=await i(a(`/api/skills/marketplace/packages/${n}${s?`?${s}`:``}`),{cache:`no-store`});if(!c.ok)throw Error(await o(c));let l=(await c.json()).payload;if(!l?.name||!l.skillDocPreview||typeof l.skillDocPreview.name!=`string`||typeof l.skillDocPreview.description!=`string`||typeof l.skillDocPreview.bodyMarkdown!=`string`||typeof l.skillDocPreview.disableModelInvocation!=`boolean`||!l.skillDocPreview.metadata||typeof l.skillDocPreview.metadata!=`object`||typeof l.skillDocPreview.metadata.name!=`string`||typeof l.skillDocPreview.metadata.description!=`string`)throw Error(`Invalid response`);return l}async function m(e){let t=await i(a(`/api/skills/marketplace/install`),{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({target:`global`,...e})});if(!t.ok)throw Error(await o(t));let n=await t.json();if(!n.payload?.skillId)throw Error(n.error||`Invalid response`);return n.payload}async function h(e){let t=await i(a(`/api/skills/${encodeURIComponent(e)}/content`),{cache:`no-store`});if(!t.ok)throw Error(await o(t));let n=(await t.json()).payload;if(!n||typeof n.name!=`string`||typeof n.description!=`string`||typeof n.bodyMarkdown!=`string`||typeof n.disableModelInvocation!=`boolean`||!n.metadata||typeof n.metadata!=`object`||typeof n.metadata.name!=`string`||typeof n.metadata.description!=`string`)throw Error(`Invalid response`);return n}async function g(){let e=await i(a(`/api/skills/marketplace/provider`),{cache:`no-store`});if(!e.ok)throw Error(await o(e));let t=await e.json();if(!t.payload?.provider)throw Error(`Invalid response`);return t.payload}async function _(){let e=await i(a(`/api/skills/marketplace/providers`),{cache:`no-store`});if(!e.ok)throw Error(await o(e));let t=await e.json();if(!t.payload?.providers)throw Error(`Invalid response`);return t.payload}var v=e(),y=t(),b=[{light:`bg-sky-100 text-sky-800`,dark:`dark:bg-sky-950/55 dark:text-sky-200`},{light:`bg-violet-100 text-violet-800`,dark:`dark:bg-violet-950/55 dark:text-violet-200`},{light:`bg-emerald-100 text-emerald-800`,dark:`dark:bg-emerald-950/55 dark:text-emerald-200`},{light:`bg-orange-100 text-orange-800`,dark:`dark:bg-orange-950/55 dark:text-orange-200`},{light:`bg-rose-100 text-rose-800`,dark:`dark:bg-rose-950/55 dark:text-rose-200`},{light:`bg-amber-100 text-amber-900`,dark:`dark:bg-amber-950/55 dark:text-amber-200`},{light:`bg-cyan-100 text-cyan-800`,dark:`dark:bg-cyan-950/55 dark:text-cyan-200`},{light:`bg-indigo-100 text-indigo-800`,dark:`dark:bg-indigo-950/55 dark:text-indigo-200`},{light:`bg-fuchsia-100 text-fuchsia-800`,dark:`dark:bg-fuchsia-950/55 dark:text-fuchsia-200`},{light:`bg-teal-100 text-teal-800`,dark:`dark:bg-teal-950/55 dark:text-teal-200`}];function x(e){let t=0;for(let n=0;n<e.length;n+=1)t=Math.imul(31,t)+e.charCodeAt(n)|0;return Math.abs(t)}function S(e){let t=e.trim();if(!t)return`?`;let n=t.match(/[\p{L}\p{N}]/u);return n?n[0].toLocaleUpperCase(`en-US`):t[0]}function C(e){let t=(0,v.c)(9),{name:r,className:i}=e,a;t[0]===r?a=t[1]:(a=S(r),t[0]=r,t[1]=a);let o=a,s=b[x(r)%b.length],c;t[2]!==i||t[3]!==s.dark||t[4]!==s.light?(c=n(`flex size-11 shrink-0 items-center justify-center rounded-xl font-semibold tracking-tight shadow-surface`,`text-[1.05rem] ring-1 ring-inset ring-black/[0.06] dark:ring-white/[0.1]`,`transition-[transform,box-shadow] duration-200 ease-out group-hover:ring-black/[0.1] dark:group-hover:ring-white/[0.14]`,`group-hover:-translate-y-px`,s.light,s.dark,i),t[2]=i,t[3]=s.dark,t[4]=s.light,t[5]=c):c=t[5];let l;return t[6]!==o||t[7]!==c?(l=(0,y.jsx)(`div`,{className:c,"aria-hidden":!0,children:o}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}var w=`https://skillhub.cn`,T=`https://clawhub.ai`;function E(e){let t=e.trim();return t?`${w}/skills/${encodeURIComponent(t)}`:null}function D(e){let t=e.trim();return t?`${T}/${encodeURIComponent(t)}`:null}function O(e,t){return e===`skillhub`?E(t):e===`clawhub`?D(t):null}function k(e,t){return t===`store`?e.name.trim()||e.id:e.id.trim()||e.name}function A(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function j(e){return e.filter(e=>e.type!==`collision`)}function M(e){let t=[e.kind];return e.label?.trim()&&t.push(e.label.trim()),e.package?.trim()&&t.push(e.package.trim()),e.formula?.trim()&&t.push(e.formula.trim()),e.module?.trim()&&t.push(e.module.trim()),e.url?.trim()&&t.push(e.url.trim()),t.join(` · `)}function N(e){return{...e,enabled:e.enabled??!0,disableModelInvocation:e.disableModelInvocation??!1}}export{s as _,O as a,c,g as d,_ as f,l as g,m as h,k as i,d as l,h as m,M as n,N as o,f as p,A as r,C as s,j as t,p as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{t as r}from"./cn-JdwAhgNB.js";import{t as i}from"./messages-B4XqB8I6.js";import{n as a}from"./locale-store-deR2zRaE.js";import{Ws as o,as as s,ko as c,kt as l,nc as u,ni as d,ti as f,xl as p}from"./index-B-_CEvIX.js";import{n as m,r as h}from"./settings-page-layout-t_Ox1slk.js";import{r as g,t as _}from"./settings-form-section-CiYU8AvV.js";var v=e(t(),1),y=n();async function b(){if(typeof navigator>`u`||!navigator.mediaDevices?.getUserMedia)return!1;try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});for(let t of e.getTracks())t.stop();return!0}catch{return!1}}function x(e,t,n){return e.task===`opened-settings`?n.openedSettings:e.status===`granted`&&t?e.task===`already-granted`?n.alreadyGranted:n.granted:t?e.status===`denied`?n.denied:n.prompted:n.rendererDenied}function S(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:t.denied}function C(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}function w(e,t){return e.task===`opened-settings`?t.openedSettings:e.status===`granted`?e.task===`already-granted`?t.alreadyGranted:t.granted:e.status===`denied`?t.denied:t.prompted}var T=new Set([`microphone`,`accessibility`,`notifications`,`screen`]);function E(e,t,n){return t===`granted`?!1:e===`accessibility`&&(n===`darwin`||n===`win32`||n===`linux`)||e===`screen`&&(n===`darwin`||n===`win32`)||T.has(e)?t===`unknown`:!1}function D(e,t,n){return e===`accessibility`?!1:e===`screen`&&n===`linux`?!0:T.has(e)?t===`denied`:!0}var O=[{key:`fullDisk`,pane:`fullDisk`,platforms:[`darwin`]},{key:`screen`,pane:`screen`},{key:`microphone`,pane:`microphone`},{key:`accessibility`,pane:`accessibility`},{key:`automation`,pane:`automation`},{key:`notifications`,pane:`notifications`},{key:`location`,pane:`location`}];function k(e){return e===`linux`?O:O.filter(t=>!t.platforms||t.platforms.includes(e))}function A(e,t){let n=i(e).systemSettings.status;return t===`granted`?{label:n.granted,className:`text-emerald-600 dark:text-emerald-400`}:t===`denied`?{label:n.denied,className:`text-amber-600 dark:text-amber-400`}:{label:n.unknown,className:`text-fg-muted`}}function j(e,t,n){let r=i(e).systemSettings.permUnknown?.[t];return r?n===`darwin`&&r.darwin?r.darwin:n===`win32`&&r.win32?r.win32:n===`linux`&&r.linux?r.linux:null:null}var M={behavior:null,perms:null,loadError:null,permFeedback:null,permBusy:!1,refreshing:!1};function N(){let e=a(e=>e.language),t=i(e).systemSettings,[n,T]=(0,v.useReducer)(l,M),{behavior:O,perms:N,loadError:P,permFeedback:F,permBusy:I,refreshing:L}=n,R=typeof window<`u`?window.electronAPI?.system:void 0,z=(0,v.useCallback)(async e=>{if(R){T({type:`patch`,patch:{loadError:null}});try{T({type:`patch`,patch:{behavior:await R.getBehavior(),perms:await R.getPermissions({probe:e?.showRefreshFeedback}),...e?.showRefreshFeedback?{permFeedback:t.refreshDone}:{}}})}catch(t){T({type:`patch`,patch:{loadError:t instanceof Error?t.message:String(t),...e?.showRefreshFeedback?{permFeedback:null}:{}}})}}},[R,t.refreshDone]),B=(0,v.useCallback)(async()=>{if(!(L||I)){T({type:`patch`,patch:{refreshing:!0}});try{await z({showRefreshFeedback:!0})}finally{T({type:`patch`,patch:{refreshing:!1}})}}},[z,I,L]);if((0,v.useEffect)(()=>{let e=new Set([t.refreshDone,t.openSettingsDone,t.openSettingsFailed,t.desktopNotify.testShown]);if(!F||!e.has(F))return;let n=window.setTimeout(()=>{T({type:`patch`,patch:{permFeedback:null}})},3e3);return()=>window.clearTimeout(n)},[F,t.openSettingsDone,t.openSettingsFailed,t.refreshDone,t.desktopNotify.testShown]),(0,v.useEffect)(()=>{c()&&R&&z()},[R,z]),!c()||!R)return(0,y.jsxs)(h,{gap:`gap-3`,children:[(0,y.jsx)(m,{title:t.title}),(0,y.jsxs)(`div`,{className:g(),children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:t.desktopOnlyTitle}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-fg-muted`,children:t.desktopOnlyBody})]})]});let V=async e=>{try{let{behavior:t}=await R.setBehavior(e);T({type:`patch`,patch:{behavior:t}}),(e.notifyEnabled!==void 0||e.notifySoundEnabled!==void 0)&&f()}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},H=async e=>{if(!e){await V({notifyEnabled:!1});return}T({type:`patch`,patch:{permBusy:!0,permFeedback:null}});try{let e=await d(t.desktopNotify.testTitle,t.desktopNotify.testBody);if(e===`unsupported`){T({type:`patch`,patch:{permFeedback:t.notificationsFeedback.unsupported}});return}if(e===`denied`){T({type:`patch`,patch:{permFeedback:t.desktopNotify.denied}});return}if(e==="default"){T({type:`patch`,patch:{permFeedback:t.notificationsFeedback.default}});return}await V({notifyEnabled:!0}),T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:t.desktopNotify.testShown}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}},U=async e=>{T({type:`patch`,patch:{permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{(await R.openPrivacy(e)).ok?T({type:`patch`,patch:{permFeedback:t.openSettingsDone}}):T({type:`patch`,patch:{permFeedback:t.openSettingsFailed}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}},W=async()=>{T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestMicrophone(),n=await b();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:x(e,n,t.permFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}},G=async()=>{if(R.requestAccessibility){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestAccessibility();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:S(e,t.accessibilityFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},K=async()=>{if(R.requestNotifications){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestNotifications();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:C(e,t.notificationsFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},q=async()=>{if(R.requestScreen){T({type:`patch`,patch:{permBusy:!0,permFeedback:null}}),T({type:`patch`,patch:{loadError:null}});try{let e=await R.requestScreen();T({type:`patch`,patch:{perms:await R.getPermissions()}}),T({type:`patch`,patch:{permFeedback:w(e,t.screenFeedback)}})}catch(e){T({type:`patch`,patch:{loadError:e instanceof Error?e.message:String(e)}})}finally{T({type:`patch`,patch:{permBusy:!1}})}}},J=O?O.platform===`win32`?t.permissionsHintWin:O.platform===`linux`?t.permissionsHintLinux:O.platform===`darwin`?t.permissionsHintDarwin:t.permissionsHint:t.permissionsHint;return(0,y.jsxs)(h,{gap:`gap-6`,children:[(0,y.jsx)(m,{title:t.title}),P?(0,y.jsx)(`p`,{className:`text-sm text-amber-600 dark:text-amber-400`,role:`alert`,children:P}):null,F?(0,y.jsx)(`p`,{className:r(`text-sm`,F===t.refreshDone||F===t.openSettingsDone||F===t.permFeedback.granted||F===t.permFeedback.alreadyGranted||F===t.accessibilityFeedback.granted||F===t.accessibilityFeedback.alreadyGranted||F===t.notificationsFeedback.granted||F===t.notificationsFeedback.alreadyGranted||F===t.screenFeedback.granted||F===t.screenFeedback.alreadyGranted||F===t.desktopNotify.testShown?`text-emerald-600 dark:text-emerald-400`:`text-fg-muted`),role:`status`,"aria-live":`polite`,children:F}):null,(0,y.jsxs)(_,{children:[(0,y.jsxs)(`div`,{className:`mb-4 flex items-center gap-2 text-sm font-semibold text-fg`,children:[(0,y.jsx)(o,{className:`size-4 text-accent`,strokeWidth:1.75}),t.behaviorGroup]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.openAtLogin}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.openAtLoginDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.openAtLogin,onChange:e=>{V({openAtLogin:e.target.checked})}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.keepAwake}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.keepAwakeDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.keepAwakePreferred,onChange:e=>{V({keepAwakePreferred:e.target.checked})}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.notifyDesktop}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.notifyDesktopDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O||I,checked:!!O?.notifyEnabled,onChange:e=>{H(e.target.checked)}})]}),(0,y.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl bg-surface-hover/50 px-3 py-2.5 dark:bg-surface-hover/35`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:t.toggles.notifySound}),(0,y.jsx)(`p`,{className:`text-xs text-fg-muted`,children:t.toggles.notifySoundDesc})]}),(0,y.jsx)(`input`,{type:`checkbox`,className:`ui-checkbox`,disabled:!O,checked:!!O?.notifySoundEnabled,onChange:e=>{V({notifySoundEnabled:e.target.checked})}})]})]})]}),O&&N?(0,y.jsxs)(`section`,{className:g(),children:[(0,y.jsxs)(`div`,{className:`mb-4 flex flex-col gap-1 sm:flex-row sm:items-center sm:justify-between`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:t.permissionsTitle}),(0,y.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:J}),O.platform===`darwin`&&!O.packaged?(0,y.jsx)(`p`,{className:`mt-1 text-xs text-amber-600 dark:text-amber-400`,children:t.permissionsHintDevDarwin}):null]}),(0,y.jsxs)(`button`,{type:`button`,disabled:L||I,"aria-busy":L,className:r(`mt-2 inline-flex max-w-full items-center justify-center gap-1.5 rounded-lg border border-edge bg-surface-panel px-3 py-1.5 text-sm font-medium text-fg transition-colors hover:bg-surface-hover disabled:opacity-50 sm:mt-0`,s.press),onClick:()=>void B(),children:[(0,y.jsx)(u,{className:r(`size-3.5`,L&&`animate-spin`),strokeWidth:1.75,"aria-hidden":!0}),L?t.refreshing:t.refresh]})]}),(0,y.jsx)(`ul`,{className:`space-y-3`,children:k(O.platform).map(({key:n,pane:i})=>{let a=A(e,N[n]),o=t.perm[n],c=N[n]===`unknown`?j(e,n,O.platform):null;return o?(0,y.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-xl bg-surface-panel/70 p-3 shadow-surface sm:flex-row sm:items-center sm:justify-between`,children:[(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:o.title}),(0,y.jsx)(`p`,{className:`mt-0.5 text-xs text-fg-muted`,children:o.desc}),(0,y.jsx)(`p`,{className:`mt-1 text-xs font-medium ${a.className}`,children:a.label}),c?(0,y.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:c}):null]}),(0,y.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2`,children:[n===`notifications`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>void K(),children:t.requestAccess}):null,n===`microphone`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>void W(),children:t.requestAccess}):null,n===`accessibility`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>void G(),children:t.requestAccess}):null,n===`screen`&&E(n,N[n],O.platform)?(0,y.jsx)(`button`,{type:`button`,disabled:I,className:r(`inline-flex items-center gap-1 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover disabled:opacity-50`,s.press),onClick:()=>void q(),children:t.requestAccess}):null,D(n,N[n],O.platform)?(0,y.jsxs)(`button`,{type:`button`,className:r(`inline-flex items-center gap-1.5 rounded-lg border border-edge bg-surface-base px-2.5 py-1.5 text-xs font-medium text-fg hover:bg-surface-hover`,s.press),onClick:()=>void U(i),children:[t.openSettings,(0,y.jsx)(p,{className:`size-3.5`,strokeWidth:1.75,"aria-hidden":!0})]}):null]})]},n):null})})]}):null]})}export{N as SystemSettingsPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{d as i,f as a,t as o}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{l as s,n as c}from"./locale-store-deR2zRaE.js";import{Ba as l,Ct as u,Kl as d,Mi as f,Xa as p,_c as m,dc as h,ds as g,fu as _,ht as v,ji as y,ms as b,pt as x,rt as S,xl as C,yt as w}from"./index-B-_CEvIX.js";var T=n(),E=e(t(),1),D=r();function O(e,t){return(t===`zh`?{backlog:`收集箱`,ready:`就绪`,active:`进行中`,review:`待验收`,closed:`已关闭`}:{backlog:`Backlog`,ready:`Ready`,active:`Active`,review:`Review`,closed:`Closed`})[e]}function k(){let e=(0,T.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsxs)(`div`,{className:`space-y-4`,"aria-busy":!0,children:[(0,D.jsx)(l,{className:`h-32 rounded-2xl`}),(0,D.jsx)(l,{className:`h-52 rounded-2xl`}),(0,D.jsx)(l,{className:`h-40 rounded-2xl`})]}),e[0]=t):t=e[0],t}function A(e){let t=(0,T.c)(6),{items:n,empty:r}=e;if(n.length===0){let e;return t[0]===r?e=t[1]:(e=(0,D.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:r}),t[0]=r,t[1]=e),e}let i;t[2]===n?i=t[3]:(i=n.map(j),t[2]=n,t[3]=i);let a;return t[4]===i?a=t[5]:(a=(0,D.jsx)(`ul`,{className:`space-y-2`,children:i}),t[4]=i,t[5]=a),a}function j(e){return(0,D.jsxs)(`li`,{className:`flex gap-2 text-sm leading-6 text-fg`,children:[(0,D.jsx)(d,{className:`mt-1 size-4 shrink-0 text-success`}),(0,D.jsx)(`span`,{children:e})]},e)}function M(){let{taskId:e=``}=i(),[t]=a(),n=c(e=>e.language),r=s(e=>e.token),l=(0,E.useMemo)(()=>x(n),[n]),d=p(e=>e.setPageHeader),T=p(e=>e.clearPageHeader),[j,M]=(0,E.useState)(null),[N,P]=(0,E.useState)(null),[F,I]=(0,E.useState)(!1),L=(0,E.useMemo)(()=>y(t.get(`returnTo`),`/`,[`/projects`,`/chat`,`/notes`,`/tasks`]),[t]);(0,E.useEffect)(()=>{let t=!0;return M(null),P(null),w(e).then(e=>{t&&M(e)}).catch(()=>{t&&P(l.taskNotFound)}),()=>{t=!1}},[l.taskNotFound,e,r]);let R=async t=>{if(j){I(!0),P(null);try{M(await v(e,t,j.task.version))}catch{P(l.actionFailed)}finally{I(!1)}}};if((0,E.useLayoutEffect)(()=>(d({startExtra:(0,D.jsx)(o,{to:L,className:`flex size-9 items-center justify-center rounded-lg text-fg-muted hover:bg-surface-hover`,"aria-label":l.backToWork,children:(0,D.jsx)(_,{className:`size-4`})}),main:j?(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`truncate text-base font-semibold text-fg`,children:j.task.title}),(0,D.jsxs)(`p`,{className:`text-xs text-fg-muted`,children:[O(j.task.phase,n),` · `,j.operationalState]})]}):null,end:null}),T),[T,l.backToWork,j,n,L,d]),N&&!j)return(0,D.jsx)(`div`,{className:`mx-auto max-w-3xl p-6 text-sm text-danger`,children:N});if(!j)return(0,D.jsx)(`div`,{className:`mx-auto max-w-4xl p-4 sm:p-6`,children:(0,D.jsx)(k,{})});let z=j.waits[0],B=j.receipts[0],V=j.allowedCommands.includes(`start`),H=j.allowedCommands.includes(`add_wait`);return(0,D.jsxs)(`main`,{className:`mx-auto max-w-4xl space-y-4 p-4 pb-16 sm:p-6`,children:[(0,D.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsxs)(`p`,{className:`text-xs font-medium text-accent`,children:[O(j.task.phase,n),` · `,j.operationalState]}),(0,D.jsx)(`h2`,{className:`mt-2 text-xl font-semibold text-fg`,children:j.task.title}),j.task.body?(0,D.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-sm leading-6 text-fg-muted`,children:j.task.body}):null]}),j.task.phase===`closed`?null:(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[z?(0,D.jsxs)(g,{disabled:F,onClick:()=>void R({type:`resolve_wait`,waitId:z.id}),children:[(0,D.jsx)(h,{className:`size-4`}),l.resumeTask]}):null,!z&&V?(0,D.jsxs)(g,{disabled:F,onClick:()=>void R({type:`start`,executor:{kind:`agent`,agentId:j.task.delegateAgentId??`main`}}),children:[(0,D.jsx)(h,{className:`size-4`}),l.runTask]}):null,!z&&H?(0,D.jsxs)(g,{variant:`secondary`,disabled:F,onClick:()=>void R({type:`add_wait`,wait:{kind:`paused`,reason:`Paused by user`,condition:{}}}),children:[(0,D.jsx)(m,{className:`size-4`}),l.pauseTask]}):null,(0,D.jsxs)(g,{variant:`ghost`,disabled:F,onClick:()=>void R({type:`close`,resolution:`cancelled`}),children:[(0,D.jsx)(b,{className:`size-4`}),l.cancelTask]})]})]}),j.task.dueAt?(0,D.jsx)(`p`,{className:`mt-4 text-xs text-fg-muted`,children:S(j.task.dueAt)}):null,N?(0,D.jsx)(`p`,{className:`mt-3 text-sm text-danger`,children:N}):null]}),j.attention.length>0?(0,D.jsxs)(`section`,{className:`rounded-2xl border border-warning/40 bg-warning/5 p-5`,children:[(0,D.jsx)(`h3`,{className:`font-medium text-fg`,children:l.needsAttention}),(0,D.jsx)(`ul`,{className:`mt-3 space-y-2 text-sm text-fg-muted`,children:j.attention.map((e,t)=>(0,D.jsx)(`li`,{children:e.summary},`${e.kind}-${t}`))})]}):null,(0,D.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,D.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,D.jsx)(`h3`,{className:`font-medium text-fg`,children:l.successDefinition}),(0,D.jsx)(`div`,{className:`mt-4`,children:(0,D.jsx)(A,{items:j.task.contract?.acceptanceCriteria??[],empty:l.noDefinition})})]}),(0,D.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,D.jsx)(`h3`,{className:`font-medium text-fg`,children:l.expectedOutputs}),(0,D.jsx)(`div`,{className:`mt-4`,children:(0,D.jsx)(A,{items:j.task.contract?.expectedOutputs??[],empty:l.noDefinition})})]})]}),j.dependencies.length>0||j.dependents.length>0?(0,D.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,D.jsx)(`h3`,{className:`font-medium text-fg`,children:l.taskRelations}),(0,D.jsxs)(`div`,{className:`mt-4 grid gap-4 sm:grid-cols-2`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:l.dependencies}),j.dependencies.map(e=>(0,D.jsxs)(o,{to:f(`/tasks/${e.id}`,L),className:`block text-sm text-accent hover:underline`,children:[e.title,` · `,O(e.phase,n)]},e.id))]}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`p`,{className:`mb-2 text-xs text-fg-muted`,children:l.dependents}),j.dependents.map(e=>(0,D.jsxs)(o,{to:f(`/tasks/${e.id}`,L),className:`block text-sm text-accent hover:underline`,children:[e.title,` · `,O(e.phase,n)]},e.id))]})]})]}):null,(0,D.jsxs)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-5`,children:[(0,D.jsx)(`h3`,{className:`font-medium text-fg`,children:l.executionReceipts}),j.receipts.length===0?(0,D.jsx)(`p`,{className:`mt-4 text-sm text-fg-muted`,children:l.noReceipts}):(0,D.jsx)(`div`,{className:`mt-4 space-y-4`,children:j.receipts.map(e=>(0,D.jsxs)(`article`,{className:`border-t border-edge pt-4 first:border-0 first:pt-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,D.jsx)(`p`,{className:`font-medium text-fg`,children:e.summary}),(0,D.jsxs)(`span`,{className:`text-xs text-fg-muted`,children:[e.status,` · `,e.verification.status]})]}),e.nextAction?(0,D.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:e.nextAction}):null,(0,D.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,D.jsx)(g,{className:`px-2 py-1 text-xs`,variant:`secondary`,onClick:()=>void u(e.runId,`helpful`),children:l.doneWell}),(0,D.jsx)(g,{className:`px-2 py-1 text-xs`,variant:`ghost`,onClick:()=>void u(e.runId,`not_helpful`),children:l.needsFix}),e.evidence[0]?.uri?(0,D.jsxs)(`a`,{className:`ml-auto inline-flex items-center gap-1 text-xs text-accent`,href:e.evidence[0].uri,children:[(0,D.jsx)(C,{className:`size-3`}),l.evidenceDetails]}):null]})]},e.runId))})]}),B?.needsUser?(0,D.jsx)(`p`,{className:`text-sm text-warning`,children:B.nextAction??l.noDecisionNeeded}):null]})}export{M as TaskDetailPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{f as i,t as a}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{n as o}from"./locale-store-deR2zRaE.js";import{i as s}from"./vendor-swr-BIWyz7Rc.js";import{$l as c,$t as l,Ba as u,Bl as d,Bt as f,Cc as p,Gt as m,Ht as h,Jt as g,Ks as _,Kt as v,Os as y,Qt as b,Ro as x,Rt as S,Ut as C,Vt as w,Wt as T,Xa as E,Xt as D,Yt as O,Zt as k,ds as A,eu as j,hc as M,lc as N,ol as P,qt as F,xl as I,zo as L,zt as R}from"./index-B-_CEvIX.js";import{n as z,t as B}from"./use-autosave-BN2QgFGn.js";import{t as V}from"./page-tabs-BO262zuu.js";import{a as H}from"./connectors-api-BMMqC0_9.js";var U=n(),W=e(t(),1),G=r(),K=new Set([`profile`,`understanding`,`collaboration`,`sources`,`dreaming`,`privacy`]),q=`w-full rounded-xl border border-edge bg-surface-panel px-3 py-2 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent/60 focus:ring-2 focus:ring-accent/20`,J={en:{title:`About You`,subtitle:`What xopc knows, why it knows it, and how it should work with you.`,profile:`Profile`,understanding:`Understanding`,collaboration:`Working agreement`,sources:`Sources`,dreaming:`Background review`,privacy:`Privacy`,profileHint:`Facts you provide directly. These are available across conversations.`,done:`Done`,required:`This field cannot be empty.`,callName:`What should xopc call you?`,callNamePlaceholder:`For example: Alex, Joyce, or Dr. Chen`,role:`Your role`,rolePlaceholder:`For example: product designer, founder, or engineer`,primaryGoal:`What are you mainly trying to achieve?`,primaryGoalPlaceholder:`The outcome you want xopc to optimize for`,pronouns:`Pronouns (optional)`,pronounsPlaceholder:`For example: she/her, he/him, they/them`,timezone:`Timezone`,locale:`Language / locale`,detect:`Use this device`,understoodHint:`Reviewable beliefs learned from your conversations and work. Inferences stay pending until confirmed.`,addUnderstanding:`Add understanding`,statement:`What should xopc understand?`,kind:`Type`,add:`Add`,cancel:`Cancel`,active:`Active`,review:`Needs review`,confirm:`Confirm`,reject:`Wrong`,edit:`Edit`,delete:`Delete`,confirmDelete:`Delete now`,rulesHint:`Explicit instructions for how xopc should collaborate with you. Rules outrank inferred understanding.`,addRule:`Add rule`,ruleStatement:`How should xopc work with you?`,category:`Category`,disable:`Disable`,enable:`Enable`,emptyUnderstanding:`Nothing here yet. Tell xopc something explicitly, or confirm a suggestion after it learns one.`,emptyRules:`No working agreements yet.`,sourceExplicit:`You said this directly`,sourceInferred:`Inferred — may be wrong`,sourceObserved:`Observed across prior work`,sourcesHint:`Review every granted source, its access mode, retention, and last collection. Revoking stops future learning.`,manageSources:`Connect another source`,noSources:`No sources are authorized.`,connected:`Connected`,unavailable:`Needs attention`,revoke:`Revoke & remove derived`,refresh:`Refresh`,once:`One-time`,continuous:`Continuous`,localOnly:`Local only`,derivedOnly:`Derived understanding only`,focuses:`Current focuses`,focusHint:`Candidate focuses never activate until you confirm them.`,activate:`Activate`,pause:`Pause`,complete:`Complete`,noFocuses:`No focus candidates yet.`,dreamingHint:`A deterministic daily review checks expiry, contradictory evidence, and corroborated candidates. It never auto-activates an inference.`,mode:`Background review`,on:`On — propose for review`,off:`Off`,reviewTime:`Daily review time`,evidenceThreshold:`Supporting evidence required`,scanLimit:`Maximum items per run`,lastRun:`Last review`,neverRun:`Not run yet`,runCompleted:`Completed`,runFailed:`Failed`,runRunning:`Running`,runItems:`items`,privacyHint:`Choose how generic memory providers handle sensitive content. Structured user understanding applies stricter rules of its own.`,sensitivePolicy:`Sensitive memory writes`,policyDeny:`Do not store`,policyConfirm:`Ask before storing`,policyAllow:`Store when relevant`,privacyWarning:`Secret and regulated content is never stored as structured user understanding, regardless of this setting.`,error:`Could not load your context.`,retry:`Try again`},zh:{title:`关于你`,subtitle:`清楚查看 xopc 知道什么、为什么知道,以及应该如何与你协作。`,profile:`个人资料`,understanding:`对你的理解`,collaboration:`协作约定`,sources:`数据来源`,dreaming:`后台复核`,privacy:`隐私`,profileHint:`由你直接提供的事实,会在不同对话中使用。`,done:`完成`,required:`此项不能为空。`,callName:`希望 xopc 如何称呼你?`,callNamePlaceholder:`例如:Mic、Joyce、张老师`,role:`你的角色`,rolePlaceholder:`例如:产品设计师、创业者、工程师`,primaryGoal:`你目前最想达成什么?`,primaryGoalPlaceholder:`希望 xopc 优先帮助你实现的结果`,pronouns:`代词(可选)`,pronounsPlaceholder:`例如:she/her、he/him、they/them`,timezone:`时区`,locale:`语言 / 地区`,detect:`使用本机时区`,understoodHint:`从对话和工作中形成、可复核的理解。推断内容在你确认前保持待审核。`,addUnderstanding:`添加理解`,statement:`希望 xopc 了解什么?`,kind:`类型`,add:`添加`,cancel:`取消`,active:`使用中`,review:`待审核`,confirm:`确认`,reject:`不正确`,edit:`编辑`,delete:`删除`,confirmDelete:`确认删除`,rulesHint:`你明确设定的协作方式。协作约定的优先级高于推断出的理解。`,addRule:`添加约定`,ruleStatement:`希望 xopc 如何与你协作?`,category:`类别`,disable:`停用`,enable:`启用`,emptyUnderstanding:`还没有内容。你可以直接告诉 xopc,或在它学到建议后进行确认。`,emptyRules:`还没有协作约定。`,sourceExplicit:`由你直接告知`,sourceInferred:`推断内容,可能有误`,sourceObserved:`从过往工作中观察到`,sourcesHint:`查看每项授权的访问方式、保留策略和最近采集时间;撤销后将停止后续学习。`,manageSources:`连接其他来源`,noSources:`尚未授权任何来源。`,connected:`已连接`,unavailable:`需要处理`,revoke:`撤销并删除派生理解`,refresh:`立即更新`,once:`仅一次`,continuous:`持续更新`,localOnly:`仅本地处理`,derivedOnly:`仅保留派生理解`,focuses:`当前关注`,focusHint:`候选关注不会自动生效,只有你确认后才会启用。`,activate:`启用`,pause:`暂停`,complete:`完成`,noFocuses:`还没有候选关注。`,dreamingHint:`每天进行一次确定性复核,检查过期、矛盾证据和得到佐证的候选理解;推断内容不会自动生效。`,mode:`后台复核`,on:`开启并生成待审核项`,off:`关闭`,reviewTime:`每日复核时间`,evidenceThreshold:`所需支持证据数`,scanLimit:`每次最多检查`,lastRun:`最近一次复核`,neverRun:`尚未运行`,runCompleted:`已完成`,runFailed:`失败`,runRunning:`运行中`,runItems:`项`,privacyHint:`选择通用记忆服务如何处理敏感内容;结构化用户理解有独立且更严格的规则。`,sensitivePolicy:`敏感记忆写入`,policyDeny:`不保存`,policyConfirm:`保存前询问`,policyAllow:`相关时允许保存`,privacyWarning:`无论这里如何设置,秘密和受监管内容都不会保存为结构化用户理解。`,error:`无法加载用户上下文。`,retry:`重试`}},Y={preference:{en:`Preference`,zh:`偏好`},boundary:{en:`Boundary`,zh:`边界`},relationship:{en:`Relationship`,zh:`关系`},routine:{en:`Routine`,zh:`习惯`},current_state:{en:`Current state`,zh:`当前状态`},long_term_goal:{en:`Long-term goal`,zh:`长期目标`},project_context:{en:`Project context`,zh:`项目背景`},task_lesson:{en:`Task lesson`,zh:`任务经验`},derived_insight:{en:`Insight`,zh:`洞察`}},X={communication:{en:`Communication`,zh:`沟通`},execution:{en:`Execution`,zh:`执行`},boundary:{en:`Boundary`,zh:`边界`},routine:{en:`Routine`,zh:`习惯`},proactive:{en:`Proactive help`,zh:`主动协助`}};function Z(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`section`,{className:`rounded-2xl border border-edge bg-surface-panel p-4 sm:p-5`,children:n}),t[0]=n,t[1]=r),r}function Q(e){let t=(0,U.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,G.jsx)(`div`,{className:`rounded-2xl border border-dashed border-edge px-5 py-10 text-center text-sm text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function ee(e){return JSON.stringify(e)}function te(e){let t=(0,U.c)(10),[n,r]=(0,W.useState)(e),i;t[0]===e?i=t[1]:(i=ee(e),t[0]=e,t[1]=i);let a=(0,W.useRef)(i),o;t[2]===e?o=t[3]:(o=ee(e),t[2]=e,t[3]=o);let s=o,c,l;t[4]!==e||t[5]!==s?(c=()=>{if(s===a.current)return;let t=a.current;a.current=s,r(n=>ee(n)===t?e:n)},l=[e,s],t[4]=e,t[5]=s,t[6]=c,t[7]=l):(c=t[6],l=t[7]),(0,W.useEffect)(c,l);let u;return t[8]===n?u=t[9]:(u=[n,r],t[8]=n,t[9]=u),u}function ne(e){return{callName:e.callName,role:e.role,primaryGoal:e.primaryGoal,pronouns:e.pronouns,timezone:e.timezone,locale:e.locale}}function re(){let e=(0,U.c)(86),t=o(se),n=J[t],[r,a]=i(),l;if(e[0]!==r){let t=r.get(`tab`);l=t&&K.has(t)?t:`profile`,e[0]=r,e[1]=l}else l=e[1];let f=l,m=E(oe),h=E(ae),{data:g,error:v,isLoading:y,mutate:b}=s(`/api/you`,T),x;e[2]!==h||e[3]!==m||e[4]!==n.subtitle||e[5]!==n.title?(x=()=>(m({startExtra:null,main:(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`text-base font-semibold text-fg`,children:n.title}),(0,G.jsx)(`p`,{className:`hidden text-xs text-fg-muted sm:block`,children:n.subtitle})]}),end:null}),h),e[2]=h,e[3]=m,e[4]=n.subtitle,e[5]=n.title,e[6]=x):x=e[6];let S;if(e[7]!==h||e[8]!==m||e[9]!==n?(S=[h,m,n],e[7]=h,e[8]=m,e[9]=n,e[10]=S):S=e[10],(0,W.useEffect)(x,S),y){let t;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,G.jsxs)(`div`,{className:`space-y-4 p-4 sm:p-6`,children:[(0,G.jsx)(u,{className:`h-10 w-96 max-w-full`}),(0,G.jsx)(u,{className:`h-72 rounded-2xl`})]}),e[11]=t):t=e[11],t}if(v||!g){let t;e[12]===b?t=e[13]:(t=()=>void b(),e[12]=b,e[13]=t);let r;e[14]!==n.retry||e[15]!==t?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:t,children:n.retry}),e[14]=n.retry,e[15]=t,e[16]=r):r=e[16];let i;return e[17]!==n.error||e[18]!==r?(i=(0,G.jsx)(`div`,{className:`p-6`,children:(0,G.jsxs)(Q,{children:[n.error,` `,r]})}),e[17]=n.error,e[18]=r,e[19]=i):i=e[19],i}let C=n.title,w;e[20]===a?w=e[21]:(w=e=>a({tab:e}),e[20]=a,e[21]=w);let D;e[22]===n.profile?D=e[23]:(D={id:`profile`,label:n.profile,icon:d},e[22]=n.profile,e[23]=D);let O;e[24]!==g.understandings.length||e[25]!==n.understanding?(O={id:`understanding`,label:n.understanding,icon:j,count:g.understandings.length},e[24]=g.understandings.length,e[25]=n.understanding,e[26]=O):O=e[26];let k=n.collaboration,A;e[27]===g.rules?A=e[28]:(A=g.rules.filter(ie),e[27]=g.rules,e[28]=A);let M;e[29]!==n.collaboration||e[30]!==A.length?(M={id:`collaboration`,label:k,icon:P,count:A.length},e[29]=n.collaboration,e[30]=A.length,e[31]=M):M=e[31];let N;e[32]===n.sources?N=e[33]:(N={id:`sources`,label:n.sources,icon:c},e[32]=n.sources,e[33]=N);let F;e[34]===n.dreaming?F=e[35]:(F={id:`dreaming`,label:n.dreaming,icon:p},e[34]=n.dreaming,e[35]=F);let I;e[36]===n.privacy?I=e[37]:(I={id:`privacy`,label:n.privacy,icon:_},e[36]=n.privacy,e[37]=I);let L;e[38]!==N||e[39]!==F||e[40]!==I||e[41]!==D||e[42]!==O||e[43]!==M?(L=[D,O,M,N,F,I],e[38]=N,e[39]=F,e[40]=I,e[41]=D,e[42]=O,e[43]=M,e[44]=L):L=e[44];let R;e[45]!==n.title||e[46]!==L||e[47]!==w||e[48]!==f?(R=(0,G.jsx)(V,{ariaLabel:C,activeTab:f,onChange:w,items:L}),e[45]=n.title,e[46]=L,e[47]=w,e[48]=f,e[49]=R):R=e[49];let z;e[50]!==g.profile||e[51]!==t||e[52]!==b||e[53]!==n||e[54]!==f?(z=f===`profile`?(0,G.jsx)(ce,{profile:g.profile,language:t,t:n,onChanged:e=>b(t=>t&&{...t,profile:e},{revalidate:!1})}):null,e[50]=g.profile,e[51]=t,e[52]=b,e[53]=n,e[54]=f,e[55]=z):z=e[55];let B;e[56]!==g.understandings||e[57]!==t||e[58]!==b||e[59]!==n||e[60]!==f?(B=f===`understanding`?(0,G.jsx)(ue,{items:g.understandings,language:t,t:n,onChanged:e=>e?b(t=>t&&{...t,understandings:t.understandings.map(t=>t.id===e.id?e:t)},{revalidate:!1}):b()}):null,e[56]=g.understandings,e[57]=t,e[58]=b,e[59]=n,e[60]=f,e[61]=B):B=e[61];let H;e[62]!==g.rules||e[63]!==t||e[64]!==b||e[65]!==n||e[66]!==f?(H=f===`collaboration`?(0,G.jsx)(he,{rules:g.rules,language:t,t:n,onChanged:()=>b()}):null,e[62]=g.rules,e[63]=t,e[64]=b,e[65]=n,e[66]=f,e[67]=H):H=e[67];let q;e[68]!==n||e[69]!==f?(q=f===`sources`?(0,G.jsx)(ve,{t:n}):null,e[68]=n,e[69]=f,e[70]=q):q=e[70];let Y;e[71]!==g.consolidation?.lastRun||e[72]!==n||e[73]!==f?(Y=f===`dreaming`?(0,G.jsx)(ye,{lastRun:g.consolidation?.lastRun??null,t:n}):null,e[71]=g.consolidation?.lastRun,e[72]=n,e[73]=f,e[74]=Y):Y=e[74];let X;e[75]!==n||e[76]!==f?(X=f===`privacy`?(0,G.jsx)(xe,{t:n}):null,e[75]=n,e[76]=f,e[77]=X):X=e[77];let Z;return e[78]!==R||e[79]!==z||e[80]!==B||e[81]!==H||e[82]!==q||e[83]!==Y||e[84]!==X?(Z=(0,G.jsxs)(`div`,{className:`mx-auto w-full max-w-5xl space-y-5 p-4 sm:p-6`,children:[R,z,B,H,q,Y,X]}),e[78]=R,e[79]=z,e[80]=B,e[81]=H,e[82]=q,e[83]=Y,e[84]=X,e[85]=Z):Z=e[85],Z}function ie(e){return e.status===`active`}function ae(e){return e.clearPageHeader}function oe(e){return e.setPageHeader}function se(e){return e.language}function ce(e){let t=(0,U.c)(78),{profile:n,language:r,t:i,onChanged:a}=e,o;t[0]===n?o=t[1]:(o=ne(n),t[0]=n,t[1]=o);let s=o,[c,u]=te(s),d;t[2]===c?d=t[3]:(d=ee(c),t[2]=c,t[3]=d);let f;t[4]===s?f=t[5]:(f=ee(s),t[4]=s,t[5]=f);let p=d!==f,m;t[6]!==a||t[7]!==n?(m=async e=>{await a((await l({...e,accessibility:n.accessibility})).profile)},t[6]=a,t[7]=n,t[8]=m):m=t[8];let h;t[9]!==c||t[10]!==p||t[11]!==m?(h={value:c,dirty:p,delayMs:500,onSave:m},t[9]=c,t[10]=p,t[11]=m,t[12]=h):h=t[12];let g=B(h),_;t[13]!==c||t[14]!==u?(_=(e,t,n)=>(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:t}),(0,G.jsx)(`input`,{className:q,placeholder:n,value:c[e],onChange:t=>u(n=>({...n,[e]:t.target.value}))})]}),t[13]=c,t[14]=u,t[15]=_):_=t[15];let v=_,y=g.onBlurCapture,b;t[16]===i.profileHint?b=t[17]:(b=(0,G.jsx)(`p`,{className:`mb-5 text-sm leading-6 text-fg-muted`,children:i.profileHint}),t[16]=i.profileHint,t[17]=b);let x;t[18]!==v||t[19]!==i.callName||t[20]!==i.callNamePlaceholder?(x=v(`callName`,i.callName,i.callNamePlaceholder),t[18]=v,t[19]=i.callName,t[20]=i.callNamePlaceholder,t[21]=x):x=t[21];let S;t[22]!==v||t[23]!==i.role||t[24]!==i.rolePlaceholder?(S=v(`role`,i.role,i.rolePlaceholder),t[22]=v,t[23]=i.role,t[24]=i.rolePlaceholder,t[25]=S):S=t[25];let C;t[26]===i.primaryGoal?C=t[27]:(C=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.primaryGoal}),t[26]=i.primaryGoal,t[27]=C);let w;t[28]===u?w=t[29]:(w=e=>u(t=>({...t,primaryGoal:e.target.value})),t[28]=u,t[29]=w);let T;t[30]!==c.primaryGoal||t[31]!==i.primaryGoalPlaceholder||t[32]!==w?(T=(0,G.jsx)(`textarea`,{className:q,rows:3,placeholder:i.primaryGoalPlaceholder,value:c.primaryGoal,onChange:w}),t[30]=c.primaryGoal,t[31]=i.primaryGoalPlaceholder,t[32]=w,t[33]=T):T=t[33];let E;t[34]!==C||t[35]!==T?(E=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[C,T]}),t[34]=C,t[35]=T,t[36]=E):E=t[36];let D;t[37]!==v||t[38]!==r||t[39]!==i.pronouns||t[40]!==i.pronounsPlaceholder?(D=r===`en`?v(`pronouns`,i.pronouns,i.pronounsPlaceholder):null,t[37]=v,t[38]=r,t[39]=i.pronouns,t[40]=i.pronounsPlaceholder,t[41]=D):D=t[41];let O;t[42]===i.timezone?O=t[43]:(O=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:i.timezone}),t[42]=i.timezone,t[43]=O);let k;t[44]===u?k=t[45]:(k=e=>u(t=>({...t,timezone:e.target.value})),t[44]=u,t[45]=k);let j;t[46]!==c.timezone||t[47]!==k?(j=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:c.timezone,onChange:k}),t[46]=c.timezone,t[47]=k,t[48]=j):j=t[48];let M;t[49]===u?M=t[50]:(M=()=>u(le),t[49]=u,t[50]=M);let N;t[51]!==i.detect||t[52]!==M?(N=(0,G.jsx)(A,{className:`shrink-0 whitespace-nowrap`,onClick:M,children:i.detect}),t[51]=i.detect,t[52]=M,t[53]=N):N=t[53];let P;t[54]!==j||t[55]!==N?(P=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[j,N]}),t[54]=j,t[55]=N,t[56]=P):P=t[56];let F;t[57]!==O||t[58]!==P?(F=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[O,P]}),t[57]=O,t[58]=P,t[59]=F):F=t[59];let I;t[60]!==v||t[61]!==i.locale?(I=v(`locale`,i.locale),t[60]=v,t[61]=i.locale,t[62]=I):I=t[62];let L;t[63]!==x||t[64]!==S||t[65]!==E||t[66]!==D||t[67]!==F||t[68]!==I?(L=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[x,S,E,D,F,I]}),t[63]=x,t[64]=S,t[65]=E,t[66]=D,t[67]=F,t[68]=I,t[69]=L):L=t[69];let R;t[70]!==g.error||t[71]!==g.status?(R=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:g.status,error:g.error})}),t[70]=g.error,t[71]=g.status,t[72]=R):R=t[72];let V;return t[73]!==g.onBlurCapture||t[74]!==L||t[75]!==R||t[76]!==b?(V=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:y,children:[b,L,R]})}),t[73]=g.onBlurCapture,t[74]=L,t[75]=R,t[76]=b,t[77]=V):V=t[77],V}function le(e){return{...e,timezone:h()}}function ue(e){let t=(0,U.c)(50),{items:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(``),[u,d]=(0,W.useState)(`preference`),f;t[0]===n?f=t[1]:(f=n.filter(fe),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=n.filter(de),t[2]=n,t[3]=m);let h=m,g;t[4]!==u||t[5]!==a||t[6]!==c?(g=async e=>{e.preventDefault(),c.trim()&&(await R({statement:c,kind:u}),l(``),s(!1),await a())},t[4]=u,t[5]=a,t[6]=c,t[7]=g):g=t[7];let _=g,v;t[8]===i.understoodHint?v=t[9]:(v=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.understoodHint}),t[8]=i.understoodHint,t[9]=v);let y,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>s(!0),b=(0,G.jsx)(N,{className:`size-4`}),t[10]=y,t[11]=b):(y=t[10],b=t[11]);let S;t[12]===i.addUnderstanding?S=t[13]:(S=(0,G.jsxs)(A,{variant:`primary`,onClick:y,children:[b,i.addUnderstanding]}),t[12]=i.addUnderstanding,t[13]=S);let C;t[14]!==v||t[15]!==S?(C=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[v,S]}),t[14]=v,t[15]=S,t[16]=C):C=t[16];let w;t[17]===i?w=t[18]:(w=(0,G.jsx)(pe,{t:i}),t[17]=i,t[18]=w);let T;t[19]!==o||t[20]!==u||t[21]!==r||t[22]!==c||t[23]!==_||t[24]!==i.add||t[25]!==i.cancel||t[26]!==i.statement?(T=o?(0,G.jsx)(Z,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:_,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:i.statement,value:c,onChange:e=>l(e.target.value)}),(0,G.jsx)(x,{value:u,onChange:e=>d(e.target.value),children:Object.entries(Y).map(e=>{let[t,n]=e;return(0,G.jsx)(L,{value:t,children:n[r]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(A,{type:`submit`,variant:`primary`,children:i.add}),(0,G.jsx)(A,{onClick:()=>s(!1),children:i.cancel})]})]})}):null,t[19]=o,t[20]=u,t[21]=r,t[22]=c,t[23]=_,t[24]=i.add,t[25]=i.cancel,t[26]=i.statement,t[27]=T):T=t[27];let E;t[28]!==r||t[29]!==a||t[30]!==h||t[31]!==i?(E=h.length?(0,G.jsxs)(`section`,{className:`space-y-3`,children:[(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[i.review,` · `,h.length]}),h.map(e=>(0,G.jsx)($,{item:e,language:r,t:i,onChanged:a},e.id))]}):null,t[28]=r,t[29]=a,t[30]=h,t[31]=i,t[32]=E):E=t[32];let D;t[33]!==p.length||t[34]!==i.active?(D=(0,G.jsxs)(`h2`,{className:`text-sm font-semibold text-fg`,children:[i.active,` · `,p.length]}),t[33]=p.length,t[34]=i.active,t[35]=D):D=t[35];let O;t[36]!==p||t[37]!==r||t[38]!==a||t[39]!==i?(O=p.length?p.map(e=>(0,G.jsx)($,{item:e,language:r,t:i,onChanged:a},e.id)):(0,G.jsx)(Q,{children:i.emptyUnderstanding}),t[36]=p,t[37]=r,t[38]=a,t[39]=i,t[40]=O):O=t[40];let k;t[41]!==D||t[42]!==O?(k=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[D,O]}),t[41]=D,t[42]=O,t[43]=k):k=t[43];let j;return t[44]!==T||t[45]!==E||t[46]!==k||t[47]!==C||t[48]!==w?(j=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[C,w,T,E,k]}),t[44]=T,t[45]=E,t[46]=k,t[47]=C,t[48]=w,t[49]=j):j=t[49],j}function de(e){return[`candidate`,`needs_review`,`stale`].includes(e.status)}function fe(e){return e.status===`active`}function $(e){let t=(0,U.c)(57),{item:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(!1),[u,d]=te(n.statement),f=u!==n.statement,p;t[0]===i.required?p=t[1]:(p=e=>e.trim()?null:i.required,t[0]=i.required,t[1]=p);let m;t[2]!==n.id||t[3]!==a?(m=async e=>{await a((await D(n.id,{statement:e})).understanding)},t[2]=n.id,t[3]=a,t[4]=m):m=t[4];let h;t[5]!==u||t[6]!==o||t[7]!==f||t[8]!==p||t[9]!==m?(h={value:u,dirty:f,enabled:o,delayMs:500,validate:p,onSave:m},t[5]=u,t[6]=o,t[7]=f,t[8]=p,t[9]=m,t[10]=h):h=t[10];let g=B(h),_=Y[n.kind][r],v;t[11]===_?v=t[12]:(v=(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:_}),t[11]=_,t[12]=v);let b=n.explicitness===`explicit`?i.sourceExplicit:n.explicitness===`observed`?i.sourceObserved:i.sourceInferred,x;t[13]===b?x=t[14]:(x=(0,G.jsx)(`span`,{className:`text-xs text-fg-subtle`,children:b}),t[13]=b,t[14]=x);let S;t[15]!==v||t[16]!==x?(S=(0,G.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2`,children:[v,x]}),t[15]=v,t[16]=x,t[17]=S):S=t[17];let C;t[18]!==u||t[19]!==o||t[20]!==d?(C=o?(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,value:u,onChange:e=>d(e.target.value),rows:3}):(0,G.jsx)(`p`,{className:`text-sm leading-6 text-fg`,children:u}),t[18]=u,t[19]=o,t[20]=d,t[21]=C):C=t[21];let T;t[22]!==C||t[23]!==S?(T=(0,G.jsx)(`div`,{className:`flex items-start justify-between gap-3`,children:(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[S,C]})}),t[22]=C,t[23]=S,t[24]=T):T=t[24];let E;t[25]!==g||t[26]!==o||t[27]!==i.done||t[28]!==i.edit?(E=o?(0,G.jsx)(A,{variant:`ghost`,onClick:()=>{g.flush(),s(!1)},children:i.done}):(0,G.jsxs)(A,{variant:`ghost`,onClick:()=>s(!0),children:[(0,G.jsx)(M,{className:`size-3.5`}),i.edit]}),t[25]=g,t[26]=o,t[27]=i.done,t[28]=i.edit,t[29]=E):E=t[29];let O;t[30]!==n.id||t[31]!==n.status||t[32]!==a||t[33]!==i.confirm||t[34]!==i.reject?(O=n.status===`active`?null:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(A,{variant:`primary`,onClick:async()=>{await a((await D(n.id,{status:`active`})).understanding)},children:i.confirm}),(0,G.jsx)(A,{onClick:async()=>{await a((await D(n.id,{status:`rejected`})).understanding)},children:i.reject})]}),t[30]=n.id,t[31]=n.status,t[32]=a,t[33]=i.confirm,t[34]=i.reject,t[35]=O):O=t[35];let k;t[36]!==c||t[37]!==n.id||t[38]!==a?(k=async()=>{if(!c){l(!0);return}await w(n.id),l(!1),await a()},t[36]=c,t[37]=n.id,t[38]=a,t[39]=k):k=t[39];let j;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,G.jsx)(y,{className:`size-3.5`}),t[40]=j):j=t[40];let N=c?i.confirmDelete:i.delete,P;t[41]!==k||t[42]!==N?(P=(0,G.jsxs)(A,{variant:`ghost`,className:`text-danger`,onClick:k,children:[j,N]}),t[41]=k,t[42]=N,t[43]=P):P=t[43];let F;t[44]!==g.error||t[45]!==g.status||t[46]!==o?(F=o||g.status!==`idle`?(0,G.jsx)(z,{className:`ml-auto`,status:g.status,error:g.error}):null,t[44]=g.error,t[45]=g.status,t[46]=o,t[47]=F):F=t[47];let I;t[48]!==E||t[49]!==O||t[50]!==P||t[51]!==F?(I=(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-2`,children:[E,O,P,F]}),t[48]=E,t[49]=O,t[50]=P,t[51]=F,t[52]=I):I=t[52];let L;return t[53]!==g.onBlurCapture||t[54]!==T||t[55]!==I?(L=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:g.onBlurCapture,children:[T,I]})}),t[53]=g.onBlurCapture,t[54]=T,t[55]=I,t[56]=L):L=t[56],L}function pe(e){let t=(0,U.c)(20),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-focuses`,v);if(a){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-40 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;return t[1]===n.error?e=t[2]:(e=(0,G.jsx)(Q,{children:n.error}),t[1]=n.error,t[2]=e),e}let c;if(t[3]!==r||t[4]!==o||t[5]!==n.activate||t[6]!==n.complete||t[7]!==n.focusHint||t[8]!==n.focuses||t[9]!==n.noFocuses||t[10]!==n.pause||t[11]!==n.reject){let e=(r??[]).filter(me),i;t[13]===n.focuses?i=t[14]:(i=(0,G.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.focuses}),t[13]=n.focuses,t[14]=i);let a;t[15]===n.focusHint?a=t[16]:(a=(0,G.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n.focusHint}),t[15]=n.focusHint,t[16]=a);let s;t[17]!==i||t[18]!==a?(s=(0,G.jsxs)(`div`,{children:[i,a]}),t[17]=i,t[18]=a,t[19]=s):s=t[19],c=(0,G.jsxs)(`section`,{className:`space-y-3`,children:[s,e.length?e.map(e=>(0,G.jsxs)(Z,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:e.title}),(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] text-fg-muted`,children:e.status})]}),(0,G.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[Math.round(e.confidence*100),`%`]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:[e.status===`active`?(0,G.jsx)(A,{onClick:async()=>{await b(e.id,`paused`),await o()},children:n.pause}):(0,G.jsx)(A,{variant:`primary`,onClick:async()=>{await b(e.id,`active`),await o()},children:n.activate}),(0,G.jsx)(A,{variant:`ghost`,onClick:async()=>{await b(e.id,`completed`),await o()},children:n.complete}),e.status===`candidate`?(0,G.jsx)(A,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await b(e.id,`rejected`),await o()},children:n.reject}):null]})]},e.id)):(0,G.jsx)(Q,{children:n.noFocuses})]}),t[3]=r,t[4]=o,t[5]=n.activate,t[6]=n.complete,t[7]=n.focusHint,t[8]=n.focuses,t[9]=n.noFocuses,t[10]=n.pause,t[11]=n.reject,t[12]=c}else c=t[12];return c}function me(e){return e.status!==`rejected`}function he(e){let t=(0,U.c)(36),{rules:n,language:r,t:i,onChanged:a}=e,[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(``),[u,d]=(0,W.useState)(`communication`),[p,m]=(0,W.useState)(null),h;t[0]!==u||t[1]!==a||t[2]!==c?(h=async e=>{e.preventDefault(),c.trim()&&(await S({statement:c,category:u}),l(``),s(!1),await a())},t[0]=u,t[1]=a,t[2]=c,t[3]=h):h=t[3];let g=h,_;t[4]===i.rulesHint?_=t[5]:(_=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:i.rulesHint}),t[4]=i.rulesHint,t[5]=_);let v,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>s(!0),b=(0,G.jsx)(N,{className:`size-4`}),t[6]=v,t[7]=b):(v=t[6],b=t[7]);let C;t[8]===i.addRule?C=t[9]:(C=(0,G.jsxs)(A,{variant:`primary`,onClick:v,children:[b,i.addRule]}),t[8]=i.addRule,t[9]=C);let w;t[10]!==_||t[11]!==C?(w=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[_,C]}),t[10]=_,t[11]=C,t[12]=w):w=t[12];let T;t[13]!==o||t[14]!==u||t[15]!==r||t[16]!==c||t[17]!==g||t[18]!==i.add||t[19]!==i.cancel||t[20]!==i.ruleStatement?(T=o?(0,G.jsx)(Z,{children:(0,G.jsxs)(`form`,{className:`space-y-3`,onSubmit:g,children:[(0,G.jsx)(`textarea`,{autoFocus:!0,className:q,rows:3,placeholder:i.ruleStatement,value:c,onChange:e=>l(e.target.value)}),(0,G.jsx)(x,{value:u,onChange:e=>d(e.target.value),children:Object.entries(X).map(e=>{let[t,n]=e;return(0,G.jsx)(L,{value:t,children:n[r]},t)})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(A,{type:`submit`,variant:`primary`,children:i.add}),(0,G.jsx)(A,{onClick:()=>s(!1),children:i.cancel})]})]})}):null,t[13]=o,t[14]=u,t[15]=r,t[16]=c,t[17]=g,t[18]=i.add,t[19]=i.cancel,t[20]=i.ruleStatement,t[21]=T):T=t[21];let E;t[22]!==p||t[23]!==r||t[24]!==a||t[25]!==n||t[26]!==i.confirmDelete||t[27]!==i.delete||t[28]!==i.disable||t[29]!==i.emptyRules||t[30]!==i.enable?(E=n.length?n.filter(ge).map(e=>(0,G.jsxs)(Z,{children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:X[e.category][r]}),(0,G.jsx)(`p`,{className:`mt-3 text-sm leading-6 ${e.status===`disabled`?`text-fg-subtle line-through`:`text-fg`}`,children:e.statement})]}),(0,G.jsxs)(`span`,{className:`text-xs tabular-nums text-fg-subtle`,children:[`P`,e.priority]})]}),(0,G.jsxs)(`div`,{className:`mt-4 flex gap-2`,children:[(0,G.jsx)(A,{variant:`ghost`,onClick:async()=>{await O(e.id,{status:e.status===`active`?`disabled`:`active`}),await a()},children:e.status===`active`?i.disable:i.enable}),(0,G.jsxs)(A,{variant:`ghost`,className:`text-danger`,onClick:async()=>{if(p!==e.id){m(e.id);return}await f(e.id),m(null),await a()},children:[(0,G.jsx)(y,{className:`size-3.5`}),p===e.id?i.confirmDelete:i.delete]})]})]},e.id)):(0,G.jsx)(Q,{children:i.emptyRules}),t[22]=p,t[23]=r,t[24]=a,t[25]=n,t[26]=i.confirmDelete,t[27]=i.delete,t[28]=i.disable,t[29]=i.emptyRules,t[30]=i.enable,t[31]=E):E=t[31];let D;return t[32]!==w||t[33]!==T||t[34]!==E?(D=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[w,T,E]}),t[32]=w,t[33]=T,t[34]=E,t[35]=D):D=t[35],D}function ge(e){return e.status!==`archived`}async function _e(){let[e,t]=await Promise.all([C(),H()]);return{grants:e,connectors:t}}function ve(e){let t=(0,U.c)(39),{t:n}=e,{data:r,error:i,isLoading:o,mutate:c}=s(`you-understanding-sources`,_e);if(o){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-64 rounded-2xl`}),t[0]=e):e=t[0],e}if(i){let e;t[1]===c?e=t[2]:(e=()=>void c(),t[1]=c,t[2]=e);let r;t[3]!==n.retry||t[4]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[3]=n.retry,t[4]=e,t[5]=r):r=t[5];let i;return t[6]!==n.error||t[7]!==r?(i=(0,G.jsxs)(Q,{children:[n.error,` `,r]}),t[6]=n.error,t[7]=r,t[8]=i):i=t[8],i}let l;t[9]===r?.grants?l=t[10]:(l=r?.grants??[],t[9]=r?.grants,t[10]=l);let d=l,f;t[11]===r?.connectors?f=t[12]:(f=r?.connectors??[],t[11]=r?.connectors,t[12]=f);let p=f,m;t[13]===n.sourcesHint?m=t[14]:(m=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.sourcesHint}),t[13]=n.sourcesHint,t[14]=m);let h;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,G.jsx)(I,{className:`size-4`}),t[15]=h):h=t[15];let _;t[16]===n.manageSources?_=t[17]:(_=(0,G.jsx)(A,{asChild:!0,variant:`primary`,children:(0,G.jsxs)(a,{to:`/connectors?understanding=1&returnTo=%2Fyou%3Ftab%3Dsources`,children:[n.manageSources,h]})}),t[16]=n.manageSources,t[17]=_);let v;t[18]!==m||t[19]!==_?(v=(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[m,_]}),t[18]=m,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==d||t[22]!==c||t[23]!==n.continuous||t[24]!==n.derivedOnly||t[25]!==n.localOnly||t[26]!==n.noSources||t[27]!==n.once||t[28]!==n.refresh||t[29]!==n.revoke?(y=d.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:d.map(e=>(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsxs)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:[e.accessMode===`continuous`?n.continuous:n.once,` · `,e.processingPolicy===`local_only`?n.localOnly:e.retentionPolicy===`derived_only`?n.derivedOnly:e.retentionPolicy]}),e.lastCollectedAt?(0,G.jsx)(`p`,{className:`mt-1 text-xs text-fg-subtle`,children:new Date(e.lastCollectedAt).toLocaleString()}):null]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-1`,children:[e.accessMode===`continuous`?(0,G.jsx)(A,{variant:`ghost`,onClick:async()=>{await F(e.id),await c()},children:n.refresh}):null,(0,G.jsx)(A,{variant:`ghost`,className:`text-danger`,onClick:async()=>{await g(e.id),await c()},children:n.revoke})]})]})},e.id))}):(0,G.jsx)(Q,{children:n.noSources}),t[21]=d,t[22]=c,t[23]=n.continuous,t[24]=n.derivedOnly,t[25]=n.localOnly,t[26]=n.noSources,t[27]=n.once,t[28]=n.refresh,t[29]=n.revoke,t[30]=y):y=t[30];let b;t[31]!==p||t[32]!==n.connected||t[33]!==n.unavailable?(b=p.length?(0,G.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:p.map(e=>{let t=e.enabled&&(e.status===`connected`||e.connectionStatus===`connected`||e.authStatus===`connected`);return(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),(0,G.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:e.connectorId})]}),(0,G.jsx)(`span`,{className:`shrink-0 rounded-full px-2 py-1 text-xs ${t?`bg-success-soft text-success`:`bg-warning-soft text-warning`}`,children:t?n.connected:n.unavailable})]})},e.instanceId)})}):null,t[31]=p,t[32]=n.connected,t[33]=n.unavailable,t[34]=b):b=t[34];let x;return t[35]!==v||t[36]!==y||t[37]!==b?(x=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[v,y,b]}),t[35]=v,t[36]=y,t[37]=b,t[38]=x):x=t[38],x}function ye(e){let t=(0,U.c)(112),{lastRun:n,t:r}=e,{data:i,error:a,isLoading:o,mutate:c}=s(`you-context-settings`,m),l=i?.dreaming??null,[d,f]=te(l),p;t[0]!==d||t[1]!==l?(p=d&&l&&ee(d)!==ee(l),t[0]=d,t[1]=l,t[2]=p):p=t[2];let g=!!p,_;t[3]===c?_=t[4]:(_=async e=>{await k({dreaming:e}),await c()},t[3]=c,t[4]=_);let v;t[5]!==d||t[6]!==g||t[7]!==_?(v={value:d,dirty:g,delayMs:500,onSave:_},t[5]=d,t[6]=g,t[7]=_,t[8]=v):v=t[8];let y=B(v);if(a){let e;t[9]===c?e=t[10]:(e=()=>void c(),t[9]=c,t[10]=e);let n;t[11]!==r.retry||t[12]!==e?(n=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:r.retry}),t[11]=r.retry,t[12]=e,t[13]=n):n=t[13];let i;return t[14]!==r.error||t[15]!==n?(i=(0,G.jsxs)(Q,{children:[r.error,` `,n]}),t[14]=r.error,t[15]=n,t[16]=i):i=t[16],i}if(o||!d){let e;return t[17]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-72 rounded-2xl`}),t[17]=e):e=t[17],e}let b=n?.status===`completed`?r.runCompleted:n?.status===`failed`?r.runFailed:r.runRunning,S;t[18]===r.dreamingHint?S=t[19]:(S=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:r.dreamingHint}),t[18]=r.dreamingHint,t[19]=S);let C=y.onBlurCapture,w;t[20]===r.mode?w=t[21]:(w=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.mode}),t[20]=r.mode,t[21]=w);let T;t[22]===f?T=t[23]:(T=e=>f(t=>t&&{...t,mode:e.target.value}),t[22]=f,t[23]=T);let E;t[24]===r.on?E=t[25]:(E=(0,G.jsx)(L,{value:`review`,children:r.on}),t[24]=r.on,t[25]=E);let D;t[26]===r.off?D=t[27]:(D=(0,G.jsx)(L,{value:`off`,children:r.off}),t[26]=r.off,t[27]=D);let O;t[28]!==d.mode||t[29]!==D||t[30]!==T||t[31]!==E?(O=(0,G.jsxs)(x,{value:d.mode,onChange:T,children:[E,D]}),t[28]=d.mode,t[29]=D,t[30]=T,t[31]=E,t[32]=O):O=t[32];let j;t[33]!==O||t[34]!==w?(j=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[w,O]}),t[33]=O,t[34]=w,t[35]=j):j=t[35];let M;t[36]===r.reviewTime?M=t[37]:(M=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.reviewTime}),t[36]=r.reviewTime,t[37]=M);let N;t[38]===f?N=t[39]:(N=e=>f(t=>t&&{...t,schedule:{time:e.target.value}}),t[38]=f,t[39]=N);let P;t[40]!==d.schedule.time||t[41]!==N?(P=(0,G.jsx)(`input`,{type:`time`,className:q,value:d.schedule.time,onChange:N}),t[40]=d.schedule.time,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==M||t[44]!==P?(F=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[M,P]}),t[43]=M,t[44]=P,t[45]=F):F=t[45];let I;t[46]===r.timezone?I=t[47]:(I=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.timezone}),t[46]=r.timezone,t[47]=I);let R=d.timezone??``,V;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(V=h(),t[48]=V):V=t[48];let H;t[49]===f?H=t[50]:(H=e=>f(t=>t&&{...t,timezone:e.target.value||void 0}),t[49]=f,t[50]=H);let W;t[51]!==R||t[52]!==H?(W=(0,G.jsx)(`input`,{className:`${q} min-w-0 flex-1`,value:R,placeholder:V,onChange:H}),t[51]=R,t[52]=H,t[53]=W):W=t[53];let K;t[54]===f?K=t[55]:(K=()=>f(be),t[54]=f,t[55]=K);let J;t[56]!==r.detect||t[57]!==K?(J=(0,G.jsx)(A,{className:`shrink-0 whitespace-nowrap`,onClick:K,children:r.detect}),t[56]=r.detect,t[57]=K,t[58]=J):J=t[58];let Y;t[59]!==W||t[60]!==J?(Y=(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[W,J]}),t[59]=W,t[60]=J,t[61]=Y):Y=t[61];let X;t[62]!==I||t[63]!==Y?(X=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm sm:col-span-2`,children:[I,Y]}),t[62]=I,t[63]=Y,t[64]=X):X=t[64];let ne;t[65]===r.evidenceThreshold?ne=t[66]:(ne=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.evidenceThreshold}),t[65]=r.evidenceThreshold,t[66]=ne);let re;t[67]===f?re=t[68]:(re=e=>f(t=>t&&{...t,minEvidenceSources:Number(e.target.value)}),t[67]=f,t[68]=re);let ie;t[69]!==d.minEvidenceSources||t[70]!==re?(ie=(0,G.jsx)(`input`,{type:`number`,min:2,max:10,className:q,value:d.minEvidenceSources,onChange:re}),t[69]=d.minEvidenceSources,t[70]=re,t[71]=ie):ie=t[71];let ae;t[72]!==ne||t[73]!==ie?(ae=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[ne,ie]}),t[72]=ne,t[73]=ie,t[74]=ae):ae=t[74];let oe;t[75]===r.scanLimit?oe=t[76]:(oe=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:r.scanLimit}),t[75]=r.scanLimit,t[76]=oe);let se;t[77]===f?se=t[78]:(se=e=>f(t=>t&&{...t,limit:Number(e.target.value)}),t[77]=f,t[78]=se);let ce;t[79]!==d.limit||t[80]!==se?(ce=(0,G.jsx)(`input`,{type:`number`,min:1,max:2e3,className:q,value:d.limit,onChange:se}),t[79]=d.limit,t[80]=se,t[81]=ce):ce=t[81];let le;t[82]!==oe||t[83]!==ce?(le=(0,G.jsxs)(`label`,{className:`space-y-1.5 text-sm`,children:[oe,ce]}),t[82]=oe,t[83]=ce,t[84]=le):le=t[84];let ue;t[85]!==j||t[86]!==F||t[87]!==X||t[88]!==ae||t[89]!==le?(ue=(0,G.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[j,F,X,ae,le]}),t[85]=j,t[86]=F,t[87]=X,t[88]=ae,t[89]=le,t[90]=ue):ue=t[90];let de;t[91]!==y.error||t[92]!==y.status?(de=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:y.status,error:y.error})}),t[91]=y.error,t[92]=y.status,t[93]=de):de=t[93];let fe;t[94]!==y.onBlurCapture||t[95]!==ue||t[96]!==de?(fe=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:C,children:[ue,de]})}),t[94]=y.onBlurCapture,t[95]=ue,t[96]=de,t[97]=fe):fe=t[97];let $;t[98]===r.lastRun?$=t[99]:($=(0,G.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:r.lastRun}),t[98]=r.lastRun,t[99]=$);let pe;t[100]!==n||t[101]!==b||t[102]!==r.neverRun||t[103]!==r.runItems?(pe=n?(0,G.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-center gap-2 text-sm text-fg-muted`,children:[(0,G.jsx)(`span`,{children:b}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(`time`,{children:new Date(n.startedAt).toLocaleString()}),typeof n.metrics.scanned==`number`?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{children:`·`}),(0,G.jsxs)(`span`,{children:[String(n.metrics.scanned),` `,r.runItems]})]}):null]}):(0,G.jsx)(`p`,{className:`mt-2 text-sm text-fg-muted`,children:r.neverRun}),t[100]=n,t[101]=b,t[102]=r.neverRun,t[103]=r.runItems,t[104]=pe):pe=t[104];let me;t[105]!==$||t[106]!==pe?(me=(0,G.jsxs)(Z,{children:[$,pe]}),t[105]=$,t[106]=pe,t[107]=me):me=t[107];let he;return t[108]!==fe||t[109]!==me||t[110]!==S?(he=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[S,fe,me]}),t[108]=fe,t[109]=me,t[110]=S,t[111]=he):he=t[111],he}function be(e){return e&&{...e,timezone:h()}}function xe(e){let t=(0,U.c)(49),{t:n}=e,{data:r,error:i,isLoading:a,mutate:o}=s(`you-context-settings`,m),c=r?.privacy.sensitiveWritePolicy??null,[l,d]=te(c),f=!!(l&&c&&l!==c),p;t[0]===o?p=t[1]:(p=async e=>{await k({privacy:{sensitiveWritePolicy:e}}),await o()},t[0]=o,t[1]=p);let h;t[2]!==l||t[3]!==f||t[4]!==p?(h={value:l,dirty:f,delayMs:350,onSave:p},t[2]=l,t[3]=f,t[4]=p,t[5]=h):h=t[5];let g=B(h);if(i){let e;t[6]===o?e=t[7]:(e=()=>void o(),t[6]=o,t[7]=e);let r;t[8]!==n.retry||t[9]!==e?(r=(0,G.jsx)(`button`,{className:`text-accent hover:underline`,onClick:e,children:n.retry}),t[8]=n.retry,t[9]=e,t[10]=r):r=t[10];let i;return t[11]!==n.error||t[12]!==r?(i=(0,G.jsxs)(Q,{children:[n.error,` `,r]}),t[11]=n.error,t[12]=r,t[13]=i):i=t[13],i}if(a||!l){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,G.jsx)(u,{className:`h-56 rounded-2xl`}),t[14]=e):e=t[14],e}let _;t[15]===n.privacyHint?_=t[16]:(_=(0,G.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-fg-muted`,children:n.privacyHint}),t[15]=n.privacyHint,t[16]=_);let v;t[17]===n.sensitivePolicy?v=t[18]:(v=(0,G.jsx)(`span`,{className:`font-medium text-fg`,children:n.sensitivePolicy}),t[17]=n.sensitivePolicy,t[18]=v);let y;t[19]===d?y=t[20]:(y=e=>d(e.target.value),t[19]=d,t[20]=y);let b;t[21]===n.policyDeny?b=t[22]:(b=(0,G.jsx)(L,{value:`deny`,children:n.policyDeny}),t[21]=n.policyDeny,t[22]=b);let S;t[23]===n.policyConfirm?S=t[24]:(S=(0,G.jsx)(L,{value:`confirm`,children:n.policyConfirm}),t[23]=n.policyConfirm,t[24]=S);let C;t[25]===n.policyAllow?C=t[26]:(C=(0,G.jsx)(L,{value:`allow`,children:n.policyAllow}),t[25]=n.policyAllow,t[26]=C);let w;t[27]!==l||t[28]!==y||t[29]!==b||t[30]!==S||t[31]!==C?(w=(0,G.jsxs)(x,{value:l,onChange:y,children:[b,S,C]}),t[27]=l,t[28]=y,t[29]=b,t[30]=S,t[31]=C,t[32]=w):w=t[32];let T;t[33]!==w||t[34]!==v?(T=(0,G.jsxs)(`label`,{className:`block max-w-xl space-y-1.5 text-sm`,children:[v,w]}),t[33]=w,t[34]=v,t[35]=T):T=t[35];let E;t[36]===n.privacyWarning?E=t[37]:(E=(0,G.jsx)(`p`,{className:`mt-3 max-w-2xl text-xs leading-5 text-fg-subtle`,children:n.privacyWarning}),t[36]=n.privacyWarning,t[37]=E);let D;t[38]!==g.error||t[39]!==g.status?(D=(0,G.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,G.jsx)(z,{status:g.status,error:g.error})}),t[38]=g.error,t[39]=g.status,t[40]=D):D=t[40];let O;t[41]!==g.onBlurCapture||t[42]!==T||t[43]!==E||t[44]!==D?(O=(0,G.jsx)(Z,{children:(0,G.jsxs)(`div`,{onBlurCapture:g.onBlurCapture,children:[T,E,D]})}),t[41]=g.onBlurCapture,t[42]=T,t[43]=E,t[44]=D,t[45]=O):O=t[45];let A;return t[46]!==O||t[47]!==_?(A=(0,G.jsxs)(`div`,{className:`space-y-5`,children:[_,O]}),t[46]=O,t[47]=_,t[48]=A):A=t[48],A}export{re as UserContextPage};
|
|
@@ -1 +0,0 @@
|
|
|
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{r as i,s as a}from"./locale-store-deR2zRaE.js";import{Ra as o,ns as s}from"./index-B-_CEvIX.js";e();var c=t();function l(){return{enabled:!0,provider:`xopc-local`,alibaba:{model:`paraformer-v2`},openai:{model:`whisper-1`},providers:{"xopc-local":{model:`sensevoice-small`}},fallback:{enabled:!1,order:[`xopc-local`]}}}function u(){return{enabled:!0,provider:`edge`,trigger:`inbound`,maxTextLength:512,timeoutMs:6e4,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`},"tts-local-cli":{command:``,outputFormat:`wav`}}}function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e){return typeof e==`string`&&e.trim().length>0?e.trim():`xopc-local`}function p(e,t,n){let r=d(e.providers)?e.providers:void 0,i=r&&d(r[t])?r[t]:void 0;return{...n,...i??{}}}function m(e){let t=l();if(!d(e))return t;let n=f(e.provider),r=p(e,`alibaba`,t.alibaba??{}),i=p(e,`openai`,t.openai??{}),a=t.fallback??{enabled:!1,order:[`xopc-local`]};if(d(e.fallback)){let t=Array.isArray(e.fallback.order)?e.fallback.order.filter(e=>typeof e==`string`&&e.trim().length>0):a.order;a={enabled:typeof e.fallback.enabled==`boolean`?e.fallback.enabled:a.enabled,order:t.length?t:a.order}}let o=d(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,d(t)?{...t}:{}])):void 0;return{enabled:!!e.enabled,provider:n,alibaba:r,openai:i,...o?{providers:o}:{},fallback:a}}function h(e){return typeof e==`string`&&e.trim().length>0?e.trim():`edge`}function g(e){let t=u();if(!d(e))return t;let n=h(e.provider),r=e.trigger===`off`||e.trigger===`always`||e.trigger===`inbound`||e.trigger===`tagged`?e.trigger:`inbound`,i=t[`tts-local-cli`]??{},a=d(e.providers)?Object.fromEntries(Object.entries(e.providers).map(([e,t])=>[e,d(t)?{...t}:{}])):void 0;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,...a?{providers:a}:{},alibaba:p(e,`alibaba`,t.alibaba??{}),openai:p(e,`openai`,t.openai??{}),edge:p(e,`edge`,t.edge??{}),minimax:p(e,`minimax`,t.minimax??{}),"tts-local-cli":p(e,`tts-local-cli`,i)}}function _(e){let{alibaba:t,openai:n,providers:r,...i}=e,a={...r??{}};return t&&(a.alibaba={...a.alibaba??{},...t}),n&&(a.openai={...a.openai??{},...n}),{...i,...Object.keys(a).length>0?{providers:a}:{}}}function v(e){let{alibaba:t,openai:n,edge:r,minimax:i,"tts-local-cli":a,providers:o,...s}=e,c={...o??{}};return t&&(c.alibaba={...c.alibaba??{},...t}),n&&(c.openai={...c.openai??{},...n}),r&&(c.edge={...c.edge??{},...r}),i&&(c.minimax={...c.minimax??{},...i}),a&&(c[`tts-local-cli`]={...c[`tts-local-cli`]??{},...a}),{...s,...Object.keys(c).length>0?{providers:c}:{}}}function y(e){let t=d(e)?e:{},n=d(t.voice)?t.voice:{},r=d(n.input)?n.input:{},i=d(r.refinement)?r.refinement:{},a=i.mode===`punctuation`||i.mode===`light`||i.mode===`custom`?i.mode:`off`;return{stt:m(t.stt),tts:g(t.tts),voice:{languageMode:n.languageMode===`manual`?`manual`:`auto`,language:n.language===`zh`?`zh`:`en`,input:{refinement:{mode:a,...typeof i.model==`string`&&i.model.trim()?{model:i.model.trim()}:{},...typeof i.customInstruction==`string`?{customInstruction:i.customInstruction}:{}}}}}}async function b(){return y((await a(i(`/api/config`))).payload?.config??{})}async function x(e){await a(i(`/api/config`),{method:`PATCH`,body:JSON.stringify({stt:_(e.stt),tts:v(e.tts),voice:e.voice})}),e.voice.languageMode===`auto`&&await a(i(`/api/voice/language`),{method:`POST`,body:JSON.stringify({language:e.voice.language})}),typeof window<`u`&&window.dispatchEvent(new Event(`voice-config-changed`)),o()}async function S(){let e=await a(i(`/api/voice/models`));if(!e.payload?.models)throw Error(`Missing voice models payload`);return e.payload.models}async function C(){let e=await a(i(`/api/voice/providers`));if(!e.payload?.providers)throw Error(`Missing voice providers payload`);return e.payload}async function w(){let e=await a(i(`/api/voice/stt-providers`));if(!e.payload?.providers)throw Error(`Missing STT providers payload`);return e.payload}async function T(){let e=await a(i(`/api/voice/local/status`));if(!e.payload)throw Error(`Missing local voice status payload`);return e.payload}async function E(e){await a(i(`/api/voice/local/models/${encodeURIComponent(e)}/install`),{method:`POST`,body:`{}`})}async function D(e){await a(i(`/api/voice/local/models/${encodeURIComponent(e)}`),{method:`DELETE`})}async function O(e){let t=await a(i(`/api/voice/tts-test`),{method:`POST`,body:JSON.stringify(e)});if(t.ok===!1){let e=typeof t.error==`string`?t.error:t.error?.message;throw Error(e||`TTS test failed`)}if(!t.payload||typeof t.payload.audio!=`string`||!t.payload.audio.trim())throw Error(`TTS test returned no audio. Check the selected voice engine and try again.`);return t.payload}async function k(e){let t=await a(i(`/api/voice/reveal-api-key`),{method:`POST`,body:JSON.stringify(e)});if(!t.payload)throw Error(`Missing reveal payload`);return t.payload}var A=n();function j(e){let t=(0,c.c)(15),{kind:n,providerId:i,fieldId:a,value:o,onChange:l,labels:u,placeholder:d,className:f}=e,p=d===void 0?`sk-...`:d,m;t[0]!==n||t[1]!==i?(m=()=>k({kind:n,provider:i}).then(M),t[0]=n,t[1]=i,t[2]=m):m=t[2];let h=m,g;t[3]===f?g=t[4]:(g=r(`flex min-w-0 flex-col gap-1.5`,f),t[3]=f,t[4]=g);let _;t[5]!==a||t[6]!==u||t[7]!==l||t[8]!==p||t[9]!==h||t[10]!==o?(_=(0,A.jsx)(s,{id:a,value:o,onChange:l,placeholder:p,labels:u,reveal:h,loadFailedLabel:u.loadFailed,maskedHelp:u.maskedHelp,notInConfigFile:u.notInConfigFile,inputClassName:`text-xs`}),t[5]=a,t[6]=u,t[7]=l,t[8]=p,t[9]=h,t[10]=o,t[11]=_):_=t[11];let v;return t[12]!==g||t[13]!==_?(v=(0,A.jsx)(`div`,{className:g,children:_}),t[12]=g,t[13]=_,t[14]=v):v=t[14],v}function M(e){return e.apiKey??null}export{b as a,y as c,O as d,C as i,x as l,T as n,w as o,S as r,E as s,j as t,D as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,t as n}from"./vendor-react-BOUWij0V.js";import{f as r,l as i}from"./chunk-KS7C4IRE-BMhrPKJC.js";import{t as a}from"./check-DUBLcKHA.js";import{t as o}from"./cn-JdwAhgNB.js";import{t as ee}from"./messages-B4XqB8I6.js";import{n as te}from"./locale-store-deR2zRaE.js";import{$a as ne,At as re,Ba as s,Et as ie,Fl as ae,Ks as c,Nc as l,Qa as oe,Yl as se,Za as u,Zl as ce,ao as le,cl as ue,co as d,ds as f,eo as de,fl as p,fs as fe,gl as pe,io as me,lo as he,ms as m,no as h,oo as ge,ro as g,so as _e,to as ve}from"./index-B-_CEvIX.js";var _=e(t(),1),v=new Set([`completed`,`failed`,`canceled`]);function ye(){return new Promise(e=>window.setTimeout(e,1200))}async function be(e,t){let n=[],r=t.wait??ye;for(let i=0;i<e.length&&!t.shouldStop?.();i+=1){let a=e[i];if(a)try{await t.grantDirectory(a.rootPath);let o=await t.startRun(a.rootPath);for(t.onRun(o,i,e.length);!v.has(o.status)&&!t.shouldStop?.();)await r(),o=await t.fetchRun(o.id),t.onRun(o,i,e.length);if(n.push(o),o.status===`canceled`||t.shouldStop?.())break}catch(e){if(t.onError?.(e,a,i),t.shouldStop?.())break}}return n}var y=n(),xe=[`folder_structure`,`recent_progress`,`next_steps`];function b(e){return e instanceof Error?e.message:String(e)}function x({embedded:e=!1,onRequestClose:t}={}){let n=te(e=>e.language),v=ee(n).onboarding.workDiscovery,ye=ee(n).chat.workingDirectory,x=i(),[Se]=r(),Ce=e||Se.get(`new`)===`1`,[S,C]=(0,_.useState)(`loading`),[w,T]=(0,_.useState)(null),[E,D]=(0,_.useState)(null),[O,k]=(0,_.useState)(!1),[A,j]=(0,_.useState)(null),[we,M]=(0,_.useState)(!1),[N,P]=(0,_.useState)(``),[F,I]=(0,_.useState)(!1),[L,R]=(0,_.useState)(()=>new Set),[z,Te]=(0,_.useState)([]),[B,Ee]=(0,_.useState)(()=>new Set),[De,V]=(0,_.useState)([]),[Oe,ke]=(0,_.useState)(!1),[H,U]=(0,_.useState)({current:0,total:0}),[Ae,je]=(0,_.useState)([]),[W,Me]=(0,_.useState)(()=>new Set),G=(0,_.useRef)(!1),Ne=e=>{Me(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};(0,_.useEffect)(()=>{let e=!1;return window.electronAPI?.understandingSources?.catalog().then(t=>{e||je(t)}),()=>{e=!0}},[]);let K=(0,_.useCallback)(e=>{u.getState().updateDirectoryRun(e),D(e),e.status===`completed`?(R(new Set(e.result?.profileCandidates?.filter(e=>e.status===`pending`).map(e=>e.id)??[])),C(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`)):e.status===`failed`||e.status===`canceled`?C(`error`):C(`running`)},[]),Pe=async()=>{k(!0),j(null);try{let e=await ne();if(!e.length){j(v.noCandidates);return}Te(e),Ee(new Set([e[0].rootPath])),C(`candidates`)}catch(e){j(b(e))}finally{k(!1)}},Fe=e=>{Ee(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},Ie=(0,_.useCallback)((e,t,n)=>{u.getState().updateDirectoryRun(e),D(e),U({current:t+1,total:n}),V(n=>{let r=[...n];return r[t]=e,r}),C(`running`)},[]),Le=(0,_.useCallback)(e=>{V(t=>t.map(t=>t?.id===e.id?e:t))},[]),Re=async()=>{let e=z.filter(e=>B.has(e.rootPath));if(!e.length)return;k(!0),j(null),V([]),U({current:1,total:e.length}),ke(!0),G.current=!1;let t=!1;try{let n=await be(e,{grantDirectory:g,startRun:_e,fetchRun:h,shouldStop:()=>G.current,onRun:(e,n,r)=>{Ie(e,n,r),t||(t=!0,u.getState().collectSources(e.id,[...W]))},onError:(t,n,r)=>{U({current:r+1,total:e.length}),j(v.folderAnalysisFailed.replace(`{{folder}}`,n.displayName).replace(`{{error}}`,b(t)))}});if(G.current)return;let r=n.find(e=>e.status===`completed`)??n.at(-1);r?K(r):C(`candidates`)}catch(e){j(b(e)),C(`candidates`)}finally{ke(!1),k(!1)}},q=re({onPicked:(0,_.useCallback)(async e=>{k(!0),j(null);try{T(await me(e)),C(`consent`)}catch(e){j(b(e)),C(`intro`)}finally{k(!1)}},[])});(0,_.useEffect)(()=>{let e=!1;return ve().then(async({enabled:n,state:r})=>{if(!e){if(!n){t?t():x(`/chat`,{replace:!0});return}if(!Ce&&r.activeRunId)try{let t=await h(r.activeRunId);e||K(t);return}catch{}e||C(`intro`)}}).catch(t=>{e||(j(b(t)),C(`intro`))}),()=>{e=!0}},[K,x,t,Ce]),(0,_.useEffect)(()=>{if(!E||S!==`running`||Oe)return;let e=!1,t=async()=>{try{let t=await h(E.id);e||K(t)}catch{}},n=window.setInterval(()=>void t(),1200),r=e=>{let n=e.detail;(!n?.runId||n.runId===E.id)&&t()};for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.addEventListener(e,r);return()=>{e=!0,window.clearInterval(n);for(let e of[`work-discovery-progress`,`work-discovery-completed`,`work-discovery-failed`,`work-discovery-canceled`])window.removeEventListener(e,r)}},[K,Oe,S,E]);let J=async()=>{k(!0);try{await de()}finally{t?t():x(`/chat`,{replace:!0})}},ze=async()=>{if(w){k(!0),j(null),V([]),U({current:0,total:0});try{await g(w.canonicalRootPath);let e=await _e(w.canonicalRootPath);K(e),u.getState().collectSources(e.id,[...W])}catch(e){j(b(e)),C(`consent`)}finally{k(!1)}}},Y=(e,t)=>{let n=t?`?draft=${encodeURIComponent(t)}`:``;x(`/chat/${encodeURIComponent(e)}${n}`)},Be=e=>{D(e),M(!1),I(!1),R(new Set(e.result?.profileCandidates?.filter(e=>e.status===`pending`).map(e=>e.id)??[])),e.status===`completed`?C(e.feedback?.recognitionDecision===`confirmed`?`recommendation`:`recognition`):e.status===`failed`||e.status===`canceled`?C(`error`):C(`running`)},Ve=async()=>{E&&(G.current=!0,K(await oe(E.id)))},X=async(e,t)=>{if(!E)return;await ge(E.id,e.id).catch(()=>{});let r=t?`${n===`zh`?`先帮我评估这个方向,不要修改文件:`:`First assess this direction without changing files:`}\n\n${e.actionPrompt}`:e.actionPrompt;Y(E.sessionKey,r)},He=async()=>{if(E){k(!0),j(null);try{let e=E.result?.profileCandidates??[],t=await d((e.length>0?await he(E.id,e.map(e=>({id:e.id,status:L.has(e.id)?`accepted`:`rejected`}))):E).id,`confirmed`);D(t),Le(t),C(`recommendation`)}catch(e){j(b(e))}finally{k(!1)}}},Z=async e=>{if(!(!E||!N.trim())){k(!0),j(null);try{let t=await d(E.id,e,N.trim());D(t),Y(t.sessionKey,N.trim())}catch(e){j(b(e)),k(!1)}}},Ue=async()=>{if(E){k(!0);try{Y((await d(E.id,`dismissed`)).sessionKey)}catch(e){j(b(e)),k(!1)}}},Q=E?.result?.suggestions.find(e=>e.id===E.result?.primarySuggestionId)??E?.result?.suggestions[0],We=E?.result?.suggestions.filter(e=>e.id!==Q?.id)??[],Ge=e=>e===`command`?v.riskCommand:e===`file_write`?v.riskFileWrite:v.riskAnalysis,Ke=De.filter(e=>e?.status===`completed`),qe=e&&S===`candidates`,$=Ke.length>1?(0,y.jsxs)(`div`,{className:`mt-6 rounded-xl border border-edge bg-surface-panel p-2`,children:[(0,y.jsx)(`p`,{className:`px-2 pb-2 text-xs font-medium text-fg-muted`,children:v.analysisResults}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Ke.map(e=>{let t=z.find(t=>t.rootPath===e.rootPath)?.displayName??e.rootPath.split(/[\\/]/).filter(Boolean).at(-1)??e.rootPath;return(0,y.jsx)(`button`,{type:`button`,className:`rounded-lg px-3 py-2 text-sm font-medium transition ${e.id===E?.id?`bg-accent text-white`:`bg-surface-muted text-fg hover:bg-surface-hover`}`,onClick:()=>Be(e),children:t},e.id)})})]}):null;return(0,y.jsxs)(`div`,{className:e?`flex h-full min-h-0 flex-1 flex-col overflow-hidden bg-surface-base`:`flex min-h-full flex-1 flex-col bg-surface-base`,children:[(0,y.jsxs)(`main`,{className:e?`mx-auto flex h-full min-h-0 w-full max-w-[40rem] flex-1 flex-col px-5 py-7 sm:px-8 sm:py-9 ${qe?`overflow-hidden`:`overflow-y-auto [scrollbar-gutter:stable]`}`:`mx-auto flex w-full max-w-[40rem] flex-1 flex-col px-5 py-10 sm:px-8 sm:py-16`,children:[e?null:(0,y.jsx)(`div`,{className:`mb-10 flex items-center justify-center`,children:(0,y.jsx)(fe,{className:`size-11`})}),S===`loading`?(0,y.jsxs)(`div`,{className:`mx-auto flex min-h-[26rem] w-full max-w-md flex-col items-center`,"aria-busy":!0,children:[(0,y.jsx)(s,{className:`h-8 w-64 max-w-full`}),(0,y.jsx)(s,{className:`mt-4 h-4 w-full max-w-sm`}),(0,y.jsx)(s,{className:`mt-2 h-4 w-4/5 max-w-xs`}),(0,y.jsx)(s,{className:`mt-10 h-12 w-full rounded-xl`}),(0,y.jsx)(s,{className:`mt-3 h-11 w-full rounded-xl`}),(0,y.jsx)(s,{className:`mt-5 h-4 w-3/5 max-w-56`})]}):null,S===`intro`?(0,y.jsxs)(`section`,{className:`flex flex-1 flex-col text-center`,"aria-labelledby":`work-discovery-title`,children:[(0,y.jsxs)(`div`,{className:`mx-auto max-w-[36rem]`,children:[(0,y.jsx)(`h1`,{id:`work-discovery-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:v.title}),(0,y.jsx)(`p`,{className:`mx-auto mt-3 max-w-[34rem] text-[0.95rem] leading-7 text-fg-muted`,children:v.subtitle})]}),(0,y.jsxs)(`div`,{className:`mx-auto mt-9 w-full max-w-md`,children:[Ae.length?(0,y.jsxs)(`div`,{className:`mb-5 rounded-xl border border-edge bg-surface-panel p-3 text-left`,children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v.localSourcesTitle}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:v.localSourcesSubtitle}),(0,y.jsx)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3`,children:Ae.map(e=>{let t=W.has(e.id);return(0,y.jsxs)(`button`,{type:`button`,className:o(`flex min-h-16 flex-col items-center justify-center gap-1 rounded-lg border px-2 py-2 text-xs font-medium transition-colors`,t?`border-accent/40 bg-accent-soft text-accent-fg`:`border-edge bg-surface-base text-fg-muted hover:bg-surface-hover hover:text-fg`),"aria-pressed":t,onClick:()=>Ne(e.id),children:[(0,y.jsx)(`span`,{className:o(`flex size-4 items-center justify-center rounded-full border`,t?`border-accent bg-accent text-white`:`border-edge`),children:t?(0,y.jsx)(a,{className:`size-3`,"aria-hidden":!0}):null}),e.displayName]},e.id)})})]}):null,(0,y.jsxs)(f,{type:`button`,className:`h-12 w-full gap-2 bg-accent text-white hover:bg-accent-hover`,onClick:()=>void Pe(),disabled:O||q.picking,children:[O?(0,y.jsx)(l,{className:`size-4 animate-spin`}):(0,y.jsx)(c,{className:`size-4`}),v.quickScan]}),(0,y.jsxs)(f,{type:`button`,variant:`secondary`,className:`mt-3 h-11 w-full gap-2`,onClick:q.pick,disabled:O||q.picking,children:[q.picking?(0,y.jsx)(l,{className:`size-4 animate-spin`}):(0,y.jsx)(p,{className:`size-4`}),v.chooseFolderManually]}),(0,y.jsxs)(`div`,{className:`mt-4 flex items-start justify-center gap-2 text-xs leading-5 text-fg-muted`,children:[(0,y.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,y.jsx)(`span`,{children:v.quickScanNote})]}),(0,y.jsx)(`button`,{type:`button`,className:`mt-4 text-sm font-medium text-accent-fg hover:underline`,onClick:()=>x(`/connectors?understanding=1&returnTo=%2Fonboarding%2Fworkspace`),children:v.connectCloudSource}),A?(0,y.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:A}):null]}),(0,y.jsx)(`button`,{type:`button`,className:`mx-auto mt-auto pt-10 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void J(),disabled:O,children:v.skip})]}):null,S===`candidates`?(0,y.jsxs)(`section`,{className:e?`flex h-full min-h-0 flex-col`:void 0,"aria-labelledby":`work-discovery-candidates-title`,children:[(0,y.jsxs)(`div`,{className:e?`shrink-0 text-center`:`text-center`,children:[(0,y.jsx)(`h1`,{id:`work-discovery-candidates-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:v.candidatesTitle}),(0,y.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:v.candidatesSubtitle})]}),(0,y.jsx)(`div`,{className:e?`mt-5 min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain pr-1 [scrollbar-gutter:stable]`:`mt-7 space-y-2`,children:z.map((e,t)=>{let n=B.has(e.rootPath);return(0,y.jsxs)(`button`,{type:`button`,"aria-pressed":n,className:`flex w-full items-start gap-3 rounded-xl border p-4 text-left transition ${n?`border-accent bg-accent-soft/45`:`border-edge bg-surface-panel hover:border-edge-strong`}`,onClick:()=>Fe(e.rootPath),children:[(0,y.jsx)(`span`,{className:`mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-md border ${n?`border-accent bg-accent text-white`:`border-edge bg-surface-base text-transparent`}`,children:(0,y.jsx)(a,{className:`size-3.5`})}),(0,y.jsx)(p,{className:`mt-0.5 size-5 shrink-0 text-accent-fg`}),(0,y.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,y.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`truncate text-sm font-medium text-fg`,children:e.displayName}),t===0?(0,y.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[0.7rem] font-medium text-accent-fg`,children:v.recommendedCandidate}):null]}),(0,y.jsx)(`span`,{className:`mt-1 block truncate font-mono text-xs text-fg-muted`,children:e.rootPath}),(0,y.jsxs)(`span`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-1 text-xs text-fg-muted`,children:[(0,y.jsx)(`span`,{children:e.projectKind===`coding`?v.codingProject:e.projectKind===`general`?v.generalProject:v.unknownProject}),e.branch?(0,y.jsx)(`span`,{children:v.branchValue.replace(`{{branch}}`,e.branch)}):null,e.changedFileCount>0?(0,y.jsx)(`span`,{children:v.changedFiles.replace(`{{count}}`,String(e.changedFileCount))}):null]})]})]},e.id)})}),(0,y.jsxs)(`div`,{className:e?`shrink-0 border-t border-edge-subtle pt-4`:void 0,children:[(0,y.jsxs)(`div`,{className:`${e?``:`mt-5 `}flex items-start gap-2 rounded-xl border border-edge-subtle bg-surface-panel px-4 py-3 text-xs leading-5 text-fg-muted`,children:[(0,y.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,y.jsx)(`span`,{children:v.multiFolderPrivacyNote})]}),A?(0,y.jsx)(`p`,{className:`mt-3 text-sm text-danger`,role:`alert`,children:A}):null,(0,y.jsxs)(`div`,{className:`${e?`mt-4`:`mt-7`} flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,y.jsxs)(f,{type:`button`,className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,disabled:O||B.size===0,onClick:()=>void Re(),children:[O?(0,y.jsx)(l,{className:`mr-2 size-4 animate-spin`}):null,v.analyzeSelected.replace(`{{count}}`,String(B.size))]}),(0,y.jsx)(f,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:O,onClick:q.pick,children:v.chooseFolderManually})]}),(0,y.jsx)(`button`,{type:`button`,className:`${e?`mt-3`:`mt-6`} mx-auto block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>C(`intro`),children:v.back})]})]}):null,S===`consent`&&w?(0,y.jsxs)(`section`,{"aria-labelledby":`work-discovery-consent-title`,children:[(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`h1`,{id:`work-discovery-consent-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:v.selectedTitle}),(0,y.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:v.selectedSubtitle})]}),(0,y.jsxs)(`div`,{className:`mt-8 overflow-hidden rounded-xl border border-edge bg-surface-panel`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-edge-subtle px-4 py-3.5`,children:[(0,y.jsx)(p,{className:`size-5 shrink-0 text-accent-fg`}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`p`,{className:`truncate text-sm font-medium text-fg`,children:w.displayName}),(0,y.jsx)(`p`,{className:`truncate font-mono text-xs text-fg-muted`,children:w.canonicalRootPath})]}),(0,y.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2.5 py-1 text-xs font-medium text-accent-fg`,children:w.projectKind===`coding`?v.codingProject:w.projectKind===`general`?v.generalProject:v.unknownProject})]}),(0,y.jsxs)(`div`,{className:`grid gap-3 border-b border-edge-subtle bg-surface-base/60 p-4 sm:grid-cols-2`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:v.localFingerprint}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:w.fingerprint.branch?v.branchValue.replace(`{{branch}}`,w.fingerprint.branch):v.noGitBranch})]}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:v.recentActivity}),(0,y.jsx)(`p`,{className:`mt-1 text-sm text-fg`,children:v.changedFiles.replace(`{{count}}`,String(w.fingerprint.changedFileCount))})]}),w.fingerprint.recentAreas.length>0?(0,y.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,y.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:v.recentAreas}),(0,y.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1.5`,children:w.fingerprint.recentAreas.map(e=>(0,y.jsx)(`code`,{className:`rounded-md bg-surface-muted px-2 py-1 text-xs text-fg`,children:e},e))})]}):null]}),(0,y.jsxs)(`div`,{className:`divide-y divide-edge-subtle px-4`,children:[(0,y.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,y.jsx)(pe,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v.willRead}),(0,y.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:v.willReadValue})]})]}),(0,y.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,y.jsx)(m,{className:`mt-0.5 size-4 shrink-0 text-fg-muted`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v.willIgnore}),(0,y.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg-muted`,children:v.willIgnoreValue})]})]}),(0,y.jsxs)(`div`,{className:`flex gap-3 py-4`,children:[(0,y.jsx)(c,{className:`mt-0.5 size-4 shrink-0 text-accent-fg`}),(0,y.jsx)(`p`,{className:`text-sm leading-6 text-fg-muted`,children:w.remoteModel?v.providerDisclosure.replace(`{{provider}}`,w.provider):v.localDisclosure})]})]})]}),A?(0,y.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:A}):null,(0,y.jsxs)(`div`,{className:`mt-7 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,y.jsxs)(f,{type:`button`,className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,disabled:O,onClick:()=>void ze(),children:[O?(0,y.jsx)(l,{className:`mr-2 size-4 animate-spin`}):null,v.startAnalysis]}),(0,y.jsx)(f,{type:`button`,variant:`secondary`,className:`h-11 flex-1`,disabled:O,onClick:q.pick,children:v.changeFolder})]}),(0,y.jsx)(`button`,{type:`button`,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>void J(),children:v.skip})]}):null,S===`running`&&E?(0,y.jsxs)(`section`,{"aria-labelledby":`work-discovery-running-title`,"aria-live":`polite`,children:[(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`h1`,{id:`work-discovery-running-title`,className:`text-2xl font-semibold tracking-tight text-fg`,children:v.analyzingTitle}),(0,y.jsx)(`p`,{className:`mt-3 text-[0.95rem] leading-7 text-fg-muted`,children:v.analyzingSubtitle}),H.total>1?(0,y.jsx)(`p`,{className:`mt-2 text-sm font-medium text-accent-fg`,children:v.analyzingFolderProgress.replace(`{{current}}`,String(H.current)).replace(`{{total}}`,String(H.total))}):null]}),(0,y.jsx)(`div`,{className:`mt-9 rounded-xl border border-edge bg-surface-panel px-5 py-2`,children:xe.map((e,t)=>{let n=Math.max(0,xe.indexOf(E.stage??`folder_structure`)),r=t<n,i=t===n;return(0,y.jsxs)(`div`,{className:`flex items-center gap-4 border-b border-edge-subtle py-4 last:border-b-0`,children:[(0,y.jsx)(`span`,{className:`flex size-7 items-center justify-center rounded-full ${r?`bg-accent text-white`:i?`bg-accent-soft text-accent-fg`:`bg-surface-muted text-fg-subtle`}`,children:r?(0,y.jsx)(a,{className:`size-4`}):i?(0,y.jsx)(l,{className:`size-4 animate-spin motion-reduce:animate-none`}):(0,y.jsx)(`span`,{className:`size-1.5 rounded-full bg-current`})}),(0,y.jsx)(`span`,{className:i||r?`text-sm font-medium text-fg`:`text-sm text-fg-muted`,children:v.stages[e]})]},e)})}),(0,y.jsx)(`p`,{className:`mt-4 truncate text-center font-mono text-xs text-fg-muted`,children:E.rootPath}),(0,y.jsxs)(`div`,{className:`mx-auto mt-7 flex max-w-md flex-col gap-3`,children:[(0,y.jsx)(f,{type:`button`,variant:`secondary`,className:`h-11 w-full`,onClick:()=>x(`/chat`),children:v.continueInBackground}),(0,y.jsx)(`button`,{type:`button`,className:`mx-auto text-sm text-fg-muted hover:text-danger hover:underline`,onClick:()=>void Ve(),children:v.cancelAnalysis})]})]}):null,S===`recognition`&&E?.result?(0,y.jsxs)(`section`,{"aria-labelledby":`work-discovery-recognition-title`,children:[(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:v.recognitionEyebrow}),(0,y.jsx)(`h1`,{id:`work-discovery-recognition-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:E.result.lowConfidence?v.lowConfidenceTitle:v.recognitionTitle})]}),$,(0,y.jsxs)(`div`,{className:`mt-7 rounded-2xl border border-accent/25 bg-gradient-to-br from-accent-soft/45 via-surface-panel to-surface-panel p-5 sm:p-6`,children:[(0,y.jsx)(`p`,{className:`text-base font-medium leading-7 text-fg`,children:E.result.projectSummary}),(0,y.jsx)(`p`,{className:`mt-3 text-sm leading-6 text-fg-muted`,children:E.result.currentState}),!E.result.lowConfidence&&Q?.evidence.length?(0,y.jsx)(`ul`,{className:`mt-5 space-y-2 border-t border-edge-subtle pt-4`,children:Q.evidence.slice(0,3).map((e,t)=>(0,y.jsxs)(`li`,{className:`flex gap-2 text-xs leading-5 text-fg-muted`,children:[(0,y.jsx)(ue,{className:`mt-0.5 size-3.5 shrink-0 text-accent-fg`}),(0,y.jsxs)(`span`,{children:[e.path?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`code`,{className:`font-mono text-fg`,children:e.path}),`: `]}):null,e.observation]})]},`${Q.id}-recognition-${t}`))}):null]}),E.result.workThreads?.length?(0,y.jsxs)(`div`,{className:`mt-5 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v.workThreadsTitle}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:v.workThreadsSubtitle}),(0,y.jsx)(`div`,{className:`mt-3 divide-y divide-edge-subtle`,children:E.result.workThreads.map(e=>(0,y.jsxs)(`div`,{className:`py-3 first:pt-0 last:pb-0`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`rounded-full bg-accent-soft px-2 py-0.5 text-[0.7rem] font-medium text-accent-fg`,children:e.horizon===`current`?v.workThreadCurrent:e.horizon===`ongoing`?v.workThreadOngoing:v.workThreadLongTerm}),(0,y.jsx)(`span`,{className:`text-sm font-medium text-fg`,children:e.title})]}),(0,y.jsx)(`p`,{className:`mt-1.5 text-xs leading-5 text-fg-muted`,children:e.summary})]},e.id))})]}):null,E.result.profileCandidates?.length?(0,y.jsxs)(`div`,{className:`mt-5 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,y.jsx)(`p`,{className:`text-sm font-medium text-fg`,children:v.profileCandidatesTitle}),(0,y.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:v.profileCandidatesSubtitle}),(0,y.jsx)(`div`,{className:`mt-3 space-y-2`,children:E.result.profileCandidates.map(e=>(0,y.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg px-2 py-2 hover:bg-surface-muted`,children:[(0,y.jsx)(`input`,{type:`checkbox`,className:`mt-0.5 size-4 rounded border-edge accent-accent`,checked:L.has(e.id),onChange:()=>R(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}),(0,y.jsx)(`span`,{className:`text-sm leading-5 text-fg`,children:e.statement})]},e.id))})]}):null,E.result.lowConfidence?(0,y.jsxs)(`div`,{className:`mt-5`,children:[(0,y.jsx)(`p`,{className:`text-sm font-medium leading-6 text-fg`,children:E.result.contextQuestion}),(0,y.jsx)(`textarea`,{value:N,onChange:e=>P(e.target.value),placeholder:v.correctionPlaceholder,className:`mt-3 min-h-24 w-full resize-y rounded-xl border border-edge bg-surface-panel px-3 py-2.5 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,y.jsx)(f,{className:`mt-3 w-full bg-accent text-white hover:bg-accent-hover`,disabled:O||!N.trim(),onClick:()=>void Z(`different_goal`),children:v.continueWithCorrection})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`mt-6 flex flex-col gap-3 sm:flex-row-reverse`,children:[(0,y.jsxs)(f,{className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,disabled:O,onClick:()=>void He(),children:[O?(0,y.jsx)(l,{className:`size-4 animate-spin`}):(0,y.jsx)(a,{className:`size-4`}),v.confirmUnderstanding]}),(0,y.jsx)(f,{variant:`secondary`,className:`h-11 flex-1`,disabled:O,onClick:()=>M(e=>!e),children:v.notQuiteRight})]}),we?(0,y.jsxs)(`div`,{className:`mt-4 rounded-xl border border-edge bg-surface-panel p-4`,children:[(0,y.jsx)(`label`,{className:`text-sm font-medium text-fg`,htmlFor:`work-discovery-correction`,children:v.correctionLabel}),(0,y.jsx)(`textarea`,{id:`work-discovery-correction`,value:N,onChange:e=>P(e.target.value),placeholder:v.correctionPlaceholder,className:`mt-2 min-h-24 w-full resize-y rounded-lg border border-edge bg-surface-base px-3 py-2.5 text-sm text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/15`}),(0,y.jsxs)(`div`,{className:`mt-3 flex flex-wrap justify-end gap-2`,children:[(0,y.jsx)(f,{variant:`ghost`,disabled:O||!N.trim(),onClick:()=>void Z(`different_goal`),children:v.differentGoal}),(0,y.jsx)(f,{variant:`primary`,disabled:O||!N.trim(),onClick:()=>void Z(`corrected`),children:v.useCorrection})]})]}):null]}),A?(0,y.jsx)(`p`,{className:`mt-4 text-sm text-danger`,role:`alert`,children:A}):null,(0,y.jsx)(`button`,{type:`button`,disabled:O,className:`mx-auto mt-6 block text-sm text-fg-muted hover:text-fg hover:underline disabled:opacity-60`,onClick:()=>void Ue(),children:v.openConversation})]}):null,S===`recommendation`&&E?.result&&Q?(0,y.jsxs)(`section`,{"aria-labelledby":`work-discovery-recommendation-title`,children:[(0,y.jsxs)(`div`,{className:`text-center`,children:[(0,y.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.16em] text-accent-fg`,children:v.understandingConfirmed}),(0,y.jsx)(`h1`,{id:`work-discovery-recommendation-title`,className:`mt-2 text-2xl font-semibold tracking-tight text-fg`,children:v.primaryRecommendationTitle})]}),$,(0,y.jsx)(`article`,{className:`mt-7 rounded-2xl border border-accent/30 bg-surface-panel p-5 sm:p-6`,children:(0,y.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,y.jsx)(`div`,{className:`flex size-9 shrink-0 items-center justify-center rounded-xl bg-accent-soft text-accent-fg`,children:(0,y.jsx)(se,{className:`size-5`})}),(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,y.jsx)(`h2`,{className:`text-lg font-semibold text-fg`,children:Q.title}),(0,y.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:Q.rationale}),(0,y.jsxs)(`div`,{className:`mt-4 flex flex-wrap gap-2 text-xs`,children:[(0,y.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-surface-muted px-2.5 py-1 text-fg-muted`,children:[(0,y.jsx)(ae,{className:`size-3.5`}),v.estimatedMinutes.replace(`{{count}}`,String(Q.estimatedMinutes))]}),(0,y.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2.5 py-1 text-fg-muted`,children:Ge(Q.risk)})]}),(0,y.jsxs)(`div`,{className:`mt-4 rounded-xl bg-surface-base px-4 py-3`,children:[(0,y.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:v.expectedTask}),(0,y.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-fg`,children:Q.expectedTask})]}),(0,y.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,y.jsx)(f,{className:`h-10 bg-accent px-4 text-white hover:bg-accent-hover`,onClick:()=>void X(Q,!1),children:v.startRecommendedAction}),(0,y.jsx)(f,{className:`h-10 px-4`,variant:`secondary`,onClick:()=>void X(Q,!0),children:v.explainFirst})]})]})]})}),We.length>0?(0,y.jsxs)(`div`,{className:`mt-5 border-t border-edge-subtle pt-4`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between py-2 text-sm font-medium text-fg-muted hover:text-fg`,onClick:()=>I(e=>!e),children:[v.otherDirections,(0,y.jsx)(ce,{className:`size-4 transition-transform ${F?`rotate-180`:``}`})]}),F?(0,y.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle rounded-xl border border-edge bg-surface-panel px-4`,children:We.map(e=>(0,y.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-3 py-4 text-left`,onClick:()=>void X(e,!0),children:[(0,y.jsx)(se,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle`}),(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`span`,{className:`block text-sm font-medium text-fg`,children:e.title}),(0,y.jsx)(`span`,{className:`mt-1 block text-xs leading-5 text-fg-muted`,children:e.expectedTask})]})]},e.id))}):null]}):null,(0,y.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-3`,children:[(0,y.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Y(E.sessionKey),children:v.doSomethingElse}),(0,y.jsx)(`button`,{type:`button`,className:`text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>{M(!0),C(`recognition`)},children:v.correctUnderstanding})]})]}):null,S===`error`&&E?(0,y.jsxs)(`section`,{className:`text-center`,"aria-labelledby":`work-discovery-error-title`,children:[(0,y.jsx)(`div`,{className:`mx-auto flex size-11 items-center justify-center rounded-xl bg-danger-soft text-danger`,children:(0,y.jsx)(m,{className:`size-5`})}),(0,y.jsx)(`h1`,{id:`work-discovery-error-title`,className:`mt-5 text-2xl font-semibold tracking-tight text-fg`,children:v.errorTitle}),(0,y.jsx)(`p`,{className:`mx-auto mt-3 max-w-lg text-sm leading-6 text-fg-muted`,children:E.errorMessage}),(0,y.jsxs)(`div`,{className:`mx-auto mt-7 flex max-w-md flex-col gap-3 sm:flex-row-reverse`,children:[(0,y.jsx)(f,{className:`h-11 flex-1 bg-accent text-white hover:bg-accent-hover`,onClick:()=>void le(E.id).then(K),children:v.retry}),(0,y.jsx)(f,{variant:`secondary`,className:`h-11 flex-1`,onClick:()=>{D(null),T(null),C(`intro`)},children:v.chooseDifferent})]}),(0,y.jsx)(`button`,{type:`button`,className:`mt-6 text-sm text-fg-muted hover:text-fg hover:underline`,onClick:()=>Y(E.sessionKey),children:v.openConversation})]}):null]}),q.hasNativePicker?null:(0,y.jsx)(ie,{open:q.modalOpen,onOpenChange:q.setModalOpen,initialAbsolutePath:w?.canonicalRootPath,onConfirm:q.confirmPick,wd:ye})]})}export{x as WorkDiscoveryPage};
|