@xopcai/xopc 0.0.189 → 0.0.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/README.zh-CN.md +0 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DTFKTPs8.js → activity-store-DstnJCS5.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DqO25Qe5.js → agent-avatar-dicebear-DvEkT222.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CXyivfqY.js +68 -0
- package/dist/gateway/static/root/assets/{api-DWeXfwVU.js → api-BTL9kayv.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BRpV8PXG.js → app-management-settings-panel-COpP_pKN.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-3ntKM9nQ.js → appearance-settings-DTVNUEDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DsE67BSO.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Df7Ycj_7.js → archive-plugin-IpX6VA0o.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-UHgfZYtj.js → attachment-load-CKVFNUi1.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-D0TVev47.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BJah99wE.js → binary-plugins-BrfvfOS4.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DNlY5KqF.js → block-editor-D9sEfg32.js} +48 -48
- package/dist/gateway/static/root/assets/browser-settings-page-DpZzq8j2.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-vyUfdzAd.js → browser-workflow-inputs-BixZ5lCR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-C1cKZjx-.js → browser-workflows-page-YEFuodJI.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B9Cmcuff.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-api-BB8t4Ja7.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C_EpuQtk.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BGG2kpJB.js → channel-recipient-api-BThDGiO3.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CvzD5qSv.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-BMMqC0_9.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BKrm7tJ9.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-Bm8koRoD.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BUuBEJuP.js → desktop-pet-CMG3mcaJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BGfVIJM3.js → desktop-pet-settings-D8aaPb0x.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DrQFfHH_.js → directory-picker-path-field-C95yW03b.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CEnIFOX-.js → extension-debug-page-DsG7Z9lV.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CCqHbexs.js → extension-page-CUAXEbAt.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CsR7QOJo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-CgUE2Ii1.js → gateway-config-api-DL70Nakc.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BgDxQ08c.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DxhKNiCF.js → gateway-startup-retry-EO9mKvzE.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BX7q55uZ.js +1 -0
- package/dist/gateway/static/root/assets/home-page-C08Nen5T.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DCFdc-HD.js → image-generation-api-Bu7PyVSh.js} +1 -1
- package/dist/gateway/static/root/assets/index-B-_CEvIX.js +150 -0
- package/dist/gateway/static/root/assets/index-D6e3tPL-.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Bf2VLtXW.js → keyboard-shortcuts-settings-Dt6wS5zW.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BQVC0tWq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Ca1RuI13.js → local-apps-page-DcD3-N00.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-deR2zRaE.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-D6yvW-E4.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B3Eop1zn.js → management-settings-B6EVkJQy.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BGOYjgnM.js → markdown-split-CHUjCnBh.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CT0txyM4.js → media-plugins-DRrtI2O0.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-DfKgAe78.js → notes-page-fermYvpI.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BVCwabjq.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-DNrbCgmC.js → page-tabs-BO262zuu.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BTqViDOR.js → preview-open-alternatives-yZYTy-2e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-C_2L4_Iu.js → product-open-page-Dgy8XWhR.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CS4Ujor7.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DMtPC8c4.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BpfHZT88.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-BFLfkDGG.js → schema-form-DdE4gtw_.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BZkyrJBM.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlK0A4l.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CiYU8AvV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-C9a-EbTZ.js → settings-loading-skeleton-Bv03cWib.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DI9qDH5x.js → settings-page-C-LdINFj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D-LWQdI5.js → settings-page-layout-t_Ox1slk.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CJwmPvgs.js → setup-status-panel-HRG_lK4_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BKSMG9r5.js → share-preview-page-DF8gW6bo.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-v_iLhxxa.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-S-bjtsXX.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BiNBfaX5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-zsz2HIlZ.js → skills-page.utils-DlnGtvAH.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-IWNDBI1O.js → system-settings-panel-Bv7GXFc6.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CgtK02kP.js → task-detail-page-BhQcOpnx.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BkJe7UDo.js → theme-store-DnBOcGXi.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-C07LGthO.js → typed-models-lib-4XBsLEuv.js} +1 -1
- package/dist/gateway/static/root/assets/use-autosave-BN2QgFGn.js +1 -0
- package/dist/gateway/static/root/assets/user-context-page-PtcY7BoJ.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Boue1D46.js → voice-api-key-field-DnhJtC5l.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-bbmvCmc8.js → work-discovery-overlay-nmEAafFl.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C5Kwe_bc.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DlHv-GZC.js → workflow-run-setup-panel-BnNWBDwz.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Z_qzaohv.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tool-activity.js +0 -36
- package/dist/packages/realtime-client/src/index.js +105 -48
- package/dist/packages/realtime-protocol/src/index.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +0 -1
- package/dist/src/agent/agent-manager.js +6 -13
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +5 -7
- package/dist/src/agent/bootstrap/bootstrap-cache.d.ts +0 -1
- package/dist/src/agent/bootstrap/bootstrap-cache.js +3 -4
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
- package/dist/src/agent/bootstrap/bootstrap-files.js +3 -4
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -4
- package/dist/src/agent/bootstrap/load-bootstrap-files.d.ts +0 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -14
- package/dist/src/agent/bootstrap/types.d.ts +1 -1
- package/dist/src/agent/context/workspace-templates/SOUL.md +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/provider-registry.d.ts +2 -0
- package/dist/src/agent/image/generation/provider-registry.js +20 -10
- package/dist/src/agent/image/generation/providers/xopc-cloud.d.ts +2 -0
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +74 -0
- package/dist/src/agent/image/generation/types.d.ts +2 -2
- package/dist/src/agent/memory/builtin-provider.d.ts +2 -4
- package/dist/src/agent/memory/builtin-provider.js +35 -15
- package/dist/src/agent/memory/context/types.d.ts +3 -1
- package/dist/src/agent/memory/create-memory-manager.js +2 -0
- package/dist/src/agent/memory/index.d.ts +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/memory/manager.d.ts +9 -1
- package/dist/src/agent/memory/manager.js +39 -9
- package/dist/src/agent/memory/memory-config.d.ts +1 -1
- package/dist/src/agent/memory/memory-config.js +1 -1
- package/dist/src/agent/memory/source-origin.js +0 -2
- package/dist/src/agent/memory/types.d.ts +5 -1
- package/dist/src/agent/memory/understanding/service.d.ts +10 -10
- package/dist/src/agent/memory/understanding/service.js +108 -176
- package/dist/src/agent/memory/understanding/types.d.ts +7 -8
- package/dist/src/agent/memory/user-context-coordinator.d.ts +2 -1
- package/dist/src/agent/memory/user-context-coordinator.js +27 -41
- package/dist/src/agent/orchestration/agent-orchestrator.js +4 -7
- package/dist/src/agent/prompt/sections/memory-skills.js +4 -4
- package/dist/src/agent/prompt/sections/tooling.js +0 -10
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +0 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -33
- package/dist/src/agent/prompt/system-prompt.js +1 -2
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service.d.ts +1 -2
- package/dist/src/agent/service.js +4 -17
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +1 -1
- package/dist/src/agent/tools/dreaming-tool.d.ts +0 -2
- package/dist/src/agent/tools/dreaming-tool.js +13 -38
- package/dist/src/agent/tools/factory.d.ts +0 -3
- package/dist/src/agent/tools/factory.js +1 -10
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +1 -2
- package/dist/src/agent/tools/memory-tool.js +1 -1
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -5
- package/dist/src/agent/workspace-runtime/registry.js +2 -15
- package/dist/src/agent-manifest/schema.d.ts +17 -17
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/memory-runtime.d.ts +2 -2
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/automations/domain/validation.d.ts +28 -28
- package/dist/src/automations/draft/automation-draft-validator.d.ts +3 -3
- package/dist/src/chat-commands/builtins/understanding.js +2 -5
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/init.js +3 -22
- package/dist/src/cli/commands/onboard/model.d.ts +3 -0
- package/dist/src/cli/commands/onboard/model.js +19 -4
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/templates.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/paths.d.ts +0 -5
- package/dist/src/config/paths.js +2 -11
- package/dist/src/config/schema.d.ts +24 -117
- package/dist/src/config/schema.js +9 -39
- package/dist/src/connectors/learning-coordinator.js +75 -3
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +0 -5
- package/dist/src/gateway/agents-admin.d.ts +0 -7
- package/dist/src/gateway/agents-admin.js +4 -33
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +3 -3
- package/dist/src/gateway/dreaming-automation-reconciler.js +48 -88
- package/dist/src/gateway/hono/lib/config-payload.d.ts +19 -7
- package/dist/src/gateway/hono/lib/config-payload.js +3 -1
- package/dist/src/gateway/hono/oauth-async.d.ts +1 -0
- package/dist/src/gateway/hono/oauth-async.js +17 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -33
- package/dist/src/gateway/hono/routes/config-patch/misc.js +17 -1
- package/dist/src/gateway/hono/routes/connectors.js +13 -12
- package/dist/src/gateway/hono/routes/index.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -5
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +9 -8
- package/dist/src/gateway/hono/routes/status.js +0 -7
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +3 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +203 -0
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +2 -0
- package/dist/src/gateway/hono/routes/work-discovery.js +3 -134
- package/dist/src/gateway/hono/routes/you.d.ts +0 -22
- package/dist/src/gateway/hono/routes/you.js +234 -1118
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +2 -4
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +2 -4
- package/dist/src/knowledge/connected-understanding-pipeline.js +31 -81
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/knowledge/people-graph.d.ts +22 -25
- package/dist/src/knowledge/people-graph.js +76 -43
- package/dist/src/proactive/execution/context.js +8 -13
- package/dist/src/providers/model-catalog-store.d.ts +15 -0
- package/dist/src/providers/model-catalog-store.js +14 -1
- package/dist/src/providers/model-catalog-sync-service.js +6 -0
- package/dist/src/providers/model-registry.js +4 -4
- package/dist/src/providers/register-runtime-providers.js +4 -4
- package/dist/src/providers/xopc-cloud-model-source.js +55 -8
- package/dist/src/realtime/broker.d.ts +1 -0
- package/dist/src/realtime/broker.js +19 -2
- package/dist/src/realtime/runtime.js +6 -1
- package/dist/src/storage/sqlite/connector-account-repository.js +0 -1
- package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +37 -0
- package/dist/src/storage/sqlite/context-consolidation-repository.js +64 -0
- package/dist/src/storage/sqlite/fts.d.ts +2 -0
- package/dist/src/storage/sqlite/fts.js +29 -1
- package/dist/src/storage/sqlite/index.d.ts +4 -6
- package/dist/src/storage/sqlite/index.js +5 -7
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +9 -2
- package/dist/src/storage/sqlite/knowledge-repository.js +58 -10
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +7 -56
- package/dist/src/storage/sqlite/memory-records-repository.js +68 -218
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +54 -0
- package/dist/src/storage/sqlite/migrations/114_user_context_domain.sql +193 -0
- package/dist/src/storage/sqlite/migrations/115_remove_legacy_user_context.sql +6 -0
- package/dist/src/storage/sqlite/migrations/116_structured_context_consolidation.sql +38 -0
- package/dist/src/storage/sqlite/migrations/117_unified_understanding_sources.sql +110 -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/storage/sqlite/schema.sql +0 -20
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +34 -0
- package/dist/src/storage/sqlite/user-context-quality-repository.js +74 -0
- package/dist/src/storage/sqlite/user-context-repository.d.ts +64 -0
- package/dist/src/storage/sqlite/user-context-repository.js +383 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/tool-summary.js +1 -7
- package/dist/src/tui/tui-startup-resources.js +1 -2
- package/dist/src/user-context/config.d.ts +17 -210
- package/dist/src/user-context/config.js +19 -85
- package/dist/src/user-context/consolidation.d.ts +26 -0
- package/dist/src/user-context/consolidation.js +115 -0
- package/dist/src/user-context/domain.d.ts +75 -0
- package/dist/src/user-context/domain.js +4 -0
- package/dist/src/user-context/manual-understanding.d.ts +7 -14
- package/dist/src/user-context/manual-understanding.js +19 -54
- package/dist/src/{agent/memory/context → user-context}/planner.d.ts +5 -6
- package/dist/src/user-context/planner.js +311 -0
- package/dist/src/user-context/relationship-continuity.d.ts +3 -6
- package/dist/src/user-context/relationship-continuity.js +39 -32
- package/dist/src/user-context/sources/catalog.d.ts +2 -0
- package/dist/src/user-context/sources/catalog.js +149 -0
- package/dist/src/user-context/sources/index.d.ts +3 -0
- package/dist/src/user-context/sources/index.js +3 -0
- package/dist/src/user-context/sources/repository.d.ts +40 -0
- package/dist/src/user-context/sources/repository.js +164 -0
- package/dist/src/user-context/sources/types.d.ts +83 -0
- package/dist/src/work-discovery/analyzer.d.ts +4 -3
- package/dist/src/work-discovery/analyzer.js +21 -16
- package/dist/src/work-discovery/incremental-repository.js +42 -40
- package/dist/src/work-discovery/index.js +3 -3
- package/dist/src/work-discovery/service.d.ts +7 -7
- package/dist/src/work-discovery/service.js +241 -190
- package/dist/src/work-discovery/source-repository.js +42 -53
- package/dist/src/work-discovery/types.d.ts +2 -14
- package/package.json +3 -8
- package/dist/gateway/static/root/assets/agents-BvdqdER9.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-nKLsfy6C.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Dh5bdZiN.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CRJ_nAuh.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DeQR5BZt.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-D7tkhDMv.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D7uK3q1p.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-Bw6Dniyq.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-BrUTz4uU.js +0 -1
- package/dist/gateway/static/root/assets/connector-logo-8YU53RUT.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-k9tMiOL5.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-B3B1eqnr.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-DEZw_7zN.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dg8qCiIp.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-27tRzDEo.js +0 -1
- package/dist/gateway/static/root/assets/home-page-VA511kMr.js +0 -3
- package/dist/gateway/static/root/assets/index-BvR-i-m6.js +0 -216
- package/dist/gateway/static/root/assets/index-zybP34zk.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CaJq4-wV.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-DUW5YE3R.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BLTCg69e.js +0 -2
- package/dist/gateway/static/root/assets/messages-CMjnbdbn.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-Bp1w9UM1.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CZmbPDQN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D5pzqfm5.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CC-XhVGI.js +0 -1
- package/dist/gateway/static/root/assets/segmented-styles-BL8oLBEp.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B2eTLVDV.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CRuZ_bl0.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-C4GXGeA4.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-YzSDS4G_.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CwOo8zZk.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-xd1cgSGN.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-CstQ___Y.js +0 -1
- package/dist/gateway/static/root/assets/use-save-bar-registration-CQYE0l6z.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BnQAWS_B.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CAszL1y8.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DxGzo3-x.js +0 -11
- package/dist/src/agent/code-intelligence/binary.d.ts +0 -15
- package/dist/src/agent/code-intelligence/binary.js +0 -372
- package/dist/src/agent/code-intelligence/index.d.ts +0 -4
- package/dist/src/agent/code-intelligence/index.js +0 -4
- package/dist/src/agent/code-intelligence/runtime.d.ts +0 -34
- package/dist/src/agent/code-intelligence/runtime.js +0 -280
- package/dist/src/agent/code-intelligence/tool-gating.d.ts +0 -5
- package/dist/src/agent/code-intelligence/tool-gating.js +0 -6
- package/dist/src/agent/code-intelligence/tools.d.ts +0 -6
- package/dist/src/agent/code-intelligence/tools.js +0 -266
- package/dist/src/agent/code-intelligence/types.d.ts +0 -22
- package/dist/src/agent/memory/context/planner.js +0 -286
- package/dist/src/agent/memory/dreaming/config.d.ts +0 -48
- package/dist/src/agent/memory/dreaming/config.js +0 -98
- package/dist/src/agent/memory/dreaming/constants.d.ts +0 -12
- package/dist/src/agent/memory/dreaming/constants.js +0 -18
- package/dist/src/agent/memory/dreaming/deep-promotion.d.ts +0 -19
- package/dist/src/agent/memory/dreaming/deep-promotion.js +0 -152
- package/dist/src/agent/memory/dreaming/light-sweep.d.ts +0 -16
- package/dist/src/agent/memory/dreaming/light-sweep.js +0 -115
- package/dist/src/agent/memory/dreaming/preview.d.ts +0 -23
- package/dist/src/agent/memory/dreaming/preview.js +0 -52
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.d.ts +0 -16
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.js +0 -44
- package/dist/src/agent/memory/dreaming/rem-patterns.d.ts +0 -19
- package/dist/src/agent/memory/dreaming/rem-patterns.js +0 -150
- package/dist/src/agent/memory/dreaming/runner.d.ts +0 -10
- package/dist/src/agent/memory/dreaming/runner.js +0 -78
- package/dist/src/agent/memory/dreaming/schedule.d.ts +0 -23
- package/dist/src/agent/memory/dreaming/schedule.js +0 -38
- package/dist/src/agent/memory/dreaming/scope.d.ts +0 -11
- package/dist/src/agent/memory/dreaming/scope.js +0 -33
- package/dist/src/agent/memory/dreaming/utils.d.ts +0 -3
- package/dist/src/agent/memory/dreaming/utils.js +0 -31
- package/dist/src/gateway/hono/routes/memory.d.ts +0 -3
- package/dist/src/gateway/hono/routes/memory.js +0 -460
- package/dist/src/storage/sqlite/dreaming-repository.d.ts +0 -61
- package/dist/src/storage/sqlite/dreaming-repository.js +0 -88
- package/dist/src/storage/sqlite/memory-readiness-repository.d.ts +0 -7
- package/dist/src/storage/sqlite/memory-readiness-repository.js +0 -30
- package/dist/src/storage/sqlite/memory-reference-consent-repository.d.ts +0 -27
- package/dist/src/storage/sqlite/memory-reference-consent-repository.js +0 -107
- package/dist/src/storage/sqlite/user-claims-repository.d.ts +0 -101
- package/dist/src/storage/sqlite/user-claims-repository.js +0 -241
- package/dist/src/storage/sqlite/user-profile-setup-repository.d.ts +0 -3
- package/dist/src/storage/sqlite/user-profile-setup-repository.js +0 -32
- package/dist/src/user-context/actionableInsights.d.ts +0 -14
- package/dist/src/user-context/actionableInsights.js +0 -34
- package/dist/src/user-context/context-compiler.d.ts +0 -27
- package/dist/src/user-context/context-compiler.js +0 -48
- package/dist/src/user-context/import.d.ts +0 -12
- package/dist/src/user-context/import.js +0 -51
- package/dist/src/user-context/memory-episode-evaluator.d.ts +0 -32
- package/dist/src/user-context/memory-episode-evaluator.js +0 -35
- package/dist/src/user-context/memory-readiness.d.ts +0 -33
- package/dist/src/user-context/memory-readiness.js +0 -41
- package/dist/src/user-context/memory-use-audit.d.ts +0 -10
- package/dist/src/user-context/memory-use-audit.js +0 -26
- package/dist/src/user-context/personal-playbook.d.ts +0 -11
- package/dist/src/user-context/personal-playbook.js +0 -41
- package/dist/src/user-context/profile.d.ts +0 -37
- package/dist/src/user-context/profile.js +0 -163
- package/dist/src/user-context/projection.d.ts +0 -120
- package/dist/src/user-context/projection.js +0 -262
- package/dist/src/user-context/source-recommendations.d.ts +0 -13
- package/dist/src/user-context/source-recommendations.js +0 -85
- /package/dist/src/{agent/code-intelligence → user-context/sources}/types.js +0 -0
|
@@ -3,6 +3,7 @@ import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost,
|
|
|
3
3
|
import { buckets } from "./rate-limit/buckets.js";
|
|
4
4
|
import { isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
|
|
5
5
|
import "./rate-limit/index.js";
|
|
6
|
+
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
6
7
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
7
8
|
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
8
9
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
@@ -12,7 +13,6 @@ import { createHonoApp } from "./hono/app.js";
|
|
|
12
13
|
import { GatewayServer } from "./server.js";
|
|
13
14
|
import { GatewayLockError, acquireGatewayLock } from "./lock.js";
|
|
14
15
|
import { runGatewayLoop } from "./run-loop.js";
|
|
15
|
-
import { checkPortAvailable, forceFreePortAndWait, listPortListeners, parseLsofOutput } from "./ports.js";
|
|
16
16
|
import { apiError, apiOk } from "./protocol.js";
|
|
17
17
|
import "./hono/index.js";
|
|
18
18
|
import { assertSecureGatewayHttpUrl, assertSecureWebSocketUrl, isInsecurePrivateWsAllowed, isSecureWebSocketUrl } from "./ws-security.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { loadConfig } from "../config/loader.js";
|
|
2
2
|
import "../config/index.js";
|
|
3
3
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
4
|
+
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
4
5
|
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
5
6
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
6
7
|
import { acquireGatewayLock } from "./lock.js";
|
|
7
|
-
import { consumeGatewayRestartIntentSync, consumeGatewaySigusr1RestartAuthorization, isGatewaySigusr1RestartExternallyAllowed, resetGatewayRestartStateForInProcessRestart, scheduleGatewaySigusr1Restart, setGatewaySigusr1RestartPolicy } from "../infra/restart.js";
|
|
8
8
|
//#region src/gateway/run-loop.ts
|
|
9
9
|
/**
|
|
10
10
|
* Gateway Run Loop - Core run loop for gateway process management
|
|
@@ -43,7 +43,7 @@ export interface GatewayConfigCoordinatorOptions {
|
|
|
43
43
|
getExtensionLoader: () => ExtensionLoader | null;
|
|
44
44
|
/** Re-evaluate browser-extension server attachment after agent defaults change. */
|
|
45
45
|
reconcileBrowserExtensionServer: () => Promise<void>;
|
|
46
|
-
/** Sync built-in
|
|
46
|
+
/** Sync the built-in consolidation automation after userContext.dreaming changes. */
|
|
47
47
|
reconcileDreamingAutomations: () => Promise<void>;
|
|
48
48
|
/** Latest channel status snapshot for the `channels.status` event. */
|
|
49
49
|
getChannelsStatus: () => unknown;
|
|
@@ -6,11 +6,11 @@ import "../../storage/sqlite/index.js";
|
|
|
6
6
|
import { init_session_key, parseSessionKey } from "../../routing/session-key.js";
|
|
7
7
|
import { resolveExecutionContext } from "../../tasks/execution-context.js";
|
|
8
8
|
import { TaskRunCoordinator } from "../../tasks/task-run-coordinator.js";
|
|
9
|
-
import { recordExplicitRelationshipFollowUp } from "../../user-context/relationship-continuity.js";
|
|
10
9
|
import { formatAgentRunErrorForClient } from "../../agent/client-error-format.js";
|
|
11
10
|
import { prependEnvelopeTimestamp } from "../../channels/envelope-timestamp.js";
|
|
12
11
|
import "../chat-limits.js";
|
|
13
12
|
import { resolveWebchatSessionKey } from "../resolve-webchat-session-key.js";
|
|
13
|
+
import { recordExplicitRelationshipFollowUp } from "../../user-context/relationship-continuity.js";
|
|
14
14
|
import { ChatStreamMapper } from "../chat-stream/mapper.js";
|
|
15
15
|
import { coalesceThinkingDeltas } from "../chat-stream/thinking-delta-coalescer.js";
|
|
16
16
|
import crypto from "crypto";
|
|
@@ -49,15 +49,13 @@ async function* runGatewayAgent(deps, message, channel, chatId, origin, attachme
|
|
|
49
49
|
const streamSessionKey = webchatSessionKey ?? chatId;
|
|
50
50
|
if (webchatSessionKey) {
|
|
51
51
|
if (!webchatMetadata) throw new Error("Session metadata is unavailable");
|
|
52
|
-
|
|
53
|
-
if (!parsedSession) throw new Error("Resolved webchat session key is invalid");
|
|
52
|
+
if (!parseSessionKey(webchatSessionKey)) throw new Error("Resolved webchat session key is invalid");
|
|
54
53
|
updateInteractionStateFromMessage({
|
|
55
54
|
sessionKey: webchatSessionKey,
|
|
56
55
|
message
|
|
57
56
|
});
|
|
58
57
|
recordExplicitRelationshipFollowUp({
|
|
59
58
|
sessionKey: webchatSessionKey,
|
|
60
|
-
sourceAgentId: parsedSession.agentId,
|
|
61
59
|
message
|
|
62
60
|
});
|
|
63
61
|
const executionContext = resolveExecutionContext({
|
|
@@ -66,6 +66,11 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
66
66
|
import "../discussions/index.js";
|
|
67
67
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
68
68
|
import "../endpoint-tools/index.js";
|
|
69
|
+
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
70
|
+
import { LocalAppService } from "../local-apps/service.js";
|
|
71
|
+
import "../local-apps/index.js";
|
|
72
|
+
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
73
|
+
import { MobileNotificationService } from "../mobile/notification-service.js";
|
|
69
74
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
70
75
|
import { reconcileDreamingAutomations } from "./dreaming-automation-reconciler.js";
|
|
71
76
|
import { NotesStore } from "../notes/store.js";
|
|
@@ -83,10 +88,6 @@ import { assertGatewayAuthNotKnownWeak } from "./security/known-weak-secrets.js"
|
|
|
83
88
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
84
89
|
import { auditGatewayConfig } from "./security/audit.js";
|
|
85
90
|
import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
|
|
86
|
-
import { runBootstrapMigrationsSync } from "../migrations/runner.js";
|
|
87
|
-
import { MobileNotificationService } from "../mobile/notification-service.js";
|
|
88
|
-
import { LocalAppService } from "../local-apps/service.js";
|
|
89
|
-
import "../local-apps/index.js";
|
|
90
91
|
import { createRuntimeBrowserRecipeService } from "../browser/recipes/runtime-service.js";
|
|
91
92
|
import "../browser/recipes/index.js";
|
|
92
93
|
import { mapProductEventToProactive } from "../proactive/events/product-event-bridge.js";
|
|
@@ -98,7 +99,6 @@ import { ProactiveTemporalWorker } from "../proactive/temporal/worker.js";
|
|
|
98
99
|
import { ProactiveInboxService } from "../proactive/inbox/service.js";
|
|
99
100
|
import { ProactiveInboxWorker } from "../proactive/inbox/worker.js";
|
|
100
101
|
import "../proactive/index.js";
|
|
101
|
-
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
102
102
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
103
103
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
104
104
|
import { GatewaySessionsApi } from "./service/sessions-api.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { listPortListeners } from "../gateway/ports.js";
|
|
2
1
|
import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
|
|
2
|
+
import { listPortListeners } from "../gateway/ports.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { spawnSync } from "node:child_process";
|
|
5
5
|
//#region src/infra/gateway-processes.ts
|
|
@@ -4,8 +4,8 @@ import { init_paths, resolveConfigPath } from "../config/paths.js";
|
|
|
4
4
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
5
5
|
import { isRestartEnabled } from "../config/commands.flags.js";
|
|
6
6
|
import { resolveGatewayService } from "../daemon/service.js";
|
|
7
|
-
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
8
7
|
import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
|
|
8
|
+
import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
|
|
9
9
|
import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
|
|
10
10
|
//#region src/infra/update-restart.ts
|
|
11
11
|
init_loader();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
|
-
import "./update-channels.js";
|
|
3
|
-
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
4
2
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
5
3
|
import { createDefaultCommandRunner, runCommandWithTimeout } from "./run-command.js";
|
|
6
4
|
import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
|
|
7
5
|
import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
8
6
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
7
|
+
import "./update-channels.js";
|
|
8
|
+
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
9
9
|
import { trimLogTail } from "./update-log.js";
|
|
10
10
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
11
11
|
import path from "node:path";
|
|
@@ -3,9 +3,9 @@ import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-s
|
|
|
3
3
|
import { createLogger } from "../utils/logger/index.js";
|
|
4
4
|
import { init_logger } from "../utils/logger.js";
|
|
5
5
|
import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
|
|
6
|
-
import { acquireUpdateLock } from "./update-lock.js";
|
|
7
6
|
import { normalizeUpdateChannel } from "./update-channels.js";
|
|
8
7
|
import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
|
|
8
|
+
import { acquireUpdateLock } from "./update-lock.js";
|
|
9
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
10
10
|
import { readFile } from "node:fs/promises";
|
|
11
11
|
//#region src/infra/update-startup.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { getMemoryRecord, upsertMemoryRecord } from "../storage/sqlite/memory-records-repository.js";
|
|
4
3
|
import { attachMemoryEvidence, claimKnowledgeSourceItems, completeKnowledgeSourceItemSynthesis, deleteMemoryEvidenceForRecord, listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
4
|
+
import { getMemoryRecord, upsertMemoryRecord } from "../storage/sqlite/memory-records-repository.js";
|
|
5
5
|
import "../storage/sqlite/index.js";
|
|
6
6
|
import { createHash, randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/knowledge/connected-knowledge-pipeline.ts
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import type { UnderstandingCandidate, UnderstandingReviewResult } from '../agent/memory/understanding/types.js';
|
|
2
2
|
import type { MemoryManager } from '../agent/memory/manager.js';
|
|
3
|
-
import { resolveUserEntity, type UserClaim, type UserClaimClass } from '../storage/sqlite/index.js';
|
|
4
3
|
import type { KnowledgeSourceItem } from './types.js';
|
|
5
4
|
export type ClaimObservation = {
|
|
6
|
-
class:
|
|
5
|
+
class: 'relationship' | 'project' | 'routine';
|
|
7
6
|
key: string;
|
|
8
7
|
value: Record<string, unknown>;
|
|
9
|
-
subject?: Parameters<typeof resolveUserEntity>[0];
|
|
10
8
|
items: KnowledgeSourceItem[];
|
|
11
9
|
windowDays: number;
|
|
12
10
|
};
|
|
13
11
|
export declare function deriveConnectedClaimObservations(items: KnowledgeSourceItem[]): ClaimObservation[];
|
|
14
|
-
export declare function
|
|
12
|
+
export declare function renderConnectedObservation(observation: ClaimObservation): UnderstandingCandidate;
|
|
15
13
|
export declare class ConnectedUnderstandingPipeline {
|
|
16
14
|
private readonly memoryManager;
|
|
17
15
|
constructor(memoryManager: MemoryManager);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { linkUserClaimMemoryRecord, reinforceUserClaim, resolveUserEntity } from "../storage/sqlite/user-claims-repository.js";
|
|
2
1
|
import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
3
2
|
import "../storage/sqlite/index.js";
|
|
4
3
|
//#region src/knowledge/connected-understanding-pipeline.ts
|
|
@@ -43,30 +42,9 @@ function relationshipObservations(items) {
|
|
|
43
42
|
const strongIdentity = (signal.email ?? signal.username)?.toLowerCase();
|
|
44
43
|
if (strongIdentity && owners.has(strongIdentity)) continue;
|
|
45
44
|
const label = signal.name ?? signal.email ?? signal.username;
|
|
46
|
-
const handles = [
|
|
47
|
-
...signal.email ? [{
|
|
48
|
-
type: "email",
|
|
49
|
-
value: signal.email,
|
|
50
|
-
sourceScope: "global",
|
|
51
|
-
verified: true
|
|
52
|
-
}] : [],
|
|
53
|
-
...signal.username ? [{
|
|
54
|
-
type: "provider_user",
|
|
55
|
-
value: signal.username,
|
|
56
|
-
sourceScope: String(item.metadata.toolkit ?? item.sourceInstanceId),
|
|
57
|
-
verified: true
|
|
58
|
-
}] : [],
|
|
59
|
-
...signal.name ? [{
|
|
60
|
-
type: "display_name",
|
|
61
|
-
value: signal.name,
|
|
62
|
-
sourceScope: item.sourceInstanceId,
|
|
63
|
-
verified: false
|
|
64
|
-
}] : []
|
|
65
|
-
];
|
|
66
45
|
const identityKey = signal.email?.toLowerCase() ?? `${String(item.metadata.toolkit ?? item.sourceInstanceId)}:${signal.username?.toLowerCase() ?? signal.name?.toLowerCase()}`;
|
|
67
46
|
const entry = grouped.get(identityKey) ?? {
|
|
68
47
|
label,
|
|
69
|
-
handles,
|
|
70
48
|
events: /* @__PURE__ */ new Map()
|
|
71
49
|
};
|
|
72
50
|
const eventKey = logicalEventKey(item);
|
|
@@ -76,13 +54,8 @@ function relationshipObservations(items) {
|
|
|
76
54
|
}
|
|
77
55
|
return [...grouped.values()].sort((left, right) => right.events.size - left.events.size).slice(0, 8).map((entry) => ({
|
|
78
56
|
class: "relationship",
|
|
79
|
-
key:
|
|
57
|
+
key: `person:${entry.label.toLocaleLowerCase()}`,
|
|
80
58
|
value: { label: entry.label },
|
|
81
|
-
subject: {
|
|
82
|
-
type: "person",
|
|
83
|
-
canonicalLabel: entry.label,
|
|
84
|
-
handles: entry.handles
|
|
85
|
-
},
|
|
86
59
|
items: [...entry.events.values()],
|
|
87
60
|
windowDays: 90
|
|
88
61
|
}));
|
|
@@ -131,18 +104,8 @@ function projectObservations(items) {
|
|
|
131
104
|
const { label: subject, events } = entry;
|
|
132
105
|
return {
|
|
133
106
|
class: "project",
|
|
134
|
-
key:
|
|
107
|
+
key: `project:${subject.toLocaleLowerCase()}`,
|
|
135
108
|
value: { label: subject },
|
|
136
|
-
subject: {
|
|
137
|
-
type: "project",
|
|
138
|
-
canonicalLabel: subject,
|
|
139
|
-
handles: [{
|
|
140
|
-
type: "provider_user",
|
|
141
|
-
value: subject,
|
|
142
|
-
sourceScope: "project",
|
|
143
|
-
verified: true
|
|
144
|
-
}]
|
|
145
|
-
},
|
|
146
109
|
items: [...events.values()],
|
|
147
110
|
windowDays: 60
|
|
148
111
|
};
|
|
@@ -156,34 +119,41 @@ function deriveConnectedClaimObservations(items) {
|
|
|
156
119
|
...projectObservations(active)
|
|
157
120
|
];
|
|
158
121
|
}
|
|
159
|
-
function
|
|
160
|
-
const
|
|
161
|
-
|
|
122
|
+
function confidenceFor(observation) {
|
|
123
|
+
const days = new Set(observation.items.map((item) => item.occurredAt?.slice(0, 10)).filter(Boolean)).size;
|
|
124
|
+
return Math.min(.92, .48 + Math.min(observation.items.length, 8) * .035 + Math.min(days, 5) * .045);
|
|
125
|
+
}
|
|
126
|
+
function isDurableObservation(observation) {
|
|
127
|
+
const days = new Set(observation.items.map((item) => item.occurredAt?.slice(0, 10)).filter(Boolean)).size;
|
|
128
|
+
return observation.items.length >= 3 && days >= (observation.class === "routine" ? 3 : 2);
|
|
129
|
+
}
|
|
130
|
+
function renderConnectedObservation(observation) {
|
|
131
|
+
const label = typeof observation.value.label === "string" ? observation.value.label : "";
|
|
132
|
+
const confidence = confidenceFor(observation);
|
|
133
|
+
if (observation.class === "relationship") return {
|
|
162
134
|
kind: "relationship",
|
|
163
135
|
content: `Frequently collaborates with ${label}.`,
|
|
164
|
-
canonicalKey: `
|
|
165
|
-
confidence
|
|
136
|
+
canonicalKey: `connected:${observation.key}`,
|
|
137
|
+
confidence,
|
|
166
138
|
importance: .65,
|
|
167
139
|
explicitness: "inferred",
|
|
168
140
|
durability: "recurring",
|
|
169
141
|
sensitivity: "personal",
|
|
170
|
-
disclosurePolicy: "ask_before_reference"
|
|
171
|
-
tags: ["connected-source", "structured-claim"]
|
|
142
|
+
disclosurePolicy: "ask_before_reference"
|
|
172
143
|
};
|
|
173
|
-
if (
|
|
144
|
+
if (observation.class === "project") return {
|
|
174
145
|
kind: "project_context",
|
|
175
146
|
content: `Recently contributed repeatedly to ${label}.`,
|
|
176
|
-
canonicalKey: `
|
|
177
|
-
confidence
|
|
147
|
+
canonicalKey: `connected:${observation.key}`,
|
|
148
|
+
confidence,
|
|
178
149
|
importance: .72,
|
|
179
150
|
explicitness: "inferred",
|
|
180
151
|
durability: "recurring",
|
|
181
152
|
sensitivity: "personal",
|
|
182
|
-
disclosurePolicy: "referenceable"
|
|
183
|
-
tags: ["connected-source", "structured-claim"]
|
|
153
|
+
disclosurePolicy: "referenceable"
|
|
184
154
|
};
|
|
185
|
-
const weekday = Number(
|
|
186
|
-
const hour = Number(
|
|
155
|
+
const weekday = Number(observation.value.weekday);
|
|
156
|
+
const hour = Number(observation.value.hour);
|
|
187
157
|
return {
|
|
188
158
|
kind: "routine",
|
|
189
159
|
content: `Often has calendar activity on ${[
|
|
@@ -195,14 +165,13 @@ function renderUserClaim(claim) {
|
|
|
195
165
|
"Friday",
|
|
196
166
|
"Saturday"
|
|
197
167
|
][weekday] ?? "Unknown"} around ${String(hour).padStart(2, "0")}:00 UTC.`,
|
|
198
|
-
canonicalKey: `
|
|
199
|
-
confidence
|
|
168
|
+
canonicalKey: `connected:${observation.key}`,
|
|
169
|
+
confidence,
|
|
200
170
|
importance: .58,
|
|
201
171
|
explicitness: "inferred",
|
|
202
172
|
durability: "recurring",
|
|
203
173
|
sensitivity: "personal",
|
|
204
|
-
disclosurePolicy: "referenceable"
|
|
205
|
-
tags: ["connected-source", "structured-claim"]
|
|
174
|
+
disclosurePolicy: "referenceable"
|
|
206
175
|
};
|
|
207
176
|
}
|
|
208
177
|
var ConnectedUnderstandingPipeline = class {
|
|
@@ -223,29 +192,12 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
223
192
|
createdRecords: []
|
|
224
193
|
};
|
|
225
194
|
for (const observation of observations) {
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
agentId,
|
|
229
|
-
class: observation.class,
|
|
230
|
-
key: subject ? `${observation.key}:${subject.id}` : observation.key,
|
|
231
|
-
subjectEntityId: subject?.id,
|
|
232
|
-
value: observation.value,
|
|
233
|
-
evidence: observation.items.map((item) => ({
|
|
234
|
-
logicalEventKey: logicalEventKey(item),
|
|
235
|
-
sourceItemId: item.id,
|
|
236
|
-
sourceInstanceId: item.sourceInstanceId,
|
|
237
|
-
relation: "supports",
|
|
238
|
-
observedAt: item.occurredAt
|
|
239
|
-
}))
|
|
240
|
-
});
|
|
241
|
-
if (claim.state !== "active") continue;
|
|
242
|
-
const result = await this.memoryManager.applyUnderstandingCandidates([renderUserClaim(claim)], {
|
|
243
|
-
agentId,
|
|
195
|
+
if (!isDurableObservation(observation)) continue;
|
|
196
|
+
const result = await this.memoryManager.applyUnderstandingCandidates([renderConnectedObservation(observation)], {
|
|
244
197
|
sourceItemIds: observation.items.map((item) => item.id).slice(0, 20),
|
|
245
198
|
sourceText: JSON.stringify({
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
activeDays: claim.activeDayCount,
|
|
199
|
+
independentEvidenceCount: observation.items.length,
|
|
200
|
+
activeDays: new Set(observation.items.map((item) => item.occurredAt?.slice(0, 10))).size,
|
|
249
201
|
windowDays: observation.windowDays
|
|
250
202
|
}),
|
|
251
203
|
source: {
|
|
@@ -254,8 +206,6 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
254
206
|
},
|
|
255
207
|
reviewSource: "background"
|
|
256
208
|
});
|
|
257
|
-
const memoryRecordId = result.createdRecords[0]?.id;
|
|
258
|
-
if (memoryRecordId) linkUserClaimMemoryRecord(claim.id, memoryRecordId);
|
|
259
209
|
totals.created += result.created;
|
|
260
210
|
totals.deduplicated += result.deduplicated;
|
|
261
211
|
totals.rejected += result.rejected;
|
|
@@ -265,4 +215,4 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
265
215
|
}
|
|
266
216
|
};
|
|
267
217
|
//#endregion
|
|
268
|
-
export { ConnectedUnderstandingPipeline, deriveConnectedClaimObservations,
|
|
218
|
+
export { ConnectedUnderstandingPipeline, deriveConnectedClaimObservations, renderConnectedObservation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KnowledgeIngestionService, SqliteKnowledgeSourceStateStore } from "./ingestion-service.js";
|
|
2
2
|
import { ConnectedKnowledgePipeline } from "./connected-knowledge-pipeline.js";
|
|
3
|
-
import { ConnectedUnderstandingPipeline, deriveConnectedClaimObservations,
|
|
3
|
+
import { ConnectedUnderstandingPipeline, deriveConnectedClaimObservations, renderConnectedObservation } from "./connected-understanding-pipeline.js";
|
|
4
4
|
import { startConnectedKnowledgeCoordinator } from "./coordinator.js";
|
|
5
5
|
import { LocalFolderKnowledgeSourceAdapter } from "./local-folder-adapter.js";
|
|
6
6
|
import { buildConnectedPeopleGraph } from "./people-graph.js";
|
|
7
|
-
export { ConnectedKnowledgePipeline, ConnectedUnderstandingPipeline, KnowledgeIngestionService, LocalFolderKnowledgeSourceAdapter, SqliteKnowledgeSourceStateStore, buildConnectedPeopleGraph, deriveConnectedClaimObservations,
|
|
7
|
+
export { ConnectedKnowledgePipeline, ConnectedUnderstandingPipeline, KnowledgeIngestionService, LocalFolderKnowledgeSourceAdapter, SqliteKnowledgeSourceStateStore, buildConnectedPeopleGraph, deriveConnectedClaimObservations, renderConnectedObservation, startConnectedKnowledgeCoordinator };
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
export type ConnectedPersonNode = {
|
|
2
|
-
id: string;
|
|
3
|
-
label: string;
|
|
4
|
-
names: string[];
|
|
5
|
-
emails: string[];
|
|
6
|
-
usernames: string[];
|
|
7
|
-
roles: string[];
|
|
8
|
-
mentionCount: number;
|
|
9
|
-
lastObservedAt: string;
|
|
10
|
-
};
|
|
11
|
-
export type ConnectedPersonSourceEdge = {
|
|
12
|
-
personId: string;
|
|
13
|
-
sourceInstanceId: string;
|
|
14
|
-
connectorId?: string;
|
|
15
|
-
toolkit?: string;
|
|
16
|
-
mentionCount: number;
|
|
17
|
-
lastObservedAt: string;
|
|
18
|
-
};
|
|
19
|
-
export type ConnectedPeopleGraph = {
|
|
20
|
-
people: ConnectedPersonNode[];
|
|
21
|
-
sourceEdges: ConnectedPersonSourceEdge[];
|
|
22
|
-
scannedItems: number;
|
|
23
|
-
truncated: boolean;
|
|
24
|
-
};
|
|
25
1
|
export declare function buildConnectedPeopleGraph(options?: {
|
|
26
2
|
query?: string;
|
|
27
3
|
limit?: number;
|
|
28
|
-
}):
|
|
4
|
+
}): {
|
|
5
|
+
people: {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
names: string[];
|
|
9
|
+
emails: string[];
|
|
10
|
+
usernames: string[];
|
|
11
|
+
roles: any[];
|
|
12
|
+
mentionCount: number;
|
|
13
|
+
lastObservedAt: string;
|
|
14
|
+
}[];
|
|
15
|
+
sourceEdges: {
|
|
16
|
+
mentionCount: number;
|
|
17
|
+
lastObservedAt: string;
|
|
18
|
+
connectorId?: string;
|
|
19
|
+
toolkit?: string;
|
|
20
|
+
personId: string;
|
|
21
|
+
sourceInstanceId: string;
|
|
22
|
+
}[];
|
|
23
|
+
scannedItems: number;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
};
|
|
@@ -1,58 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { listKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
2
2
|
import "../storage/sqlite/index.js";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
3
4
|
//#region src/knowledge/people-graph.ts
|
|
5
|
+
function readString(record, key) {
|
|
6
|
+
const value = record[key];
|
|
7
|
+
return typeof value === "string" && value.trim() ? value.trim().slice(0, 160) : void 0;
|
|
8
|
+
}
|
|
9
|
+
function personKey(name, email, username) {
|
|
10
|
+
return email?.toLocaleLowerCase() ?? username?.toLocaleLowerCase() ?? name?.toLocaleLowerCase();
|
|
11
|
+
}
|
|
4
12
|
function sourceMetadata(sourceInstanceId) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
13
|
+
const connectorId = sourceInstanceId.startsWith("composio:") ? sourceInstanceId.split(":")[1] : void 0;
|
|
14
|
+
return connectorId ? {
|
|
15
|
+
connectorId,
|
|
16
|
+
toolkit: connectorId.replace(/^composio-/, "")
|
|
17
|
+
} : {};
|
|
11
18
|
}
|
|
12
19
|
function buildConnectedPeopleGraph(options = {}) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
const items = listKnowledgeSourceItems({
|
|
21
|
+
includeDeleted: false,
|
|
22
|
+
limit: 500
|
|
23
|
+
});
|
|
24
|
+
const people = /* @__PURE__ */ new Map();
|
|
25
|
+
for (const item of items) {
|
|
26
|
+
const entities = Array.isArray(item.metadata.personEntities) ? item.metadata.personEntities : [];
|
|
27
|
+
for (const raw of entities) {
|
|
28
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
|
|
29
|
+
const record = raw;
|
|
30
|
+
const name = readString(record, "name");
|
|
31
|
+
const email = readString(record, "email");
|
|
32
|
+
const username = readString(record, "username");
|
|
33
|
+
const key = personKey(name, email, username);
|
|
34
|
+
if (!key) continue;
|
|
35
|
+
const observedAt = item.occurredAt ?? new Date(item.updatedAt).toISOString();
|
|
36
|
+
const current = people.get(key) ?? {
|
|
37
|
+
id: createHash("sha256").update(key).digest("hex").slice(0, 20),
|
|
38
|
+
label: name ?? email ?? username,
|
|
39
|
+
names: /* @__PURE__ */ new Set(),
|
|
40
|
+
emails: /* @__PURE__ */ new Set(),
|
|
41
|
+
usernames: /* @__PURE__ */ new Set(),
|
|
42
|
+
sources: /* @__PURE__ */ new Map(),
|
|
43
|
+
mentionCount: 0,
|
|
44
|
+
lastObservedAt: observedAt
|
|
45
|
+
};
|
|
46
|
+
if (name) current.names.add(name);
|
|
47
|
+
if (email) current.emails.add(email);
|
|
48
|
+
if (username) current.usernames.add(username);
|
|
49
|
+
current.mentionCount += 1;
|
|
50
|
+
if (observedAt > current.lastObservedAt) current.lastObservedAt = observedAt;
|
|
51
|
+
const source = current.sources.get(item.sourceInstanceId) ?? {
|
|
52
|
+
count: 0,
|
|
53
|
+
lastObservedAt: observedAt
|
|
54
|
+
};
|
|
55
|
+
source.count += 1;
|
|
56
|
+
if (observedAt > source.lastObservedAt) source.lastObservedAt = observedAt;
|
|
57
|
+
current.sources.set(item.sourceInstanceId, source);
|
|
58
|
+
people.set(key, current);
|
|
59
|
+
}
|
|
19
60
|
}
|
|
20
|
-
const query = options.query?.trim().
|
|
21
|
-
const
|
|
22
|
-
const matching = graph.people.map((entity) => {
|
|
23
|
-
const edges = edgesByPerson.get(entity.id) ?? [];
|
|
24
|
-
const names = [...entity.canonicalLabel.includes("@") ? [] : [entity.canonicalLabel], ...entity.handles.filter((handle) => handle.type === "display_name").map((handle) => handle.value)].filter((value, index, values) => values.findIndex((candidate) => candidate.toLowerCase() === value.toLowerCase()) === index).toSorted();
|
|
25
|
-
const emails = entity.handles.filter((handle) => handle.type === "email").map((handle) => handle.value).toSorted();
|
|
26
|
-
const usernames = entity.handles.filter((handle) => handle.type === "provider_user").map((handle) => handle.value).toSorted();
|
|
27
|
-
return {
|
|
28
|
-
id: entity.id,
|
|
29
|
-
label: entity.canonicalLabel,
|
|
30
|
-
names,
|
|
31
|
-
emails,
|
|
32
|
-
usernames,
|
|
33
|
-
roles: [],
|
|
34
|
-
mentionCount: edges.reduce((sum, edge) => sum + edge.mentionCount, 0),
|
|
35
|
-
lastObservedAt: edges.reduce((latest, edge) => !latest || edge.lastObservedAt > latest ? edge.lastObservedAt : latest, "") || entity.updatedAt
|
|
36
|
-
};
|
|
37
|
-
}).filter((person) => !query || [
|
|
61
|
+
const query = options.query?.trim().toLocaleLowerCase() ?? "";
|
|
62
|
+
const all = [...people.values()].filter((person) => !query || [
|
|
38
63
|
person.label,
|
|
39
64
|
...person.names,
|
|
40
65
|
...person.emails,
|
|
41
66
|
...person.usernames
|
|
42
|
-
].some((value) => value.
|
|
43
|
-
const
|
|
44
|
-
const included = new Set(people.map((person) => person.id));
|
|
67
|
+
].some((value) => value.toLocaleLowerCase().includes(query))).sort((left, right) => right.mentionCount - left.mentionCount);
|
|
68
|
+
const selected = all.slice(0, Math.max(1, Math.min(options.limit ?? 100, 500)));
|
|
45
69
|
return {
|
|
46
|
-
people
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...
|
|
51
|
-
|
|
52
|
-
|
|
70
|
+
people: selected.map((person) => ({
|
|
71
|
+
id: person.id,
|
|
72
|
+
label: person.label,
|
|
73
|
+
names: [...person.names],
|
|
74
|
+
emails: [...person.emails],
|
|
75
|
+
usernames: [...person.usernames],
|
|
76
|
+
roles: [],
|
|
77
|
+
mentionCount: person.mentionCount,
|
|
78
|
+
lastObservedAt: person.lastObservedAt
|
|
53
79
|
})),
|
|
54
|
-
|
|
55
|
-
|
|
80
|
+
sourceEdges: selected.flatMap((person) => [...person.sources].map(([sourceInstanceId, source]) => ({
|
|
81
|
+
personId: person.id,
|
|
82
|
+
sourceInstanceId,
|
|
83
|
+
...sourceMetadata(sourceInstanceId),
|
|
84
|
+
mentionCount: source.count,
|
|
85
|
+
lastObservedAt: source.lastObservedAt
|
|
86
|
+
}))),
|
|
87
|
+
scannedItems: items.length,
|
|
88
|
+
truncated: all.length > selected.length
|
|
56
89
|
};
|
|
57
90
|
}
|
|
58
91
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSqliteDatabase } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import {
|
|
2
|
+
import { listUnderstandings } from "../../storage/sqlite/user-context-repository.js";
|
|
3
3
|
import { getKnowledgeSourceItem } from "../../storage/sqlite/knowledge-repository.js";
|
|
4
4
|
import { getConnectorSyncPolicyForConnection } from "../../storage/sqlite/connector-sync-policy-repository.js";
|
|
5
5
|
import { wrapExternalContent } from "../../gateway/security/external-content.js";
|
|
@@ -162,25 +162,20 @@ var UserUnderstandingContextProvider = class {
|
|
|
162
162
|
async collect(input) {
|
|
163
163
|
const scope = eventRows(input.eventIds).at(-1);
|
|
164
164
|
if (!scope) return emptyContext();
|
|
165
|
-
const records =
|
|
166
|
-
workspaceId: scope.workspace_id,
|
|
167
|
-
...scope.project_id ? { visibleToProjectId: scope.project_id } : { unscopedProjectOnly: true },
|
|
168
|
-
status: "active",
|
|
169
|
-
limit: 20
|
|
170
|
-
}).filter((record) => {
|
|
165
|
+
const records = listUnderstandings(["active"]).filter((record) => {
|
|
171
166
|
const now = Date.now();
|
|
172
|
-
|
|
173
|
-
|
|
167
|
+
const scopeMatches = record.scope.type === "global" || record.scope.type === "workspace" && record.scope.id === scope.workspace_id || record.scope.type === "project" && record.scope.id === scope.project_id;
|
|
168
|
+
return record.disclosurePolicy === "referenceable" && record.sensitivity !== "secret" && record.sensitivity !== "regulated" && scopeMatches && (!record.validFrom || record.validFrom <= now) && (!record.validTo || record.validTo >= now) && (!record.expiresAt || record.expiresAt >= now) && !record.conflictGroupId && (record.explicitness === "explicit" || record.confidence >= .7);
|
|
169
|
+
}).slice(0, 20);
|
|
174
170
|
return {
|
|
175
171
|
content: { records: records.map((record) => ({
|
|
176
|
-
evidenceId: `
|
|
172
|
+
evidenceId: `understanding:${record.id}`,
|
|
177
173
|
kind: record.kind,
|
|
178
|
-
content: boundedText(record.
|
|
174
|
+
content: boundedText(record.statement, 1e3),
|
|
179
175
|
confidence: record.confidence,
|
|
180
|
-
importance: record.importance,
|
|
181
176
|
updatedAt: record.updatedAt
|
|
182
177
|
})) },
|
|
183
|
-
evidenceIds: records.map((record) => `
|
|
178
|
+
evidenceIds: records.map((record) => `understanding:${record.id}`)
|
|
184
179
|
};
|
|
185
180
|
}
|
|
186
181
|
};
|
|
@@ -2,7 +2,22 @@ export interface CatalogModel {
|
|
|
2
2
|
id: string;
|
|
3
3
|
name: string;
|
|
4
4
|
availability: 'available' | 'unavailable';
|
|
5
|
+
kind: 'language' | 'image';
|
|
6
|
+
input: Array<'text' | 'image'>;
|
|
7
|
+
output: Array<'text' | 'image'>;
|
|
8
|
+
operations: Array<'chat.completions' | 'responses' | 'images.generate' | 'images.edit'>;
|
|
9
|
+
reasoning: boolean;
|
|
10
|
+
contextWindow: number;
|
|
5
11
|
maxOutputTokens: number | null;
|
|
12
|
+
imageGeneration?: {
|
|
13
|
+
maxCount: number;
|
|
14
|
+
sizes: string[];
|
|
15
|
+
aspectRatios?: string[];
|
|
16
|
+
qualities: Array<'low' | 'medium' | 'high' | 'auto'>;
|
|
17
|
+
formats: Array<'png' | 'jpeg' | 'webp'>;
|
|
18
|
+
backgrounds: Array<'transparent' | 'opaque' | 'auto'>;
|
|
19
|
+
maxInputImages: number;
|
|
20
|
+
};
|
|
6
21
|
}
|
|
7
22
|
export interface CatalogSource {
|
|
8
23
|
providerId: string;
|