@xopcai/xopc 0.0.248 → 0.0.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-etpmyV7S.js → activity-store-B759R_qf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BmKxSM1k.js → agent-avatar-dicebear-BUu7EnwM.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C1rXNUAG.js +1 -0
- package/dist/gateway/static/root/assets/agents-DK9HjHO0.js +1 -0
- package/dist/gateway/static/root/assets/{api-B0-hLuZ1.js → api-Cg0v7Lpn.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-C9DkCW_d.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-CFggS95Y.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-jOvT-fzU.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BnMSgZvR.js → archive-plugin-BQrilVVv.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CejsQMev.js → attachment-load-BG0BliqV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-RC8EyoAf.js → automations-page-Bo4RiTkh.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BKjKTlW8.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DGjppLSG.js → binary-plugins-BCnyNU0C.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CWdP4bUc.js → block-editor-Db8DlVvg.js} +50 -50
- package/dist/gateway/static/root/assets/browser-settings-page-Dzq18pO1.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BQ1Ilw_o.js → browser-workflow-inputs-C71vfl0b.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CJh4NyxT.js → browser-workflows-page-vvmSYKsO.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DW4SBQf4.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-57OGuewD.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-Ohhee4vm.js → channels-status-swr-CKyV3jY5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BOtoKTK3.js → chat-terminal-dock-B1Xd6OFB.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CT_I3kbR.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DTj1V3Sw.js → cron-expression-D-F9vjtE.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-Yr6OCvGL.js → date-picker-B2OoYvic.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-BiGx9Sbj.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DbGzggPF.js → desktop-pet-BNMRqipe.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DeYbIV7A.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DgTtk4KC.js → extension-debug-page-COyn05ub.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DtQeiP6f.js → extension-page-oH43chS2.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BMO59994.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-cimpViGk.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DXuXtU1w.js → gateway-config-swr-BGdHwT4e.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BHJtnSic.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CzBzglzQ.js → gateway-startup-retry-CuaM3b4c.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DNhrZHqx.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BiHwiBnQ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-TIgsn04n.js → image-generation-api-D7duj7Uj.js} +1 -1
- package/dist/gateway/static/root/assets/index-DGeGmj4k.css +2 -0
- package/dist/gateway/static/root/assets/index-aBs0EfQB.js +72 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-wsWuoa8p.js → keyboard-shortcuts-settings-D8Zw_lYd.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CpyvYyrb.js → local-app-workbench-page-eBFVWmtH.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-CXrbrGo8.js → local-apps-page-CvPDPRwb.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BJFLQY8O.js → locale-store-zEL8bkwx.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-ClvcWlL6.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-BdJZFR7U.js → management-settings-D8moh99U.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-NK3ACVG2.js → markdown-split-D7V3j0vE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DTF9v1gg.js → markdown-view-DGRN-8wP.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-F0jcUxyl.js → media-plugins-BLaE5b1Y.js} +1 -1
- package/dist/gateway/static/root/assets/messages-W5P19VTF.js +11 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-DiVDuCxl.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CEEvR-fV.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BLqgXNCx.js +8 -0
- package/dist/gateway/static/root/assets/page-tabs-BFMGjA60.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-DNEWZN7H.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CxGGlWA8.js → product-open-page-Co5u7asH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CIiFJ5tk.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B3UF-Pfm.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CIsNlSBi.js → registry-api-Cg92zSod.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BUtpkJPG.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-YkjhiQfA.js → runtime-tools-settings-panel-C0ByNmlV.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-oFGf3G3s.js → schema-form-Dq_VQpuY.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-UgJmG-V4.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDCzpdkl.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CZu6FX4k.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-C7VWs0IT.js → settings-page-S8ekeUZd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BdVmwXMv.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-t5oz18rh.js → share-preview-page-D2fEidbn.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BdsqnCYj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ghzAQKna.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-AYiPlgZE.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-DEDTYs2W.js → skills-page.utils-DGzl-ib-.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-5Xd5mIiR.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BQAUaCDD.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-O597U8q_.js → theme-store-ZVClZKQ0.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-CdZN1Jin.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-B5eUJ6Zq.js → use-autosave-czRI0NBc.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-W3GTm6nA.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CMKSwz4C.js → voice-api-key-field-8YEvA3cU.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-q7B6fOFB.js → voice-config-api-CopF64lY.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-keLtqYYJ.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DZmvLZjb.js → workflow-run-setup-panel-Dy5WgYMO.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BbAV3h7n.js +5 -0
- package/dist/gateway/static/root/index.html +10 -26
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +4 -4
- package/dist/src/agent/agent-manager.js +31 -15
- package/dist/src/agent/background-review/coordinator.d.ts +2 -4
- package/dist/src/agent/background-review/coordinator.js +5 -30
- package/dist/src/agent/background-review/prompts.d.ts +4 -2
- package/dist/src/agent/background-review/prompts.js +24 -19
- package/dist/src/agent/background-review/run-background-review.d.ts +6 -7
- package/dist/src/agent/background-review/run-background-review.js +47 -41
- package/dist/src/agent/background-review/settings.d.ts +0 -1
- package/dist/src/agent/background-review/settings.js +6 -7
- package/dist/src/agent/context/audit.d.ts +36 -0
- package/dist/src/agent/context/audit.js +97 -0
- package/dist/src/agent/context/coordinator.d.ts +26 -0
- package/dist/src/agent/context/coordinator.js +72 -0
- package/dist/src/agent/context/execution-context.d.ts +54 -0
- package/dist/src/agent/context/execution-context.js +147 -0
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/prepend.d.ts +2 -0
- package/dist/src/agent/context/prepend.js +28 -0
- package/dist/src/agent/context/project-context.d.ts +3 -3
- package/dist/src/agent/context/project-context.js +26 -23
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -0
- package/dist/src/agent/embedded/run-turn.js +22 -2
- package/dist/src/agent/embedded/types.d.ts +1 -25
- package/dist/src/agent/external-tools/composio-provider.js +87 -92
- package/dist/src/agent/external-tools/gateway-tools.d.ts +4 -1
- package/dist/src/agent/external-tools/gateway-tools.js +153 -41
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/external-tools/search-error.d.ts +12 -0
- package/dist/src/agent/external-tools/search-error.js +29 -0
- package/dist/src/agent/external-tools/service.d.ts +4 -0
- package/dist/src/agent/external-tools/service.js +22 -2
- package/dist/src/agent/memory/compaction-policy.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +45 -77
- package/dist/src/agent/memory/create-memory-manager.js +1 -3
- package/dist/src/agent/memory/index.d.ts +0 -5
- package/dist/src/agent/memory/index.js +2 -5
- package/dist/src/agent/memory/manager.d.ts +0 -16
- package/dist/src/agent/memory/manager.js +11 -40
- package/dist/src/agent/memory/memory-config.js +1 -1
- package/dist/src/agent/memory/runtime.d.ts +2 -2
- package/dist/src/agent/memory/runtime.js +9 -19
- package/dist/src/agent/memory/types.d.ts +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +13 -21
- package/dist/src/agent/prompt/sections/memory-skills.js +25 -36
- package/dist/src/agent/prompt/sections/tooling.js +10 -4
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -3
- package/dist/src/agent/service/direct-turn-helpers.js +6 -23
- package/dist/src/agent/service/process-direct-streaming.js +5 -3
- package/dist/src/agent/service.js +4 -3
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -0
- package/dist/src/agent/tools/delegate-tool.js +5 -2
- package/dist/src/agent/tools/factory.js +36 -19
- package/dist/src/agent/tools/index.d.ts +3 -2
- package/dist/src/agent/tools/index.js +4 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +9 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +129 -0
- package/dist/src/agent/tools/{dreaming-tool.d.ts → memory-maintenance-tool.d.ts} +2 -2
- package/dist/src/agent/tools/memory-maintenance-tool.js +31 -0
- package/dist/src/agent/tools/user-context-tool.d.ts +8 -0
- package/dist/src/agent/tools/user-context-tool.js +81 -0
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/chat-commands/builtins/understanding.js +24 -6
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.d.ts +68 -75
- package/dist/src/config/schema.js +29 -18
- package/dist/src/config/web-patch.d.ts +1 -1
- package/dist/src/connectors/auth-provider-registry.js +1 -1
- package/dist/src/connectors/composio-managed-client.js +6 -2
- package/dist/src/connectors/connected-source-ingestion.js +1 -1
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -3
- package/dist/src/connectors/connected-source-understanding.js +86 -99
- package/dist/src/connectors/connection-candidates.d.ts +11 -0
- package/dist/src/connectors/connection-candidates.js +58 -0
- package/dist/src/connectors/connection-capabilities.d.ts +4 -0
- package/dist/src/connectors/connection-capabilities.js +37 -0
- package/dist/src/connectors/connection-recovery-service.d.ts +42 -0
- package/dist/src/connectors/connection-recovery-service.js +396 -0
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.d.ts +0 -2
- package/dist/src/connectors/learning-coordinator.js +6 -7
- package/dist/src/connectors/principal.d.ts +5 -0
- package/dist/src/connectors/principal.js +18 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +28 -10
- package/dist/src/gateway/agent-builtin-tools.js +30 -9
- package/dist/src/gateway/chat-stream/mapper.js +1 -28
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -24
- package/dist/src/gateway/clarify-bridge.d.ts +4 -0
- package/dist/src/gateway/clarify-bridge.js +9 -4
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +52 -30
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- package/dist/src/gateway/hono/middleware/auth.js +1 -2
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +72 -28
- package/dist/src/gateway/hono/routes/connection-waits.d.ts +3 -0
- package/dist/src/gateway/hono/routes/connection-waits.js +58 -0
- package/dist/src/gateway/hono/routes/connectors.js +7 -15
- package/dist/src/gateway/hono/routes/context-sources.d.ts +4 -0
- package/dist/src/gateway/hono/routes/context-sources.js +159 -0
- package/dist/src/gateway/hono/routes/index.js +4 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -4
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +22 -7
- package/dist/src/gateway/hono/routes/projects.js +36 -44
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +15 -1
- package/dist/src/gateway/hono/routes/side-chats.js +13 -2
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.d.ts +3 -0
- package/dist/src/gateway/hono/routes/user-model.js +480 -0
- package/dist/src/gateway/memory-maintenance-automation-reconciler.d.ts +11 -0
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +72 -0
- package/dist/src/gateway/service/agent-runner.d.ts +9 -1
- package/dist/src/gateway/service/agent-runner.js +25 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +18 -14
- package/dist/src/gateway/service/session-input-coordinator.d.ts +3 -0
- package/dist/src/gateway/service/session-input-coordinator.js +12 -2
- package/dist/src/gateway/service.d.ts +3 -1
- package/dist/src/gateway/service.js +45 -14
- package/dist/src/gateway/side-chat/manager.d.ts +16 -3
- package/dist/src/gateway/side-chat/manager.js +117 -28
- package/dist/src/gateway/side-chat/run-service.d.ts +2 -0
- package/dist/src/gateway/side-chat/run-service.js +28 -5
- package/dist/src/gateway/side-chat/types.d.ts +9 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.d.ts +0 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +46 -217
- package/dist/src/knowledge-memory/domain.d.ts +35 -0
- package/dist/src/knowledge-memory/index.d.ts +2 -0
- package/dist/src/knowledge-memory/index.js +2 -0
- package/dist/src/knowledge-memory/repository.d.ts +45 -0
- package/dist/src/knowledge-memory/repository.js +154 -0
- package/dist/src/memory-maintenance/index.d.ts +2 -0
- package/dist/src/memory-maintenance/index.js +3 -0
- package/dist/src/memory-maintenance/schedule.d.ts +13 -0
- package/dist/src/memory-maintenance/schedule.js +51 -0
- package/dist/src/memory-maintenance/service.d.ts +28 -0
- package/dist/src/memory-maintenance/service.js +216 -0
- package/dist/src/notes/service.d.ts +1 -0
- package/dist/src/notes/service.js +7 -1
- package/dist/src/notes/types.d.ts +16 -0
- package/dist/src/proactive/execution/context.d.ts +2 -2
- package/dist/src/proactive/execution/context.js +16 -11
- package/dist/src/proactive/index.d.ts +1 -1
- package/dist/src/proactive/index.js +2 -2
- package/dist/src/projects/index.d.ts +1 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/knowledge-bind.d.ts +1 -0
- package/dist/src/projects/knowledge-bind.js +15 -0
- package/dist/src/projects/project-loop.d.ts +3 -3
- package/dist/src/projects/project-loop.js +4 -4
- package/dist/src/projects/project-store.js +2 -1
- package/dist/src/realtime/runtime.js +1 -0
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +54 -0
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +30 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +338 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +1 -1
- package/dist/src/storage/sqlite/context-evidence-repository.d.ts +24 -0
- package/dist/src/storage/sqlite/context-evidence-repository.js +52 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -5
- package/dist/src/storage/sqlite/index.js +4 -6
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +0 -19
- package/dist/src/storage/sqlite/knowledge-repository.js +1 -90
- package/dist/src/storage/sqlite/migrations/148_user_model_foundation.sql +554 -0
- package/dist/src/storage/sqlite/migrations/149_separate_source_index_from_memory.sql +18 -0
- package/dist/src/storage/sqlite/migrations/150_session_connection_waits.sql +47 -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/notes-repository.d.ts +2 -1
- package/dist/src/storage/sqlite/notes-repository.js +37 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +14 -2
- package/dist/src/storage/sqlite/session-input-repository.js +16 -13
- package/dist/src/storage/sqlite/session-repository.js +4 -1
- package/dist/src/storage/sqlite/transcript-repository.js +1 -1
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/project-operating-view-service.js +1 -1
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-context-repository.d.ts +0 -1
- package/dist/src/tasks/task-context-repository.js +1 -1
- package/dist/src/tasks/task-deletion-service.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tasks/task-run-repository.js +1 -0
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tui/tool-summary.js +2 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/user-context/config.d.ts +135 -153
- package/dist/src/user-context/config.js +94 -99
- package/dist/src/user-context/relationship-continuity.d.ts +2 -2
- package/dist/src/user-context/relationship-continuity.js +34 -24
- package/dist/src/user-context/sources/activity-clustering.d.ts +9 -3
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +1 -21
- package/dist/src/user-context/sources/repository.js +1 -183
- package/dist/src/user-context/sources/types.d.ts +0 -23
- package/dist/src/user-model/capture/executor.d.ts +40 -0
- package/dist/src/user-model/capture/executor.js +134 -0
- package/dist/src/user-model/capture/index.d.ts +2 -0
- package/dist/src/user-model/capture/index.js +3 -0
- package/dist/src/user-model/capture/semantic.d.ts +21 -0
- package/dist/src/user-model/capture/semantic.js +197 -0
- package/dist/src/user-model/domain.d.ts +93 -0
- package/dist/src/user-model/domain.js +33 -0
- package/dist/src/user-model/goals.d.ts +58 -0
- package/dist/src/user-model/goals.js +89 -0
- package/dist/src/user-model/importance.d.ts +11 -0
- package/dist/src/user-model/importance.js +17 -0
- package/dist/src/user-model/index.d.ts +5 -0
- package/dist/src/user-model/index.js +6 -0
- package/dist/src/user-model/repository.d.ts +23 -0
- package/dist/src/user-model/repository.js +268 -0
- package/dist/src/user-model/temporal.d.ts +10 -0
- package/dist/src/user-model/temporal.js +44 -0
- package/dist/src/voice/realtime/memory-context.d.ts +7 -2
- package/dist/src/voice/realtime/memory-context.js +39 -51
- package/dist/src/work-discovery/service.d.ts +3 -14
- package/dist/src/work-discovery/service.js +138 -99
- package/dist/src/work-discovery/types.d.ts +3 -3
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +12 -20
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CUXApfcE.js +0 -1
- package/dist/gateway/static/root/assets/agents-DNq_GKuc.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-qfwAgyhQ.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-DqQVUpCC.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-dwIqYmXk.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-SkdcSZ0i.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CKCa6TvG.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DSp--zIZ.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CMd2dDrI.js +0 -1
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-udWs5Kdm.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-DpN3XZg9.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DinCToZh.js +0 -1
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DcguCgsH.js +0 -1
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +0 -1
- package/dist/gateway/static/root/assets/eye-off-DEAzt3g1.js +0 -1
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +0 -1
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-Br7lSf6H.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CdPoDMuj.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DHk1hawP.js +0 -1
- package/dist/gateway/static/root/assets/home-page-YGipe_W6.js +0 -1
- package/dist/gateway/static/root/assets/index-D5TQQpeb.js +0 -71
- package/dist/gateway/static/root/assets/index-DReBaaTX.css +0 -2
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +0 -1
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-context-graph-BjUf7fQ9.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CXKy6E_l.js +0 -2
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +0 -1
- package/dist/gateway/static/root/assets/messages-CHNYp8EQ.js +0 -3
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +0 -1
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-3NKCniSp.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-nCfkBN8M.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DuqLahi6.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-C7j9EdQk.js +0 -5
- package/dist/gateway/static/root/assets/oauth-api-8lP_qJpq.js +0 -1
- package/dist/gateway/static/root/assets/oauth-authorization-window-Cdolr2wE.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +0 -1
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-CsNVTKC0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CfebYVX0.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-48GvzSVa.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-64xj_s2m.js +0 -1
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +0 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CcwcdRN8.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BaN84CyW.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DjWzRk4z.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DVVOCNbr.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DUYbYLi7.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BGyD0gB9.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CjF8DTsN.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-BSYuRgFI.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-YZYSTJH7.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-FKUi9wDL.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BCyiduKd.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-jhT2EzeH.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DQC0TpMa.js +0 -5
- package/dist/src/agent/memory/builtin-provider.d.ts +0 -37
- package/dist/src/agent/memory/builtin-provider.js +0 -225
- package/dist/src/agent/memory/context/types.d.ts +0 -40
- package/dist/src/agent/memory/understanding/quality.d.ts +0 -8
- package/dist/src/agent/memory/understanding/quality.js +0 -18
- package/dist/src/agent/memory/understanding/service.d.ts +0 -19
- package/dist/src/agent/memory/understanding/service.js +0 -209
- package/dist/src/agent/memory/understanding/types.d.ts +0 -34
- package/dist/src/agent/memory/understanding/types.js +0 -1
- package/dist/src/agent/memory/user-context-coordinator.d.ts +0 -23
- package/dist/src/agent/memory/user-context-coordinator.js +0 -113
- package/dist/src/agent/tools/dreaming-tool.js +0 -37
- package/dist/src/agent/tools/memory-tool.d.ts +0 -9
- package/dist/src/agent/tools/memory-tool.js +0 -119
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +0 -11
- package/dist/src/gateway/dreaming-automation-reconciler.js +0 -63
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +0 -21
- package/dist/src/gateway/hono/routes/understanding-sources.js +0 -387
- package/dist/src/gateway/hono/routes/you.d.ts +0 -3
- package/dist/src/gateway/hono/routes/you.js +0 -457
- package/dist/src/projects/memory-bind.d.ts +0 -1
- package/dist/src/projects/memory-bind.js +0 -14
- package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +0 -37
- package/dist/src/storage/sqlite/context-consolidation-repository.js +0 -64
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +0 -217
- package/dist/src/storage/sqlite/memory-records-repository.js +0 -715
- package/dist/src/storage/sqlite/remote-context-repository.d.ts +0 -3
- package/dist/src/storage/sqlite/remote-context-repository.js +0 -40
- package/dist/src/storage/sqlite/understanding-focus-exclusions.d.ts +0 -2
- package/dist/src/storage/sqlite/understanding-focus-exclusions.js +0 -24
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +0 -49
- package/dist/src/storage/sqlite/user-context-quality-repository.js +0 -118
- package/dist/src/storage/sqlite/user-context-repository.d.ts +0 -85
- package/dist/src/storage/sqlite/user-context-repository.js +0 -535
- package/dist/src/user-context/automatic-context.d.ts +0 -17
- package/dist/src/user-context/automatic-context.js +0 -85
- package/dist/src/user-context/consolidation.d.ts +0 -27
- package/dist/src/user-context/consolidation.js +0 -187
- package/dist/src/user-context/context-objects.d.ts +0 -17
- package/dist/src/user-context/context-objects.js +0 -99
- package/dist/src/user-context/evaluation/harness.d.ts +0 -13
- package/dist/src/user-context/evaluation/harness.js +0 -31
- package/dist/src/user-context/extraction/executor.d.ts +0 -22
- package/dist/src/user-context/extraction/executor.js +0 -142
- package/dist/src/user-context/extraction/repair.d.ts +0 -19
- package/dist/src/user-context/extraction/repair.js +0 -71
- package/dist/src/user-context/extraction/semantic.d.ts +0 -18
- package/dist/src/user-context/extraction/semantic.js +0 -148
- package/dist/src/user-context/focus-lifecycle.d.ts +0 -2
- package/dist/src/user-context/focus-lifecycle.js +0 -26
- package/dist/src/user-context/manual-understanding.d.ts +0 -12
- package/dist/src/user-context/manual-understanding.js +0 -37
- package/dist/src/user-context/planner.d.ts +0 -17
- package/dist/src/user-context/planner.js +0 -465
- package/dist/src/user-context/relationships/indexer.d.ts +0 -13
- package/dist/src/user-context/relationships/indexer.js +0 -185
- package/dist/src/user-context/relationships/service.d.ts +0 -22
- package/dist/src/user-context/relationships/service.js +0 -50
- package/dist/src/user-context/retriever.d.ts +0 -15
- package/dist/src/user-context/retriever.js +0 -124
- package/dist/src/user-context/scope.d.ts +0 -7
- package/dist/src/user-context/scope.js +0 -9
- package/dist/src/user-context/selection-policy.d.ts +0 -20
- package/dist/src/user-context/selection-policy.js +0 -33
- package/dist/src/user-context/understanding.d.ts +0 -15
- package/dist/src/user-context/understanding.js +0 -24
- package/dist/src/user-context/understandingQuality.d.ts +0 -5
- package/dist/src/user-context/understandingQuality.js +0 -48
- /package/dist/src/{agent/memory/context/types.js → knowledge-memory/domain.js} +0 -0
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const UserMemoryModeSchema: z.ZodEnum<{
|
|
3
|
-
off: "off";
|
|
4
|
-
auto: "auto";
|
|
5
|
-
readOnly: "readOnly";
|
|
6
|
-
confirmWrite: "confirmWrite";
|
|
7
|
-
}>;
|
|
8
2
|
export declare const DEFAULT_CONTEXT_COMPACTION_POLICY: {
|
|
9
3
|
enabled: boolean;
|
|
10
4
|
triggerThreshold: number;
|
|
@@ -40,79 +34,60 @@ export declare const ContextCompactionPolicySchema: z.ZodDefault<z.ZodObject<{
|
|
|
40
34
|
maxActiveTranscriptBytes: z.ZodDefault<z.ZodNumber>;
|
|
41
35
|
postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
36
|
}, z.core.$strict>>;
|
|
43
|
-
export declare const
|
|
44
|
-
mode: z.ZodDefault<z.ZodEnum<{
|
|
45
|
-
off: "off";
|
|
46
|
-
auto: "auto";
|
|
47
|
-
readOnly: "readOnly";
|
|
48
|
-
confirmWrite: "confirmWrite";
|
|
49
|
-
}>>;
|
|
50
|
-
sources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
51
|
-
session: "session";
|
|
52
|
-
workspace: "workspace";
|
|
53
|
-
understanding: "understanding";
|
|
54
|
-
agentProfile: "agentProfile";
|
|
55
|
-
}>>>;
|
|
56
|
-
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
57
|
-
agentProfile: z.ZodOptional<z.ZodEnum<{
|
|
58
|
-
allow: "allow";
|
|
59
|
-
confirm: "confirm";
|
|
60
|
-
deny: "deny";
|
|
61
|
-
}>>;
|
|
62
|
-
understanding: z.ZodOptional<z.ZodEnum<{
|
|
63
|
-
allow: "allow";
|
|
64
|
-
confirm: "confirm";
|
|
65
|
-
deny: "deny";
|
|
66
|
-
}>>;
|
|
67
|
-
workspace: z.ZodOptional<z.ZodEnum<{
|
|
68
|
-
allow: "allow";
|
|
69
|
-
confirm: "confirm";
|
|
70
|
-
deny: "deny";
|
|
71
|
-
}>>;
|
|
72
|
-
}, z.core.$strict>>;
|
|
73
|
-
retention: z.ZodOptional<z.ZodObject<{
|
|
74
|
-
compaction: z.ZodDefault<z.ZodObject<{
|
|
75
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
-
triggerThreshold: z.ZodDefault<z.ZodNumber>;
|
|
77
|
-
reserveTokens: z.ZodDefault<z.ZodNumber>;
|
|
78
|
-
minMessagesBeforeCompact: z.ZodDefault<z.ZodNumber>;
|
|
79
|
-
keepRecentTokens: z.ZodDefault<z.ZodNumber>;
|
|
80
|
-
recentTurnsPreserve: z.ZodDefault<z.ZodNumber>;
|
|
81
|
-
summaryMaxTokens: z.ZodDefault<z.ZodNumber>;
|
|
82
|
-
summaryChunkTokens: z.ZodDefault<z.ZodNumber>;
|
|
83
|
-
summaryTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
84
|
-
summaryRetries: z.ZodDefault<z.ZodNumber>;
|
|
85
|
-
qualityGuard: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
-
gapAudit: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
-
model: z.ZodOptional<z.ZodString>;
|
|
88
|
-
minToolResultKeepChars: z.ZodDefault<z.ZodNumber>;
|
|
89
|
-
maxActiveTranscriptBytes: z.ZodDefault<z.ZodNumber>;
|
|
90
|
-
postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
91
|
-
}, z.core.$strict>>;
|
|
92
|
-
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
93
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
95
|
-
}, z.core.$strict>>;
|
|
96
|
-
}, z.core.$strict>>;
|
|
97
|
-
export declare const UserUnderstandingConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
37
|
+
export declare const UserModelConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
98
38
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
39
|
+
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
allow: "allow";
|
|
41
|
+
confirm: "confirm";
|
|
42
|
+
deny: "deny";
|
|
43
|
+
}>>;
|
|
44
|
+
sensitiveWritePolicy: z.ZodDefault<z.ZodEnum<{
|
|
45
|
+
allow: "allow";
|
|
46
|
+
confirm: "confirm";
|
|
47
|
+
deny: "deny";
|
|
48
|
+
}>>;
|
|
99
49
|
processingPolicy: z.ZodDefault<z.ZodEnum<{
|
|
100
50
|
local_only: "local_only";
|
|
101
51
|
remote_allowed: "remote_allowed";
|
|
102
52
|
}>>;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
53
|
+
extraction: z.ZodDefault<z.ZodObject<{
|
|
54
|
+
reviewIntervalTurns: z.ZodDefault<z.ZodNumber>;
|
|
55
|
+
maxHistoryMessages: z.ZodDefault<z.ZodNumber>;
|
|
56
|
+
maxDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
maintenance: z.ZodDefault<z.ZodObject<{
|
|
59
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
60
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
61
|
+
temporalSweepMinutes: z.ZodDefault<z.ZodNumber>;
|
|
62
|
+
dailyTime: z.ZodDefault<z.ZodString>;
|
|
63
|
+
weeklyDay: z.ZodDefault<z.ZodEnum<{
|
|
64
|
+
sun: "sun";
|
|
65
|
+
mon: "mon";
|
|
66
|
+
tue: "tue";
|
|
67
|
+
wed: "wed";
|
|
68
|
+
thu: "thu";
|
|
69
|
+
fri: "fri";
|
|
70
|
+
sat: "sat";
|
|
71
|
+
}>>;
|
|
72
|
+
weeklyTime: z.ZodDefault<z.ZodString>;
|
|
73
|
+
evidenceThreshold: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
75
|
+
staleRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
76
|
+
}, z.core.$strict>>;
|
|
107
77
|
}, z.core.$strict>>;
|
|
108
|
-
export declare const
|
|
109
|
-
|
|
78
|
+
export declare const KnowledgeMemoryConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
79
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
110
81
|
allow: "allow";
|
|
111
82
|
confirm: "confirm";
|
|
112
83
|
deny: "deny";
|
|
113
84
|
}>>;
|
|
114
|
-
|
|
115
|
-
|
|
85
|
+
sources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
86
|
+
project: "project";
|
|
87
|
+
session: "session";
|
|
88
|
+
workspace: "workspace";
|
|
89
|
+
connector: "connector";
|
|
90
|
+
}>>>;
|
|
116
91
|
searchStrategy: z.ZodDefault<z.ZodEnum<{
|
|
117
92
|
"local-first": "local-first";
|
|
118
93
|
"external-first": "external-first";
|
|
@@ -131,17 +106,29 @@ export declare const UserContextProviderRoutingSchema: z.ZodDefault<z.ZodObject<
|
|
|
131
106
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
132
107
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
133
108
|
}, z.core.$strict>>;
|
|
134
|
-
export declare const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
109
|
+
export declare const ContextPlanningConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
110
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
111
|
+
maxAssertions: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
maxKnowledge: z.ZodDefault<z.ZodNumber>;
|
|
113
|
+
maxChars: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
compaction: z.ZodDefault<z.ZodObject<{
|
|
115
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
116
|
+
triggerThreshold: z.ZodDefault<z.ZodNumber>;
|
|
117
|
+
reserveTokens: z.ZodDefault<z.ZodNumber>;
|
|
118
|
+
minMessagesBeforeCompact: z.ZodDefault<z.ZodNumber>;
|
|
119
|
+
keepRecentTokens: z.ZodDefault<z.ZodNumber>;
|
|
120
|
+
recentTurnsPreserve: z.ZodDefault<z.ZodNumber>;
|
|
121
|
+
summaryMaxTokens: z.ZodDefault<z.ZodNumber>;
|
|
122
|
+
summaryChunkTokens: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
summaryTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
124
|
+
summaryRetries: z.ZodDefault<z.ZodNumber>;
|
|
125
|
+
qualityGuard: z.ZodDefault<z.ZodBoolean>;
|
|
126
|
+
gapAudit: z.ZodDefault<z.ZodBoolean>;
|
|
127
|
+
model: z.ZodOptional<z.ZodString>;
|
|
128
|
+
minToolResultKeepChars: z.ZodDefault<z.ZodNumber>;
|
|
129
|
+
maxActiveTranscriptBytes: z.ZodDefault<z.ZodNumber>;
|
|
130
|
+
postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
142
131
|
}, z.core.$strict>>;
|
|
143
|
-
minEvidenceSources: z.ZodDefault<z.ZodNumber>;
|
|
144
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
145
132
|
}, z.core.$strict>>;
|
|
146
133
|
export declare const UserContextConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
147
134
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -152,79 +139,60 @@ export declare const UserContextConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
152
139
|
"zh-CN": "zh-CN";
|
|
153
140
|
}>>;
|
|
154
141
|
}, z.core.$strict>>;
|
|
155
|
-
|
|
156
|
-
mode: z.ZodDefault<z.ZodEnum<{
|
|
157
|
-
off: "off";
|
|
158
|
-
auto: "auto";
|
|
159
|
-
readOnly: "readOnly";
|
|
160
|
-
confirmWrite: "confirmWrite";
|
|
161
|
-
}>>;
|
|
162
|
-
sources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
163
|
-
session: "session";
|
|
164
|
-
workspace: "workspace";
|
|
165
|
-
understanding: "understanding";
|
|
166
|
-
agentProfile: "agentProfile";
|
|
167
|
-
}>>>;
|
|
168
|
-
writePolicy: z.ZodOptional<z.ZodObject<{
|
|
169
|
-
agentProfile: z.ZodOptional<z.ZodEnum<{
|
|
170
|
-
allow: "allow";
|
|
171
|
-
confirm: "confirm";
|
|
172
|
-
deny: "deny";
|
|
173
|
-
}>>;
|
|
174
|
-
understanding: z.ZodOptional<z.ZodEnum<{
|
|
175
|
-
allow: "allow";
|
|
176
|
-
confirm: "confirm";
|
|
177
|
-
deny: "deny";
|
|
178
|
-
}>>;
|
|
179
|
-
workspace: z.ZodOptional<z.ZodEnum<{
|
|
180
|
-
allow: "allow";
|
|
181
|
-
confirm: "confirm";
|
|
182
|
-
deny: "deny";
|
|
183
|
-
}>>;
|
|
184
|
-
}, z.core.$strict>>;
|
|
185
|
-
retention: z.ZodOptional<z.ZodObject<{
|
|
186
|
-
compaction: z.ZodDefault<z.ZodObject<{
|
|
187
|
-
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
188
|
-
triggerThreshold: z.ZodDefault<z.ZodNumber>;
|
|
189
|
-
reserveTokens: z.ZodDefault<z.ZodNumber>;
|
|
190
|
-
minMessagesBeforeCompact: z.ZodDefault<z.ZodNumber>;
|
|
191
|
-
keepRecentTokens: z.ZodDefault<z.ZodNumber>;
|
|
192
|
-
recentTurnsPreserve: z.ZodDefault<z.ZodNumber>;
|
|
193
|
-
summaryMaxTokens: z.ZodDefault<z.ZodNumber>;
|
|
194
|
-
summaryChunkTokens: z.ZodDefault<z.ZodNumber>;
|
|
195
|
-
summaryTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
196
|
-
summaryRetries: z.ZodDefault<z.ZodNumber>;
|
|
197
|
-
qualityGuard: z.ZodDefault<z.ZodBoolean>;
|
|
198
|
-
gapAudit: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
-
model: z.ZodOptional<z.ZodString>;
|
|
200
|
-
minToolResultKeepChars: z.ZodDefault<z.ZodNumber>;
|
|
201
|
-
maxActiveTranscriptBytes: z.ZodDefault<z.ZodNumber>;
|
|
202
|
-
postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
203
|
-
}, z.core.$strict>>;
|
|
204
|
-
maxAgeDays: z.ZodOptional<z.ZodNumber>;
|
|
205
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
206
|
-
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
207
|
-
}, z.core.$strict>>;
|
|
208
|
-
}, z.core.$strict>>;
|
|
209
|
-
understanding: z.ZodDefault<z.ZodObject<{
|
|
142
|
+
userModel: z.ZodDefault<z.ZodObject<{
|
|
210
143
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
+
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
145
|
+
allow: "allow";
|
|
146
|
+
confirm: "confirm";
|
|
147
|
+
deny: "deny";
|
|
148
|
+
}>>;
|
|
149
|
+
sensitiveWritePolicy: z.ZodDefault<z.ZodEnum<{
|
|
150
|
+
allow: "allow";
|
|
151
|
+
confirm: "confirm";
|
|
152
|
+
deny: "deny";
|
|
153
|
+
}>>;
|
|
211
154
|
processingPolicy: z.ZodDefault<z.ZodEnum<{
|
|
212
155
|
local_only: "local_only";
|
|
213
156
|
remote_allowed: "remote_allowed";
|
|
214
157
|
}>>;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
158
|
+
extraction: z.ZodDefault<z.ZodObject<{
|
|
159
|
+
reviewIntervalTurns: z.ZodDefault<z.ZodNumber>;
|
|
160
|
+
maxHistoryMessages: z.ZodDefault<z.ZodNumber>;
|
|
161
|
+
maxDurationMs: z.ZodDefault<z.ZodNumber>;
|
|
162
|
+
}, z.core.$strict>>;
|
|
163
|
+
maintenance: z.ZodDefault<z.ZodObject<{
|
|
164
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
165
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
166
|
+
temporalSweepMinutes: z.ZodDefault<z.ZodNumber>;
|
|
167
|
+
dailyTime: z.ZodDefault<z.ZodString>;
|
|
168
|
+
weeklyDay: z.ZodDefault<z.ZodEnum<{
|
|
169
|
+
sun: "sun";
|
|
170
|
+
mon: "mon";
|
|
171
|
+
tue: "tue";
|
|
172
|
+
wed: "wed";
|
|
173
|
+
thu: "thu";
|
|
174
|
+
fri: "fri";
|
|
175
|
+
sat: "sat";
|
|
176
|
+
}>>;
|
|
177
|
+
weeklyTime: z.ZodDefault<z.ZodString>;
|
|
178
|
+
evidenceThreshold: z.ZodDefault<z.ZodNumber>;
|
|
179
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
180
|
+
staleRetentionDays: z.ZodDefault<z.ZodNumber>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
219
182
|
}, z.core.$strict>>;
|
|
220
|
-
|
|
221
|
-
|
|
183
|
+
knowledgeMemory: z.ZodDefault<z.ZodObject<{
|
|
184
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
185
|
+
writePolicy: z.ZodDefault<z.ZodEnum<{
|
|
222
186
|
allow: "allow";
|
|
223
187
|
confirm: "confirm";
|
|
224
188
|
deny: "deny";
|
|
225
189
|
}>>;
|
|
226
|
-
|
|
227
|
-
|
|
190
|
+
sources: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
191
|
+
project: "project";
|
|
192
|
+
session: "session";
|
|
193
|
+
workspace: "workspace";
|
|
194
|
+
connector: "connector";
|
|
195
|
+
}>>>;
|
|
228
196
|
searchStrategy: z.ZodDefault<z.ZodEnum<{
|
|
229
197
|
"local-first": "local-first";
|
|
230
198
|
"external-first": "external-first";
|
|
@@ -243,18 +211,32 @@ export declare const UserContextConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
243
211
|
allowedProviderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
244
212
|
autoWriteKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
245
213
|
}, z.core.$strict>>;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
214
|
+
contextPlanning: z.ZodDefault<z.ZodObject<{
|
|
215
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
216
|
+
maxAssertions: z.ZodDefault<z.ZodNumber>;
|
|
217
|
+
maxKnowledge: z.ZodDefault<z.ZodNumber>;
|
|
218
|
+
maxChars: z.ZodDefault<z.ZodNumber>;
|
|
219
|
+
compaction: z.ZodDefault<z.ZodObject<{
|
|
220
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
221
|
+
triggerThreshold: z.ZodDefault<z.ZodNumber>;
|
|
222
|
+
reserveTokens: z.ZodDefault<z.ZodNumber>;
|
|
223
|
+
minMessagesBeforeCompact: z.ZodDefault<z.ZodNumber>;
|
|
224
|
+
keepRecentTokens: z.ZodDefault<z.ZodNumber>;
|
|
225
|
+
recentTurnsPreserve: z.ZodDefault<z.ZodNumber>;
|
|
226
|
+
summaryMaxTokens: z.ZodDefault<z.ZodNumber>;
|
|
227
|
+
summaryChunkTokens: z.ZodDefault<z.ZodNumber>;
|
|
228
|
+
summaryTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
229
|
+
summaryRetries: z.ZodDefault<z.ZodNumber>;
|
|
230
|
+
qualityGuard: z.ZodDefault<z.ZodBoolean>;
|
|
231
|
+
gapAudit: z.ZodDefault<z.ZodBoolean>;
|
|
232
|
+
model: z.ZodOptional<z.ZodString>;
|
|
233
|
+
minToolResultKeepChars: z.ZodDefault<z.ZodNumber>;
|
|
234
|
+
maxActiveTranscriptBytes: z.ZodDefault<z.ZodNumber>;
|
|
235
|
+
postCompactionSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
254
236
|
}, z.core.$strict>>;
|
|
255
|
-
minEvidenceSources: z.ZodDefault<z.ZodNumber>;
|
|
256
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
257
237
|
}, z.core.$strict>>;
|
|
258
238
|
}, z.core.$strict>>;
|
|
259
239
|
export type UserContextConfig = z.infer<typeof UserContextConfigSchema>;
|
|
260
|
-
export type
|
|
240
|
+
export type UserModelConfig = z.infer<typeof UserModelConfigSchema>;
|
|
241
|
+
export type KnowledgeMemoryConfig = z.infer<typeof KnowledgeMemoryConfigSchema>;
|
|
242
|
+
export type ContextPlanningConfig = z.infer<typeof ContextPlanningConfigSchema>;
|
|
@@ -10,15 +10,9 @@ function isValidTimeZone(value) {
|
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
var
|
|
13
|
+
var DEFAULT_CONTEXT_COMPACTION_POLICY, ContextCompactionPolicySchema, WritePolicySchema, MaintenanceTimeSchema, UserModelConfigSchema, KnowledgeMemoryConfigSchema, ContextPlanningConfigSchema, UserContextConfigSchema;
|
|
14
14
|
var init_config = __esmMin((() => {
|
|
15
15
|
init_response_language();
|
|
16
|
-
UserMemoryModeSchema = z.enum([
|
|
17
|
-
"off",
|
|
18
|
-
"readOnly",
|
|
19
|
-
"confirmWrite",
|
|
20
|
-
"auto"
|
|
21
|
-
]);
|
|
22
16
|
DEFAULT_CONTEXT_COMPACTION_POLICY = {
|
|
23
17
|
enabled: true,
|
|
24
18
|
triggerThreshold: .8,
|
|
@@ -54,62 +48,84 @@ var init_config = __esmMin((() => {
|
|
|
54
48
|
maxActiveTranscriptBytes: z.number().int().min(64e3).default(2e6),
|
|
55
49
|
postCompactionSections: z.array(z.string().min(1)).max(12).default(["Session Startup", "Red Lines"])
|
|
56
50
|
}).strict().default(DEFAULT_CONTEXT_COMPACTION_POLICY);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
])).default(["session"]),
|
|
65
|
-
writePolicy: z.object({
|
|
66
|
-
agentProfile: z.enum([
|
|
67
|
-
"deny",
|
|
68
|
-
"confirm",
|
|
69
|
-
"allow"
|
|
70
|
-
]).optional(),
|
|
71
|
-
understanding: z.enum([
|
|
72
|
-
"deny",
|
|
73
|
-
"confirm",
|
|
74
|
-
"allow"
|
|
75
|
-
]).optional(),
|
|
76
|
-
workspace: z.enum([
|
|
77
|
-
"deny",
|
|
78
|
-
"confirm",
|
|
79
|
-
"allow"
|
|
80
|
-
]).optional()
|
|
81
|
-
}).strict().optional(),
|
|
82
|
-
retention: z.object({
|
|
83
|
-
compaction: ContextCompactionPolicySchema,
|
|
84
|
-
maxAgeDays: z.number().int().positive().optional(),
|
|
85
|
-
maxItems: z.number().int().positive().optional(),
|
|
86
|
-
maxChars: z.number().int().positive().optional()
|
|
87
|
-
}).strict().optional()
|
|
88
|
-
}).strict().default({
|
|
89
|
-
mode: "off",
|
|
90
|
-
sources: ["session"]
|
|
91
|
-
});
|
|
92
|
-
UserUnderstandingConfigSchema = z.object({
|
|
51
|
+
WritePolicySchema = z.enum([
|
|
52
|
+
"deny",
|
|
53
|
+
"confirm",
|
|
54
|
+
"allow"
|
|
55
|
+
]);
|
|
56
|
+
MaintenanceTimeSchema = z.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Expected time in HH:mm format");
|
|
57
|
+
UserModelConfigSchema = z.object({
|
|
93
58
|
enabled: z.boolean().default(true),
|
|
59
|
+
writePolicy: WritePolicySchema.default("confirm"),
|
|
60
|
+
sensitiveWritePolicy: WritePolicySchema.default("confirm"),
|
|
94
61
|
processingPolicy: z.enum(["local_only", "remote_allowed"]).default("remote_allowed"),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
62
|
+
extraction: z.object({
|
|
63
|
+
reviewIntervalTurns: z.number().int().min(1).max(1e3).default(10),
|
|
64
|
+
maxHistoryMessages: z.number().int().min(1).max(200).default(80),
|
|
65
|
+
maxDurationMs: z.number().int().min(1e3).max(6e5).default(12e4)
|
|
66
|
+
}).strict().default({
|
|
67
|
+
reviewIntervalTurns: 10,
|
|
68
|
+
maxHistoryMessages: 80,
|
|
69
|
+
maxDurationMs: 12e4
|
|
70
|
+
}),
|
|
71
|
+
maintenance: z.object({
|
|
72
|
+
enabled: z.boolean().default(true),
|
|
73
|
+
timezone: z.string().min(1).refine(isValidTimeZone, "Invalid IANA timezone").optional(),
|
|
74
|
+
temporalSweepMinutes: z.number().int().min(15).max(60).refine((value) => 60 % value === 0, "Must divide one hour evenly").default(60),
|
|
75
|
+
dailyTime: MaintenanceTimeSchema.default("03:00"),
|
|
76
|
+
weeklyDay: z.enum([
|
|
77
|
+
"sun",
|
|
78
|
+
"mon",
|
|
79
|
+
"tue",
|
|
80
|
+
"wed",
|
|
81
|
+
"thu",
|
|
82
|
+
"fri",
|
|
83
|
+
"sat"
|
|
84
|
+
]).default("sun"),
|
|
85
|
+
weeklyTime: MaintenanceTimeSchema.default("04:00"),
|
|
86
|
+
evidenceThreshold: z.number().int().min(2).max(10).default(2),
|
|
87
|
+
limit: z.number().int().positive().max(1e4).default(1e3),
|
|
88
|
+
staleRetentionDays: z.number().int().min(1).max(3650).default(30)
|
|
89
|
+
}).strict().default({
|
|
90
|
+
enabled: true,
|
|
91
|
+
temporalSweepMinutes: 60,
|
|
92
|
+
dailyTime: "03:00",
|
|
93
|
+
weeklyDay: "sun",
|
|
94
|
+
weeklyTime: "04:00",
|
|
95
|
+
evidenceThreshold: 2,
|
|
96
|
+
limit: 1e3,
|
|
97
|
+
staleRetentionDays: 30
|
|
98
|
+
})
|
|
99
99
|
}).strict().default({
|
|
100
100
|
enabled: true,
|
|
101
|
+
writePolicy: "confirm",
|
|
102
|
+
sensitiveWritePolicy: "confirm",
|
|
101
103
|
processingPolicy: "remote_allowed",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
extraction: {
|
|
105
|
+
reviewIntervalTurns: 10,
|
|
106
|
+
maxHistoryMessages: 80,
|
|
107
|
+
maxDurationMs: 12e4
|
|
108
|
+
},
|
|
109
|
+
maintenance: {
|
|
110
|
+
enabled: true,
|
|
111
|
+
temporalSweepMinutes: 60,
|
|
112
|
+
dailyTime: "03:00",
|
|
113
|
+
weeklyDay: "sun",
|
|
114
|
+
weeklyTime: "04:00",
|
|
115
|
+
evidenceThreshold: 2,
|
|
116
|
+
limit: 1e3,
|
|
117
|
+
staleRetentionDays: 30
|
|
118
|
+
}
|
|
106
119
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"confirm",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
KnowledgeMemoryConfigSchema = z.object({
|
|
121
|
+
enabled: z.boolean().default(true),
|
|
122
|
+
writePolicy: WritePolicySchema.default("confirm"),
|
|
123
|
+
sources: z.array(z.enum([
|
|
124
|
+
"session",
|
|
125
|
+
"workspace",
|
|
126
|
+
"project",
|
|
127
|
+
"connector"
|
|
128
|
+
])).default(["session", "workspace"]),
|
|
113
129
|
searchStrategy: z.enum([
|
|
114
130
|
"local-first",
|
|
115
131
|
"external-first",
|
|
@@ -128,61 +144,40 @@ var init_config = __esmMin((() => {
|
|
|
128
144
|
allowedProviderIds: z.array(z.string().min(1)).optional(),
|
|
129
145
|
autoWriteKinds: z.array(z.string().min(1)).optional()
|
|
130
146
|
}).strict().default({
|
|
147
|
+
enabled: true,
|
|
148
|
+
writePolicy: "confirm",
|
|
149
|
+
sources: ["session", "workspace"],
|
|
131
150
|
searchStrategy: "fanout",
|
|
132
151
|
writeStrategy: "local-first",
|
|
133
152
|
allowExternalWrites: false
|
|
134
153
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
limit: z.number().int().positive().max(2e3).default(500)
|
|
154
|
+
ContextPlanningConfigSchema = z.object({
|
|
155
|
+
enabled: z.boolean().default(true),
|
|
156
|
+
maxAssertions: z.number().int().min(1).max(100).default(20),
|
|
157
|
+
maxKnowledge: z.number().int().min(0).max(100).default(12),
|
|
158
|
+
maxChars: z.number().int().min(500).max(5e4).default(6e3),
|
|
159
|
+
compaction: ContextCompactionPolicySchema
|
|
142
160
|
}).strict().default({
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
161
|
+
enabled: true,
|
|
162
|
+
maxAssertions: 20,
|
|
163
|
+
maxKnowledge: 12,
|
|
164
|
+
maxChars: 6e3,
|
|
165
|
+
compaction: DEFAULT_CONTEXT_COMPACTION_POLICY
|
|
147
166
|
});
|
|
148
167
|
UserContextConfigSchema = z.object({
|
|
149
168
|
enabled: z.boolean().default(true),
|
|
150
169
|
preferences: z.object({ responseLanguage: ResponseLanguageSchema.default("auto") }).strict().default({ responseLanguage: "auto" }),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
providerRouting: UserContextProviderRoutingSchema,
|
|
155
|
-
dreaming: UserContextDreamingSchema
|
|
170
|
+
userModel: UserModelConfigSchema,
|
|
171
|
+
knowledgeMemory: KnowledgeMemoryConfigSchema,
|
|
172
|
+
contextPlanning: ContextPlanningConfigSchema
|
|
156
173
|
}).strict().default({
|
|
157
174
|
enabled: true,
|
|
158
175
|
preferences: { responseLanguage: "auto" },
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
writePolicy: { understanding: "confirm" }
|
|
163
|
-
},
|
|
164
|
-
understanding: {
|
|
165
|
-
enabled: true,
|
|
166
|
-
processingPolicy: "remote_allowed",
|
|
167
|
-
adaptiveCadence: true,
|
|
168
|
-
reviewIntervalTurns: 10,
|
|
169
|
-
maxHistoryMessages: 80,
|
|
170
|
-
maxDurationMs: 12e4
|
|
171
|
-
},
|
|
172
|
-
privacy: { sensitiveWritePolicy: "confirm" },
|
|
173
|
-
providerRouting: {
|
|
174
|
-
searchStrategy: "fanout",
|
|
175
|
-
writeStrategy: "local-first",
|
|
176
|
-
allowExternalWrites: false
|
|
177
|
-
},
|
|
178
|
-
dreaming: {
|
|
179
|
-
mode: "review",
|
|
180
|
-
schedule: { time: "03:00" },
|
|
181
|
-
minEvidenceSources: 2,
|
|
182
|
-
limit: 500
|
|
183
|
-
}
|
|
176
|
+
userModel: UserModelConfigSchema.parse({}),
|
|
177
|
+
knowledgeMemory: KnowledgeMemoryConfigSchema.parse({}),
|
|
178
|
+
contextPlanning: ContextPlanningConfigSchema.parse({})
|
|
184
179
|
});
|
|
185
180
|
}));
|
|
186
181
|
//#endregion
|
|
187
182
|
init_config();
|
|
188
|
-
export { ContextCompactionPolicySchema,
|
|
183
|
+
export { ContextCompactionPolicySchema, ContextPlanningConfigSchema, DEFAULT_CONTEXT_COMPACTION_POLICY, KnowledgeMemoryConfigSchema, UserContextConfigSchema, UserModelConfigSchema, init_config };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type UserAssertion } from '../user-model/index.js';
|
|
2
2
|
export interface RelationshipFollowUpRequest {
|
|
3
3
|
subject: string;
|
|
4
4
|
validFrom?: number;
|
|
@@ -8,4 +8,4 @@ export declare function recordExplicitRelationshipFollowUp(input: {
|
|
|
8
8
|
sessionKey: string;
|
|
9
9
|
message: string;
|
|
10
10
|
nowMs?: number;
|
|
11
|
-
}):
|
|
11
|
+
}): UserAssertion | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { createContextEvidence
|
|
2
|
-
import "../
|
|
1
|
+
import { createContextEvidence } from "../storage/sqlite/context-evidence-repository.js";
|
|
2
|
+
import { reconcileAssertion } from "../user-model/repository.js";
|
|
3
|
+
import "../user-model/index.js";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
//#region src/user-context/relationship-continuity.ts
|
|
5
6
|
const CHINESE_FOLLOW_UP_PATTERN = /^(?:请|记得|麻烦|帮我)?\s*(?:明天|下周|之后|到时候)?\s*(?:提醒我|问问我|跟进一下|跟进)(?:关于)?[::,,\s]*(.+)$/;
|
|
@@ -24,35 +25,44 @@ function extractExplicitRelationshipFollowUp(message, nowMs = Date.now()) {
|
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
27
|
function recordExplicitRelationshipFollowUp(input) {
|
|
27
|
-
const
|
|
28
|
+
const now = input.nowMs ?? Date.now();
|
|
29
|
+
const request = extractExplicitRelationshipFollowUp(input.message, now);
|
|
28
30
|
if (!request) return null;
|
|
29
|
-
const
|
|
30
|
-
const existing = listUnderstandings().find((item) => item.canonicalKey === canonicalKey && item.scope.type === "global" && item.status !== "rejected" && item.status !== "archived");
|
|
31
|
-
if (existing) return existing;
|
|
32
|
-
const understanding = createUnderstanding({
|
|
33
|
-
kind: "relationship",
|
|
34
|
-
canonicalKey,
|
|
35
|
-
status: "active",
|
|
36
|
-
scope: { type: "global" },
|
|
37
|
-
explicitness: "explicit",
|
|
38
|
-
durability: "recurring",
|
|
39
|
-
sensitivity: "normal",
|
|
40
|
-
disclosurePolicy: "referenceable",
|
|
41
|
-
confidence: 1,
|
|
42
|
-
statement: request.subject,
|
|
43
|
-
...request.validFrom ? { validFrom: request.validFrom } : {},
|
|
44
|
-
createdBy: "user",
|
|
45
|
-
changeReason: "Explicit follow-up request"
|
|
46
|
-
});
|
|
31
|
+
const key = hash(request.subject.toLocaleLowerCase());
|
|
47
32
|
const evidence = createContextEvidence({
|
|
48
33
|
sourceType: "conversation",
|
|
49
34
|
sourceRef: `session:${input.sessionKey}:follow-up:${hash(input.message)}`,
|
|
50
35
|
redactedExcerpt: input.message.slice(0, 600),
|
|
51
36
|
trustLevel: "owner",
|
|
52
|
-
observedAt:
|
|
37
|
+
observedAt: now
|
|
53
38
|
});
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
return reconcileAssertion({
|
|
40
|
+
subject: {
|
|
41
|
+
type: "topic",
|
|
42
|
+
id: key
|
|
43
|
+
},
|
|
44
|
+
predicate: `relationship.follow_up.${key}`,
|
|
45
|
+
cardinality: "single",
|
|
46
|
+
scope: { type: "global" },
|
|
47
|
+
kind: "relationship",
|
|
48
|
+
value: request.subject,
|
|
49
|
+
normalizedValue: request.subject.toLocaleLowerCase(),
|
|
50
|
+
statement: request.subject,
|
|
51
|
+
authority: "user_explicit",
|
|
52
|
+
confidence: 1,
|
|
53
|
+
declaredImportance: .8,
|
|
54
|
+
inferredImportance: .8,
|
|
55
|
+
consequence: "medium",
|
|
56
|
+
actionability: 1,
|
|
57
|
+
volatility: "slow",
|
|
58
|
+
sensitivity: "normal",
|
|
59
|
+
disclosurePolicy: "referenceable",
|
|
60
|
+
...request.validFrom ? { validFrom: request.validFrom } : {},
|
|
61
|
+
observedAt: now,
|
|
62
|
+
createdBy: "user",
|
|
63
|
+
evidenceId: evidence.id,
|
|
64
|
+
evidenceConfidence: 1
|
|
65
|
+
}, now).assertion;
|
|
56
66
|
}
|
|
57
67
|
//#endregion
|
|
58
68
|
export { extractExplicitRelationshipFollowUp, recordExplicitRelationshipFollowUp };
|