@xopcai/xopc 0.0.374 → 0.0.376
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-BeYLqqr8.js → activity-store-CvR3rjdp.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BrA20N2m.js → agent-avatar-dicebear-B6OsxiBw.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-MB_QmjX-.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-Bpcf0zhP.js +1 -0
- package/dist/gateway/static/root/assets/agents-BQ7ag_R3.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-B4tgTbWG.js → agents-admin-api-DsXvJeqd.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BXahEVPm.js → app-management-settings-panel-9JzhRHSD.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CE2qJMkD.js → appearance-settings-CoyZuGAt.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DGVOnCxZ.js → apps-page-CcbCxZaw.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-bI9OLnXj.js → archive-plugin-kfDRSd7K.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BWL7eT4_.js → automations-page-DZJKbmlm.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-ChKT1JN6.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-dOwLzjeH.js → binary-plugins-d4QP_iyy.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-3n446-mX.js → block-editor-DraiSml9.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-automation-inputs-i7h1Svpf.js → browser-automation-inputs-BAiaU9gl.js} +1 -1
- package/dist/gateway/static/root/assets/browser-automations-page-Bo40qRor.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-Dg4S7ph5.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-D4KFLtqM.js → capabilities-B-vsqiw2.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CquUV0DP.js → capabilities-DQEeiNq_.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CuHSjBDG.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-bxxADxzW.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-BRMqvQVb.js → capability-header-actions-CaH0L2sV.js} +1 -1
- package/dist/gateway/static/root/assets/channels-Drx78hEY.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BRdzCjWO.js → chat-terminal-dock-hZnKhClF.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-BhCHMRpD.js → computer-settings-page-CYEA9B-G.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BXE8Z-Ll.js → connector-service-page-DXi2Bx2u.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BCWPY5hs.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-BJ7N92wm.js → date-picker-BW_xBw2L.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-gyxCM-hb.js → dependency-picker-ByRPupfC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-B-WM4l-L.js → desktop-pet-DTcVMPlC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-usJqcew5.js → desktop-pet-settings-BkMP5pdR.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DoSR4DGk.js → device-pairing-wizard-5kYuK9oW.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DqVlV2YH.js → directory-picker-path-field-DIYIejyX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CbgEonkK.js → extension-debug-page-QCUvXcP2.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CUule9SU.js → extension-page-BMeQveJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DxlAZ2iy.js → extension-provider-CDOEBj7F.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-_OFukkEJ.js → extension-settings-page-D-M7P4HQ.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-CiSc3h8i.js → fallback-models-5DaUVrLS.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BoRkBnsw.js → gateway-config-swr-CWIVt5XM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-C3WQQY10.js → gateway-realtime-DC8N3fNU.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BkE2mHog.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DK2NzPkL.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-TYSQEQcG.js → gateway-startup-retry-pVqdX0dO.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-A3oTV3Vq.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-_pKiNfSq.js → image-generation-api-CX6__We2.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DdvIj-ZL.js → imports-page-b0ILSTz1.js} +1 -1
- package/dist/gateway/static/root/assets/index-Cz75qf5b.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DbqFlNsF.js → keyboard-shortcuts-settings-DGl7wSHG.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-REowUzkp.js → local-app-workbench-page--W2QjBqz.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DdCMNn_z.js → local-apps-page-8SQ85WLr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Cg9RdsNN.js → local-session-drafts-LCEmswHW.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-rWFLl-p4.js → locale-store-UEl-U1DO.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BAQeHGd4.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-D4vcSRE3.js → management-settings-DoXDsSSN.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BHFFusQs.js → markdown-view-DUo9Tl3H.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BVPTMWJI.js → media-plugins-8zr2wlMR.js} +1 -1
- package/dist/gateway/static/root/assets/{messages-C1SUo4gG.js → messages-Uqz0xpsK.js} +2 -2
- package/dist/gateway/static/root/assets/models-hub-cache-3HOFy11k.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Cg65uYJ3.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-CSLVCZBn.js → notes-api-bDQOslzF.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-DDUlWJOk.js +8 -0
- package/dist/gateway/static/root/assets/number-input-DDeqHK-G.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-D7Y4vFRN.js → page-context-capture-button-o-i2_7Jz.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-E9-LBR1_.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CK_czbBx.js → product-open-page-DWgjStlK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-CU6KlaVP.js → product-preview-content-BWQRI242.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-c3ye2bdq.js → project-detail-page-FjGobz6n.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BA1UuuRF.js → projects-page-CVhXJp7f.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CoMBYjHD.js → registry-api-CftkuRz7.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B2AcKWlb.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Cxjmwdyf.js → runtime-tools-settings-panel-DmOfq9ay.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Av47PHdM.js → scenes-page-QQ2CiTee.js} +2 -2
- package/dist/gateway/static/root/assets/schema-form-TbUx_9NF.js +1 -0
- package/dist/gateway/static/root/assets/{send-session-input-CLhR1uEp.js → send-session-input-D4c72mD6.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-u_4_kFQt.js → session-api-DtpzfFNw.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-De46GeR0.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-CquSXQHo.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BOHKIN4t.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-BeVtwwVd.js → settings-page-NncRVc1e.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-t1vcGUsK.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-XhiuPKF4.js → share-link-dialog-DGUiTTZ3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Vc0TQuZ8.js → share-preview-page-BDl6XGKm.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BVSb1vh4.js → shares-api-BIx5ji2U.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DVM6xJuW.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-Dgwc707w.js → skill-api-Crld1PEV.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BsLx_FXd.js → skill-reload-api-D2HAboLP.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DdD6C_Z8.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-Ck6zGDHb.js → system-settings-panel-DUro5X0b.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-C3ZPEZqw.js → task-detail-page-BYNcWubZ.js} +2 -2
- package/dist/gateway/static/root/assets/{task-expandable-content-DxeBTJvh.js → task-expandable-content-BKa2YEJy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-KcQhCg1-.js → theme-store-ByAapAD7.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-Dv-XBvpD.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-CjxMpAm2.js → tunnel-api-C2_SEpMa.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-Dnhp9xQ4.js → usage-page-CqMzyGiK.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C-IWxbzm.js → use-autosave-BhsYFV0o.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-Dxphaxk-.js → use-composer-attachments-Bv4umde0.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Du37Gofn.js → use-file-preview-expanded-CBVymo3h.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-EMn_nA9w.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-7BImy8Jc.js → voice-api-key-field-DRoGFFs6.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-6MINytQl.js → voice-config-api-BwLiaw5J.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CVd_y3K2.js → work-discovery-overlay-DbH62mtI.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dwg40uGK.js → workflow-run-setup-panel-BYfytB9q.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-rJqJ9dQo.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-CXiyhTwv.js → workspace-api-BHy2a_hm.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CaKc_J7j.js → xopc-cloud-account-card-DrAX_9m_.js} +1 -1
- package/dist/gateway/static/root/index.html +26 -26
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +2 -7
- package/dist/src/agent/agent-manager.js +23 -52
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/prompts.d.ts +6 -0
- package/dist/src/agent/background-review/prompts.js +7 -1
- package/dist/src/agent/background-review/run-background-review.d.ts +3 -0
- package/dist/src/agent/background-review/run-background-review.js +183 -15
- package/dist/src/agent/context/coordinator.d.ts +1 -0
- package/dist/src/agent/context/coordinator.js +11 -2
- package/dist/src/agent/context/execution-context.js +40 -4
- package/dist/src/agent/context/project-context.js +11 -3
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +2 -2
- package/dist/src/agent/embedded/run-turn.js +5 -5
- 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/mcp/connection-setup.d.ts +21 -0
- package/dist/src/agent/mcp/connection-setup.js +214 -0
- package/dist/src/agent/mcp/tool-catalog.d.ts +18 -0
- package/dist/src/agent/mcp/tool-catalog.js +120 -0
- package/dist/src/agent/memory/compaction-promotion.d.ts +2 -0
- package/dist/src/agent/memory/compaction-promotion.js +33 -2
- package/dist/src/agent/service.js +5 -5
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +14 -6
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/model-credential-store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/draft/automation-draft-service.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/chat-commands/context.js +1 -1
- package/dist/src/cli/commands/agent.js +2 -2
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/image-providers.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +3 -3
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/extension-cli-register.js +1 -1
- package/dist/src/config/agent-model-intents.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +2 -2
- package/dist/src/config/schema.d.ts +5 -0
- package/dist/src/config/schema.js +5 -5
- package/dist/src/connectors/connected-source-ingestion.js +45 -7
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +59 -67
- package/dist/src/connectors/content-enrichment.js +1 -1
- package/dist/src/connectors/health.js +35 -2
- package/dist/src/connectors/learning-coordinator.js +2 -2
- package/dist/src/extensions/activation-context.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +5 -0
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.js +5 -5
- package/dist/src/gateway/hono/routes/connectors.js +4 -4
- package/dist/src/gateway/hono/routes/context-sources.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +2 -1
- package/dist/src/gateway/hono/routes/mcp.js +90 -1
- package/dist/src/gateway/hono/routes/memory-learning.d.ts +3 -0
- package/dist/src/gateway/hono/routes/memory-learning.js +76 -0
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/observability.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +1 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -3
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service.js +18 -8
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/imports/inventory.js +1 -1
- package/dist/src/infra/update-restart.d.ts +5 -0
- package/dist/src/infra/update-restart.js +38 -31
- package/dist/src/infra/update-runner.d.ts +1 -0
- package/dist/src/infra/update-runner.js +47 -18
- package/dist/src/knowledge/chunks.d.ts +10 -0
- package/dist/src/knowledge/chunks.js +28 -0
- package/dist/src/knowledge/connected-knowledge-pipeline.js +67 -33
- package/dist/src/knowledge/index.js +1 -1
- package/dist/src/knowledge/ingestion-service.js +5 -1
- package/dist/src/knowledge/local-folder-adapter.d.ts +2 -1
- package/dist/src/knowledge/local-folder-adapter.js +22 -13
- package/dist/src/knowledge-memory/domain.d.ts +4 -0
- package/dist/src/knowledge-memory/index.d.ts +1 -0
- package/dist/src/knowledge-memory/index.js +2 -1
- package/dist/src/knowledge-memory/repair-evidence.d.ts +2 -0
- package/dist/src/knowledge-memory/repair-evidence.js +57 -0
- package/dist/src/knowledge-memory/repository.d.ts +8 -0
- package/dist/src/knowledge-memory/repository.js +48 -27
- package/dist/src/knowledge-memory/search-text.d.ts +3 -0
- package/dist/src/knowledge-memory/search-text.js +32 -0
- package/dist/src/knowledge-memory/usage-policy.d.ts +6 -0
- package/dist/src/knowledge-memory/usage-policy.js +61 -0
- package/dist/src/memory-learning/repository.d.ts +24 -0
- package/dist/src/memory-learning/repository.js +96 -0
- package/dist/src/memory-learning/service.d.ts +17 -0
- package/dist/src/memory-learning/service.js +105 -0
- package/dist/src/memory-learning/source-learning.d.ts +7 -0
- package/dist/src/memory-learning/source-learning.js +235 -0
- package/dist/src/memory-learning/task-receipts.d.ts +3 -0
- package/dist/src/memory-learning/task-receipts.js +95 -0
- package/dist/src/memory-learning/work-capture.d.ts +51 -0
- package/dist/src/memory-learning/work-capture.js +140 -0
- package/dist/src/memory-maintenance/service.js +5 -5
- package/dist/src/notes/service.js +1 -1
- package/dist/src/observability/runtime.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +3 -3
- package/dist/src/personal-agent/prompt-context.js +2 -2
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +10 -3
- package/dist/src/platform/index.js +1 -1
- package/dist/src/providers/index.js +4 -4
- package/dist/src/providers/local-model.d.ts +2 -0
- package/dist/src/providers/local-model.js +16 -0
- package/dist/src/providers/model-registry.js +2 -2
- package/dist/src/providers/provider-auth-service.js +1 -1
- package/dist/src/providers/provider-disconnect-core.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-catalog-coordinator.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +1 -1
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +2 -1
- package/dist/src/storage/sqlite/knowledge-repository.js +6 -0
- package/dist/src/storage/sqlite/migrations/245_memory_learning.sql +125 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +6 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +3 -3
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +2 -2
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/user-context/access-policy.js +2 -1
- package/dist/src/user-context/config.d.ts +10 -0
- package/dist/src/user-context/config.js +5 -0
- package/dist/src/user-context/extraction/registry.d.ts +1 -1
- package/dist/src/user-context/extraction/registry.js +10 -0
- package/dist/src/user-context/identity-bindings.d.ts +10 -0
- package/dist/src/user-context/identity-bindings.js +24 -0
- package/dist/src/user-context/sources/consent-fields.d.ts +2 -0
- package/dist/src/user-context/sources/consent-fields.js +66 -0
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +1 -1
- package/dist/src/user-model/capture/semantic.d.ts +3 -1
- package/dist/src/user-model/capture/semantic.js +14 -6
- package/dist/src/user-model/index.js +1 -1
- package/dist/src/user-model/usage-policy.js +34 -0
- package/dist/src/voice/platform-streams.js +2 -1
- package/dist/src/voice/realtime/agentEngine.js +21 -5
- package/dist/src/voice/realtime/engine.d.ts +4 -0
- package/dist/src/voice/realtime/memory-context.js +19 -5
- package/dist/src/voice/realtime/runtime.d.ts +5 -0
- package/dist/src/voice/realtime/runtime.js +4 -0
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/service.js +6 -6
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +38 -10
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BZrOdxou.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-B3ux1AhY.js +0 -1
- package/dist/gateway/static/root/assets/agents-CXlXFU6M.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-BxIShhkZ.js +0 -6
- package/dist/gateway/static/root/assets/browser-automations-page-BmTK7Gtn.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-DBQ-WETQ.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-D-nQ6Zzi.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dx1fpBmH.js +0 -8
- package/dist/gateway/static/root/assets/channels-DXfEP1FR.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-D9RZjhw8.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-cLCDEe4D.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-qSUrpS1h.js +0 -1
- package/dist/gateway/static/root/assets/home-page-COjDsuzg.js +0 -2
- package/dist/gateway/static/root/assets/index-DEaVabvo.js +0 -106
- package/dist/gateway/static/root/assets/logs-page-B_6fHDoi.js +0 -2
- package/dist/gateway/static/root/assets/models-hub-cache-Jj8dvYcv.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-B7U6EbAi.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BzHVaH8j.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-E6huhFk4.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-D_FLVZAm.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-IM7QeSm3.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-B06ZCie_.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-Bol3ScEc.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DpCanqrD.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-zTmrMwMm.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Bkhkt_6M.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CFIte-vM.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-DJRAP3nb.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-sx1lNWKf.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BQR4JdXB.js +0 -6
|
@@ -115,6 +115,11 @@ export declare const KnowledgeMemoryConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
115
115
|
allow: "allow";
|
|
116
116
|
deny: "deny";
|
|
117
117
|
}>>;
|
|
118
|
+
learning: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
idleFlushMs: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
maxBatchChars: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
maxDailyBatches: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
}, z.core.$strict>>;
|
|
118
123
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
119
124
|
project: "project";
|
|
120
125
|
session: "session";
|
|
@@ -244,6 +249,11 @@ export declare const UserContextConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
244
249
|
allow: "allow";
|
|
245
250
|
deny: "deny";
|
|
246
251
|
}>>;
|
|
252
|
+
learning: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
idleFlushMs: z.ZodDefault<z.ZodNumber>;
|
|
254
|
+
maxBatchChars: z.ZodDefault<z.ZodNumber>;
|
|
255
|
+
maxDailyBatches: z.ZodDefault<z.ZodNumber>;
|
|
256
|
+
}, z.core.$strict>>;
|
|
247
257
|
readScopes: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
248
258
|
project: "project";
|
|
249
259
|
session: "session";
|
|
@@ -150,6 +150,11 @@ var init_config = __esmMin((() => {
|
|
|
150
150
|
KnowledgeMemoryConfigSchema = z.object({
|
|
151
151
|
enabled: z.boolean().default(true),
|
|
152
152
|
writePolicy: z.enum(["deny", "allow"]).default("allow"),
|
|
153
|
+
learning: z.object({
|
|
154
|
+
idleFlushMs: z.number().int().min(1e3).max(6e5).default(6e4),
|
|
155
|
+
maxBatchChars: z.number().int().min(4e3).max(12e4).default(3e4),
|
|
156
|
+
maxDailyBatches: z.number().int().min(1).max(1e4).default(100)
|
|
157
|
+
}).strict().optional(),
|
|
153
158
|
readScopes: z.array(z.enum([
|
|
154
159
|
"global",
|
|
155
160
|
"agent",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ContextExtractionRun } from '../../storage/sqlite/index.js';
|
|
2
2
|
import type { UnderstandingKind } from '../domain.js';
|
|
3
|
-
export type ExtractorId = 'turn-semantics' | 'transcript-synthesis' | 'connector-semantic';
|
|
3
|
+
export type ExtractorId = 'turn-semantics' | 'transcript-synthesis' | 'source-work-synthesis' | 'connector-semantic';
|
|
4
4
|
export type ExtractorDefinition = {
|
|
5
5
|
id: ExtractorId;
|
|
6
6
|
version: string;
|
|
@@ -15,6 +15,16 @@ const UNDERSTANDING_KINDS = [
|
|
|
15
15
|
"derived_insight"
|
|
16
16
|
];
|
|
17
17
|
const DEFINITIONS = {
|
|
18
|
+
"source-work-synthesis": {
|
|
19
|
+
id: "source-work-synthesis",
|
|
20
|
+
version: "1",
|
|
21
|
+
inputKinds: ["file", "connector"],
|
|
22
|
+
requiredProcessingPolicy: "local_only",
|
|
23
|
+
authorityCeiling: "external_untrusted",
|
|
24
|
+
candidateKinds: ["project_context", "task_lesson"],
|
|
25
|
+
maxAutomaticStatus: "active",
|
|
26
|
+
timeoutMs: 3e4
|
|
27
|
+
},
|
|
18
28
|
"turn-semantics": {
|
|
19
29
|
id: "turn-semantics",
|
|
20
30
|
version: "1",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
//#region src/user-context/identity-bindings.ts
|
|
3
|
+
init_transaction();
|
|
4
|
+
function bindOwnerIdentity(input) {
|
|
5
|
+
if (![
|
|
6
|
+
input.channel,
|
|
7
|
+
input.accountId,
|
|
8
|
+
input.peerId
|
|
9
|
+
].every((value) => value.trim())) throw new Error("Identity fields are required.");
|
|
10
|
+
getSqliteDatabase().prepare(`INSERT INTO owner_identity_bindings(principal_id, channel, account_id, peer_id, verified_at)
|
|
11
|
+
VALUES ('local-owner', ?, ?, ?, ?) ON CONFLICT(channel, account_id, peer_id) DO UPDATE
|
|
12
|
+
SET verified_at = excluded.verified_at, revoked_at = NULL`).run(input.channel, input.accountId, input.peerId, Date.now());
|
|
13
|
+
}
|
|
14
|
+
function isOwnerIdentity(input) {
|
|
15
|
+
if ([
|
|
16
|
+
"webchat",
|
|
17
|
+
"cli",
|
|
18
|
+
"tui"
|
|
19
|
+
].includes(input.source)) return true;
|
|
20
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM owner_identity_bindings
|
|
21
|
+
WHERE principal_id = 'local-owner' AND channel = ? AND account_id = ? AND peer_id = ? AND revoked_at IS NULL`).get(input.source, input.accountId, input.peerId));
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { bindOwnerIdentity, isOwnerIdentity };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/user-context/sources/consent-fields.ts
|
|
2
|
+
const FIELD_KEYS = {
|
|
3
|
+
title: [
|
|
4
|
+
"title",
|
|
5
|
+
"subject",
|
|
6
|
+
"name",
|
|
7
|
+
"fullName",
|
|
8
|
+
"repository"
|
|
9
|
+
],
|
|
10
|
+
content: [
|
|
11
|
+
"content",
|
|
12
|
+
"body",
|
|
13
|
+
"text",
|
|
14
|
+
"snippet",
|
|
15
|
+
"description",
|
|
16
|
+
"summary"
|
|
17
|
+
],
|
|
18
|
+
participants: [
|
|
19
|
+
"from",
|
|
20
|
+
"to",
|
|
21
|
+
"cc",
|
|
22
|
+
"bcc",
|
|
23
|
+
"sender",
|
|
24
|
+
"author",
|
|
25
|
+
"organizer",
|
|
26
|
+
"attendees",
|
|
27
|
+
"participants",
|
|
28
|
+
"assignee",
|
|
29
|
+
"owners"
|
|
30
|
+
],
|
|
31
|
+
status: [
|
|
32
|
+
"status",
|
|
33
|
+
"state",
|
|
34
|
+
"labels"
|
|
35
|
+
],
|
|
36
|
+
timestamps: [
|
|
37
|
+
"createdAt",
|
|
38
|
+
"updatedAt",
|
|
39
|
+
"modifiedAt",
|
|
40
|
+
"start",
|
|
41
|
+
"end",
|
|
42
|
+
"created_at",
|
|
43
|
+
"updated_at",
|
|
44
|
+
"modified_at"
|
|
45
|
+
],
|
|
46
|
+
owner_activity: [
|
|
47
|
+
"user",
|
|
48
|
+
"username",
|
|
49
|
+
"owner"
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
/** Restrict source fields before either model processing or searchable chunk persistence. */
|
|
53
|
+
function consentFilteredText(value, allowedFields) {
|
|
54
|
+
if (!value) return;
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(value);
|
|
57
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return;
|
|
58
|
+
const keys = new Set([...allowedFields].flatMap((field) => FIELD_KEYS[field] ?? []));
|
|
59
|
+
const selected = Object.entries(parsed).filter(([key]) => keys.has(key));
|
|
60
|
+
return selected.length ? JSON.stringify(Object.fromEntries(selected)) : void 0;
|
|
61
|
+
} catch {
|
|
62
|
+
return !/^\s*[\[{]/.test(value) && allowedFields.has("content") ? value : void 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { consentFilteredText };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCollaborationRule, init_collaboration_rule_repository, listCollaborationRules } from "../storage/sqlite/collaboration-rule-repository.js";
|
|
2
|
-
import { reconcileAssertion } from "./repository.js";
|
|
3
2
|
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals } from "./goals.js";
|
|
3
|
+
import { reconcileAssertion } from "./repository.js";
|
|
4
4
|
import { applyUserProfilePatch } from "./profile.js";
|
|
5
5
|
//#region src/user-model/bootstrap.ts
|
|
6
6
|
init_collaboration_rule_repository();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCollaborationRule, init_collaboration_rule_repository, listCollaborationRules } from "../../storage/sqlite/collaboration-rule-repository.js";
|
|
2
2
|
import { createContextEvidence, init_context_evidence_repository } from "../../storage/sqlite/context-evidence-repository.js";
|
|
3
|
-
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, linkAssertionEvidence, mergeAssertionObservation, reconcileAssertion, setAssertionStatus } from "../repository.js";
|
|
4
3
|
import { createUserGoal, listUserGoals } from "../goals.js";
|
|
4
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, linkAssertionEvidence, mergeAssertionObservation, reconcileAssertion, setAssertionStatus } from "../repository.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/user-model/capture/executor.ts
|
|
7
7
|
init_context_evidence_repository();
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { type WorkCandidate } from '../../memory-learning/work-capture.js';
|
|
1
2
|
import type { AssertionCandidate } from '../domain.js';
|
|
2
3
|
export declare const USER_MODEL_CAPTURE_INTENTS: readonly ["remember", "query", "confirm", "correct", "forget", "user_assertion", "task", "none"];
|
|
3
4
|
export type UserModelCaptureIntent = typeof USER_MODEL_CAPTURE_INTENTS[number];
|
|
4
5
|
export interface CaptureEvidence {
|
|
5
6
|
ref: string;
|
|
6
|
-
role: 'user' | 'assistant';
|
|
7
|
+
role: 'user' | 'assistant' | 'toolResult';
|
|
7
8
|
text: string;
|
|
8
9
|
createdAt: number;
|
|
9
10
|
}
|
|
@@ -32,6 +33,7 @@ export interface ParsedCollaborationRuleCandidate {
|
|
|
32
33
|
evidenceRefs: string[];
|
|
33
34
|
}
|
|
34
35
|
export interface UserModelInterpretation {
|
|
36
|
+
knowledge?: WorkCandidate[];
|
|
35
37
|
intent: UserModelCaptureIntent;
|
|
36
38
|
assertions: ParsedAssertionOperation[];
|
|
37
39
|
goals?: ParsedGoalCandidate[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WorkCandidateSchema } from "../../memory-learning/work-capture.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
//#region src/user-model/capture/semantic.ts
|
|
3
4
|
const USER_MODEL_CAPTURE_INTENTS = [
|
|
@@ -30,6 +31,7 @@ const ScopeSchema = z.object({
|
|
|
30
31
|
});
|
|
31
32
|
});
|
|
32
33
|
const AssertionOperationSchema = z.object({
|
|
34
|
+
intent: z.enum(USER_MODEL_CAPTURE_INTENTS).optional(),
|
|
33
35
|
action: z.enum([
|
|
34
36
|
"create",
|
|
35
37
|
"merge",
|
|
@@ -122,6 +124,7 @@ const AssertionOperationSchema = z.object({
|
|
|
122
124
|
});
|
|
123
125
|
});
|
|
124
126
|
const GroundingSchema = z.object({
|
|
127
|
+
intent: z.enum(USER_MODEL_CAPTURE_INTENTS).optional(),
|
|
125
128
|
evidence: z.array(z.object({
|
|
126
129
|
ref: z.string().min(1),
|
|
127
130
|
quote: z.string().min(1)
|
|
@@ -150,6 +153,7 @@ const CollaborationRuleSchema = z.object({
|
|
|
150
153
|
statement: z.string().min(4).max(600)
|
|
151
154
|
}).merge(GroundingSchema).strict();
|
|
152
155
|
const InterpretationSchema = z.object({
|
|
156
|
+
knowledge: z.array(WorkCandidateSchema).max(8).default([]),
|
|
153
157
|
intent: z.enum(USER_MODEL_CAPTURE_INTENTS),
|
|
154
158
|
assertions: z.array(AssertionOperationSchema).max(8),
|
|
155
159
|
goals: z.array(GoalSchema).max(4).default([]),
|
|
@@ -198,7 +202,8 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
198
202
|
]);
|
|
199
203
|
const allowed = new Set(allowedTargetIds);
|
|
200
204
|
const assertions = [];
|
|
201
|
-
|
|
205
|
+
for (const item of parsed.assertions) {
|
|
206
|
+
if (!assertionIntents.has(item.intent ?? parsed.intent)) continue;
|
|
202
207
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
203
208
|
if (!evidenceRefs) continue;
|
|
204
209
|
if (item.action !== "create" && (!item.targetAssertionId || !allowed.has(item.targetAssertionId))) continue;
|
|
@@ -214,7 +219,7 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
214
219
|
value: item.value,
|
|
215
220
|
normalizedValue: item.normalizedValue,
|
|
216
221
|
statement: item.statement,
|
|
217
|
-
authority: effectiveAuthority(parsed.intent, item.authority),
|
|
222
|
+
authority: effectiveAuthority(item.intent ?? parsed.intent, item.authority),
|
|
218
223
|
confidence: item.confidence,
|
|
219
224
|
...item.declaredImportance === void 0 ? {} : { declaredImportance: item.declaredImportance },
|
|
220
225
|
inferredImportance: item.inferredImportance,
|
|
@@ -242,7 +247,8 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
242
247
|
"correct",
|
|
243
248
|
"user_assertion"
|
|
244
249
|
]);
|
|
245
|
-
const goals =
|
|
250
|
+
const goals = parsed.goals.flatMap((item) => {
|
|
251
|
+
if (!structuredIntents.has(item.intent ?? parsed.intent)) return [];
|
|
246
252
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
247
253
|
if (!evidenceRefs) return [];
|
|
248
254
|
return [{
|
|
@@ -253,8 +259,9 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
253
259
|
...item.targetAt === void 0 ? {} : { targetAt: parseTime(item.targetAt) },
|
|
254
260
|
evidenceRefs
|
|
255
261
|
}];
|
|
256
|
-
})
|
|
257
|
-
const collaborationRules =
|
|
262
|
+
});
|
|
263
|
+
const collaborationRules = parsed.collaborationRules.flatMap((item) => {
|
|
264
|
+
if (!structuredIntents.has(item.intent ?? parsed.intent)) return [];
|
|
258
265
|
const evidenceRefs = groundedEvidenceRefs(item, evidenceByRef);
|
|
259
266
|
if (!evidenceRefs || item.scope.type === "agent") return [];
|
|
260
267
|
return [{
|
|
@@ -265,8 +272,9 @@ function parseUserModelInterpretation(raw, evidence, allowedTargetIds = []) {
|
|
|
265
272
|
statement: item.statement,
|
|
266
273
|
evidenceRefs
|
|
267
274
|
}];
|
|
268
|
-
})
|
|
275
|
+
});
|
|
269
276
|
return {
|
|
277
|
+
knowledge: parsed.knowledge,
|
|
270
278
|
intent: parsed.intent,
|
|
271
279
|
assertions,
|
|
272
280
|
goals,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PERSONAL_DOMAINS, USER_MODEL_PRINCIPAL_ID, defaultAssertionDomain, defaultAssertionLayer, init_domain, validateCandidate, validateScope } from "./domain.js";
|
|
2
|
+
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "./goals.js";
|
|
2
3
|
import { defaultReviewAt, isAssertionValidAt, requiresBoundedValidity, resolveCurrentAssertion } from "./temporal.js";
|
|
3
4
|
import { deleteUserAssertion, getActiveAssertionByPredicate, getActiveAssertionForSlot, getAssertionSlot, getUserAssertion, getUserTimezone, linkAssertionEvidence, listSlotAssertions, listUserAssertionSources, listUserAssertions, mergeAssertionObservation, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "./repository.js";
|
|
4
5
|
import { listActionRuleSuggestions } from "./action-rule-suggestions.js";
|
|
5
6
|
import { calculateExecutionValue } from "./importance.js";
|
|
6
|
-
import { createPriorityWindow, createUserGoal, listPriorityWindows, listUserGoals, setUserGoalStatus, updatePriorityWindow, updateUserGoal } from "./goals.js";
|
|
7
7
|
import { deleteUserModelObservationsForGrant, linkUserAssertions, listUserAssertionEdges, listUserModelObservations, recordUserModelObservation } from "./observation-repository.js";
|
|
8
8
|
import { applyUserProfilePatch, getUserProfileSnapshot } from "./profile.js";
|
|
9
9
|
import { bootstrapUserModel } from "./bootstrap.js";
|
|
@@ -1,9 +1,43 @@
|
|
|
1
|
+
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
3
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
|
+
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
5
|
+
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
6
|
+
import { getUnderstandingConsent } from "../user-context/sources/consent-repository.js";
|
|
7
|
+
import { isOwnerIdentity } from "../user-context/identity-bindings.js";
|
|
1
8
|
//#region src/user-model/usage-policy.ts
|
|
9
|
+
init_sqlite();
|
|
10
|
+
init_transaction();
|
|
11
|
+
init_session_repository();
|
|
2
12
|
/** Automatic personalization never grants execution authority. */
|
|
3
13
|
function isWorkingAssumption(assertion) {
|
|
4
14
|
return (assertion.status === "candidate" || assertion.status === "active") && (assertion.authority === "user_observed" || assertion.authority === "system_inferred") && assertion.confidence >= .7 && (assertion.consequence === "low" || assertion.consequence === "medium") && assertion.sensitivity === "normal" && assertion.disclosurePolicy !== "ask_before_reference";
|
|
5
15
|
}
|
|
6
16
|
function canUseAssertion(assertion, asOf = Date.now(), context = {}) {
|
|
17
|
+
if (assertion.consentReceiptId) {
|
|
18
|
+
if (!isXopcDatabaseOpen()) return false;
|
|
19
|
+
const consent = getUnderstandingConsent(assertion.consentReceiptId);
|
|
20
|
+
if (!consent || consent.revokedAt !== void 0 || !consent.allowedDomains.includes(assertion.domain)) return false;
|
|
21
|
+
if (!getSqliteDatabase().prepare("SELECT 1 FROM understanding_source_grants WHERE grant_id = ? AND status = 'active'").get(consent.grantId)) return false;
|
|
22
|
+
}
|
|
23
|
+
if (isXopcDatabaseOpen() && assertion.id) {
|
|
24
|
+
const db = getSqliteDatabase();
|
|
25
|
+
const evidence = db.prepare(`SELECT e.source_type, e.source_item_id, e.conversation_id, e.content_hash,
|
|
26
|
+
link.content_hash AS linked_hash FROM user_assertion_evidence link JOIN context_evidence e ON e.evidence_id = link.evidence_id
|
|
27
|
+
WHERE link.assertion_id = ? AND link.relation = 'supports'`).all(assertion.id);
|
|
28
|
+
if (assertion.createdBy === "connector" && (!assertion.consentReceiptId || !evidence.length)) return false;
|
|
29
|
+
for (const link of evidence) {
|
|
30
|
+
if (link.conversation_id) {
|
|
31
|
+
const session = getSessionMetadata(link.conversation_id);
|
|
32
|
+
if (!session?.routing || session.routing.peerKind !== "direct" || !isOwnerIdentity(session.routing)) return false;
|
|
33
|
+
}
|
|
34
|
+
if (link.source_type === "connector") {
|
|
35
|
+
if (!link.source_item_id || !link.linked_hash || link.linked_hash !== link.content_hash) return false;
|
|
36
|
+
const source = db.prepare("SELECT content_hash, deleted_at FROM knowledge_source_items WHERE item_id = ?").get(link.source_item_id);
|
|
37
|
+
if (!source || source.deleted_at || source.content_hash !== link.linked_hash) return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
7
41
|
return (assertion.validFrom === void 0 || assertion.validFrom <= asOf) && (assertion.validTo === void 0 || assertion.validTo >= asOf) && (assertion.deleteAfter === void 0 || assertion.deleteAfter > asOf) && (assertion.reviewAt === void 0 || assertion.reviewAt > asOf) && (!context.use || !assertion.allowedUses || assertion.allowedUses.includes(context.use)) && (!assertion.allowedAgentIds || Boolean(context.agentId && assertion.allowedAgentIds.includes(context.agentId))) && assertion.sensitivity !== "secret" && assertion.sensitivity !== "regulated" && assertion.disclosurePolicy !== "ask_before_reference" && (assertion.status === "active" && assertion.authority === "user_explicit" || isWorkingAssumption(assertion));
|
|
8
42
|
}
|
|
9
43
|
//#endregion
|
|
@@ -10,6 +10,7 @@ var PlatformVoiceError = class extends Error {
|
|
|
10
10
|
this.name = "PlatformVoiceError";
|
|
11
11
|
}
|
|
12
12
|
get clientMessage() {
|
|
13
|
+
if (this.code === "realtime_quota_session_limit") return "The funded transcription duration has been reached. Start a new voice session to continue.";
|
|
13
14
|
if (this.code === "realtime_quota_workspace_budget") return "XOPC Cloud voice workspace budget is exhausted. Increase the workspace budget or choose another voice provider.";
|
|
14
15
|
if (this.status === 402 || this.code === "realtime_quota_user_credits") return "XOPC Cloud voice has insufficient Credit or quota. Check your Cloud balance and workspace budget, or choose another voice provider.";
|
|
15
16
|
if (this.status === 401 || this.status === 403) return "XOPC Cloud voice authorization failed. Sign in again and check your access to this voice model.";
|
|
@@ -80,7 +81,7 @@ function connect(url, token, signal, onEvent, onFailure) {
|
|
|
80
81
|
response.once("aborted", reject);
|
|
81
82
|
});
|
|
82
83
|
socket.on("error", fail);
|
|
83
|
-
socket.on("close", () => fail(
|
|
84
|
+
socket.on("close", (code, reason) => fail(new PlatformVoiceError(`Platform voice disconnected before completion (close ${code}${reason.length ? `: ${reason.toString("utf8").slice(0, 256)}` : ""})`, void 0, "provider_disconnected")));
|
|
84
85
|
return {
|
|
85
86
|
socket,
|
|
86
87
|
close,
|
|
@@ -43,6 +43,7 @@ function createAgentVoiceEngine(options) {
|
|
|
43
43
|
let pendingTurn;
|
|
44
44
|
let turnReceivedAtMs;
|
|
45
45
|
let taskUpdateQueued = false;
|
|
46
|
+
const deliveredReplies = /* @__PURE__ */ new Set();
|
|
46
47
|
let lastUserSpeechAt = 0;
|
|
47
48
|
let openingInputSeen = false;
|
|
48
49
|
const turn = new TurnCoordinator(claim.silenceDurationMs, (text, decision, turnId) => {
|
|
@@ -314,7 +315,7 @@ function createAgentVoiceEngine(options) {
|
|
|
314
315
|
if (response.speechWorker) prefetchNextSpeech(response);
|
|
315
316
|
else startSpeechWorker(response);
|
|
316
317
|
}
|
|
317
|
-
async function runAssistantTurn(text, turnId, updateClientMessageId, receivedAtMs = Date.now(), committedAtMs = receivedAtMs, opening) {
|
|
318
|
+
async function runAssistantTurn(text, turnId, updateClientMessageId, receivedAtMs = Date.now(), committedAtMs = receivedAtMs, opening, directReply = false) {
|
|
318
319
|
if (!claim.tts || !claim.request.conversationId || !text.trim() || closed) return false;
|
|
319
320
|
cancelActiveResponse("barge_in");
|
|
320
321
|
const response = {
|
|
@@ -337,7 +338,7 @@ function createAgentVoiceEngine(options) {
|
|
|
337
338
|
taskDone: false,
|
|
338
339
|
pcm: new PcmFrameBuffer()
|
|
339
340
|
};
|
|
340
|
-
const taskUpdateExposed = () => Boolean(updateClientMessageId && response.text.trim());
|
|
341
|
+
const taskUpdateExposed = () => directReply ? response.firstFrameSent : Boolean(updateClientMessageId && response.text.trim());
|
|
341
342
|
activeResponse = response;
|
|
342
343
|
send("response.created", { responseId: response.id });
|
|
343
344
|
if (opening) response.openingTimer = setTimeout(() => {
|
|
@@ -364,14 +365,14 @@ function createAgentVoiceEngine(options) {
|
|
|
364
365
|
}, (error) => ({ error }));
|
|
365
366
|
await interruptionWrites;
|
|
366
367
|
if (response.abortController.signal.aborted || closed) return taskUpdateExposed();
|
|
367
|
-
if (opening) {
|
|
368
|
+
if (opening || directReply) {
|
|
368
369
|
response.text = text;
|
|
369
370
|
response.firstTextAtMs = Date.now();
|
|
370
371
|
send("response.text.delta", {
|
|
371
372
|
responseId: response.id,
|
|
372
373
|
delta: text
|
|
373
374
|
});
|
|
374
|
-
queuePhrases(response, [text]);
|
|
375
|
+
queuePhrases(response, directReply ? response.segmenter.push(text) : [text]);
|
|
375
376
|
} else {
|
|
376
377
|
if (!claim.conversationSessionId) throw new Error("Conversation identity is unavailable");
|
|
377
378
|
const task = await options.runtime.agentBroker.delegate({
|
|
@@ -487,7 +488,7 @@ function createAgentVoiceEngine(options) {
|
|
|
487
488
|
});
|
|
488
489
|
if (opening) opening.result = response.audioStarted ? "completed" : "failed";
|
|
489
490
|
activeResponse = void 0;
|
|
490
|
-
return !updateClientMessageId || taskUpdateExposed();
|
|
491
|
+
return directReply ? response.firstFrameSent : !updateClientMessageId || taskUpdateExposed();
|
|
491
492
|
} catch (error) {
|
|
492
493
|
if (response.abortController.signal.aborted || closed) return taskUpdateExposed();
|
|
493
494
|
log.warn({
|
|
@@ -694,6 +695,21 @@ function createAgentVoiceEngine(options) {
|
|
|
694
695
|
}
|
|
695
696
|
return {
|
|
696
697
|
isConversationIdle,
|
|
698
|
+
offerReply(input) {
|
|
699
|
+
if (deliveredReplies.has(input.deliveryId)) return Promise.resolve(true);
|
|
700
|
+
if (taskUpdateQueued || !canOfferTaskUpdateInput() || !input.text.trim() || input.text.length > 32e3 || deliveredReplies.size >= 256) return Promise.resolve(false);
|
|
701
|
+
taskUpdateQueued = true;
|
|
702
|
+
const attempt = conversationTail.then(async () => {
|
|
703
|
+
if (!canOfferTaskUpdateInput() || options.runtime.sessionBusy(claim.request.conversationId)) return false;
|
|
704
|
+
const delivered = await runAssistantTurn(input.text, input.deliveryId, void 0, Date.now(), Date.now(), void 0, true);
|
|
705
|
+
if (delivered) deliveredReplies.add(input.deliveryId);
|
|
706
|
+
return delivered;
|
|
707
|
+
});
|
|
708
|
+
conversationTail = attempt.then(() => {}, () => {});
|
|
709
|
+
return attempt.finally(() => {
|
|
710
|
+
taskUpdateQueued = false;
|
|
711
|
+
});
|
|
712
|
+
},
|
|
697
713
|
async offerOpeningGreeting(input) {
|
|
698
714
|
if (openingInputSeen || !canOfferTaskUpdateInput() || options.runtime.sessionBusy(claim.request.conversationId)) return "skipped";
|
|
699
715
|
const opening = {
|
|
@@ -3,16 +3,20 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
5
5
|
import { getSessionConfig, init_config_repository } from "../../storage/sqlite/config-repository.js";
|
|
6
|
+
import { canUseKnowledge } from "../../knowledge-memory/usage-policy.js";
|
|
7
|
+
import { getKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
8
|
+
import { init_config, resolveKnowledgeReadPolicy } from "../../user-context/config.js";
|
|
6
9
|
import { getConversationRouting } from "../../storage/sqlite/conversation-repository.js";
|
|
7
10
|
import { getConversation } from "../../routing/agent-session-key.js";
|
|
8
11
|
import { init_session_key } from "../../routing/session-key.js";
|
|
9
|
-
import {
|
|
12
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
10
13
|
import "../../knowledge-memory/index.js";
|
|
14
|
+
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
11
15
|
import { getUserAssertion } from "../../user-model/repository.js";
|
|
12
16
|
import "../../user-model/index.js";
|
|
13
|
-
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
14
17
|
import { buildExecutionContext } from "../../agent/context/execution-context.js";
|
|
15
18
|
//#region src/voice/realtime/memory-context.ts
|
|
19
|
+
init_config();
|
|
16
20
|
init_session_key();
|
|
17
21
|
init_config_repository();
|
|
18
22
|
init_session_repository();
|
|
@@ -35,7 +39,7 @@ function buildVoiceMemoryContext(input) {
|
|
|
35
39
|
const started = performance.now();
|
|
36
40
|
try {
|
|
37
41
|
const config = input.getConfig();
|
|
38
|
-
if (!voiceMemoryEnabled(config, input.conversationId) || input.maxChars < 128) return;
|
|
42
|
+
if (!resolveUserContextSessionAccess(config, input.conversationId).userModel || !voiceMemoryEnabled(config, input.conversationId) || input.maxChars < 128) return;
|
|
39
43
|
const session = getSessionMetadata(input.conversationId);
|
|
40
44
|
const context = buildExecutionContext({
|
|
41
45
|
query: voiceMemoryQuery(input.history),
|
|
@@ -44,7 +48,9 @@ function buildVoiceMemoryContext(input) {
|
|
|
44
48
|
projectId: input.projectId,
|
|
45
49
|
conversationId: input.conversationId,
|
|
46
50
|
maxAssertions: 6,
|
|
47
|
-
maxKnowledge: 3
|
|
51
|
+
maxKnowledge: 3,
|
|
52
|
+
includeKnowledge: resolveUserContextSessionAccess(config, input.conversationId).knowledge,
|
|
53
|
+
knowledgePolicy: resolveKnowledgeReadPolicy(config.userContext.knowledgeMemory)
|
|
48
54
|
});
|
|
49
55
|
const block = JSON.stringify({ backgroundMemory: {
|
|
50
56
|
userFacts: context.assertions.map((item) => item.assertion.statement),
|
|
@@ -64,7 +70,15 @@ function buildVoiceMemoryContext(input) {
|
|
|
64
70
|
const configVersion = JSON.stringify(config.userContext);
|
|
65
71
|
const isCurrent = () => {
|
|
66
72
|
if (!voiceMemoryEnabled(input.getConfig(), input.conversationId) || JSON.stringify(input.getConfig().userContext) !== configVersion) return false;
|
|
67
|
-
return references.every((reference) => reference.kind === "assertion" ? getUserAssertion(reference.id)?.recordedAt === reference.updatedAt :
|
|
73
|
+
return references.every((reference) => reference.kind === "assertion" ? getUserAssertion(reference.id)?.recordedAt === reference.updatedAt : (() => {
|
|
74
|
+
const item = getKnowledgeItem(reference.id);
|
|
75
|
+
return Boolean(item && item.updatedAt === reference.updatedAt && canUseKnowledge(item, {
|
|
76
|
+
agentId: session?.routing?.agentId ?? "main",
|
|
77
|
+
workspaceId: input.workspaceId,
|
|
78
|
+
projectId: input.projectId,
|
|
79
|
+
conversationId: input.conversationId
|
|
80
|
+
}, resolveKnowledgeReadPolicy(input.getConfig().userContext.knowledgeMemory)));
|
|
81
|
+
})());
|
|
68
82
|
};
|
|
69
83
|
log.debug({
|
|
70
84
|
conversationId: input.conversationId,
|
|
@@ -29,6 +29,11 @@ export declare class VoiceRealtimeRuntime {
|
|
|
29
29
|
hasConversation(conversationId: string): boolean;
|
|
30
30
|
canPublishReply(conversationId: string): boolean;
|
|
31
31
|
canOfferTaskUpdate(conversationId: string): boolean;
|
|
32
|
+
offerReply(input: {
|
|
33
|
+
conversationId: string;
|
|
34
|
+
deliveryId: string;
|
|
35
|
+
text: string;
|
|
36
|
+
}): Promise<boolean>;
|
|
32
37
|
offerTaskUpdate(input: {
|
|
33
38
|
conversationId: string;
|
|
34
39
|
clientMessageId: string;
|
|
@@ -333,6 +333,10 @@ var VoiceRealtimeRuntime = class {
|
|
|
333
333
|
const sessionId = this.conversationReservations.get(conversationId);
|
|
334
334
|
return (sessionId ? this.activeSessions.get(sessionId) : void 0)?.engine?.canOfferTaskUpdate?.() === true;
|
|
335
335
|
}
|
|
336
|
+
async offerReply(input) {
|
|
337
|
+
const sessionId = this.conversationReservations.get(input.conversationId);
|
|
338
|
+
return (sessionId ? this.activeSessions.get(sessionId) : void 0)?.engine?.offerReply?.(input) ?? false;
|
|
339
|
+
}
|
|
336
340
|
async offerTaskUpdate(input) {
|
|
337
341
|
const sessionId = this.conversationReservations.get(input.conversationId);
|
|
338
342
|
const session = sessionId ? this.activeSessions.get(sessionId) : void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getWorkDiscoveryRun } from "./repository.js";
|
|
2
1
|
import { createUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, updateUnderstandingSourceRun } from "../user-context/sources/repository.js";
|
|
2
|
+
import { getWorkDiscoveryRun } from "./repository.js";
|
|
3
3
|
import { workDiscoveryFingerprintsEqual } from "./incremental.js";
|
|
4
4
|
//#region src/work-discovery/incremental-repository.ts
|
|
5
5
|
function refreshFromRun(run) {
|
|
@@ -5,19 +5,19 @@ import { createContextEvidence, init_context_evidence_repository } from "../stor
|
|
|
5
5
|
import { ensureSessionRecord, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
6
6
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
7
7
|
import { ActivityService } from "../activity/service.js";
|
|
8
|
-
import {
|
|
8
|
+
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
9
|
+
import { writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
9
10
|
import { init_session_key, resolveConversationId } from "../routing/session-key.js";
|
|
11
|
+
import "../knowledge-memory/index.js";
|
|
10
12
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
11
13
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
14
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
12
15
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
13
|
-
import {
|
|
14
|
-
import "../knowledge-memory/index.js";
|
|
15
|
-
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
16
|
+
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
16
17
|
import { createPriorityWindow, createUserGoal } from "../user-model/goals.js";
|
|
18
|
+
import { linkAssertionEvidence, reconcileAssertion } from "../user-model/repository.js";
|
|
17
19
|
import "../user-model/index.js";
|
|
18
20
|
import { createWorkDiscoveryRun, getProjectUnderstandingRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, listPendingProjectUnderstandingRuns, setWorkDiscoveryFeedback, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
19
|
-
import { isLocalModelBaseUrl } from "../providers/model-call.js";
|
|
20
|
-
import { createUnderstandingSourceRun, getUnderstandingSourceGrant, getUnderstandingSourceRun, updateUnderstandingSourceGrantCheckpoint, updateUnderstandingSourceGrantPolicies, updateUnderstandingSourceRun, upsertUnderstandingSourceGrant } from "../user-context/sources/repository.js";
|
|
21
21
|
import { allowsRemoteSourceProcessing } from "../user-context/sources/processing-policy.js";
|
|
22
22
|
import { analyzeUnderstandingSources, analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
23
23
|
import { clusterActivityTopics } from "../user-context/sources/activity-clustering.js";
|
|
@@ -3,6 +3,7 @@ import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-ru
|
|
|
3
3
|
import { init_conversation_repository, resolveRoutedConversation } from "../../storage/sqlite/conversation-repository.js";
|
|
4
4
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
5
5
|
import { extractProfileAgentId, resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
6
|
+
import { resolveModelSelector } from "../../config/agent-model-intents.js";
|
|
6
7
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
7
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
8
9
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
@@ -12,7 +13,6 @@ import { validateWorkflowJsonSchema } from "../domain/schema-validation.js";
|
|
|
12
13
|
import "../domain/index.js";
|
|
13
14
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
14
15
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
15
|
-
import { resolveModelSelector } from "../../config/agent-model-intents.js";
|
|
16
16
|
import { DelegateSubagentRunner } from "../../agent/workflow/subagent-runner.js";
|
|
17
17
|
import { preflightWorkflowConnectors } from "../../connectors/workflow-preflight.js";
|
|
18
18
|
import { CatalogWorkflowDefinitionRegistry } from "../registry/catalog-workflow-definition-registry.js";
|