@xopcai/xopc 0.0.278 → 0.0.283
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/_locales/en/messages.json +34 -4
- package/dist/browser-ext/_locales/zh_CN/messages.json +34 -4
- package/dist/browser-ext/dist/assets/{auth-ClQTK565.js → auth-DB30ywek.js} +18 -53
- package/dist/browser-ext/dist/assets/pcm-capture-worklet-CGN9Mlhg.js +39 -0
- package/dist/browser-ext/dist/assets/{sidepanel-CeGqObOa.css → sidepanel-BbSQr-6P.css} +40 -6
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +2 -2
- package/dist/browser-ext/dist/sidepanel.js +1219 -191
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-SJZ5fS17.js → activity-store-iPtG94qr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-lRVOwbrK.js → agent-avatar-dicebear-DQ74xqLi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-SElFkQd6.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DNQNTDkU.js → agents-DYazUaZ6.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CnJAVHBu.js → api-KMJzMqvZ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-oHTY5PDs.js → app-management-settings-panel-B42TpqIb.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B0YnZ3ig.js → appearance-settings-D9Lfe7Sk.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BzrodN8C.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4x142le.js → archive-plugin-BdmQwj4x.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-zibD2Hod.js → attachment-load-B4S0_nji.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CfEDFYPE.js → attachment-preview-renderer-wzIchDSv.js} +4 -4
- package/dist/gateway/static/root/assets/attachment-process-heavy-Db4nTY5N.js +5 -0
- package/dist/gateway/static/root/assets/{automations-page-Dkp7gp_S.js → automations-page-B3TmHNjQ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace--A4I0jMu.js +6 -0
- package/dist/gateway/static/root/assets/binary-plugins-B3cXF_DP.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-r5nCBBan.js → block-editor-05zyBXBe.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DcVLoIzc.js → browser-automation-inputs-BTIufVbM.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BnL4JnTM.js → browser-automations-page-DRBA9nwe.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DDTXUNWK.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Ll5UeXq5.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-BzL15bkU.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BTT2sIGg.js → channels-status-swr-DMYQNs-J.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CWVnJtBp.js → chat-terminal-dock-Dx5KQyo5.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-RPw1AOMb.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-XjPSlgq_.js → date-picker-CkDROZoe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CkyfEP88.js → dependency-picker-Bl8HcvzL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAE_NVx5.js → desktop-pet-BcknAjbW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BUw6V2R9.js → desktop-pet-settings-BuCpXQPm.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-D0_tCX49.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-giBeIVUT.js → extension-debug-page-qRpb2FFa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bqo9bNtx.js → extension-page-C7gs9wu4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BX-6AA3k.js → extension-settings-page-CyJP1CMZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-Cpmyrr6j.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DOeeTdWE.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CVTa5HSS.js → gateway-startup-retry-DoiPeb65.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DWFAopk_.js → heartbeat-settings-CV6Dolcn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Djw1H_Go.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DtMRG1oF.js → image-generation-api-CqjHWl2T.js} +1 -1
- package/dist/gateway/static/root/assets/index-B_Sg5BKz.css +2 -0
- package/dist/gateway/static/root/assets/index-CHgOG1aR.js +74 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BKGPpBnV.js → keyboard-shortcuts-settings-B3XqA41D.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BPqgyYJq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B06ToOxB.js → local-apps-page-BcIVYp0J.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BkJ7g35d.js → locale-store-1urrBBCQ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DibI1GsP.js → logs-page-BHax3XlS.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DJ6yMZCd.js → management-settings-DNFCdgzR.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DF3aJP_5.js → markdown-view-BZmcFIWa.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CdrLNAks.js → media-plugins-BDxNhoBC.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYFcjtmG.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Cs46LFXO.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BUkcn_0t.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B7LA4z-x.js → page-tabs-agH3a2PI.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +2 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-B4E34YdZ.js +48 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DTQRN7WR.js → preview-open-alternatives-XEZ7zDOP.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-Bn484J9v.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BazdmFYo.js → product-open-page-lXAbj85Z.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-LcH21ixD.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DelBiwyB.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CTq8EECj.js → registry-api-CxQstD00.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-3BjFYXCf.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D-DZf4I1.js → runtime-tools-settings-panel-DErKZlVJ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-B-Yj9DVW.js → schema-form-DhCmJQVJ.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CVFirgVd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DyfBpqkY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BxPUqwY6.js → settings-form-section-Dg6chotg.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-zLn8lIrs.js → settings-page-LyuN5N3M.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CrXhTzHr.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-CZvmf4Ob.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DyM_D8hM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bys58-15.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-sWNvFo6D.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BR5bk2vT.js → skills-page.utils-Eu0WVHTS.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C0ptJutB.js → system-settings-panel-DQKkM7B2.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-B18NcZQJ.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-mV6Cm2vj.js → theme-store-Dc5s20V3.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-TKQpPVd6.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Dc5aN2px.js → use-autosave-CkVlrFk1.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-ul-zr58b.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CY0DpJui.js → voice-api-key-field-B12fFN-L.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D3DdcH4H.js → voice-config-api-Mk78BrpP.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Brg9yJBr.js → work-discovery-overlay-CT9Zy36i.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D3fq7boB.js → workflow-run-setup-panel-BwefQliE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BY_AWs7S.js +6 -0
- package/dist/gateway/static/root/index.html +10 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/discussions.js +17 -0
- package/dist/packages/gateway-contract/src/proactive.js +4 -2
- package/dist/src/agent/agent-manager.js +17 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- package/dist/src/agent/context/coordinator.js +3 -3
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.d.ts +1 -0
- package/dist/src/agent/context/project-context.js +16 -8
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +19 -19
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/source-context/task-context.d.ts +3 -0
- package/dist/src/agent/source-context/task-context.js +24 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +5 -5
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +1 -0
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -13
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +5 -5
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/extension-cli-register.js +4 -4
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.js +3 -3
- package/dist/src/discussions/action-tasks.d.ts +21 -0
- package/dist/src/discussions/action-tasks.js +93 -0
- package/dist/src/discussions/analyzer.d.ts +21 -1
- package/dist/src/discussions/analyzer.js +229 -62
- package/dist/src/discussions/audio-repair.d.ts +8 -0
- package/dist/src/discussions/audio-repair.js +41 -0
- package/dist/src/discussions/edits.d.ts +22 -0
- package/dist/src/discussions/edits.js +81 -0
- package/dist/src/discussions/errors.d.ts +4 -0
- package/dist/src/discussions/errors.js +10 -0
- package/dist/src/discussions/export.d.ts +2 -0
- package/dist/src/discussions/export.js +23 -0
- package/dist/src/discussions/index.js +3 -2
- package/dist/src/discussions/live-worker.js +2 -2
- package/dist/src/discussions/organizer-worker.js +14 -5
- package/dist/src/discussions/organizer.d.ts +1 -1
- package/dist/src/discussions/organizer.js +60 -24
- package/dist/src/discussions/reconcile.d.ts +22 -0
- package/dist/src/discussions/reconcile.js +55 -0
- package/dist/src/discussions/recording.d.ts +9 -0
- package/dist/src/discussions/recording.js +219 -0
- package/dist/src/discussions/recordingJobs.d.ts +14 -0
- package/dist/src/discussions/recordingJobs.js +69 -0
- package/dist/src/discussions/repository.d.ts +4 -2
- package/dist/src/discussions/repository.js +15 -10
- package/dist/src/discussions/revisions.d.ts +12 -0
- package/dist/src/discussions/revisions.js +36 -0
- package/dist/src/discussions/sealer.d.ts +1 -0
- package/dist/src/discussions/sealer.js +62 -12
- package/dist/src/discussions/service.d.ts +16 -15
- package/dist/src/discussions/service.js +177 -91
- package/dist/src/discussions/types.d.ts +4 -139
- package/dist/src/discussions/types.js +1 -11
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/files/file-service.d.ts +1 -0
- package/dist/src/files/file-service.js +77 -0
- package/dist/src/gateway/agents-admin.js +4 -4
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/app.js +6 -5
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/lib/static-ui.js +1 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -2
- package/dist/src/gateway/hono/routes/discussions.js +126 -19
- package/dist/src/gateway/hono/routes/files.js +1 -22
- package/dist/src/gateway/hono/routes/index.js +0 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +4 -38
- package/dist/src/gateway/hono/routes/project-understanding.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-understanding.js +65 -0
- package/dist/src/gateway/hono/routes/projects.js +22 -6
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +4 -3
- package/dist/src/gateway/hono/routes/user-model.js +4 -4
- package/dist/src/gateway/hono/routes/voice.js +3 -3
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +0 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +2 -16
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +10 -10
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/security/gateway-scopes.js +1 -2
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/marketplace-service.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +45 -30
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/knowledge-memory/repository.d.ts +2 -0
- package/dist/src/knowledge-memory/repository.js +3 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/media-understanding/audio-transcription-runner.d.ts +1 -0
- package/dist/src/media-understanding/audio-transcription-runner.js +1 -0
- package/dist/src/media-understanding/runner.js +1 -0
- package/dist/src/media-understanding/types.d.ts +8 -0
- package/dist/src/notes/agent-context.js +3 -3
- package/dist/src/notes/service.d.ts +3 -1
- package/dist/src/notes/store.d.ts +3 -1
- package/dist/src/notes/store.js +5 -3
- package/dist/src/proactive/actions/service.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/proactive/execution/context.js +1 -1
- package/dist/src/proactive/execution/worker.js +1 -1
- package/dist/src/proactive/experience.d.ts +38 -21
- package/dist/src/proactive/experience.js +109 -13
- package/dist/src/proactive/follow-ups.js +1 -1
- package/dist/src/proactive/inbox/cards.js +9 -3
- package/dist/src/proactive/inbox/delivery.js +2 -2
- package/dist/src/proactive/inbox/digest.js +2 -2
- package/dist/src/proactive/inbox/notification-policy.js +1 -1
- package/dist/src/proactive/inbox/repository.js +1 -1
- package/dist/src/proactive/inbox/service.js +1 -1
- package/dist/src/proactive/index.js +1 -1
- package/dist/src/proactive/maintenance.js +0 -1
- package/dist/src/proactive/scenarios/control.d.ts +0 -35
- package/dist/src/proactive/scenarios/control.js +7 -53
- package/dist/src/proactive/temporal/worker.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/project-store.js +6 -4
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/session/client-history.d.ts +1 -1
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +3 -3
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/166_remove_proactive_previews.sql +1 -0
- package/dist/src/storage/sqlite/migrations/167_discussion_recording_chunks.sql +7 -0
- package/dist/src/storage/sqlite/migrations/168_discussion_evidence.sql +16 -0
- package/dist/src/storage/sqlite/migrations/169_discussion_action_tasks.sql +8 -0
- package/dist/src/storage/sqlite/migrations/170_discussion_edits.sql +8 -0
- package/dist/src/storage/sqlite/migrations/171_discussion_recording_jobs.sql +14 -0
- package/dist/src/storage/sqlite/migrations/172_project_understanding.sql +3 -0
- package/dist/src/storage/sqlite/migrations/173_mobile_discussion_source.sql +5 -0
- package/dist/src/storage/sqlite/migrations/__tests__/mobile-discussion-source.test.ts +20 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-repository.d.ts +1 -0
- package/dist/src/tasks/task-repository.js +4 -0
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +9 -9
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +5 -5
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/audio/normalize.js +28 -5
- package/dist/src/voice/local/runtime-worker.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +2 -1
- package/dist/src/voice/stt/types.d.ts +1 -0
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/analyzer.d.ts +1 -0
- package/dist/src/work-discovery/analyzer.js +28 -22
- package/dist/src/work-discovery/index.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/project-understanding.d.ts +7 -0
- package/dist/src/work-discovery/project-understanding.js +38 -0
- package/dist/src/work-discovery/repository.d.ts +3 -1
- package/dist/src/work-discovery/repository.js +18 -5
- package/dist/src/work-discovery/service.d.ts +8 -0
- package/dist/src/work-discovery/service.js +165 -17
- package/dist/src/work-discovery/types.d.ts +2 -0
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +6 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DAqn5DdL.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Bh0etSmL.js +0 -1
- package/dist/gateway/static/root/assets/attachment-process-heavy-C5CqLCsX.js +0 -5
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +0 -6
- package/dist/gateway/static/root/assets/binary-plugins-CfUzu1Hc.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DxX-t0EJ.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvacBQAI.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CJzSNo-L.js +0 -1
- package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNBhBT0b.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsR5NQEC.js +0 -1
- package/dist/gateway/static/root/assets/excel-worksheet-utils-DpdB-DjU.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-cd8owslz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dil7vuyU.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Dpeuvazg.js +0 -1
- package/dist/gateway/static/root/assets/index-B03HGpzt.js +0 -74
- package/dist/gateway/static/root/assets/index-CXF9-BpI.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CBtemxFc.js +0 -2
- package/dist/gateway/static/root/assets/messages-BGc-OJWg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-GOxomxOK.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CQBgk3_x.js +0 -8
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +0 -29
- package/dist/gateway/static/root/assets/proactive-card-BF3741px.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-1EM217v0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-B1Pm-fQd.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DUrxyNR9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C6VzHUwx.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DtemHfkv.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByEVQe0c.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BwIrk3Jx.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-DAc_FkVc.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Dwdv6QyS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CDzQWN60.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CO5XVkbY.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DOjcKOzQ.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BABuQvGD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-UhsSP_pC.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-S7XXNBWa.js +0 -6
- package/dist/src/proactive/scenarios/preview.d.ts +0 -13
- package/dist/src/proactive/scenarios/preview.js +0 -81
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getSqliteDatabase } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { getAssertionSlot, listUserAssertions } from "../../user-model/repository.js";
|
|
3
3
|
import "../../user-model/index.js";
|
|
4
|
-
import { getDiscussionCapture, getLatestDiscussionOrganization } from "../../discussions/repository.js";
|
|
5
4
|
import { authorizedConnectedSource } from "./authorization.js";
|
|
6
5
|
import { authorizedMailThread, requireMailFollowUp } from "../follow-ups.js";
|
|
6
|
+
import { getDiscussionCapture, getLatestDiscussionOrganization } from "../../discussions/repository.js";
|
|
7
7
|
import { wrapExternalContent } from "../../gateway/security/external-content.js";
|
|
8
8
|
//#region src/proactive/execution/context.ts
|
|
9
9
|
const MAX_EVENT_COUNT = 50;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { getSqliteDatabase } from "../../storage/sqlite/transaction.js";
|
|
4
|
-
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
5
4
|
import { authorizedConnectedSource } from "./authorization.js";
|
|
5
|
+
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
6
6
|
import { getPromptRevision, getScenario } from "../scenarios/repository.js";
|
|
7
7
|
import { composeScenarioPrompt } from "../scenarios/prompt-composer.js";
|
|
8
8
|
import { markReadyBatches } from "../routing/batch-repository.js";
|
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { getCard } from './inbox/cards.js';
|
|
2
|
+
type SceneKind = 'project_momentum' | 'meeting_preparation' | 'communication_follow_up';
|
|
3
|
+
type SceneStatus = 'needs_decision' | 'prepared' | 'changed' | 'following';
|
|
4
|
+
interface SceneMoment {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: SceneKind;
|
|
7
|
+
status: SceneStatus;
|
|
8
|
+
title: string;
|
|
9
|
+
promise: string;
|
|
10
|
+
moment: string;
|
|
11
|
+
relevance: string;
|
|
12
|
+
help: string;
|
|
13
|
+
arrangementId: string;
|
|
14
|
+
manageRoute: string;
|
|
15
|
+
object: {
|
|
16
|
+
label: string;
|
|
17
|
+
route: string;
|
|
18
|
+
} | null;
|
|
19
|
+
card: ReturnType<typeof getCard> | null;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
1
22
|
export declare function startDelegation(workspace: string, value: unknown): {
|
|
2
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
3
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
4
23
|
revision: number;
|
|
5
24
|
level: "off" | "active" | "quiet" | "balanced";
|
|
6
25
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -22,6 +41,7 @@ export declare function checkDelegation(workspace: string, id: string): {
|
|
|
22
41
|
status: "queued";
|
|
23
42
|
};
|
|
24
43
|
export declare function delegationOverview(workspace: string): {
|
|
44
|
+
scenes: SceneMoment[];
|
|
25
45
|
followUps: {
|
|
26
46
|
id: string;
|
|
27
47
|
subscriptionId: string;
|
|
@@ -39,31 +59,28 @@ export declare function delegationOverview(workspace: string): {
|
|
|
39
59
|
lastSyncedAt: string;
|
|
40
60
|
syncFailed: boolean;
|
|
41
61
|
}[];
|
|
42
|
-
needsDecision: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
43
|
-
prepared: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
44
|
-
updates: import("@xopcai/gateway-contract/src/proactive.js").ProactiveCard[];
|
|
45
62
|
delegations: {
|
|
46
|
-
effectiveEnabled: boolean;
|
|
47
|
-
project: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
48
|
-
latestRun: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
49
|
-
pending: boolean;
|
|
50
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
51
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
52
|
-
revision: number;
|
|
53
|
-
level: "off" | "active" | "quiet" | "balanced";
|
|
54
|
-
delivery: "digest" | "inbox" | "important";
|
|
55
|
-
completedAt: string;
|
|
56
|
-
scanIntervalMinutes: number;
|
|
57
|
-
userInstructions: string;
|
|
58
63
|
id: string;
|
|
59
64
|
scenarioKey: string;
|
|
60
|
-
|
|
61
|
-
scopeKind: "workspace" | "project";
|
|
65
|
+
scopeKind: "project" | "workspace";
|
|
62
66
|
scopeId: string;
|
|
63
67
|
enabled: boolean;
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
revision: number;
|
|
69
|
+
delivery: "digest" | "inbox" | "important";
|
|
70
|
+
completedAt: string;
|
|
71
|
+
userInstructions: string;
|
|
66
72
|
updatedAt: string;
|
|
73
|
+
effectiveEnabled: boolean;
|
|
74
|
+
project: {
|
|
75
|
+
name: string;
|
|
76
|
+
status: string;
|
|
77
|
+
};
|
|
78
|
+
projectMonitoring: {
|
|
79
|
+
mode: "observe" | "ask_before_action" | "auto_low_risk";
|
|
80
|
+
allowedActions: string[];
|
|
81
|
+
};
|
|
82
|
+
checking: boolean;
|
|
67
83
|
}[];
|
|
68
84
|
};
|
|
69
85
|
export declare function completeDeliveredProjects(now?: Date): void;
|
|
86
|
+
export {};
|
|
@@ -2,9 +2,9 @@ import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/
|
|
|
2
2
|
import { ProactiveConflict, effectiveProactivePolicy } from "./policy/service.js";
|
|
3
3
|
import { controlledSubscriptions, createControlledSubscription, requireSubscription, updateControlledSubscription } from "./scenarios/control.js";
|
|
4
4
|
import { ProactiveScenarioService } from "./scenarios/service.js";
|
|
5
|
-
import { getCard } from "./inbox/cards.js";
|
|
6
5
|
import { ProactiveEventService } from "./service.js";
|
|
7
6
|
import { listMailFollowUps } from "./follow-ups.js";
|
|
7
|
+
import { getCard } from "./inbox/cards.js";
|
|
8
8
|
import { scanDueProjects } from "./temporal/schedule.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/proactive/experience.ts
|
|
@@ -60,20 +60,116 @@ function delegationOverview(workspace) {
|
|
|
60
60
|
AND (i.expires_at IS NULL OR i.expires_at > ?)
|
|
61
61
|
ORDER BY CASE WHEN x.action_status = 'approval_required' THEN 0 WHEN x.artifact_json IS NOT NULL THEN 1 ELSE 2 END,
|
|
62
62
|
x.value_score DESC, i.updated_at DESC LIMIT 100`).all(workspace, now).map((row) => getCard(row.inbox_item_id, workspace)).filter((card) => !["withdrawn", "expired"].includes(card.status));
|
|
63
|
+
const followUps = listMailFollowUps(workspace);
|
|
64
|
+
const delegations = controlledSubscriptions(workspace).map((sub) => ({
|
|
65
|
+
id: sub.id,
|
|
66
|
+
scenarioKey: sub.scenarioKey,
|
|
67
|
+
scopeKind: sub.scopeKind,
|
|
68
|
+
scopeId: sub.scopeId,
|
|
69
|
+
enabled: sub.enabled,
|
|
70
|
+
revision: sub.revision,
|
|
71
|
+
delivery: sub.delivery,
|
|
72
|
+
completedAt: sub.completedAt,
|
|
73
|
+
userInstructions: sub.userInstructions,
|
|
74
|
+
updatedAt: sub.updatedAt,
|
|
75
|
+
effectiveEnabled: effectiveProactivePolicy(sub.id).enabled,
|
|
76
|
+
project: sub.scopeKind === "project" ? db.prepare("SELECT name, status FROM projects WHERE project_id = ?").get(sub.scopeId) ?? null : null,
|
|
77
|
+
projectMonitoring: sub.scopeKind === "project" ? projectMonitoring(sub.scopeId) : null,
|
|
78
|
+
checking: Boolean(db.prepare("SELECT 1 FROM proactive_signal_batches WHERE subscription_id = ? AND status IN ('collecting', 'ready', 'processing')").get(sub.id))
|
|
79
|
+
}));
|
|
63
80
|
return {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
scenes: projectSceneMoments(cards, delegations, followUps),
|
|
82
|
+
followUps,
|
|
83
|
+
delegations
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function projectMonitoring(projectId) {
|
|
87
|
+
const row = getSqliteDatabase().prepare("SELECT mode, allowed_actions_json FROM project_monitoring_policies WHERE project_id = ?").get(projectId);
|
|
88
|
+
return row ? {
|
|
89
|
+
mode: row.mode,
|
|
90
|
+
allowedActions: JSON.parse(row.allowed_actions_json)
|
|
91
|
+
} : {
|
|
92
|
+
mode: "observe",
|
|
93
|
+
allowedActions: []
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function projectSceneMoments(cards, delegations, followUps) {
|
|
97
|
+
const latestCardBySubscription = /* @__PURE__ */ new Map();
|
|
98
|
+
for (const card of cards) {
|
|
99
|
+
const previous = latestCardBySubscription.get(card.subscriptionId);
|
|
100
|
+
if (!previous || previous.updatedAt < card.updatedAt) latestCardBySubscription.set(card.subscriptionId, card);
|
|
101
|
+
}
|
|
102
|
+
const moments = [];
|
|
103
|
+
for (const sub of delegations) {
|
|
104
|
+
if (!sub.effectiveEnabled || sub.completedAt || ![
|
|
105
|
+
"project_delivery_risk",
|
|
106
|
+
"meeting_preparation",
|
|
107
|
+
"discussion_follow_up"
|
|
108
|
+
].includes(sub.scenarioKey)) continue;
|
|
109
|
+
const card = latestCardBySubscription.get(sub.id) ?? null;
|
|
110
|
+
const project = sub.project;
|
|
111
|
+
const kind = sub.scenarioKey === "meeting_preparation" ? "meeting_preparation" : sub.scenarioKey === "discussion_follow_up" ? "communication_follow_up" : "project_momentum";
|
|
112
|
+
const object = project ? {
|
|
113
|
+
label: project.name,
|
|
114
|
+
route: `/projects/${encodeURIComponent(sub.scopeId)}`
|
|
115
|
+
} : card?.evidence.find((item) => item.route) ? (() => {
|
|
116
|
+
const item = card.evidence.find((value) => value.route);
|
|
117
|
+
return {
|
|
118
|
+
label: item.label,
|
|
119
|
+
route: item.route
|
|
120
|
+
};
|
|
121
|
+
})() : null;
|
|
122
|
+
moments.push({
|
|
123
|
+
id: `scene:${sub.id}`,
|
|
124
|
+
kind,
|
|
125
|
+
status: sceneStatus(card),
|
|
126
|
+
title: project?.name ?? card?.title ?? (kind === "meeting_preparation" ? "Meeting preparation" : kind === "communication_follow_up" ? "Conversation follow-up" : "Project follow-through"),
|
|
127
|
+
promise: sub.userInstructions,
|
|
128
|
+
moment: card?.whyNow ?? (kind === "meeting_preparation" ? "Waiting for the next relevant meeting" : kind === "communication_follow_up" ? "Watching for a meaningful follow-up" : "Watching the project for a meaningful change"),
|
|
129
|
+
relevance: card?.summary ?? sub.userInstructions,
|
|
130
|
+
help: card?.workDone || card?.recommendation || (kind === "meeting_preparation" ? "I will bring back a brief before the meeting." : kind === "communication_follow_up" ? "I will return when the discussion needs a next step." : "I will return when the goal, commitment, or delivery risk changes."),
|
|
131
|
+
arrangementId: sub.id,
|
|
132
|
+
manageRoute: `/assistant-work?delegation=${encodeURIComponent(sub.id)}`,
|
|
133
|
+
object,
|
|
134
|
+
card,
|
|
135
|
+
updatedAt: card?.updatedAt ?? sub.updatedAt
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
for (const follow of followUps) {
|
|
139
|
+
if (!follow.enabled || follow.status !== "watching") continue;
|
|
140
|
+
const card = cards.find((item) => item.communication?.id === follow.id) ?? null;
|
|
141
|
+
moments.push({
|
|
142
|
+
id: `scene:${follow.id}`,
|
|
143
|
+
kind: "communication_follow_up",
|
|
144
|
+
status: sceneStatus(card),
|
|
145
|
+
title: follow.subject ?? "Communication follow-up",
|
|
146
|
+
promise: follow.instructions,
|
|
147
|
+
moment: card?.whyNow ?? (follow.latestDirection === "received" ? "A reply arrived" : `Waiting until ${follow.dueAt}`),
|
|
148
|
+
relevance: card?.summary ?? follow.instructions,
|
|
149
|
+
help: card?.workDone || card?.recommendation || "I will watch the thread and prepare the next step when it matters.",
|
|
150
|
+
arrangementId: follow.subscriptionId,
|
|
151
|
+
manageRoute: `/assistant-work?follow-up=${encodeURIComponent(follow.id)}`,
|
|
152
|
+
object: follow.sessionKey ? {
|
|
153
|
+
label: follow.subject ?? "Open conversation",
|
|
154
|
+
route: `/chat/${encodeURIComponent(follow.sessionKey)}`
|
|
155
|
+
} : null,
|
|
156
|
+
card,
|
|
157
|
+
updatedAt: card?.updatedAt ?? follow.lastCheckedAt ?? follow.dueAt
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const priority = {
|
|
161
|
+
needs_decision: 0,
|
|
162
|
+
prepared: 1,
|
|
163
|
+
changed: 2,
|
|
164
|
+
following: 3
|
|
76
165
|
};
|
|
166
|
+
return moments.sort((a, b) => priority[a.status] - priority[b.status] || b.updatedAt.localeCompare(a.updatedAt));
|
|
167
|
+
}
|
|
168
|
+
function sceneStatus(card) {
|
|
169
|
+
if (!card) return "following";
|
|
170
|
+
if (card.decision && card.actionStatus !== "completed") return "needs_decision";
|
|
171
|
+
if (card.artifact) return "prepared";
|
|
172
|
+
return "changed";
|
|
77
173
|
}
|
|
78
174
|
function completeDeliveredProjects(now = /* @__PURE__ */ new Date()) {
|
|
79
175
|
const db = getSqliteDatabase();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
3
3
|
import { getConnectorConnection } from "../storage/sqlite/connector-repository.js";
|
|
4
|
-
import { ProactiveConflict, effectiveProactivePolicy } from "./policy/service.js";
|
|
5
4
|
import { emailFields, readMailThread } from "./mail-thread.js";
|
|
6
5
|
import { authorizedConnectedSource } from "./execution/authorization.js";
|
|
6
|
+
import { ProactiveConflict, effectiveProactivePolicy } from "./policy/service.js";
|
|
7
7
|
import { listSubscriptions } from "./scenarios/repository.js";
|
|
8
8
|
import { createControlledSubscription } from "./scenarios/control.js";
|
|
9
9
|
import { ProactiveScenarioService } from "./scenarios/service.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { ProactiveCardActionSchema } from "../../../packages/gateway-contract/src/proactive.js";
|
|
3
3
|
import { getKnowledgeSourceItem } from "../../storage/sqlite/knowledge-repository.js";
|
|
4
|
-
import { ProactiveConflict, effectiveProactivePolicy, subscriptionSettings } from "../policy/service.js";
|
|
5
4
|
import { insightSourcesAuthorized, insightSourcesChanged } from "../execution/authorization.js";
|
|
5
|
+
import { ProactiveConflict, effectiveProactivePolicy, subscriptionSettings } from "../policy/service.js";
|
|
6
|
+
import { updateControlledSubscription } from "../scenarios/control.js";
|
|
6
7
|
import { withdrawCard } from "./lifecycle.js";
|
|
7
8
|
import { executePendingProactiveActions } from "../actions/service.js";
|
|
8
|
-
import { updateControlledSubscription } from "../scenarios/control.js";
|
|
9
9
|
import { getInboxItem } from "./repository.js";
|
|
10
10
|
import { ProactiveInboxService } from "./service.js";
|
|
11
11
|
//#region src/proactive/inbox/cards.ts
|
|
@@ -150,7 +150,8 @@ function performCardAction(id, workspaceId, value) {
|
|
|
150
150
|
if (card.status === "withdrawn" || card.status === "expired" || card.status === "resolved" && ![
|
|
151
151
|
"useful",
|
|
152
152
|
"not_useful",
|
|
153
|
-
"retry"
|
|
153
|
+
"retry",
|
|
154
|
+
"refine"
|
|
154
155
|
].includes(input.actionId)) throw new ProactiveConflict("Card is no longer actionable");
|
|
155
156
|
applyCardAction(card, workspaceId, input);
|
|
156
157
|
const result = getCard(id, workspaceId);
|
|
@@ -162,6 +163,7 @@ function applyCardAction(card, workspaceId, input) {
|
|
|
162
163
|
const service = new ProactiveInboxService();
|
|
163
164
|
if (input.taskDraft && (input.actionId !== "decide" || input.choice !== "approve" || !card.taskDraft)) throw new Error("Task draft requires a pending approval");
|
|
164
165
|
if (input.artifact && input.actionId !== "edit_artifact") throw new Error("Artifact requires an edit action");
|
|
166
|
+
if (input.instruction && input.actionId !== "refine") throw new Error("Instruction requires a refine action");
|
|
165
167
|
switch (input.actionId) {
|
|
166
168
|
case "edit_artifact":
|
|
167
169
|
if (!input.artifact || !card.artifact || input.artifact.kind !== card.artifact.kind) throw new Error("An existing artifact is required");
|
|
@@ -177,6 +179,10 @@ function applyCardAction(card, workspaceId, input) {
|
|
|
177
179
|
case "not_useful":
|
|
178
180
|
service.feedback(card.id, input.actionId);
|
|
179
181
|
break;
|
|
182
|
+
case "refine":
|
|
183
|
+
if (!input.instruction) throw new Error("Refinement instruction required");
|
|
184
|
+
service.instruct(card.id, input.instruction);
|
|
185
|
+
break;
|
|
180
186
|
case "read":
|
|
181
187
|
service.transition(card.id, { status: "read" });
|
|
182
188
|
break;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { effectiveProactivePolicy, localProactiveDay, nextDigestTime, quietHoursEnd, reserveProactiveNotification } from "../policy/service.js";
|
|
3
|
-
import { viewingProactiveCards } from "../policy/presence.js";
|
|
4
2
|
import { insightSourcesAuthorized, insightSourcesChanged } from "../execution/authorization.js";
|
|
3
|
+
import { effectiveProactivePolicy, localProactiveDay, nextDigestTime, quietHoursEnd, reserveProactiveNotification } from "../policy/service.js";
|
|
5
4
|
import { insightCorrelation } from "./lifecycle.js";
|
|
6
5
|
import { getInboxItem } from "./repository.js";
|
|
6
|
+
import { viewingProactiveCards } from "../policy/presence.js";
|
|
7
7
|
import { queueDigest } from "./digest.js";
|
|
8
8
|
import { notificationPlanFromGatewayEvent } from "../../notifications/planner.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { effectiveProactivePolicy, localProactiveDay, nextDigestTime, proactivePreferences, quietHoursEnd } from "../policy/service.js";
|
|
3
|
-
import { viewingProactiveCards } from "../policy/presence.js";
|
|
4
2
|
import { insightSourcesAuthorized } from "../execution/authorization.js";
|
|
3
|
+
import { effectiveProactivePolicy, localProactiveDay, nextDigestTime, proactivePreferences, quietHoursEnd } from "../policy/service.js";
|
|
5
4
|
import { getInboxItem } from "./repository.js";
|
|
6
5
|
import { getCard } from "./cards.js";
|
|
6
|
+
import { viewingProactiveCards } from "../policy/presence.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
//#region src/proactive/inbox/digest.ts
|
|
9
9
|
function queueDigest(item, mode, dueAt) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { effectiveProactivePolicy, quietHoursEnd } from "../policy/service.js";
|
|
2
1
|
import { insightSourcesAuthorized, insightSourcesChanged } from "../execution/authorization.js";
|
|
2
|
+
import { effectiveProactivePolicy, quietHoursEnd } from "../policy/service.js";
|
|
3
3
|
import { getInboxItem } from "./repository.js";
|
|
4
4
|
//#region src/proactive/inbox/notification-policy.ts
|
|
5
5
|
function recheckProactiveNotification(itemId, now = /* @__PURE__ */ new Date(), notificationRevision) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
3
2
|
import { insightSourcesAuthorized, insightSourcesChanged } from "../execution/authorization.js";
|
|
3
|
+
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
4
4
|
import { decideProactiveDisposition, nextQuietHoursEnd, proactiveDispositionReason } from "../../tasks/project-monitoring-service.js";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
//#region src/proactive/inbox/repository.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { executePendingProactiveActions } from "../actions/service.js";
|
|
2
1
|
import { publishInstructionFeedback } from "../scenarios/repository.js";
|
|
2
|
+
import { executePendingProactiveActions } from "../actions/service.js";
|
|
3
3
|
import { getInboxItem, getInboxSubscriptionId, listInbox, projectInsightsToInbox, recordDecision, recordFeedback, transitionInboxItem, wakeSnoozedItems } from "./repository.js";
|
|
4
4
|
//#region src/proactive/inbox/service.ts
|
|
5
5
|
var ProactiveInboxService = class {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ProactiveScenarioService } from "./scenarios/service.js";
|
|
2
|
-
import { ProactiveInboxService } from "./inbox/service.js";
|
|
3
2
|
import { normalizeEventEnvelope } from "./events/envelope.js";
|
|
4
3
|
import { matchScenario, matchesCondition } from "./routing/matcher.js";
|
|
5
4
|
import { ProactiveEventService } from "./service.js";
|
|
5
|
+
import { ProactiveInboxService } from "./inbox/service.js";
|
|
6
6
|
import { mapProductEventToProactive } from "./events/product-event-bridge.js";
|
|
7
7
|
import { pruneProactiveHistory } from "./maintenance.js";
|
|
8
8
|
import { AutomationStateContextProvider, ConnectedSourceContextProvider, ContextProviderRegistry, EventBatchContextProvider, InternalObjectContextProvider, MeetingWorkspaceContextProvider, ProjectStateContextProvider, UserModelContextProvider } from "./execution/context.js";
|
|
@@ -14,7 +14,6 @@ function pruneProactiveHistory(now = /* @__PURE__ */ new Date()) {
|
|
|
14
14
|
db.prepare("DELETE FROM proactive_notification_budget WHERE created_at < ?").run(cutoff);
|
|
15
15
|
db.prepare("DELETE FROM proactive_presence WHERE expires_at <= ?").run(now.getTime());
|
|
16
16
|
db.prepare("DELETE FROM proactive_delivery_decisions WHERE created_at < ?").run(cutoff);
|
|
17
|
-
db.prepare("DELETE FROM proactive_preview_runs WHERE created_at < ?").run(cutoff);
|
|
18
17
|
db.prepare("DELETE FROM proactive_push_probes WHERE created_at < ?").run(Date.parse(cutoff));
|
|
19
18
|
db.prepare("DELETE FROM proactive_digest_queue WHERE consumed_at < ?").run(cutoff);
|
|
20
19
|
db.prepare("DELETE FROM proactive_digests WHERE created_at < ?").run(cutoff);
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
export declare function requireSubscription(id: string, workspaceId: string): import("./types.js").ScenarioSubscription;
|
|
2
|
-
export declare function templateCatalog(workspaceId?: string): {
|
|
3
|
-
parameterSchema: {
|
|
4
|
-
type: string;
|
|
5
|
-
properties: {
|
|
6
|
-
scanIntervalMinutes: {
|
|
7
|
-
type: string;
|
|
8
|
-
minimum: number;
|
|
9
|
-
maximum: number;
|
|
10
|
-
};
|
|
11
|
-
userInstructions: {
|
|
12
|
-
type: string;
|
|
13
|
-
maxLength: number;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
calendarSource?: {
|
|
18
|
-
status: string;
|
|
19
|
-
lastSourceUpdatedAt: string;
|
|
20
|
-
};
|
|
21
|
-
key: string;
|
|
22
|
-
version: number;
|
|
23
|
-
title: string;
|
|
24
|
-
description: string;
|
|
25
|
-
scopeKind: "project" | "workspace";
|
|
26
|
-
eventTypes: string[];
|
|
27
|
-
contextProviderIds: string[];
|
|
28
|
-
scheduled: boolean;
|
|
29
|
-
requiresCalendar: boolean;
|
|
30
|
-
}[];
|
|
31
2
|
export declare function controlledSubscriptions(workspaceId: string): {
|
|
32
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
33
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
34
3
|
revision: number;
|
|
35
4
|
level: "off" | "active" | "quiet" | "balanced";
|
|
36
5
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -48,8 +17,6 @@ export declare function controlledSubscriptions(workspaceId: string): {
|
|
|
48
17
|
updatedAt: string;
|
|
49
18
|
}[];
|
|
50
19
|
export declare function createControlledSubscription(workspaceId: string, value: unknown): {
|
|
51
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
52
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
53
20
|
revision: number;
|
|
54
21
|
level: "off" | "active" | "quiet" | "balanced";
|
|
55
22
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -67,8 +34,6 @@ export declare function createControlledSubscription(workspaceId: string, value:
|
|
|
67
34
|
updatedAt: string;
|
|
68
35
|
};
|
|
69
36
|
export declare function updateControlledSubscription(workspaceId: string, id: string, value: unknown): {
|
|
70
|
-
effectiveLevel: "off" | "active" | "quiet" | "balanced";
|
|
71
|
-
schedule: Record<string, import("node:sqlite").SQLOutputValue>;
|
|
72
37
|
revision: number;
|
|
73
38
|
level: "off" | "active" | "quiet" | "balanced";
|
|
74
39
|
delivery: "digest" | "inbox" | "important";
|
|
@@ -1,51 +1,17 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
2
|
import { ProactiveSubscriptionCreateSchema, ProactiveSubscriptionSettingsSchema, ProactiveSubscriptionUpdateSchema } from "../../../packages/gateway-contract/src/proactive.js";
|
|
3
|
-
import { ProactiveConflict,
|
|
4
|
-
import { createPromptDraft, getScenario, getSubscription,
|
|
3
|
+
import { ProactiveConflict, subscriptionSettings } from "../policy/service.js";
|
|
4
|
+
import { createPromptDraft, getScenario, getSubscription, listSubscriptions, publishPromptRevision, upsertSubscription } from "./repository.js";
|
|
5
5
|
//#region src/proactive/scenarios/control.ts
|
|
6
6
|
function requireSubscription(id, workspaceId) {
|
|
7
7
|
const sub = getSubscription(id);
|
|
8
8
|
if (!sub || sub.workspaceId !== workspaceId) throw new Error("Subscription not found");
|
|
9
9
|
return sub;
|
|
10
10
|
}
|
|
11
|
-
function templateCatalog(workspaceId) {
|
|
12
|
-
return listScenarios().map((scenario) => ({
|
|
13
|
-
key: scenario.key,
|
|
14
|
-
version: scenario.version,
|
|
15
|
-
title: scenario.title,
|
|
16
|
-
description: scenario.description,
|
|
17
|
-
scopeKind: ["project_delivery_risk", "blocked_work"].includes(scenario.key) ? "project" : "workspace",
|
|
18
|
-
eventTypes: scenario.eventTypes,
|
|
19
|
-
contextProviderIds: scenario.contextProviderIds,
|
|
20
|
-
scheduled: [
|
|
21
|
-
"project_delivery_risk",
|
|
22
|
-
"blocked_work",
|
|
23
|
-
"meeting_preparation"
|
|
24
|
-
].includes(scenario.key),
|
|
25
|
-
requiresCalendar: scenario.key === "meeting_preparation",
|
|
26
|
-
...workspaceId && scenario.key === "meeting_preparation" ? { calendarSource: calendarSourceStatus(workspaceId) } : {},
|
|
27
|
-
parameterSchema: {
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
scanIntervalMinutes: {
|
|
31
|
-
type: "integer",
|
|
32
|
-
minimum: 15,
|
|
33
|
-
maximum: 10080
|
|
34
|
-
},
|
|
35
|
-
userInstructions: {
|
|
36
|
-
type: "string",
|
|
37
|
-
maxLength: 12e3
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
11
|
function controlledSubscriptions(workspaceId) {
|
|
44
12
|
return listSubscriptions().filter((sub) => sub.workspaceId === workspaceId).map((sub) => ({
|
|
45
13
|
...sub,
|
|
46
|
-
...subscriptionSettings(sub.id)
|
|
47
|
-
effectiveLevel: effectiveProactivePolicy(sub.id).level,
|
|
48
|
-
schedule: getSqliteDatabase().prepare("SELECT next_due_at AS nextDueAt, last_checked_at AS lastCheckedAt FROM proactive_schedule_state WHERE subscription_id = ?").get(sub.id) ?? null
|
|
14
|
+
...subscriptionSettings(sub.id)
|
|
49
15
|
}));
|
|
50
16
|
}
|
|
51
17
|
function saveSettings(id, value, revision) {
|
|
@@ -57,9 +23,9 @@ function saveSettings(id, value, revision) {
|
|
|
57
23
|
}
|
|
58
24
|
function createControlledSubscription(workspaceId, value) {
|
|
59
25
|
const input = ProactiveSubscriptionCreateSchema.parse(value);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (input.scopeKind !==
|
|
26
|
+
if (!getScenario(input.scenarioKey)) throw new Error("Scenario not found");
|
|
27
|
+
const scopeKind = ["project_delivery_risk", "blocked_work"].includes(input.scenarioKey) ? "project" : "workspace";
|
|
28
|
+
if (input.scopeKind !== scopeKind) throw new Error("Invalid scenario scope");
|
|
63
29
|
if (input.scopeKind === "project" && !getSqliteDatabase().prepare("SELECT 1 FROM projects WHERE project_id = ?").get(input.scopeId)) throw new Error("Project not found");
|
|
64
30
|
const scopeId = input.scopeKind === "workspace" ? workspaceId : input.scopeId;
|
|
65
31
|
return runSqliteWriteTransaction(() => {
|
|
@@ -92,17 +58,5 @@ function updateControlledSubscription(workspaceId, id, value) {
|
|
|
92
58
|
return controlledSubscriptions(workspaceId).find((item) => item.id === id);
|
|
93
59
|
});
|
|
94
60
|
}
|
|
95
|
-
function calendarSourceStatus(workspaceId) {
|
|
96
|
-
const row = getSqliteDatabase().prepare(`SELECT COUNT(*) AS count, MAX(k.updated_at) AS lastSourceUpdatedAt FROM knowledge_source_items k
|
|
97
|
-
JOIN connector_connections c ON c.id = json_extract(k.metadata_json, '$.connectionId')
|
|
98
|
-
JOIN connector_sync_policies p ON p.account_id = c.account_id
|
|
99
|
-
WHERE k.item_type = 'calendar_event' AND k.deleted_at IS NULL AND k.sensitivity NOT IN ('secret', 'regulated')
|
|
100
|
-
AND json_extract(k.metadata_json, '$.workspaceId') = ? AND c.status = 'active' AND p.scan_enabled = 1 AND p.proactive_enabled = 1
|
|
101
|
-
AND (json_array_length(p.allowed_scenario_keys_json) = 0 OR EXISTS (SELECT 1 FROM json_each(p.allowed_scenario_keys_json) WHERE value = 'meeting_preparation'))`).get(workspaceId);
|
|
102
|
-
return {
|
|
103
|
-
status: row.count ? "available" : "waiting_for_authorized_data",
|
|
104
|
-
lastSourceUpdatedAt: row.lastSourceUpdatedAt ? new Date(row.lastSourceUpdatedAt).toISOString() : null
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
61
|
//#endregion
|
|
108
|
-
export { controlledSubscriptions, createControlledSubscription, requireSubscription,
|
|
62
|
+
export { controlledSubscriptions, createControlledSubscription, requireSubscription, updateControlledSubscription };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { listKnowledgeSourceItems } from "../../storage/sqlite/knowledge-repository.js";
|
|
4
|
-
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
5
4
|
import { authorizedConnectedSource } from "../execution/authorization.js";
|
|
5
|
+
import { effectiveProactivePolicy } from "../policy/service.js";
|
|
6
6
|
import { listSubscriptions } from "../scenarios/repository.js";
|
|
7
7
|
import { scanMailFollowUps } from "../follow-ups.js";
|
|
8
8
|
import { scanDueProjects } from "./schedule.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
2
|
-
import { removeSkillsLockEntry } from "../agent/skills/hub-lock.js";
|
|
3
|
-
import { deleteManagedSkill, installSkillFromZip, isValidSkillId } from "../agent/skills/managed-store.js";
|
|
4
2
|
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../agent/skills/workspace-skills-dir.js";
|
|
5
3
|
import { loadSkills, loadWorkspaceSkillInventory } from "../agent/skills/index.js";
|
|
4
|
+
import { removeSkillsLockEntry } from "../agent/skills/hub-lock.js";
|
|
5
|
+
import { deleteManagedSkill, installSkillFromZip, isValidSkillId } from "../agent/skills/managed-store.js";
|
|
6
6
|
import { pullSkillFromSource } from "../agent/skills/hub-pull.js";
|
|
7
7
|
import { downloadFromMarketplace } from "../agent/skills/skills-marketplace.js";
|
|
8
8
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -223,7 +223,7 @@ var ProjectStore = class {
|
|
|
223
223
|
}
|
|
224
224
|
listWithSidebarSessions(query = {}) {
|
|
225
225
|
const projectConditions = [];
|
|
226
|
-
const sessionConditions = [
|
|
226
|
+
const sessionConditions = [];
|
|
227
227
|
const params = [];
|
|
228
228
|
if (query.status) {
|
|
229
229
|
const statuses = Array.isArray(query.status) ? query.status : [query.status];
|
|
@@ -241,19 +241,21 @@ var ProjectStore = class {
|
|
|
241
241
|
}
|
|
242
242
|
sessionConditions.push(`(${clauses.join(" OR ")})`);
|
|
243
243
|
}
|
|
244
|
-
const whereParts = [...projectConditions, ...sessionConditions];
|
|
244
|
+
const whereParts = [...projectConditions, ...sessionConditions.length ? [`(s.session_key IS NULL OR (${sessionConditions.join(" AND ")}))`] : []];
|
|
245
245
|
const where = whereParts.length ? `WHERE ${whereParts.join(" AND ")}` : "";
|
|
246
246
|
const limit = clampLimit(query.limit, 50);
|
|
247
247
|
const offset = Math.max(0, Math.floor(query.offset ?? 0));
|
|
248
248
|
const db = getSqliteDatabase();
|
|
249
249
|
const total = db.prepare(`SELECT COUNT(DISTINCT p.project_id) AS total
|
|
250
250
|
FROM projects p
|
|
251
|
-
JOIN sessions s ON s.project_id = p.project_id
|
|
251
|
+
LEFT JOIN sessions s ON s.project_id = p.project_id
|
|
252
|
+
AND s.hidden_from_session_list = 0 AND s.session_type = 'chat'
|
|
252
253
|
${where}`).get(...params).total;
|
|
253
254
|
return {
|
|
254
255
|
items: db.prepare(`SELECT p.*
|
|
255
256
|
FROM projects p
|
|
256
|
-
JOIN sessions s ON s.project_id = p.project_id
|
|
257
|
+
LEFT JOIN sessions s ON s.project_id = p.project_id
|
|
258
|
+
AND s.hidden_from_session_list = 0 AND s.session_type = 'chat'
|
|
257
259
|
${where}
|
|
258
260
|
GROUP BY p.project_id
|
|
259
261
|
ORDER BY
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
1
|
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
|
+
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
5
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
6
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
5
7
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
7
8
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
2
2
|
import { getModelRegistry, init_model_registry } from "./model-registry.js";
|
|
3
|
-
import { getImageGenerationProvider } from "../agent/image/generation/provider-registry.js";
|
|
4
3
|
import { parseImageGenerationModelRef } from "../agent/image/generation/model-ref.js";
|
|
4
|
+
import { getImageGenerationProvider } from "../agent/image/generation/provider-registry.js";
|
|
5
5
|
//#region src/providers/model-reference-auditor.ts
|
|
6
6
|
init_model_catalog_store();
|
|
7
7
|
init_model_registry();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
|
+
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
2
|
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
|
+
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|