@xopcai/xopc 0.0.162 → 0.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/README.zh-CN.md +4 -2
- 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-hpcNv9MZ.js → activity-store-DkALQFJT.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Zf9UQEmQ.js → agent-avatar-dicebear-RpxkQtQ3.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CxpwxMPE.js +2 -0
- package/dist/gateway/static/root/assets/{api-Dnatri09.js → api-DPIXEcIq.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BBTR9wJP.js → app-management-settings-panel-DLdjfMXB.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C2zpLCHD.js → appearance-settings-C89-uxkq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-k-tZbaRB.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-9eR_ODY1.js → archive-plugin-CqbH5geE.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-DPuWYUeX.js → attachment-load-CeU4Qiot.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-Dw49OJRl.js → automation-suggestion-card-WiOuqXq9.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Bdn3dgC_.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BdkJpDFm.js → binary-plugins-C5TdzrhJ.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CAi7SXYU.js → block-editor-BjvWhphG.js} +39 -39
- package/dist/gateway/static/root/assets/browser-settings-page-GsVTGfGs.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-Dx6wkGz1.js → browser-workflow-inputs-DXmzQ3nk.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Skertc-A.js → browser-workflows-page-C1-ptRe4.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-6d4kVjzl.js +2 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-CNFl7dM3.js → capability-presets-api-C0pVlUyc.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DCxy5Ls_.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-DYQyGDw4.js → channel-recipient-api-B5rLegwk.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Bg3P8k0f.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-DZZq0upi.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-Bng6kxYF.js → connector-logo-CuI5w4qM.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-6UR7yhIZ.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-Bpf6oegd.js → desktop-pet-BvG8vDXZ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BVUyefSd.js → desktop-pet-settings-CR__kZ8C.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DjSZAPz_.js → directory-picker-path-field-BblWMz3e.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-CAZk2AM4.js → dreaming-settings-DHMPugDE.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-C2F6vTTd.js → extension-debug-page-ByVY1gZg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-AnIt4bn4.js → extension-page-DLCKKtbK.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-M-rhlFBC.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DLFyZv33.js → gateway-config-api-DZHqhbXH.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DnQAA-qq.js → gateway-settings-CZswIehx.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DbzLyJ3R.js → gateway-startup-retry-ulwTJovP.js} +1 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-TbyRfDas.js +1 -0
- package/dist/gateway/static/root/assets/goal-detail-page-B-QBVOf2.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-REmr3QCr.js → goals-config-api-DMxG6f0N.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-BGxki8BR.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-Dz0F3uRO.js → goals-settings-G-w1gCYD.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-CQFY5gYs.js → heartbeat-settings-Csb90R59.js} +1 -1
- package/dist/gateway/static/root/assets/index-BXtJvaQl.css +1 -0
- package/dist/gateway/static/root/assets/{index-C8JkTS6d.js → index-CGwuxvzr.js} +70 -70
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BnOQXU5k.js → keyboard-shortcuts-settings-C_Bl3YOr.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BR2tBhO3.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-KsOtWOyM.js → local-apps-page-_8Rv-tSk.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-0lpYdNDr.js → locale-store-C_ax27uc.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CwF0C_Z2.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-D5GRg10r.js → markdown-split-CZnZS6gq.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C1ryULGs.js → media-plugins-C2XLYC6G.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C96Zjb0V.js +5 -0
- package/dist/gateway/static/root/assets/{notes-page-CIeZ1_DT.js → notes-page-BkuZxTFo.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CD4FADi7.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-Caj1-E_X.js → page-tabs-DR2FGC4E.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DKwEce-9.js → preview-open-alternatives-B65O8wBL.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B90ZskkN.js → product-open-page-Cag-utLH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-COKtUblD.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-QYmqanBN.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BU_gBU0f.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BDYt53uQ.js → save-bar-controls-DCWpFnPc.js} +1 -1
- package/dist/gateway/static/root/assets/schedule-field-ClacZdvE.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-D7oCARF7.js → schema-form-BVlbEipU.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-u-Pjbzfm.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-1Yck1PKq.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-CARTHCxH.js → settings-form-section-GSNlQWSW.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DEwYqESe.js → settings-loading-skeleton-08Ae5sB_.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B6vVdHeQ.js → settings-page-BseJD4I-.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D3srt5Bi.js → settings-page-layout-bSliH-Y3.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGRhJVlt.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-Ck9SxiXw.js → share-preview-page-C114OpTx.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BRFpWFgI.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-cVjU2GnN.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-CoMTjtRT.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DLBUQSk2.js → system-settings-panel-El8cDcTY.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-C1oaqeD2.js → theme-store-D37XLD_C.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-CU7hhD8T.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-Divbg_C4.js → typed-models-lib-kToxD7Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CP9a_rAf.js → use-channel-catalog-DBh0dOC9.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-C0xYCSXB.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-DzEpwYaU.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-DakZqR85.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CswqPbTT.js +1 -0
- package/dist/gateway/static/root/assets/work-page-DYRXEk8m.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DbDPYQwB.js → workflow-run-setup-panel-BwSxyVMM.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CiLSYGuN.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/src/agent/client-error-format.d.ts +1 -1
- package/dist/src/agent/client-error-format.js +6 -2
- package/dist/src/agent/embedded/model-runtime.d.ts +4 -0
- package/dist/src/agent/embedded/model-runtime.js +49 -0
- package/dist/src/agent/embedded/run-for-session.js +38 -31
- package/dist/src/agent/embedded/session-runner.d.ts +1 -0
- package/dist/src/agent/embedded/session-runner.js +13 -5
- package/dist/src/agent/failover-error.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-compatible-image-provider.d.ts +2 -6
- package/dist/src/agent/image/generation/openai-compatible-image-provider.js +1 -3
- package/dist/src/agent/image/generation/provider-registry.d.ts +5 -46
- package/dist/src/agent/image/generation/provider-registry.js +24 -73
- package/dist/{extensions/dashscope/src/image-generation-provider.d.ts → src/agent/image/generation/providers/dashscope.d.ts} +3 -6
- package/dist/{extensions/dashscope/src/image-generation-provider.js → src/agent/image/generation/providers/dashscope.js} +36 -59
- package/dist/{extensions/fal/src/image-generation-provider.d.ts → src/agent/image/generation/providers/fal.d.ts} +1 -1
- package/dist/{extensions/fal/src/image-generation-provider.js → src/agent/image/generation/providers/fal.js} +19 -29
- package/dist/{extensions/google/src/image-generation-provider.d.ts → src/agent/image/generation/providers/google.d.ts} +2 -2
- package/dist/{extensions/google/src/image-generation-provider.js → src/agent/image/generation/providers/google.js} +23 -30
- package/dist/{extensions/minimax/src/image-generation-provider.d.ts → src/agent/image/generation/providers/minimax.d.ts} +2 -5
- package/dist/{extensions/minimax/src/image-generation-provider.js → src/agent/image/generation/providers/minimax.js} +35 -51
- package/dist/{extensions/openai/src/image-generation-provider.d.ts → src/agent/image/generation/providers/openai.d.ts} +2 -2
- package/dist/{extensions/openai/src/image-generation-provider.js → src/agent/image/generation/providers/openai.js} +13 -38
- package/dist/src/agent/image/generation/runtime-types.d.ts +1 -0
- package/dist/src/agent/image/generation/runtime.d.ts +1 -3
- package/dist/src/agent/image/generation/runtime.js +6 -6
- package/dist/src/agent/image/generation/types.d.ts +23 -3
- package/dist/src/agent/image/index.d.ts +1 -1
- package/dist/src/agent/image/index.js +2 -2
- package/dist/src/agent/media-generation/runtime-shared.d.ts +2 -0
- package/dist/src/agent/media-generation/runtime-shared.js +1 -0
- package/dist/src/agent/tools/factory.js +4 -1
- package/dist/src/agent/tools/image-generate-tool.d.ts +2 -0
- package/dist/src/agent/tools/image-generate-tool.js +14 -7
- package/dist/src/auth/credentials.js +45 -2
- package/dist/src/auth/index.js +2 -1
- package/dist/src/auth/oauth/anthropic.js +27 -24
- package/dist/src/auth/oauth/github-copilot.js +20 -15
- package/dist/src/auth/oauth/google-antigravity.js +9 -2
- package/dist/src/auth/oauth/google-gemini-cli.js +9 -2
- package/dist/src/auth/oauth/google-oauth/google-antigravity.js +47 -40
- package/dist/src/auth/oauth/google-oauth/google-gemini-cli.js +48 -41
- package/dist/src/auth/oauth/google-oauth/oauth-page.js +7 -2
- package/dist/src/auth/oauth/google-oauth/pkce.js +4 -1
- package/dist/src/auth/oauth/index.d.ts +2 -0
- package/dist/src/auth/oauth/index.js +24 -10
- package/dist/src/auth/oauth/kimi-coding.js +76 -71
- package/dist/src/auth/oauth/minimax-cn.js +78 -73
- package/dist/src/auth/oauth/minimax.js +78 -73
- package/dist/src/auth/oauth/openai-codex.js +31 -25
- package/dist/src/auth/oauth/pkce.js +4 -1
- package/dist/src/auth/oauth/registry.d.ts +13 -0
- package/dist/src/auth/oauth/registry.js +65 -0
- package/dist/src/auth/oauth/xopc-cloud.d.ts +2 -0
- package/dist/src/auth/oauth/xopc-cloud.js +101 -0
- package/dist/src/auth/sync-provider-auth.d.ts +3 -0
- package/dist/src/auth/sync-provider-auth.js +17 -1
- package/dist/src/cli/commands/models.js +2 -5
- package/dist/src/cli/commands/onboard/model.js +3 -2
- package/dist/src/cli/commands/setup-shared/types.d.ts +1 -1
- package/dist/src/cli/utils/oauth-providers.d.ts +3 -26
- package/dist/src/cli/utils/oauth-providers.js +6 -80
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/models-json.d.ts +6 -0
- package/dist/src/config/models-json.js +10 -6
- package/dist/src/config/schema.d.ts +26 -15
- package/dist/src/config/schema.js +23 -12
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/app.js +12 -6
- package/dist/src/gateway/hono/lib/safe-providers-config.d.ts +0 -3
- package/dist/src/gateway/hono/lib/safe-providers-config.js +1 -3
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +8 -1
- package/dist/src/gateway/hono/oauth-async.js +3 -19
- package/dist/src/gateway/hono/oauth.js +3 -19
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -11
- package/dist/src/gateway/hono/routes/deps.d.ts +1 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -2
- package/dist/src/gateway/hono/routes/models.js +96 -128
- package/dist/src/gateway/image-generation-setup.d.ts +40 -0
- package/dist/src/gateway/image-generation-setup.js +130 -0
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +10 -0
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/media-shared/http/private-network.d.ts +1 -1
- package/dist/src/media-shared/http/private-network.js +1 -1
- package/dist/src/providers/auth-runtime/resolve-api-key.d.ts +2 -4
- package/dist/src/providers/auth-runtime/resolve-api-key.js +2 -4
- package/dist/src/providers/auth-runtime/resolve-auth.d.ts +3 -4
- package/dist/src/providers/auth-runtime/resolve-auth.js +18 -18
- package/dist/src/providers/domestic-presets.d.ts +2 -0
- package/dist/src/providers/index.js +9 -0
- package/dist/src/providers/model-catalog-store.d.ts +33 -0
- package/dist/src/providers/model-catalog-store.js +63 -0
- package/dist/src/providers/model-catalog-sync-service.d.ts +40 -0
- package/dist/src/providers/model-catalog-sync-service.js +132 -0
- package/dist/src/providers/model-reference-auditor.d.ts +14 -0
- package/dist/src/providers/model-reference-auditor.js +71 -0
- package/dist/src/providers/model-registry.d.ts +4 -1
- package/dist/src/providers/model-registry.js +33 -2
- package/dist/src/providers/presentation.js +2 -0
- package/dist/src/providers/xopc-cloud-model-source.d.ts +30 -0
- package/dist/src/providers/xopc-cloud-model-source.js +68 -0
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.d.ts +2 -0
- package/dist/src/session/session-title.js +24 -3
- package/dist/src/work-discovery/analyzer.js +27 -14
- package/package.json +5 -7
- package/dist/extensions/dashscope/src/index.d.ts +0 -4
- package/dist/extensions/dashscope/src/index.js +0 -2
- package/dist/extensions/dashscope/xopc.extension.json +0 -15
- package/dist/extensions/fal/src/index.d.ts +0 -4
- package/dist/extensions/fal/src/index.js +0 -2
- package/dist/extensions/fal/xopc.extension.json +0 -14
- package/dist/extensions/google/src/index.d.ts +0 -4
- package/dist/extensions/google/src/index.js +0 -2
- package/dist/extensions/google/xopc.extension.json +0 -14
- package/dist/extensions/minimax/src/index.d.ts +0 -4
- package/dist/extensions/minimax/src/index.js +0 -2
- package/dist/extensions/minimax/xopc.extension.json +0 -15
- package/dist/extensions/openai/src/index.d.ts +0 -4
- package/dist/extensions/openai/src/index.js +0 -2
- package/dist/extensions/openai/xopc.extension.json +0 -14
- package/dist/gateway/static/root/assets/agents-DfVkZlHc.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-BMtAa4Ra.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-BiSAMYTr.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DHmaEJS2.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B5wSgf4f.js +0 -2
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DyvFZwBj.js +0 -2
- package/dist/gateway/static/root/assets/channels-settings-BBKEqDZn.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-Drk110ve.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-HpgaUDQ1.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-CLSc6682.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DrnKFC6M.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-Cw1hpJkZ.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BDGkTVma.js +0 -2
- package/dist/gateway/static/root/assets/index-hmrG55qg.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Bdef1b7F.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CwLPgrWh.js +0 -7
- package/dist/gateway/static/root/assets/messages-BwQ3WssU.js +0 -5
- package/dist/gateway/static/root/assets/notes-workbench-Cf06q19x.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-SHTurM4t.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BcC2qUAw.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-6vGefBHv.js +0 -1
- package/dist/gateway/static/root/assets/schedule-field-Bcdni4Pj.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C5014a53.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDY3ZI1K.js +0 -1
- package/dist/gateway/static/root/assets/settings-collapsible-section-6eNF8Jey.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-z-rF0Hdg.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-CHZFXE_d.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-B7p2QNXt.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-ncw3tX9P.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-iYfeSLKI.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-CrwkicvT.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BQWxyPg8.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-50ZzGay5.js +0 -1
- package/dist/gateway/static/root/assets/work-page-DPqEahx7.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-C3eIC5HZ.js +0 -11
- package/dist/src/agent/embedded/xopc-auth-storage.d.ts +0 -19
- package/dist/src/agent/embedded/xopc-auth-storage.js +0 -40
- package/dist/src/agent/image/generation/bundled-registry.d.ts +0 -18
- package/dist/src/agent/image/generation/bundled-registry.js +0 -35
- package/dist/src/agent/image/generation/bundled.d.ts +0 -10
- package/dist/src/agent/image/generation/bundled.js +0 -15
- package/dist/src/agent/image/generation/image-provider-ui.d.ts +0 -20
- package/dist/src/agent/image/generation/image-provider-ui.js +0 -1
- package/dist/src/gateway/image-capabilities.d.ts +0 -28
- package/dist/src/gateway/image-capabilities.js +0 -78
- package/dist/src/generated/bundled-image-generation-providers.d.ts +0 -14
- package/dist/src/generated/bundled-image-generation-providers.js +0 -17
|
@@ -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{l as i,t as a}from"./chunk-KS7C4IRE-uQ0fehio.js";import{t as o}from"./check-DUBLcKHA.js";import{t as s}from"./circle-alert-BEjgurr2.js";import{t as c}from"./cn-JdwAhgNB.js";import{t as l}from"./messages-BwQ3WssU.js";import{n as u,o as d,r as f,s as p}from"./locale-store-0lpYdNDr.js";import{n as m}from"./activity-store-hpcNv9MZ.js";import{Ao as h,Bo as g,Bs as _,Ds as v,Eo as y,Gc as b,Ho as x,Ia as S,Il as C,Jc as w,Oa as T,Ol as E,Qa as D,R as O,Ro as k,So as A,Tu as j,Uo as M,Vo as N,Wo as P,Xl as F,bo as ee,cu as I,dl as L,du as te,ec as ne,et as R,ju as z,ou as re,uc as ie,wc as ae,ws as B,zo as oe,zs as se}from"./index-C8JkTS6d.js";var V=e(t(),1),H=n();function U(e){try{return decodeURIComponent(e).trim()||null}catch{return null}}function W(e){if(!e)return null;let t=e.split(/[?#]/,1)[0],n=/^\/goals\/([^/]+)\/?$/.exec(t);if(n){let e=U(n[1]);return e?{kind:`goal`,id:e}:null}let r=/^\/chat\/([^/]+)\/?$/.exec(t);if(r){let e=U(r[1]);return!e||e===`new`?null:{kind:`session`,id:e}}return null}async function G(e,t){let n=e.kind===`goal`?`/api/goals/${encodeURIComponent(e.id)}`:`/api/sessions/${encodeURIComponent(e.id)}?limit=1`;try{return(await d(f(n),{signal:t})).status===404?`missing`:`available`}catch(e){if(t?.aborted)throw e;return`available`}}var K=r(),q=3,ce={info:{Icon:L,className:`text-accent-fg bg-accent-soft`},success:{Icon:re,className:`text-success bg-success-soft`},warning:{Icon:se,className:`text-warning bg-warning-soft`},error:{Icon:s,className:`text-danger bg-danger-soft`}};function J(e,t){let n=Math.max(0,Math.round((Date.now()-e)/1e3));if(n<60)return t===`zh`?`刚刚`:`Just now`;let r=Math.round(n/60);if(r<60)return t===`zh`?`${r} 分钟前`:`${r}m ago`;let i=Math.round(r/60);if(i<24)return t===`zh`?`${i} 小时前`:`${i}h ago`;let a=Math.round(i/24);return t===`zh`?`${a} 天前`:`${a}d ago`}function Y(e){let t=(0,H.c)(55),{item:n,targetAvailability:r}=e,i=u(Z),o;t[0]===i?o=t[1]:(o=l(i),t[0]=i,t[1]=o);let s=o.projectsPage.workHome,d=m(X),{Icon:f,className:p}=ce[n.tone],h;t[2]===p?h=t[3]:(h=c(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,p),t[2]=p,t[3]=h);let g;t[4]!==f||t[5]!==n.status?(g=n.status===`running`?(0,K.jsx)(w,{className:`size-3.5 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}):(0,K.jsx)(f,{className:`size-3.5`,"aria-hidden":!0}),t[4]=f,t[5]=n.status,t[6]=g):g=t[6];let _;t[7]!==h||t[8]!==g?(_=(0,K.jsx)(`div`,{className:h,children:g}),t[7]=h,t[8]=g,t[9]=_):_=t[9];let y;t[10]===n.title?y=t[11]:(y=(0,K.jsx)(`h3`,{className:`min-w-0 flex-1 text-sm font-medium leading-5 text-fg`,children:n.title}),t[10]=n.title,t[11]=y);let b;t[12]!==s.activityUnread||t[13]!==n.read?(b=n.read?null:(0,K.jsx)(`span`,{className:`mt-1.5 size-1.5 shrink-0 rounded-full bg-accent`,"aria-label":s.activityUnread}),t[12]=s.activityUnread,t[13]=n.read,t[14]=b):b=t[14];let x;t[15]!==y||t[16]!==b?(x=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[y,b]}),t[15]=y,t[16]=b,t[17]=x):x=t[17];let S;t[18]===n.message?S=t[19]:(S=n.message?(0,K.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.message}):null,t[18]=n.message,t[19]=S);let C;t[20]===n.source?C=t[21]:(C=n.source?(0,K.jsx)(`span`,{className:`max-w-48 truncate`,children:n.source}):null,t[20]=n.source,t[21]=C);let T;t[22]!==n.updatedAt||t[23]!==i?(T=J(n.updatedAt,i),t[22]=n.updatedAt,t[23]=i,t[24]=T):T=t[24];let E;t[25]===T?E=t[26]:(E=(0,K.jsx)(`span`,{children:T}),t[25]=T,t[26]=E);let O;t[27]===n.occurrences?O=t[28]:(O=n.occurrences>1?(0,K.jsxs)(`span`,{children:[`×`,n.occurrences]}):null,t[27]=n.occurrences,t[28]=O);let k;t[29]!==s.activityCheckingRelated||t[30]!==s.activityRelatedMissing||t[31]!==s.activityViewRelated||t[32]!==n.href||t[33]!==r?(k=n.href&&r===`available`?(0,K.jsxs)(a,{to:n.href,className:`inline-flex items-center gap-0.5 font-medium text-accent-fg hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[s.activityViewRelated,(0,K.jsx)(I,{className:`size-3`,"aria-hidden":!0})]}):n.href&&r===`checking`?(0,K.jsx)(D,{className:`h-3 w-20 rounded`,"aria-label":s.activityCheckingRelated}):n.href&&r===`missing`?(0,K.jsx)(`span`,{className:`font-medium text-fg-subtle`,role:`status`,children:s.activityRelatedMissing}):null,t[29]=s.activityCheckingRelated,t[30]=s.activityRelatedMissing,t[31]=s.activityViewRelated,t[32]=n.href,t[33]=r,t[34]=k):k=t[34];let A;t[35]!==E||t[36]!==O||t[37]!==k||t[38]!==C?(A=(0,K.jsxs)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 text-[11px] text-fg-subtle`,children:[C,E,O,k]}),t[35]=E,t[36]=O,t[37]=k,t[38]=C,t[39]=A):A=t[39];let j;t[40]!==A||t[41]!==x||t[42]!==S?(j=(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[x,S,A]}),t[40]=A,t[41]=x,t[42]=S,t[43]=j):j=t[43];let M;t[44]!==n.id||t[45]!==d?(M=()=>d(n.id),t[44]=n.id,t[45]=d,t[46]=M):M=t[46];let N;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,K.jsx)(v,{className:`size-3.5`,"aria-hidden":!0}),t[47]=N):N=t[47];let P;t[48]!==s.activityRemove||t[49]!==M?(P=(0,K.jsx)(`button`,{type:`button`,className:`rounded-md p-1 text-fg-subtle opacity-0 transition-opacity hover:bg-surface-hover hover:text-fg group-hover:opacity-100 focus:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":s.activityRemove,onClick:M,children:N}),t[48]=s.activityRemove,t[49]=M,t[50]=P):P=t[50];let F;return t[51]!==j||t[52]!==P||t[53]!==_?(F=(0,K.jsxs)(`article`,{className:`group flex items-start gap-3 border-t border-edge-subtle px-1 py-3 first:border-t-0`,children:[_,j,P]}),t[51]=j,t[52]=P,t[53]=_,t[54]=F):F=t[54],F}function X(e){return e.remove}function Z(e){return e.language}function le(){let e=(0,H.c)(12),t=l(u(ve)).projectsPage.workHome,n=m(_e),r=m(ge),i=m(he),[a,s]=(0,V.useState)(!1),c;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(c={},e[0]=c):c=e[0];let[d,f]=(0,V.useState)(c),p;e[1]===n?p=e[2]:(p=n.filter(me),e[1]=n,e[2]=p);let h=p.length,g;e[3]===n?g=e[4]:(g=n.filter(pe),e[3]=n,e[4]=g);let v=g.length,y;e[5]!==a||e[6]!==n?(y=a?n:n.slice(0,q),e[5]=a,e[6]=n,e[7]=y):y=e[7];let b=y,x,S;e[8]===n?(x=e[9],S=e[10]):(x=()=>{let e=new AbortController,t=new Map(n.flatMap(fe));return f(Object.fromEntries([...t.keys()].map(de))),Promise.all([...t].map(async t=>{let[n,r]=t,i=await G(r,e.signal);e.signal.aborted||f(e=>({...e,[n]:i}))})).catch(ue),()=>e.abort()},S=[n],e[8]=n,e[9]=x,e[10]=S),(0,V.useEffect)(x,S);let C;return e[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,K.jsx)(z,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),e[11]=C):C=e[11],(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,"aria-labelledby":`workbench-activity-title`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsx)(`div`,{children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[C,(0,K.jsx)(`h2`,{id:`workbench-activity-title`,className:`text-sm font-semibold text-fg`,children:t.activityTitle}),h>0?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full bg-accent-soft px-2 py-0.5 text-[11px] font-medium text-accent-fg`,children:[(0,K.jsx)(w,{className:`size-3 animate-spin motion-reduce:animate-none`,"aria-hidden":!0}),h,` `,t.running]}):v>0?(0,K.jsxs)(`span`,{className:`rounded-full bg-surface-panel px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:[v,` `,t.activityNew]}):null]})}),a&&n.length>0?(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[v>0?(0,K.jsxs)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:r,children:[(0,K.jsx)(o,{className:`size-3.5`,"aria-hidden":!0}),t.activityMarkRead]}):null,n.some($)?(0,K.jsxs)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs text-fg-muted`,onClick:i,children:[(0,K.jsx)(_,{className:`size-3.5`,"aria-hidden":!0}),t.activityClearFinished]}):null]}):null]}),n.length>0?(0,K.jsxs)(`div`,{className:`mt-3 px-1`,children:[b.map(e=>(0,K.jsx)(Y,{item:e,targetAvailability:e.href&&W(e.href)?d[e.href]??`checking`:`available`},e.id)),n.length>q?(0,K.jsx)(`div`,{className:`border-t border-edge-subtle py-2 text-center`,children:(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,onClick:()=>s(Q),children:a?t.activityShowLess:t.activityShowAll.replace(`{{count}}`,String(n.length))})}):null]}):(0,K.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-sm text-fg-muted`,children:[(0,K.jsx)(F,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,K.jsx)(`p`,{children:t.activityEmpty})]})]})}function Q(e){return!e}function $(e){return e.status===`done`}function ue(){}function de(e){return[e,`checking`]}function fe(e){let t=W(e.href);return e.href&&t?[[e.href,t]]:[]}function pe(e){return!e.read}function me(e){return e.status===`running`}function he(e){return e.clearFinished}function ge(e){return e.markAllRead}function _e(e){return e.items}function ve(e){return e.language}function ye(e){return p(f(`/api/home${e?`?locale=${encodeURIComponent(e)}`:``}`))}function be(e,t){return p(f(`/api/proactive/insights/${encodeURIComponent(e)}`),{method:`PATCH`,body:JSON.stringify({status:t})})}function xe(e){return p(f(`/api/proactive/insights/${encodeURIComponent(e)}/approve`),{method:`POST`})}function Se(e,t){return p(f(`/api/focuses/${encodeURIComponent(e)}/calendar/${encodeURIComponent(t)}/prepare`),{method:`POST`})}function Ce(e,t){return p(f(`/api/home/decisions/respond`),{method:`POST`,body:JSON.stringify({...e,decision:t})})}function we(e,t){return e.replace(/\{\{(\w+)\}\}/g,(e,n)=>String(t[n]??``))}function Te(e,t){if(e==null)return t;let n=new Date(e);return Number.isNaN(n.getTime())?t:R(n)}function Ee(e){let t=(0,H.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,K.jsx)(`span`,{className:`rounded-full bg-surface-muted px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:n}),t[0]=n,t[1]=r),r}function De(){let e=(0,H.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,K.jsxs)(`div`,{className:`space-y-5`,"aria-busy":!0,children:[(0,K.jsx)(D,{className:`h-20 rounded-2xl`}),(0,K.jsx)(D,{className:`h-72 rounded-2xl`}),(0,K.jsx)(D,{className:`h-44 rounded-2xl`})]}),e[0]=t):t=e[0],t}function Oe(e){let t=(0,H.c)(19),{item:n,statusLabel:r}=e,i=`/work-items/${encodeURIComponent(n.id)}`,o;t[0]===n.title?o=t[1]:(o=(0,K.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=o);let s;t[2]===n.projectName?s=t[3]:(s=(0,K.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:n.projectName}),t[2]=n.projectName,t[3]=s);let c;t[4]!==o||t[5]!==s?(c=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[o,s]}),t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;t[7]===r?l=t[8]:(l=(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:r}),t[7]=r,t[8]=l);let u;t[9]!==c||t[10]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[9]=c,t[10]=l,t[11]=u):u=t[11];let d;t[12]!==n.blockedReason||t[13]!==n.nextAction?(d=n.blockedReason||n.nextAction?(0,K.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.blockedReason||n.nextAction}):null,t[12]=n.blockedReason,t[13]=n.nextAction,t[14]=d):d=t[14];let f;return t[15]!==i||t[16]!==u||t[17]!==d?(f=(0,K.jsxs)(a,{to:i,className:`group block rounded-lg px-1 py-2.5 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,d]}),t[15]=i,t[16]=u,t[17]=d,t[18]=f):f=t[18],f}function ke(e){let t=(0,H.c)(27),{item:n,kindLabel:r,reasonLabel:i,approveLabel:o,denyLabel:s,busy:c,onRespond:l}=e,u;t[0]===n.title?u=t[1]:(u=(0,K.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.title}),t[0]=n.title,t[1]=u);let d=n.projectName||r,f;t[2]===d?f=t[3]:(f=(0,K.jsx)(`p`,{className:`mt-1 truncate text-xs text-fg-subtle`,children:d}),t[2]=d,t[3]=f);let p;t[4]!==u||t[5]!==f?(p=(0,K.jsxs)(`div`,{className:`min-w-0`,children:[u,f]}),t[4]=u,t[5]=f,t[6]=p):p=t[6];let m;t[7]===i?m=t[8]:(m=(0,K.jsx)(`span`,{className:`shrink-0 rounded-full bg-surface-panel/80 px-2 py-0.5 text-[11px] font-medium text-fg-muted`,children:i}),t[7]=i,t[8]=m);let h;t[9]!==p||t[10]!==m?(h=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[p,m]}),t[9]=p,t[10]=m,t[11]=h):h=t[11];let g;t[12]===n.detail?g=t[13]:(g=n.detail?(0,K.jsx)(`p`,{className:`mt-2 line-clamp-2 text-xs leading-5 text-fg-muted`,children:n.detail}):null,t[12]=n.detail,t[13]=g);let _;t[14]!==n.href||t[15]!==h||t[16]!==g?(_=(0,K.jsxs)(a,{to:n.href,className:`group block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[h,g]}),t[14]=n.href,t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]!==o||t[19]!==c||t[20]!==s||t[21]!==n.response||t[22]!==l?(v=n.response?(0,K.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-warning/20 pt-3`,children:[(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`deny`),children:s}),(0,K.jsx)(B,{type:`button`,variant:`primary`,className:`h-8 px-2`,disabled:c,onClick:()=>l(`approve`),children:o})]}):null,t[18]=o,t[19]=c,t[20]=s,t[21]=n.response,t[22]=l,t[23]=v):v=t[23];let y;return t[24]!==_||t[25]!==v?(y=(0,K.jsxs)(`article`,{className:`rounded-xl border border-warning/35 bg-warning-soft/25 p-3.5 transition-colors hover:bg-warning-soft/40`,children:[_,v]}),t[24]=_,t[25]=v,t[26]=y):y=t[26],y}function Ae(e){let t=(0,H.c)(19),{project:n,openLabel:r,noDescription:i}=e,o=`/projects/${encodeURIComponent(n.id)}`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,K.jsx)(E,{className:`size-4 shrink-0 text-accent`,"aria-hidden":!0}),t[0]=s):s=t[0];let c;t[1]===n.name?c=t[2]:(c=(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[s,(0,K.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:n.name})]}),t[1]=n.name,t[2]=c);let l;t[3]===r?l=t[4]:(l=(0,K.jsx)(j,{className:`size-4 shrink-0 text-fg-subtle transition-transform group-hover:translate-x-0.5`,"aria-label":r}),t[3]=r,t[4]=l);let u;t[5]!==c||t[6]!==l?(u=(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[c,l]}),t[5]=c,t[6]=l,t[7]=u):u=t[7];let d=n.description||n.brief||i,f;t[8]===d?f=t[9]:(f=(0,K.jsx)(`p`,{className:`mt-3 line-clamp-2 text-xs leading-5 text-fg-muted`,children:d}),t[8]=d,t[9]=f);let p=n.lastActiveAt??n.updatedAt,m;t[10]===p?m=t[11]:(m=Te(p,``),t[10]=p,t[11]=m);let h;t[12]===m?h=t[13]:(h=(0,K.jsx)(`p`,{className:`mt-auto pt-3 text-[11px] text-fg-subtle`,children:m}),t[12]=m,t[13]=h);let g;return t[14]!==o||t[15]!==h||t[16]!==u||t[17]!==f?(g=(0,K.jsxs)(a,{to:o,className:`group flex min-h-32 flex-col rounded-xl border border-edge-subtle bg-surface-panel p-4 transition-colors hover:bg-surface-hover/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,f,h]}),t[14]=o,t[15]=h,t[16]=u,t[17]=f,t[18]=g):g=t[18],g}function je(){let e=u(e=>e.language),t=l(e),n=t.projectsPage,r=i(),o=ee(e=>e.setPageHeader),c=ee(e=>e.clearPageHeader),[d,f]=(0,V.useState)(null),[p,m]=(0,V.useState)([]),[_,w]=(0,V.useState)([]),[E,D]=(0,V.useState)(!0),[j,I]=(0,V.useState)(null),[L,R]=(0,V.useState)(null),[z,re]=(0,V.useState)(``),[se,H]=(0,V.useState)(!1),[U,W]=(0,V.useState)(``),[G,q]=(0,V.useState)(!1),[ce,J]=(0,V.useState)(null),[Y,X]=(0,V.useState)(null),[Z,Q]=(0,V.useState)(null),$=(0,V.useCallback)(async()=>{D(!0),I(null);try{let[t,n,r]=await Promise.all([ye(e),S({limit:100,sortBy:`updatedAt`,sortOrder:`desc`}),y()]);f(t),m(n.items),w(r)}catch(e){I(e instanceof Error?e.message:String(e))}finally{D(!1)}},[e]);(0,V.useEffect)(()=>{$()},[$]);let ue=(0,V.useMemo)(()=>{let e=z.trim().toLocaleLowerCase(),t=p.filter(e=>e.status!==`archived`);return e?t.filter(t=>[t.name,t.description,t.brief].filter(Boolean).some(t=>t.toLocaleLowerCase().includes(e))):t.slice(0,6)},[p,z]),de=(0,V.useMemo)(()=>d?.decisions??[],[d]),fe=(0,V.useMemo)(()=>d?.work.current.filter(e=>e.status!==`needs_input`&&e.status!==`in_review`&&e.status!==`blocked`).slice(0,10)??[],[d]),pe=(0,V.useCallback)(async t=>{t.preventDefault();let n=U.trim();if(!(!n||G)){q(!0),R(null);try{let t=await T({outcome:n,uiLocale:e});W(``),H(!1),r(`/projects/${encodeURIComponent(t.project.id)}`)}catch(e){R(e instanceof Error?e.message:String(e))}finally{q(!1)}}},[G,e,r,U]),me=(0,V.useMemo)(()=>(0,K.jsxs)(B,{type:`button`,variant:`primary`,className:`h-9 rounded-lg`,onClick:()=>H(!0),children:[(0,K.jsx)(ae,{className:`size-4`,"aria-hidden":!0}),n.workHome.newWork]}),[n.workHome.newWork]),he=(0,V.useCallback)(async(e,t)=>{if(e.response){J(e.id),I(null);try{await Ce(e.response,t),await $()}catch(e){I(e instanceof Error?e.message:String(e))}finally{J(null)}}},[$]),ge=(0,V.useCallback)(async(e,t)=>{X(e.id),I(null);try{let n=e.watches.find(e=>e.kind===t&&e.status===`active`);n?await h(e.id,n.id):await A(e.id,t),w(await y())}catch(e){I(e instanceof Error?e.message:String(e))}finally{X(null)}},[]),_e=(0,V.useCallback)(async(e,t)=>{Q(e),I(null);try{t===`approved`?await xe(e):await be(e,`dismissed`),f(t=>t&&{...t,proactiveInsights:t.proactiveInsights.filter(t=>t.id!==e)})}catch(e){I(e instanceof Error?e.message:String(e))}finally{Q(null)}},[]),ve=(0,V.useCallback)(async(e,t)=>{X(e),I(null);try{await Se(e,t),w(await y())}catch(e){I(e instanceof Error?e.message:String(e))}finally{X(null)}},[]);return(0,V.useLayoutEffect)(()=>(o({startExtra:null,main:(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h1`,{className:`truncate text-base font-semibold tracking-tight text-fg`,children:n.title}),(0,K.jsx)(`p`,{className:`truncate text-xs text-fg-muted`,children:n.workHome.subtitle})]}),end:me}),()=>c()),[c,me,o,n.title,n.workHome.subtitle]),(0,K.jsxs)(`main`,{className:`mx-auto flex w-full max-w-[1200px] flex-1 flex-col gap-7 px-4 py-7 sm:px-6 lg:px-8 lg:py-9`,children:[(0,K.jsx)(k,{open:se,onOpenChange:e=>{!e&&G||(H(e),e||R(null))},children:(0,K.jsxs)(M,{children:[(0,K.jsx)(x,{className:`fixed inset-0 z-[80] bg-scrim backdrop-blur-[2px]`}),(0,K.jsxs)(g,{className:`fixed left-1/2 top-1/2 z-[90] flex h-[min(31rem,calc(100dvh-1.5rem))] w-[min(36rem,calc(100vw-1.5rem))] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl border border-edge bg-surface-panel shadow-float focus:outline-none`,children:[(0,K.jsxs)(`div`,{className:`flex shrink-0 items-start gap-4 border-b border-edge px-5 py-4`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(P,{className:`text-base font-semibold text-fg`,children:n.workHome.delegateTitle}),(0,K.jsx)(N,{className:`mt-1 text-sm leading-5 text-fg-muted`,children:n.workHome.delegateDescription})]}),(0,K.jsx)(oe,{asChild:!0,children:(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`-mr-2 -mt-1 size-8 shrink-0 rounded-lg p-0`,title:n.cancel,"aria-label":n.cancel,disabled:G,children:(0,K.jsx)(v,{className:`size-4`,"aria-hidden":!0})})})]}),(0,K.jsxs)(`form`,{onSubmit:pe,className:`flex min-h-0 flex-1 flex-col`,children:[(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto px-5 py-4`,children:[(0,K.jsx)(`label`,{htmlFor:`new-work-outcome`,className:`mb-2 shrink-0 text-sm font-medium text-fg`,children:n.workHome.outcomeLabel}),(0,K.jsx)(`textarea`,{id:`new-work-outcome`,className:`min-h-32 w-full flex-1 resize-none rounded-xl border border-edge bg-surface-base p-3 text-sm font-normal leading-6 text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:ring-2 focus:ring-accent/20`,value:U,onChange:e=>W(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},placeholder:n.workHome.outcomePlaceholder,maxLength:12e3,disabled:G,autoFocus:!0}),(0,K.jsxs)(`div`,{className:`mt-2 flex shrink-0 items-center justify-between gap-3 text-[11px] text-fg-subtle`,children:[(0,K.jsx)(`span`,{children:n.workHome.submitShortcut}),(0,K.jsxs)(`span`,{className:`tabular-nums`,children:[U.length.toLocaleString(),` / `,12e3.toLocaleString()]})]}),L?(0,K.jsx)(`p`,{className:`mt-3 rounded-lg bg-danger-soft px-3 py-2 text-xs text-danger`,role:`alert`,children:L}):null]}),(0,K.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-edge px-5 py-4`,children:[(0,K.jsx)(oe,{asChild:!0,children:(0,K.jsx)(B,{type:`button`,variant:`ghost`,disabled:G,children:n.cancel})}),(0,K.jsxs)(B,{type:`submit`,variant:`primary`,className:`min-w-32`,disabled:G||!U.trim(),children:[(0,K.jsx)(ne,{className:`size-4`,"aria-hidden":!0}),G?n.workHome.delegating:n.workHome.delegate]})]})]})]})]})}),j?(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-xl border border-danger/25 bg-danger-soft px-4 py-3 text-sm text-danger`,children:[(0,K.jsx)(`span`,{children:j}),(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2`,onClick:()=>void $(),children:n.workHome.retry})]}):null,E?(0,K.jsx)(De,{}):d?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`section`,{className:`border-b border-edge-subtle pb-5`,children:[(0,K.jsx)(`p`,{className:`text-xs font-medium text-fg-subtle`,children:n.workHome.briefingTitle}),(0,K.jsx)(`h2`,{className:`mt-1 text-xl font-semibold tracking-tight text-fg`,children:d.decisions.length>0?we(n.workHome.todaySummary,{attention:d.decisions.length,moving:d.briefing.progress.movingCount}):we(n.workHome.todaySummaryClear,{moving:d.briefing.progress.movingCount})}),d.briefing.summary?(0,K.jsx)(`p`,{className:`mt-2 max-w-3xl text-sm leading-6 text-fg-muted`,children:d.briefing.summary}):null]}),d.proactiveInsights.length>0?(0,K.jsxs)(`section`,{className:`rounded-2xl border border-accent/20 bg-accent-soft/20 p-5`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(ne,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.insightsTitle}),(0,K.jsx)(Ee,{children:n.workHome.insightsBadge})]}),(0,K.jsx)(`div`,{className:`mt-4 space-y-3`,children:d.proactiveInsights.map(e=>(0,K.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-2 text-sm leading-6 text-fg-muted`,children:e.summary}),(0,K.jsxs)(`p`,{className:`mt-2 text-xs leading-5 text-fg-muted`,children:[(0,K.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.whyItMatters,`: `]}),e.whyItMatters]}),(0,K.jsxs)(`p`,{className:`mt-2 rounded-lg bg-surface-base px-3 py-2 text-xs leading-5 text-fg-muted`,children:[(0,K.jsxs)(`span`,{className:`font-medium text-fg`,children:[n.workHome.suggestedNext,`: `]}),e.nextAction]}),(0,K.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:e.evidence.map((e,t)=>(0,K.jsxs)(`span`,{className:`rounded-full border border-edge-subtle px-2 py-1 text-[11px] text-fg-subtle`,children:[e.label,e.source?` · ${e.source}`:``]},`${e.label}-${t}`))}),(0,K.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2 border-t border-edge-subtle pt-3`,children:[(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:Z===e.id,onClick:()=>void _e(e.id,`dismissed`),children:n.workHome.dismissInsight}),(0,K.jsx)(B,{type:`button`,variant:`primary`,className:`h-8 px-2 text-xs`,disabled:Z===e.id,onClick:()=>void _e(e.id,`approved`),children:n.workHome.investigateInsight})]})]},e.id))})]}):null,d.calendarSignals.length>0?(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(te,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.relatedCalendarTitle}),(0,K.jsx)(Ee,{children:n.workHome.relatedCalendarBadge})]}),(0,K.jsx)(`div`,{className:`mt-4 divide-y divide-edge-subtle`,children:d.calendarSignals.map(e=>(0,K.jsxs)(`article`,{className:`flex flex-col gap-3 py-3 first:pt-0 last:pb-0 sm:flex-row sm:items-center sm:justify-between`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,K.jsxs)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:[e.focusTitle,` · `,Te(e.startsAt,``)]})]}),(0,K.jsx)(B,{type:`button`,variant:`secondary`,className:`h-8 shrink-0 px-2 text-xs`,disabled:Y===e.focusId,onClick:()=>void ve(e.focusId,e.id),children:Y===e.focusId?n.workHome.focusWatchUpdating:n.workHome.prepareForEvent})]},e.id))})]}):null,_.length>0?(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(C,{className:`size-4 text-accent`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.focusesTitle}),(0,K.jsx)(Ee,{children:n.workHome.focusesBadge})]}),(0,K.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2`,children:_.slice(0,6).map(e=>{let t=e.watches.some(e=>e.kind===`progress`&&e.status===`active`),r=e.watches.some(e=>e.kind===`intelligence`&&e.status===`active`),i=t||r;return(0,K.jsxs)(`article`,{className:`rounded-xl border border-edge-subtle bg-surface-panel p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h3`,{className:`truncate text-sm font-semibold text-fg`,children:e.title}),(0,K.jsx)(`p`,{className:`mt-1 line-clamp-2 text-xs leading-5 text-fg-muted`,children:e.summary})]}),(0,K.jsx)(`span`,{className:`mt-0.5 size-2 shrink-0 rounded-full ${i?`bg-success`:`bg-fg-subtle/40`}`,"aria-hidden":!0})]}),e.blockedReason||e.nextAction?(0,K.jsx)(`p`,{className:`mt-3 line-clamp-2 border-t border-edge-subtle pt-3 text-xs leading-5 text-fg-muted`,children:e.blockedReason||e.nextAction}):null,(0,K.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[11px] text-fg-subtle`,children:i?n.workHome.focusWatchActive:n.workHome.focusWatchInactive}),(0,K.jsxs)(`div`,{className:`flex gap-1`,children:[(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:Y===e.id,onClick:()=>void ge(e,`progress`),children:Y===e.id?n.workHome.focusWatchUpdating:t?n.workHome.pauseProgressWatch:n.workHome.startFocusWatch}),(0,K.jsx)(B,{type:`button`,variant:`ghost`,className:`h-8 px-2 text-xs`,disabled:Y===e.id,onClick:()=>void ge(e,`intelligence`),children:Y===e.id?n.workHome.focusWatchUpdating:r?n.workHome.pauseNewsWatch:n.workHome.startNewsWatch})]})]})]},e.id)})})]}):null,d.work.current.length===0&&d.workflowRuns.active.length===0&&d.decisions.length===0&&d.upcomingAutomations.length===0&&_.length===0?(0,K.jsxs)(`section`,{className:`rounded-2xl border border-dashed border-edge p-8 text-center`,children:[(0,K.jsx)(b,{className:`mx-auto size-6 text-accent`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`mt-3 text-sm font-semibold text-fg`,children:n.workHome.emptyTitle}),(0,K.jsx)(`p`,{className:`mx-auto mt-1 max-w-lg text-sm leading-6 text-fg-muted`,children:n.workHome.emptyBody}),(0,K.jsxs)(`div`,{className:`mt-4 flex justify-center gap-2`,children:[(0,K.jsx)(B,{type:`button`,variant:`primary`,onClick:()=>r(`/chat/new`),children:n.workHome.startChat}),(0,K.jsx)(B,{type:`button`,variant:`secondary`,onClick:()=>H(!0),children:n.workHome.startLongWork})]})]}):null,(0,K.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,2fr)_minmax(18rem,1fr)]`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 space-y-6`,children:[de.length>0?(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(s,{className:`size-4 text-warning`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.needsYou})]}),(0,K.jsx)(`div`,{className:`mt-4 space-y-2`,children:de.map(e=>(0,K.jsx)(ke,{item:e,kindLabel:n.workHome.decisionKinds[e.kind],reasonLabel:n.workHome.decisionReasons[e.reason],approveLabel:n.workHome.approve,denyLabel:n.workHome.deny,busy:ce===e.id,onRespond:t=>void he(e,t)},e.id))})]}):(0,K.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-fg-muted`,children:[(0,K.jsx)(`span`,{className:`flex size-5 items-center justify-center rounded-full bg-success-soft text-xs text-success`,"aria-hidden":!0,children:`✓`}),n.workHome.nothingNeedsYou]}),(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-5 shadow-surface`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(F,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.continueTitle})]}),(0,K.jsxs)(`div`,{className:`mt-4 divide-y divide-edge-subtle px-1`,children:[d.workflowRuns.active.map(e=>(0,K.jsxs)(a,{to:O(e.id),className:`flex items-center justify-between gap-3 rounded-lg px-2 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,K.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`size-1.5 shrink-0 rounded-full bg-accent`,"aria-hidden":!0}),(0,K.jsx)(`span`,{className:`truncate font-medium text-fg`,children:e.title})]}),(0,K.jsx)(`span`,{className:`shrink-0 text-xs text-fg-subtle`,children:n.workHome.running})]},e.id)),fe.map(e=>(0,K.jsx)(`div`,{className:`py-1`,children:(0,K.jsx)(Oe,{item:e,statusLabel:t.projectDetailPage.workItems.statuses[e.status]})},e.id)),d.workflowRuns.active.length===0&&fe.length===0?(0,K.jsx)(`p`,{className:`py-6 text-center text-sm text-fg-muted`,children:n.workHome.noCurrentWork}):null]})]})]}),(0,K.jsxs)(`aside`,{className:`min-w-0 space-y-4`,"aria-label":n.workHome.nowTitle,children:[(0,K.jsx)(`div`,{className:`px-1`,children:(0,K.jsx)(`h2`,{className:`text-base font-semibold text-fg`,children:n.workHome.nowTitle})}),d.upcomingAutomations.length>0?(0,K.jsxs)(`section`,{className:`rounded-2xl bg-surface-base p-4 shadow-surface`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(te,{className:`size-4 text-fg-subtle`,"aria-hidden":!0}),(0,K.jsx)(`h3`,{className:`text-sm font-semibold text-fg`,children:n.workHome.scheduled})]}),(0,K.jsx)(`div`,{className:`mt-2 divide-y divide-edge-subtle`,children:d.upcomingAutomations.slice(0,3).map(e=>(0,K.jsxs)(a,{to:`/automations`,className:`flex items-center justify-between gap-3 rounded-lg px-1 py-3 text-sm hover:bg-surface-hover/55`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate text-fg`,children:e.name||e.action}),(0,K.jsx)(`time`,{className:`shrink-0 text-xs text-fg-subtle`,children:Te(e.nextRunAt,n.never)})]},e.id))})]}):null,(0,K.jsx)(le,{}),d.briefing.wins.length>0?(0,K.jsxs)(a,{to:d.briefing.wins[0].href,className:`flex items-center justify-between gap-3 rounded-xl px-2 py-2 text-sm text-fg-muted hover:bg-surface-hover/55 hover:text-fg`,children:[(0,K.jsx)(`span`,{children:we(n.workHome.completedSummary,{count:d.briefing.wins.length})}),(0,K.jsxs)(`span`,{className:`shrink-0 text-xs font-medium text-accent`,children:[n.workHome.viewLatestResult,` →`]})]}):null]})]})]}):null,(0,K.jsxs)(`section`,{className:`border-t border-edge-subtle pt-7`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-semibold text-fg`,children:n.workHome.spacesTitle}),(0,K.jsx)(a,{to:`/projects`,className:`text-xs font-medium text-accent hover:underline`,children:n.management.viewAll})]}),p.filter(e=>e.status!==`archived`).length>6?(0,K.jsx)(`div`,{className:`mt-3 flex justify-end`,children:(0,K.jsxs)(`label`,{className:`relative block min-w-0`,children:[(0,K.jsx)(ie,{className:`pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-fg-subtle`,"aria-hidden":!0}),(0,K.jsx)(`input`,{className:`h-9 w-52 rounded-lg border border-edge bg-surface-panel pl-9 pr-3 text-sm text-fg outline-none placeholder:text-fg-muted focus:border-accent`,value:z,onChange:e=>re(e.target.value),placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder})]})}):null,(0,K.jsx)(`div`,{className:`mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-3`,children:ue.map(e=>(0,K.jsx)(Ae,{project:e,openLabel:n.workHome.openSpace,noDescription:n.noDescription},e.id))}),!E&&ue.length===0?(0,K.jsx)(`p`,{className:`py-8 text-center text-sm text-fg-muted`,children:n.workHome.noSpaces}):null]})]})}export{je as WorkPage};
|