@xopcai/xopc 0.0.189 → 0.0.190
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-9vAbkroX.js} +1 -1
- package/dist/gateway/static/root/assets/agents-D1t4SfMQ.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-DkFeIdBf.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-3ntKM9nQ.js → appearance-settings-Bxs8Fpaj.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Cgrgu5OW.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Df7Ycj_7.js → archive-plugin-Ch2RmLCC.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-UHgfZYtj.js → attachment-load-BhMQM_Ky.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-CtJxstKh.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BJah99wE.js → binary-plugins-D6CqlymH.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DNlY5KqF.js → block-editor-ClL6HEg9.js} +48 -48
- package/dist/gateway/static/root/assets/browser-settings-page-DW99iDmD.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-vyUfdzAd.js → browser-workflow-inputs-BYy48VhN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-C1cKZjx-.js → browser-workflows-page-zgLibuMH.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CHUrT9EB.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-Cycrv0YV.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-V96gPUAU.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-DS9ED-EL.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BhlyQoQI.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-CkgsvhtW.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BUuBEJuP.js → desktop-pet-Cv8rGhYW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BGfVIJM3.js → desktop-pet-settings-CIeJdwfV.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DrQFfHH_.js → directory-picker-path-field-D8jXEiAY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CEnIFOX-.js → extension-debug-page-CCZ9u6TZ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CCqHbexs.js → extension-page-CV36ILRG.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-IyQrSILY.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-CgUE2Ii1.js → gateway-config-api-D4_r5iJM.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CYlntpBH.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-D4SyWob8.js +1 -0
- package/dist/gateway/static/root/assets/home-page-B2Kagoh8.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-CYT5DOzr.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-BMhCuVBZ.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BHYbFjqy.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Ca1RuI13.js → local-apps-page-ijIe7_y2.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-deR2zRaE.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-IIn8Tess.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B3Eop1zn.js → management-settings--V_fovKD.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BGOYjgnM.js → markdown-split-Dt9-in6W.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CT0txyM4.js → media-plugins-B3pj_iO0.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-DZ366lIT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-S2sBVOLw.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-DNrbCgmC.js → page-tabs-C5ge434C.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BTqViDOR.js → preview-open-alternatives-BFa9DgSV.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-C_2L4_Iu.js → product-open-page-Dc9CcWdu.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BilzoCJ7.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BoQUyacP.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DUyUaCRF.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-BFLfkDGG.js → schema-form-B84DckWe.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Dzxlq1F0.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-TzwlZxU6.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-Dp9itvdy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-C9a-EbTZ.js → settings-loading-skeleton-CCtlhoy7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DI9qDH5x.js → settings-page-DQmMKf8r.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D-LWQdI5.js → settings-page-layout-EQIOJa_L.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CJwmPvgs.js → setup-status-panel-Cwi-SPja.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BKSMG9r5.js → share-preview-page-C4_B2jvf.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-CkyuGlZK.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BJCePQK5.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BYWLfmJi.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-zsz2HIlZ.js → skills-page.utils-Jhm24i4h.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-IWNDBI1O.js → system-settings-panel-Dpx2ags2.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CgtK02kP.js → task-detail-page-DLAdxI6e.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-DULmTHUB.js} +1 -1
- package/dist/gateway/static/root/assets/use-autosave-BrjVk5VH.js +1 -0
- package/dist/gateway/static/root/assets/user-context-page-9AAFpGAL.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Boue1D46.js → voice-api-key-field-BISTPfq_.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-bbmvCmc8.js → work-discovery-overlay-Wr-uF7VA.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BWds95sL.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DlHv-GZC.js → workflow-run-setup-panel-DHqHP8_6.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-0b4_DFHr.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/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/init.js +3 -22
- package/dist/src/cli/templates.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 +3 -32
- 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/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/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/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +2 -4
- 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/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/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
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { isUserContextMemoryKind } from "./projection.js";
|
|
2
|
-
//#region src/user-context/import.ts
|
|
3
|
-
function prepareUserContextImport(candidates, existingStatements) {
|
|
4
|
-
const known = new Set(Array.from(existingStatements, (statement) => statement.trim().toLocaleLowerCase()));
|
|
5
|
-
const imports = [];
|
|
6
|
-
let skippedCount = 0;
|
|
7
|
-
for (const candidate of candidates) {
|
|
8
|
-
if (!candidate || typeof candidate !== "object" || Array.isArray(candidate)) {
|
|
9
|
-
skippedCount += 1;
|
|
10
|
-
continue;
|
|
11
|
-
}
|
|
12
|
-
const item = candidate;
|
|
13
|
-
const statement = typeof item.statement === "string" ? item.statement.trim() : "";
|
|
14
|
-
const normalized = statement.toLocaleLowerCase();
|
|
15
|
-
if (!statement || statement.length > 5e3 || known.has(normalized) || item.status === "archived" || item.status === "rejected") {
|
|
16
|
-
skippedCount += 1;
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
const kind = isUserContextMemoryKind(item.kind) ? item.kind : "preference";
|
|
20
|
-
const sensitivity = typeof item.sensitivity === "string" && [
|
|
21
|
-
"normal",
|
|
22
|
-
"personal",
|
|
23
|
-
"secret",
|
|
24
|
-
"regulated"
|
|
25
|
-
].includes(item.sensitivity) ? item.sensitivity : "normal";
|
|
26
|
-
const durability = typeof item.durability === "string" && [
|
|
27
|
-
"ephemeral",
|
|
28
|
-
"durable",
|
|
29
|
-
"recurring"
|
|
30
|
-
].includes(item.durability) ? item.durability : "durable";
|
|
31
|
-
known.add(normalized);
|
|
32
|
-
const disclosurePolicy = typeof item.disclosurePolicy === "string" && [
|
|
33
|
-
"silent",
|
|
34
|
-
"referenceable",
|
|
35
|
-
"ask_before_reference"
|
|
36
|
-
].includes(item.disclosurePolicy) ? item.disclosurePolicy : "referenceable";
|
|
37
|
-
imports.push({
|
|
38
|
-
statement,
|
|
39
|
-
kind,
|
|
40
|
-
sensitivity,
|
|
41
|
-
durability,
|
|
42
|
-
disclosurePolicy
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
imports,
|
|
47
|
-
skippedCount
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
//#endregion
|
|
51
|
-
export { prepareUserContextImport };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export interface MemoryEpisode {
|
|
2
|
-
id: string;
|
|
3
|
-
expectedRecall: string[];
|
|
4
|
-
forbiddenRecall: string[];
|
|
5
|
-
expectedLifecycle: string[];
|
|
6
|
-
expectedDreaming: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface MemoryEpisodeObservation {
|
|
9
|
-
recalledRecordIds: string[];
|
|
10
|
-
lifecycleActions: string[];
|
|
11
|
-
dreamingActions: string[];
|
|
12
|
-
scopeViolations: number;
|
|
13
|
-
sensitivityViolations: number;
|
|
14
|
-
}
|
|
15
|
-
export interface MemoryEpisodeResult {
|
|
16
|
-
id: string;
|
|
17
|
-
recall: number;
|
|
18
|
-
forbiddenRecall: string[];
|
|
19
|
-
missingLifecycle: string[];
|
|
20
|
-
missingDreaming: string[];
|
|
21
|
-
safe: boolean;
|
|
22
|
-
passed: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare function evaluateMemoryEpisode(episode: MemoryEpisode, observation: MemoryEpisodeObservation): MemoryEpisodeResult;
|
|
25
|
-
export declare function evaluateMemoryEpisodeSuite(cases: Array<{
|
|
26
|
-
episode: MemoryEpisode;
|
|
27
|
-
observation: MemoryEpisodeObservation;
|
|
28
|
-
}>): {
|
|
29
|
-
releaseReady: boolean;
|
|
30
|
-
averageRecall: number;
|
|
31
|
-
results: MemoryEpisodeResult[];
|
|
32
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
//#region src/user-context/memory-episode-evaluator.ts
|
|
2
|
-
function coverage(expected, actual) {
|
|
3
|
-
if (expected.length === 0) return 1;
|
|
4
|
-
return expected.filter((item) => actual.has(item)).length / expected.length;
|
|
5
|
-
}
|
|
6
|
-
function evaluateMemoryEpisode(episode, observation) {
|
|
7
|
-
const recalled = new Set(observation.recalledRecordIds);
|
|
8
|
-
const lifecycle = new Set(observation.lifecycleActions);
|
|
9
|
-
const dreaming = new Set(observation.dreamingActions);
|
|
10
|
-
const forbiddenRecall = episode.forbiddenRecall.filter((recordId) => recalled.has(recordId));
|
|
11
|
-
const missingLifecycle = episode.expectedLifecycle.filter((action) => !lifecycle.has(action));
|
|
12
|
-
const missingDreaming = episode.expectedDreaming.filter((action) => !dreaming.has(action));
|
|
13
|
-
const recall = coverage(episode.expectedRecall, recalled);
|
|
14
|
-
const safe = forbiddenRecall.length === 0 && observation.scopeViolations === 0 && observation.sensitivityViolations === 0;
|
|
15
|
-
return {
|
|
16
|
-
id: episode.id,
|
|
17
|
-
recall,
|
|
18
|
-
forbiddenRecall,
|
|
19
|
-
missingLifecycle,
|
|
20
|
-
missingDreaming,
|
|
21
|
-
safe,
|
|
22
|
-
passed: safe && recall === 1 && missingLifecycle.length === 0 && missingDreaming.length === 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function evaluateMemoryEpisodeSuite(cases) {
|
|
26
|
-
const results = cases.map(({ episode, observation }) => evaluateMemoryEpisode(episode, observation));
|
|
27
|
-
const averageRecall = results.length > 0 ? results.reduce((total, result) => total + result.recall, 0) / results.length : 0;
|
|
28
|
-
return {
|
|
29
|
-
releaseReady: results.length > 0 && results.every((result) => result.passed),
|
|
30
|
-
averageRecall,
|
|
31
|
-
results
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { evaluateMemoryEpisode, evaluateMemoryEpisodeSuite };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export type MemoryReadinessReason = 'insufficient_feedback' | 'low_helpful_rate' | 'high_record_error_rate' | 'sensitive_feedback_detected' | 'insufficient_dreaming_runs' | 'high_dreaming_failure_rate';
|
|
2
|
-
export interface MemoryReadinessMetrics {
|
|
3
|
-
evaluatedTurns: number;
|
|
4
|
-
helpfulTurns: number;
|
|
5
|
-
recordFeedback: number;
|
|
6
|
-
recordErrors: number;
|
|
7
|
-
sensitiveFeedback: number;
|
|
8
|
-
dreamingRuns: number;
|
|
9
|
-
dreamingFailures: number;
|
|
10
|
-
}
|
|
11
|
-
export interface MemoryReadinessThresholds {
|
|
12
|
-
minEvaluatedTurns: number;
|
|
13
|
-
minHelpfulRate: number;
|
|
14
|
-
maxRecordErrorRate: number;
|
|
15
|
-
minDreamingRuns: number;
|
|
16
|
-
maxDreamingFailureRate: number;
|
|
17
|
-
}
|
|
18
|
-
export interface MemoryReadiness {
|
|
19
|
-
ready: boolean;
|
|
20
|
-
reasons: MemoryReadinessReason[];
|
|
21
|
-
metrics: MemoryReadinessMetrics & {
|
|
22
|
-
helpfulRate: number | null;
|
|
23
|
-
recordErrorRate: number | null;
|
|
24
|
-
dreamingFailureRate: number | null;
|
|
25
|
-
};
|
|
26
|
-
thresholds: MemoryReadinessThresholds;
|
|
27
|
-
evaluatedAt: string;
|
|
28
|
-
}
|
|
29
|
-
export declare const MEMORY_READINESS_THRESHOLDS: MemoryReadinessThresholds;
|
|
30
|
-
export declare function evaluateMemoryReadiness(metrics: MemoryReadinessMetrics, options?: {
|
|
31
|
-
thresholds?: Partial<MemoryReadinessThresholds>;
|
|
32
|
-
nowMs?: number;
|
|
33
|
-
}): MemoryReadiness;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region src/user-context/memory-readiness.ts
|
|
2
|
-
const MEMORY_READINESS_THRESHOLDS = {
|
|
3
|
-
minEvaluatedTurns: 20,
|
|
4
|
-
minHelpfulRate: .75,
|
|
5
|
-
maxRecordErrorRate: .1,
|
|
6
|
-
minDreamingRuns: 10,
|
|
7
|
-
maxDreamingFailureRate: .1
|
|
8
|
-
};
|
|
9
|
-
function rate(numerator, denominator) {
|
|
10
|
-
return denominator > 0 ? Math.round(numerator / denominator * 1e4) / 1e4 : null;
|
|
11
|
-
}
|
|
12
|
-
function evaluateMemoryReadiness(metrics, options = {}) {
|
|
13
|
-
const thresholds = {
|
|
14
|
-
...MEMORY_READINESS_THRESHOLDS,
|
|
15
|
-
...options.thresholds
|
|
16
|
-
};
|
|
17
|
-
const helpfulRate = rate(metrics.helpfulTurns, metrics.evaluatedTurns);
|
|
18
|
-
const recordErrorRate = rate(metrics.recordErrors, metrics.recordFeedback);
|
|
19
|
-
const dreamingFailureRate = rate(metrics.dreamingFailures, metrics.dreamingRuns);
|
|
20
|
-
const reasons = [];
|
|
21
|
-
if (metrics.evaluatedTurns < thresholds.minEvaluatedTurns) reasons.push("insufficient_feedback");
|
|
22
|
-
else if (helpfulRate === null || helpfulRate < thresholds.minHelpfulRate) reasons.push("low_helpful_rate");
|
|
23
|
-
if (recordErrorRate !== null && recordErrorRate > thresholds.maxRecordErrorRate) reasons.push("high_record_error_rate");
|
|
24
|
-
if (metrics.sensitiveFeedback > 0) reasons.push("sensitive_feedback_detected");
|
|
25
|
-
if (metrics.dreamingRuns < thresholds.minDreamingRuns) reasons.push("insufficient_dreaming_runs");
|
|
26
|
-
else if (dreamingFailureRate === null || dreamingFailureRate > thresholds.maxDreamingFailureRate) reasons.push("high_dreaming_failure_rate");
|
|
27
|
-
return {
|
|
28
|
-
ready: reasons.length === 0,
|
|
29
|
-
reasons,
|
|
30
|
-
metrics: {
|
|
31
|
-
...metrics,
|
|
32
|
-
helpfulRate,
|
|
33
|
-
recordErrorRate,
|
|
34
|
-
dreamingFailureRate
|
|
35
|
-
},
|
|
36
|
-
thresholds,
|
|
37
|
-
evaluatedAt: new Date(options.nowMs ?? Date.now()).toISOString()
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { MEMORY_READINESS_THRESHOLDS, evaluateMemoryReadiness };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { MemoryTraceEventPayload } from '../storage/sqlite/memory-records-repository.js';
|
|
2
|
-
export declare function summarizeMemoryUseAudit(traces: MemoryTraceEventPayload[]): {
|
|
3
|
-
total: number;
|
|
4
|
-
injectTurns: number;
|
|
5
|
-
turnsUsingMemory: number;
|
|
6
|
-
selectedRecords: number;
|
|
7
|
-
helpful: number;
|
|
8
|
-
notHelpful: number;
|
|
9
|
-
skippedReasons: Record<string, number>;
|
|
10
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//#region src/user-context/memory-use-audit.ts
|
|
2
|
-
function summarizeMemoryUseAudit(traces) {
|
|
3
|
-
const injects = traces.filter((trace) => trace.phase === "inject");
|
|
4
|
-
const skippedReasons = {};
|
|
5
|
-
let selectedRecords = 0;
|
|
6
|
-
let helpful = 0;
|
|
7
|
-
let notHelpful = 0;
|
|
8
|
-
for (const trace of injects) {
|
|
9
|
-
selectedRecords += trace.selectedRecordIds.length;
|
|
10
|
-
if (trace.skippedReason) skippedReasons[trace.skippedReason] = (skippedReasons[trace.skippedReason] ?? 0) + 1;
|
|
11
|
-
const responseFeedback = trace.feedback.find((item) => item.level === "response");
|
|
12
|
-
if (responseFeedback?.rating === "helpful") helpful += 1;
|
|
13
|
-
if (responseFeedback?.rating === "not_helpful" || responseFeedback?.rating === "irrelevant") notHelpful += 1;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
total: traces.length,
|
|
17
|
-
injectTurns: injects.length,
|
|
18
|
-
turnsUsingMemory: injects.filter((trace) => trace.selectedRecordIds.length > 0).length,
|
|
19
|
-
selectedRecords,
|
|
20
|
-
helpful,
|
|
21
|
-
notHelpful,
|
|
22
|
-
skippedReasons
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { summarizeMemoryUseAudit };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { MemoryRecord } from '../agent/memory/types.js';
|
|
2
|
-
export declare const PERSONAL_PLAYBOOK_RULE_TAG = "playbook:rule";
|
|
3
|
-
export declare const PERSONAL_PLAYBOOK_DISABLED_TAG = "playbook:disabled";
|
|
4
|
-
export declare const PERSONAL_PLAYBOOK_ORDER_PREFIX = "playbook:order:";
|
|
5
|
-
export interface PersonalPlaybookContext {
|
|
6
|
-
channel?: string;
|
|
7
|
-
supportNeed?: 'listen' | 'clarify' | 'advise' | 'act' | 'unknown';
|
|
8
|
-
}
|
|
9
|
-
export declare function personalPlaybookContext(record: MemoryRecord): PersonalPlaybookContext;
|
|
10
|
-
export declare function patchPersonalPlaybookContextTags(tags: string[], patch: PersonalPlaybookContext): string[];
|
|
11
|
-
export declare function buildPersonalPlaybookPrompt(records: MemoryRecord[], context?: PersonalPlaybookContext): string;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//#region src/user-context/personal-playbook.ts
|
|
2
|
-
const PERSONAL_PLAYBOOK_RULE_TAG = "playbook:rule";
|
|
3
|
-
const PERSONAL_PLAYBOOK_DISABLED_TAG = "playbook:disabled";
|
|
4
|
-
const PERSONAL_PLAYBOOK_ORDER_PREFIX = "playbook:order:";
|
|
5
|
-
const PLAYBOOK_CHANNEL_PREFIX = "playbook:when:channel:";
|
|
6
|
-
const PLAYBOOK_SUPPORT_PREFIX = "playbook:when:support:";
|
|
7
|
-
function personalPlaybookContext(record) {
|
|
8
|
-
const channel = record.tags?.find((tag) => tag.startsWith(PLAYBOOK_CHANNEL_PREFIX))?.slice(22);
|
|
9
|
-
const supportNeed = record.tags?.find((tag) => tag.startsWith(PLAYBOOK_SUPPORT_PREFIX))?.slice(22);
|
|
10
|
-
return {
|
|
11
|
-
...channel ? { channel: decodeURIComponent(channel) } : {},
|
|
12
|
-
...supportNeed ? { supportNeed } : {}
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function patchPersonalPlaybookContextTags(tags, patch) {
|
|
16
|
-
let next = tags;
|
|
17
|
-
if ("channel" in patch) {
|
|
18
|
-
next = next.filter((tag) => !tag.startsWith(PLAYBOOK_CHANNEL_PREFIX));
|
|
19
|
-
if (patch.channel) next.push(`${PLAYBOOK_CHANNEL_PREFIX}${encodeURIComponent(patch.channel)}`);
|
|
20
|
-
}
|
|
21
|
-
if ("supportNeed" in patch) {
|
|
22
|
-
next = next.filter((tag) => !tag.startsWith(PLAYBOOK_SUPPORT_PREFIX));
|
|
23
|
-
if (patch.supportNeed) next.push(`${PLAYBOOK_SUPPORT_PREFIX}${patch.supportNeed}`);
|
|
24
|
-
}
|
|
25
|
-
return [...new Set(next)];
|
|
26
|
-
}
|
|
27
|
-
function order(record) {
|
|
28
|
-
const tag = record.tags?.find((value) => value.startsWith(PERSONAL_PLAYBOOK_ORDER_PREFIX));
|
|
29
|
-
const parsed = tag ? Number.parseInt(tag.slice(15), 10) : NaN;
|
|
30
|
-
return Number.isFinite(parsed) ? parsed : 1e3;
|
|
31
|
-
}
|
|
32
|
-
function buildPersonalPlaybookPrompt(records, context = {}) {
|
|
33
|
-
const rules = records.filter((record) => record.status === "active").filter((record) => record.tags?.includes(PERSONAL_PLAYBOOK_RULE_TAG)).filter((record) => !record.tags?.includes(PERSONAL_PLAYBOOK_DISABLED_TAG)).filter((record) => {
|
|
34
|
-
const condition = personalPlaybookContext(record);
|
|
35
|
-
return (!condition.channel || condition.channel === context.channel) && (!condition.supportNeed || condition.supportNeed === context.supportNeed);
|
|
36
|
-
}).sort((left, right) => order(left) - order(right) || left.updatedAt.localeCompare(right.updatedAt));
|
|
37
|
-
if (!rules.length) return "";
|
|
38
|
-
return ["## Personal playbook", ...rules.map((record) => `- ${record.content}`)].join("\n");
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { PERSONAL_PLAYBOOK_DISABLED_TAG, PERSONAL_PLAYBOOK_ORDER_PREFIX, PERSONAL_PLAYBOOK_RULE_TAG, buildPersonalPlaybookPrompt, patchPersonalPlaybookContextTags, personalPlaybookContext };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Config } from '../config/schema.js';
|
|
2
|
-
export type UserProfileFields = {
|
|
3
|
-
callName: string;
|
|
4
|
-
pronouns: string;
|
|
5
|
-
timezone: string;
|
|
6
|
-
notes: string;
|
|
7
|
-
};
|
|
8
|
-
export type UserProfileSuggestion = {
|
|
9
|
-
id: string;
|
|
10
|
-
value: string;
|
|
11
|
-
source: 'gateway_os';
|
|
12
|
-
confidence: 'medium';
|
|
13
|
-
};
|
|
14
|
-
export type UserProfilePromptState = {
|
|
15
|
-
state: 'active' | 'snoozed';
|
|
16
|
-
suggestionHash?: string;
|
|
17
|
-
snoozedUntil?: string;
|
|
18
|
-
updatedAt?: string;
|
|
19
|
-
};
|
|
20
|
-
export type UserProfileSetup = {
|
|
21
|
-
missing: Array<keyof UserProfileFields>;
|
|
22
|
-
shouldPrompt: boolean;
|
|
23
|
-
state: 'complete' | 'active' | 'snoozed';
|
|
24
|
-
callNameSuggestion?: UserProfileSuggestion;
|
|
25
|
-
snoozedUntil?: string;
|
|
26
|
-
};
|
|
27
|
-
export declare function parseUserProfileMarkdown(content: string): UserProfileFields;
|
|
28
|
-
export declare function serializeUserProfileMarkdown(profile: UserProfileFields): string;
|
|
29
|
-
export declare function patchUserProfileMarkdown(content: string, patch: Partial<UserProfileFields>): string;
|
|
30
|
-
export declare function normalizeGatewayUserName(raw: string): string | undefined;
|
|
31
|
-
export declare function detectGatewayCallNameSuggestion(config: Config): UserProfileSuggestion | undefined;
|
|
32
|
-
export declare function buildUserProfileSetup(input: {
|
|
33
|
-
profile: UserProfileFields;
|
|
34
|
-
promptState: UserProfilePromptState;
|
|
35
|
-
config: Config;
|
|
36
|
-
now?: Date;
|
|
37
|
-
}): UserProfileSetup;
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import * as os$1 from "node:os";
|
|
2
|
-
import { createHash } from "node:crypto";
|
|
3
|
-
//#region src/user-context/profile.ts
|
|
4
|
-
const EMPTY_PROFILE = {
|
|
5
|
-
callName: "",
|
|
6
|
-
pronouns: "",
|
|
7
|
-
timezone: "",
|
|
8
|
-
notes: ""
|
|
9
|
-
};
|
|
10
|
-
const TECHNICAL_USER_NAMES = new Set([
|
|
11
|
-
"admin",
|
|
12
|
-
"administrator",
|
|
13
|
-
"app",
|
|
14
|
-
"daemon",
|
|
15
|
-
"defaultuser0",
|
|
16
|
-
"guest",
|
|
17
|
-
"nobody",
|
|
18
|
-
"node",
|
|
19
|
-
"owner",
|
|
20
|
-
"root",
|
|
21
|
-
"runner",
|
|
22
|
-
"service",
|
|
23
|
-
"system",
|
|
24
|
-
"ubuntu",
|
|
25
|
-
"user",
|
|
26
|
-
"wdagutilityaccount",
|
|
27
|
-
"www-data",
|
|
28
|
-
"xopc"
|
|
29
|
-
]);
|
|
30
|
-
function markdownField(line) {
|
|
31
|
-
const match = line.match(/^[-*]\s+\*\*(.+?):\*\*\s*(.*)$/i);
|
|
32
|
-
if (!match) return void 0;
|
|
33
|
-
return {
|
|
34
|
-
label: match[1].trim().toLowerCase(),
|
|
35
|
-
value: match[2].trim()
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function contextSection(lines) {
|
|
39
|
-
const heading = lines.findIndex((line) => /^##\s+Context\s*$/i.test(line.trim()));
|
|
40
|
-
if (heading < 0) return void 0;
|
|
41
|
-
const nextHeadingOffset = lines.slice(heading + 1).findIndex((line) => /^##\s+/.test(line.trim()));
|
|
42
|
-
return {
|
|
43
|
-
start: heading,
|
|
44
|
-
end: nextHeadingOffset < 0 ? lines.length : heading + 1 + nextHeadingOffset
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function parseUserProfileMarkdown(content) {
|
|
48
|
-
if (!content.trim()) return { ...EMPTY_PROFILE };
|
|
49
|
-
const profile = { ...EMPTY_PROFILE };
|
|
50
|
-
let nameFallback = "";
|
|
51
|
-
let preferredName = "";
|
|
52
|
-
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
53
|
-
for (const line of lines) {
|
|
54
|
-
const field = markdownField(line);
|
|
55
|
-
if (!field) continue;
|
|
56
|
-
if (field.label === "name") nameFallback = field.value;
|
|
57
|
-
if (field.label === "what to call them") preferredName = field.value;
|
|
58
|
-
if (field.label === "pronouns") profile.pronouns = field.value;
|
|
59
|
-
if (field.label === "timezone") profile.timezone = field.value;
|
|
60
|
-
if (field.label === "notes") profile.notes = field.value;
|
|
61
|
-
}
|
|
62
|
-
profile.callName = preferredName || nameFallback;
|
|
63
|
-
const context = contextSection(lines);
|
|
64
|
-
if (context && !profile.notes) profile.notes = lines.slice(context.start + 1, context.end).join("\n").replace(/^_\(.*?\)_\s*$/gm, "").replace(/^---\s*$/gm, "").trim();
|
|
65
|
-
return profile;
|
|
66
|
-
}
|
|
67
|
-
function serializeUserProfileMarkdown(profile) {
|
|
68
|
-
const lines = [
|
|
69
|
-
"# PROFILE.md - About You",
|
|
70
|
-
"",
|
|
71
|
-
`- **Name:** ${profile.callName.trim()}`,
|
|
72
|
-
`- **Pronouns:** ${profile.pronouns.trim()}`,
|
|
73
|
-
`- **Timezone:** ${profile.timezone.trim()}`,
|
|
74
|
-
""
|
|
75
|
-
];
|
|
76
|
-
if (profile.notes.trim()) lines.push("## Context", "", profile.notes.trim(), "");
|
|
77
|
-
return lines.join("\n");
|
|
78
|
-
}
|
|
79
|
-
function patchSimpleField(lines, labels, insertLabel, value, updateEveryMatch = false) {
|
|
80
|
-
const matches = lines.flatMap((line, index) => {
|
|
81
|
-
const field = markdownField(line);
|
|
82
|
-
return field && labels.includes(field.label) ? [index] : [];
|
|
83
|
-
});
|
|
84
|
-
const targets = updateEveryMatch ? matches : matches.slice(-1);
|
|
85
|
-
if (targets.length > 0) {
|
|
86
|
-
for (const index of targets) lines[index] = `- **${lines[index].match(/^[-*]\s+\*\*(.+?):\*\*/i)?.[1] ?? insertLabel}:** ${value}`;
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
const insertAt = contextSection(lines)?.start ?? lines.length;
|
|
90
|
-
lines.splice(insertAt, 0, `- **${insertLabel}:** ${value}`, "");
|
|
91
|
-
}
|
|
92
|
-
function patchUserProfileMarkdown(content, patch) {
|
|
93
|
-
if (!content.trim()) return serializeUserProfileMarkdown({
|
|
94
|
-
...EMPTY_PROFILE,
|
|
95
|
-
...patch
|
|
96
|
-
});
|
|
97
|
-
const lines = content.replace(/\r\n/g, "\n").split("\n");
|
|
98
|
-
if (patch.callName !== void 0) {
|
|
99
|
-
const hasPreferred = lines.some((line) => markdownField(line)?.label === "what to call them");
|
|
100
|
-
patchSimpleField(lines, hasPreferred ? ["what to call them"] : ["name"], hasPreferred ? "What to call them" : "Name", patch.callName.trim(), patch.callName.trim().length === 0);
|
|
101
|
-
if (patch.callName.trim().length === 0 && hasPreferred) patchSimpleField(lines, ["name"], "Name", "", true);
|
|
102
|
-
}
|
|
103
|
-
if (patch.pronouns !== void 0) patchSimpleField(lines, ["pronouns"], "Pronouns", patch.pronouns.trim());
|
|
104
|
-
if (patch.timezone !== void 0) patchSimpleField(lines, ["timezone"], "Timezone", patch.timezone.trim());
|
|
105
|
-
if (patch.notes !== void 0) {
|
|
106
|
-
const context = contextSection(lines);
|
|
107
|
-
const replacement = patch.notes.trim() ? [
|
|
108
|
-
"## Context",
|
|
109
|
-
"",
|
|
110
|
-
patch.notes.trim(),
|
|
111
|
-
""
|
|
112
|
-
] : [];
|
|
113
|
-
if (context) lines.splice(context.start, context.end - context.start, ...replacement);
|
|
114
|
-
else if (replacement.length > 0) lines.push("", ...replacement);
|
|
115
|
-
}
|
|
116
|
-
return lines.join("\n").replace(/\n{4,}/g, "\n\n\n").trimEnd() + "\n";
|
|
117
|
-
}
|
|
118
|
-
function normalizeGatewayUserName(raw) {
|
|
119
|
-
const account = raw.trim().split(/[\\/]/).at(-1)?.split("@")[0]?.trim() ?? "";
|
|
120
|
-
if (!account || account.length < 2 || account.length > 40) return void 0;
|
|
121
|
-
const normalizedKey = account.toLowerCase();
|
|
122
|
-
if (TECHNICAL_USER_NAMES.has(normalizedKey) || account.endsWith("$")) return void 0;
|
|
123
|
-
if (/^\d+$/.test(account) || /^[0-9a-f]{8,}$/i.test(account)) return void 0;
|
|
124
|
-
if ([...account].filter((character) => /\d/.test(character)).length / account.length > .35) return void 0;
|
|
125
|
-
const friendly = account.replace(/[._-]+/g, " ").replace(/\s+/g, " ").trim();
|
|
126
|
-
if (!friendly) return void 0;
|
|
127
|
-
return friendly.replace(/\b[a-z]/g, (character) => character.toUpperCase());
|
|
128
|
-
}
|
|
129
|
-
function detectGatewayCallNameSuggestion(config) {
|
|
130
|
-
if (config.gateway?.auth?.mode === "trusted-proxy") return void 0;
|
|
131
|
-
try {
|
|
132
|
-
const value = normalizeGatewayUserName(os$1.userInfo().username);
|
|
133
|
-
if (!value) return void 0;
|
|
134
|
-
return {
|
|
135
|
-
id: createHash("sha256").update(`gateway_os:${value}`).digest("hex").slice(0, 16),
|
|
136
|
-
value,
|
|
137
|
-
source: "gateway_os",
|
|
138
|
-
confidence: "medium"
|
|
139
|
-
};
|
|
140
|
-
} catch {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function buildUserProfileSetup(input) {
|
|
145
|
-
const missing = Object.keys(input.profile).filter((field) => !input.profile[field].trim());
|
|
146
|
-
if (!missing.includes("callName")) return {
|
|
147
|
-
missing,
|
|
148
|
-
shouldPrompt: false,
|
|
149
|
-
state: "complete"
|
|
150
|
-
};
|
|
151
|
-
const now = input.now ?? /* @__PURE__ */ new Date();
|
|
152
|
-
const snoozed = input.promptState.state === "snoozed" && Boolean(input.promptState.snoozedUntil) && Date.parse(input.promptState.snoozedUntil) > now.getTime();
|
|
153
|
-
const suggestion = detectGatewayCallNameSuggestion(input.config);
|
|
154
|
-
return {
|
|
155
|
-
missing,
|
|
156
|
-
shouldPrompt: !snoozed,
|
|
157
|
-
state: snoozed ? "snoozed" : "active",
|
|
158
|
-
callNameSuggestion: suggestion,
|
|
159
|
-
snoozedUntil: snoozed ? input.promptState.snoozedUntil : void 0
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
//#endregion
|
|
163
|
-
export { buildUserProfileSetup, detectGatewayCallNameSuggestion, normalizeGatewayUserName, parseUserProfileMarkdown, patchUserProfileMarkdown, serializeUserProfileMarkdown };
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { MemoryKind, MemoryRecord } from '../agent/memory/types.js';
|
|
2
|
-
import type { ConnectorConnection, ConnectorDefinition, ConnectorInstance } from '../connectors/types.js';
|
|
3
|
-
import type { KnowledgeSourceItem, KnowledgeSyncRun } from '../knowledge/types.js';
|
|
4
|
-
import type { ConnectorLearningJob } from '../storage/sqlite/index.js';
|
|
5
|
-
export type UserContextFacet = 'basics' | 'collaboration' | 'boundaries' | 'priorities' | 'people' | 'current';
|
|
6
|
-
export type UserContextOrigin = 'told_by_you' | 'observed' | 'inferred' | 'connected_source';
|
|
7
|
-
export declare const USER_CONTEXT_MEMORY_KINDS: readonly MemoryKind[];
|
|
8
|
-
export declare function isUserContextRecord(record: MemoryRecord): boolean;
|
|
9
|
-
export declare function isUserContextMemoryKind(value: unknown): value is MemoryKind;
|
|
10
|
-
export declare function facetForMemoryKind(kind: MemoryKind): UserContextFacet;
|
|
11
|
-
export declare function originForMemoryRecord(record: MemoryRecord): UserContextOrigin;
|
|
12
|
-
export declare function projectUserContextRecord(record: MemoryRecord): {
|
|
13
|
-
id: string;
|
|
14
|
-
statement: string;
|
|
15
|
-
facet: UserContextFacet;
|
|
16
|
-
kind: MemoryKind;
|
|
17
|
-
status: import("../agent/memory/types.js").MemoryStatus;
|
|
18
|
-
origin: UserContextOrigin;
|
|
19
|
-
sourceName: string;
|
|
20
|
-
scope: {
|
|
21
|
-
type: "session";
|
|
22
|
-
id: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: "project";
|
|
25
|
-
id: string;
|
|
26
|
-
} | {
|
|
27
|
-
type: "workspace";
|
|
28
|
-
id: string;
|
|
29
|
-
} | {
|
|
30
|
-
type: "global";
|
|
31
|
-
id?: undefined;
|
|
32
|
-
};
|
|
33
|
-
updatedAt: string;
|
|
34
|
-
sensitivity: import("../agent/memory/types.js").MemorySensitivity;
|
|
35
|
-
explicitness: import("../agent/memory/types.js").MemoryExplicitness;
|
|
36
|
-
durability: import("../agent/memory/types.js").MemoryDurability;
|
|
37
|
-
disclosurePolicy: import("../agent/memory/types.js").MemoryDisclosurePolicy;
|
|
38
|
-
stability: import("../agent/memory/lifecycle.js").MemoryStabilityBand;
|
|
39
|
-
stabilityScore: number;
|
|
40
|
-
confidence: number;
|
|
41
|
-
reviewAt: string;
|
|
42
|
-
reviewDue: boolean;
|
|
43
|
-
evidenceCount: number;
|
|
44
|
-
evidenceBasis: {
|
|
45
|
-
eventCount: number;
|
|
46
|
-
activeDays: number;
|
|
47
|
-
windowDays: number;
|
|
48
|
-
};
|
|
49
|
-
sourcePath: string;
|
|
50
|
-
latestEvidenceAt: string;
|
|
51
|
-
validFrom: string;
|
|
52
|
-
validTo: string;
|
|
53
|
-
expiresAt: string;
|
|
54
|
-
};
|
|
55
|
-
export declare function isPersonalContextConnector(definition: ConnectorDefinition): boolean;
|
|
56
|
-
export declare function recordsDerivedFromPersonalContextSource(records: MemoryRecord[], sourceInstanceId: string): MemoryRecord[];
|
|
57
|
-
export declare function projectPersonalContextSources(definitions: ConnectorDefinition[], instances: ConnectorInstance[], knowledge?: {
|
|
58
|
-
sourceItems?: KnowledgeSourceItem[];
|
|
59
|
-
syncRuns?: KnowledgeSyncRun[];
|
|
60
|
-
connections?: ConnectorConnection[];
|
|
61
|
-
learningJobs?: ConnectorLearningJob[];
|
|
62
|
-
claimStatsBySource?: Record<string, {
|
|
63
|
-
evidenceCount: number;
|
|
64
|
-
provisionalClaims: number;
|
|
65
|
-
activeClaims: number;
|
|
66
|
-
resolvedEntities: number;
|
|
67
|
-
lastEvidenceAt?: string;
|
|
68
|
-
}>;
|
|
69
|
-
}): {
|
|
70
|
-
category: import("../connectors/types.js").ConnectorCategory;
|
|
71
|
-
capabilities: ("tools" | "context" | "events" | "memory_source")[];
|
|
72
|
-
access: {
|
|
73
|
-
context: boolean;
|
|
74
|
-
memory: boolean;
|
|
75
|
-
read: boolean;
|
|
76
|
-
write: boolean;
|
|
77
|
-
};
|
|
78
|
-
permissionDetails: string[];
|
|
79
|
-
installed: boolean;
|
|
80
|
-
enabled: any;
|
|
81
|
-
status: any;
|
|
82
|
-
instanceId: any;
|
|
83
|
-
lastConnectedAt: any;
|
|
84
|
-
lastHealthCheckAt: any;
|
|
85
|
-
lastHealthStatus: any;
|
|
86
|
-
lastActivityAt: string;
|
|
87
|
-
derivedUnderstandingCount: number;
|
|
88
|
-
learningFunnel: {
|
|
89
|
-
indexedItems: number;
|
|
90
|
-
attributedItems: number;
|
|
91
|
-
resolvedEntities: number;
|
|
92
|
-
provisionalClaims: number;
|
|
93
|
-
activeClaims: number;
|
|
94
|
-
evidenceCount: number;
|
|
95
|
-
lastEvidenceAt: string;
|
|
96
|
-
};
|
|
97
|
-
knowledgeItemCount: number;
|
|
98
|
-
lastSyncAt: string;
|
|
99
|
-
lastSyncStatus: import("../knowledge/types.js").KnowledgeSyncRunStatus;
|
|
100
|
-
lastSyncError: string;
|
|
101
|
-
learning: {
|
|
102
|
-
status: import("../storage/sqlite/connector-learning-repository.js").ConnectorLearningStatus;
|
|
103
|
-
phase: import("../storage/sqlite/connector-learning-repository.js").ConnectorLearningPhase;
|
|
104
|
-
itemsDiscovered: number;
|
|
105
|
-
itemsIndexed: number;
|
|
106
|
-
candidatesCreated: number;
|
|
107
|
-
mode: import("../storage/sqlite/connector-learning-repository.js").ConnectorLearningMode;
|
|
108
|
-
attemptCount: number;
|
|
109
|
-
nextRunAt: string;
|
|
110
|
-
error: string;
|
|
111
|
-
updatedAt: string;
|
|
112
|
-
};
|
|
113
|
-
branding?: import("../connectors/types.js").ConnectorBranding;
|
|
114
|
-
id: string;
|
|
115
|
-
accountLabel: any;
|
|
116
|
-
accountOrdinal: any;
|
|
117
|
-
accountCount: any;
|
|
118
|
-
displayName: string;
|
|
119
|
-
description: string;
|
|
120
|
-
}[];
|