@xopcai/xopc 0.0.146 → 0.0.147
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 +2 -2
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/demo-memory/src/index.js +6 -4
- package/dist/extensions/demo-memory/src/index.js.map +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/Combination-14nmIgxH.js +41 -0
- package/dist/gateway/static/root/assets/activity-store-DXeSSlw1.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-gBVDdd-Q.js → agent-avatar-dicebear-CFdJKSjY.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DKjbRpbA.js +2 -0
- package/dist/gateway/static/root/assets/api-Bs69B5zA.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Dd5dmRWY.js → app-management-settings-panel-ag1ViXT_.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-D89pY61C.js → appearance-settings-C6iMpwOM.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CpX3lBFF.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BZj1tk3p.js → archive-plugin-Dwi3mIBy.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-18eo6l3m.js → attachment-load-BaCDoq40.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-suggestion-card-F1g3MckR.js → automation-suggestion-card-CwqtFgnw.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-DlupOxFQ.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-jOYMquLP.js → binary-plugins-DoAYhsxa.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CD77nXJU.js → block-editor-Bw72pO7S.js} +31 -31
- package/dist/gateway/static/root/assets/browser-settings-page-BwLoUBcZ.js +8 -0
- package/dist/gateway/static/root/assets/capability-presets-api-vdbAR65Q.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-BAsKbJgm.js +2 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-fTlTnWB4.js → channel-recipient-api-rTG26jpV.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CxFWy0cE.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-OKlqTtKJ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-g9f07qO6.js → connector-logo-DIMP4NWY.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-BjQQwX62.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DwPVWi3D.js → desktop-pet-kQq2e0BN.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Dm1N7RRX.js → desktop-pet-settings-B6vtozMY.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-hZghTKie.js → directory-picker-path-field-Dn5-e3v4.js} +1 -1
- package/dist/gateway/static/root/assets/dist-C230izr8.js +1 -0
- package/dist/gateway/static/root/assets/dist-CxGUk8J-.js +1 -0
- package/dist/gateway/static/root/assets/dreaming-settings-BzwIujPG.js +3 -0
- package/dist/gateway/static/root/assets/extension-debug-page-D_e_hsEy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-page-otKJCjKP.js → extension-page-D15CWHBd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-ifHzMfT-.js → extension-settings-page-D4P0n1om.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-BQX5GGl2.js → gateway-config-api-B4qZctjG.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BfXo0j0O.js → gateway-settings-BvndV7TP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DtoLihQE.js → gateway-startup-retry-BpgMunEb.js} +1 -1
- package/dist/gateway/static/root/assets/{goal-create-dialog-C_Qw_QgW.js → goal-create-dialog-DrVHKXHq.js} +1 -1
- package/dist/gateway/static/root/assets/goal-detail-page-PHlCwv68.js +4 -0
- package/dist/gateway/static/root/assets/{goals-config-api-DQJ5mBXB.js → goals-config-api-B6YJB_ct.js} +1 -1
- package/dist/gateway/static/root/assets/goals-page-Hg9uyO6e.js +2 -0
- package/dist/gateway/static/root/assets/{goals-settings-CQX8zWKe.js → goals-settings-BROWCIcL.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-yy_Pt_24.js → heartbeat-settings-CoCwIOIg.js} +1 -1
- package/dist/gateway/static/root/assets/index-CxkNzw3e.js +259 -0
- package/dist/gateway/static/root/assets/index-DjCSOyaN.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-Bm_AIYQ7.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-BJWFcxwG.js +2 -0
- package/dist/gateway/static/root/assets/local-apps-page-BsiZMrEf.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-CiM-D9jA.js → locale-store-Bp8joZck.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DOmK61ey.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-BYasrWPk.js → markdown-split-Dy7QpaAz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins--cJpmHc2.js → media-plugins-3Lxliy9D.js} +1 -1
- package/dist/gateway/static/root/assets/messages-CQGpD-dC.js +5 -0
- package/dist/gateway/static/root/assets/models-hub-panel-DGCZom4o.js +2 -0
- package/dist/gateway/static/root/assets/{notes-page-Digm3EgB.js → notes-page-BJtT4vSf.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-B_bN7cOR.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-CGVMJEW0.js → page-tabs-DKB6RDre.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BBAkU4xW.js → preview-open-alternatives-Br_YhYHp.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Dq8JouJj.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DvfL7fSe.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-DqwMXSXP.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-D4B469dh.js → save-bar-controls-BgIE9BBh.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Vy4OjH0i.js → schedule-field-BXDP-oMz.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-CPYzgmby.js → schema-form-Dhv-SmjG.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-B_mOZkQk.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BHGmH6YS.js +1 -0
- package/dist/gateway/static/root/assets/{settings-collapsible-section-BB5y9vwh.js → settings-collapsible-section-CUTExnlK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-form-section-BfzJkVHd.js → settings-form-section-CmnDhsf0.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-DM8iH25s.js → settings-loading-skeleton-B79dq-XY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-h5Alz_fA.js → settings-page-Db8uAv3X.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DjbdpK2j.js → settings-page-layout-DaFwstQw.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BUSEj0KK.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DxozU_zz.js → share-preview-page-Bi00uXzV.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DzsTYfuX.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DSsdU081.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DeB1tQZL.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DNi9Ofuj.js → system-settings-panel-Cxaph7hW.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-C9Dxcppm.js → theme-store-eCTN1RpG.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-B6Nw3iFM.js → typed-models-lib-CcZ_tyFY.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-DE9cpn4G.js → use-channel-catalog-C4PWbNoi.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-QTVMx_hG.js +1 -0
- package/dist/gateway/static/root/assets/{user-profile-fields-editor-DVBShNYF.js → user-profile-fields-editor-CPOO9Jz5.js} +1 -1
- package/dist/gateway/static/root/assets/{user-profile-settings-panel-CC0sf3vS.js → user-profile-settings-panel-C8cgtSF7.js} +1 -1
- package/dist/gateway/static/root/assets/{utils-DnsuE4YP.js → utils-CiZK2KwH.js} +1 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-b-YZtvUu.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-4zVDOl2G.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CHe2tfkc.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DXc_pbVG.js → workflow-run-setup-panel-8SLCYeXE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DEOFqiWn.js +11 -0
- package/dist/gateway/static/root/index.html +10 -9
- package/dist/package.js +1 -1
- package/dist/src/activity/types.d.ts +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -1
- package/dist/src/agent/agent-manager.js +5 -4
- package/dist/src/agent/agent-manager.js.map +1 -1
- package/dist/src/agent/background-review/coordinator.js +0 -1
- package/dist/src/agent/background-review/coordinator.js.map +1 -1
- package/dist/src/agent/background-review/settings.d.ts +1 -1
- package/dist/src/agent/background-review/settings.js +10 -17
- package/dist/src/agent/background-review/settings.js.map +1 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.d.ts +1 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js.map +1 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +2 -3
- package/dist/src/agent/bootstrap/load-bootstrap-files.js.map +1 -1
- package/dist/src/agent/code-intelligence/binary.js +1 -1
- package/dist/src/agent/context/project-context.d.ts +14 -0
- package/dist/src/agent/context/project-context.js +23 -1
- package/dist/src/agent/context/project-context.js.map +1 -1
- package/dist/src/agent/context/workspace-templates/AGENTS.md +1 -1
- package/dist/src/agent/context/workspace.d.ts +1 -2
- package/dist/src/agent/context/workspace.js +2 -4
- package/dist/src/agent/context/workspace.js.map +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -2
- package/dist/src/agent/embedded/run-for-session.js.map +1 -1
- package/dist/src/agent/embedded/run-turn.js +6 -1
- package/dist/src/agent/embedded/run-turn.js.map +1 -1
- package/dist/src/agent/embedded/types.d.ts +17 -0
- package/dist/src/agent/memory/builtin-memory-store.d.ts +2 -2
- package/dist/src/agent/memory/builtin-memory-store.js +2 -2
- package/dist/src/agent/memory/builtin-memory-store.js.map +1 -1
- package/dist/src/agent/memory/builtin-provider.d.ts +1 -3
- package/dist/src/agent/memory/builtin-provider.js +21 -48
- package/dist/src/agent/memory/builtin-provider.js.map +1 -1
- package/dist/src/agent/memory/context/planner.js +48 -9
- package/dist/src/agent/memory/context/planner.js.map +1 -1
- package/dist/src/agent/memory/context/types.d.ts +7 -1
- package/dist/src/agent/memory/context-fence.js +1 -1
- package/dist/src/agent/memory/context-fence.js.map +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +2 -9
- package/dist/src/agent/memory/create-memory-manager.js.map +1 -1
- package/dist/src/agent/memory/dreaming/config.js +4 -9
- package/dist/src/agent/memory/dreaming/config.js.map +1 -1
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.js +2 -2
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.js.map +1 -1
- package/dist/src/agent/memory/dreaming/scope.d.ts +2 -3
- package/dist/src/agent/memory/dreaming/scope.js +8 -8
- package/dist/src/agent/memory/dreaming/scope.js.map +1 -1
- package/dist/src/agent/memory/manager.d.ts +1 -5
- package/dist/src/agent/memory/manager.js +2 -23
- package/dist/src/agent/memory/manager.js.map +1 -1
- package/dist/src/agent/memory/memory-config.d.ts +3 -3
- package/dist/src/agent/memory/memory-config.js +9 -14
- package/dist/src/agent/memory/memory-config.js.map +1 -1
- package/dist/src/agent/memory/types.d.ts +9 -5
- package/dist/src/agent/memory/understanding/service.js +21 -8
- package/dist/src/agent/memory/understanding/service.js.map +1 -1
- package/dist/src/agent/memory/understanding/types.d.ts +5 -0
- package/dist/src/agent/memory/user-context-coordinator.d.ts +1 -1
- package/dist/src/agent/memory/user-context-coordinator.js +6 -2
- package/dist/src/agent/memory/user-context-coordinator.js.map +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +2 -2
- package/dist/src/agent/orchestration/agent-orchestrator.js.map +1 -1
- package/dist/src/agent/prompt/memory/index.d.ts +1 -2
- package/dist/src/agent/prompt/memory/index.js +6 -7
- package/dist/src/agent/prompt/memory/index.js.map +1 -1
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/prompt/sections/tooling.js.map +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +13 -2
- package/dist/src/agent/service/direct-turn-helpers.js.map +1 -1
- package/dist/src/agent/tools/curated-memory-tool.js +4 -4
- package/dist/src/agent/tools/curated-memory-tool.js.map +1 -1
- package/dist/src/agent/tools/factory.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +2 -2
- package/dist/src/agent/tools/factory.js.map +1 -1
- package/dist/src/agent/tools/memory-tool.js +1 -1
- package/dist/src/agent/tools/memory-tool.js.map +1 -1
- package/dist/src/agent/workflow/workflow-child-tools.js +2 -3
- package/dist/src/agent/workflow/workflow-child-tools.js.map +1 -1
- package/dist/src/agent/workspace-runtime/registry.d.ts +5 -5
- package/dist/src/agent/workspace-runtime/registry.js +6 -11
- package/dist/src/agent/workspace-runtime/registry.js.map +1 -1
- package/dist/src/agent-manifest/index.js +2 -2
- package/dist/src/agent-manifest/prompt.js +1 -7
- package/dist/src/agent-manifest/prompt.js.map +1 -1
- package/dist/src/agent-manifest/schema.d.ts +0 -598
- package/dist/src/agent-manifest/schema.js +2 -143
- package/dist/src/agent-manifest/schema.js.map +1 -1
- package/dist/src/agent-manifest/validator.js +0 -12
- package/dist/src/agent-manifest/validator.js.map +1 -1
- package/dist/src/agent-runtime/memory-runtime.d.ts +2 -2
- package/dist/src/agent-runtime/memory-runtime.js +8 -7
- package/dist/src/agent-runtime/memory-runtime.js.map +1 -1
- package/dist/src/agent-runtime/runtime-profile.d.ts +2 -0
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js.map +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -2
- package/dist/src/chat-commands/agent-edit.js.map +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/init.js +0 -22
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/templates.d.ts +1 -1
- package/dist/src/cli/templates.js +1 -16
- package/dist/src/cli/templates.js.map +1 -1
- package/dist/src/commands/agents.config.js +0 -10
- package/dist/src/commands/agents.config.js.map +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/paths.d.ts +0 -1
- package/dist/src/config/paths.js +1 -2
- package/dist/src/config/paths.js.map +1 -1
- package/dist/src/config/schema.d.ts +118 -532
- package/dist/src/config/schema.js +32 -26
- package/dist/src/config/schema.js.map +1 -1
- package/dist/src/extensions/loader.js +2 -1
- package/dist/src/extensions/loader.js.map +1 -1
- package/dist/src/gateway/agents-admin.d.ts +0 -2
- package/dist/src/gateway/agents-admin.js +0 -6
- package/dist/src/gateway/agents-admin.js.map +1 -1
- package/dist/src/gateway/capability-presets-admin.d.ts +0 -2
- package/dist/src/gateway/capability-presets-admin.js.map +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +26 -0
- package/dist/src/gateway/chat-stream/mapper.js.map +1 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +16 -1
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +0 -1
- package/dist/src/gateway/dreaming-automation-reconciler.js +41 -63
- package/dist/src/gateway/dreaming-automation-reconciler.js.map +1 -1
- package/dist/src/gateway/hono/app.js +3 -1
- package/dist/src/gateway/hono/app.js.map +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +0 -130
- package/dist/src/gateway/hono/lib/config-payload.js +0 -1
- package/dist/src/gateway/hono/lib/config-payload.js.map +1 -1
- package/dist/src/gateway/hono/routes/agents.js +6 -12
- package/dist/src/gateway/hono/routes/agents.js.map +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +6 -0
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js.map +1 -1
- package/dist/src/gateway/hono/routes/capability-presets.js +2 -2
- package/dist/src/gateway/hono/routes/capability-presets.js.map +1 -1
- package/dist/src/gateway/hono/routes/dreaming.js +9 -20
- package/dist/src/gateway/hono/routes/dreaming.js.map +1 -1
- package/dist/src/gateway/hono/routes/index.js +4 -0
- package/dist/src/gateway/hono/routes/index.js.map +1 -1
- package/dist/src/gateway/hono/routes/local-apps.d.ts +5 -0
- package/dist/src/gateway/hono/routes/local-apps.js +99 -0
- package/dist/src/gateway/hono/routes/local-apps.js.map +1 -0
- package/dist/src/gateway/hono/routes/memory.js +48 -65
- package/dist/src/gateway/hono/routes/memory.js.map +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js.map +1 -1
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +3 -0
- package/dist/src/gateway/hono/routes/work-discovery.js +150 -0
- package/dist/src/gateway/hono/routes/work-discovery.js.map +1 -0
- package/dist/src/gateway/hono/routes/you.d.ts +3 -0
- package/dist/src/gateway/hono/routes/you.js +358 -91
- package/dist/src/gateway/hono/routes/you.js.map +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +12 -0
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +9 -5
- package/dist/src/knowledge/connected-knowledge-pipeline.js.map +1 -1
- package/dist/src/local-apps/acceptance.d.ts +30 -0
- package/dist/src/local-apps/acceptance.js +93 -0
- package/dist/src/local-apps/acceptance.js.map +1 -0
- package/dist/src/local-apps/index.d.ts +5 -0
- package/dist/src/local-apps/index.js +4 -0
- package/dist/src/local-apps/preview-runtime-bridge.d.ts +4 -0
- package/dist/src/local-apps/preview-runtime-bridge.js +171 -0
- package/dist/src/local-apps/preview-runtime-bridge.js.map +1 -0
- package/dist/src/local-apps/runtime-entry.d.ts +8 -0
- package/dist/src/local-apps/runtime-entry.js +25 -0
- package/dist/src/local-apps/runtime-entry.js.map +1 -0
- package/dist/src/local-apps/scaffold.d.ts +8 -0
- package/dist/src/local-apps/scaffold.js +122 -0
- package/dist/src/local-apps/scaffold.js.map +1 -0
- package/dist/src/local-apps/service.d.ts +37 -0
- package/dist/src/local-apps/service.js +553 -0
- package/dist/src/local-apps/service.js.map +1 -0
- package/dist/src/local-apps/store.d.ts +44 -0
- package/dist/src/local-apps/store.js +195 -0
- package/dist/src/local-apps/store.js.map +1 -0
- package/dist/src/local-apps/types.d.ts +105 -0
- package/dist/src/local-apps/types.js +1 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -2
- package/dist/src/storage/sqlite/index.js +4 -3
- package/dist/src/storage/sqlite/memory-index-repository.d.ts +2 -3
- package/dist/src/storage/sqlite/memory-index-repository.js +16 -20
- package/dist/src/storage/sqlite/memory-index-repository.js.map +1 -1
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +18 -10
- package/dist/src/storage/sqlite/memory-records-repository.js +79 -34
- package/dist/src/storage/sqlite/memory-records-repository.js.map +1 -1
- package/dist/src/storage/sqlite/memory-reference-consent-repository.d.ts +27 -0
- package/dist/src/storage/sqlite/memory-reference-consent-repository.js +109 -0
- package/dist/src/storage/sqlite/memory-reference-consent-repository.js.map +1 -0
- package/dist/src/storage/sqlite/migrations/038_user_owned_memory.sql +68 -0
- package/dist/src/storage/sqlite/migrations/039_memory_reference_consents.sql +19 -0
- package/dist/src/storage/sqlite/migrations/040_local_apps.sql +32 -0
- package/dist/src/storage/sqlite/migrations/041_local_app_release_lifecycle.sql +17 -0
- package/dist/src/storage/sqlite/migrations/042_work_discovery.sql +41 -0
- package/dist/src/storage/sqlite/migrations/043_local_app_acceptance_runs.sql +16 -0
- package/dist/src/storage/sqlite/migrations/044_repair_work_discovery_foreign_keys.sql +75 -0
- package/dist/src/storage/sqlite/migrations/045_extension_ui_grants.sql +13 -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.js.map +1 -1
- 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 +20 -0
- package/dist/src/user-context/config.d.ts +227 -0
- package/dist/src/user-context/config.js +158 -0
- package/dist/src/user-context/config.js.map +1 -0
- package/dist/src/user-context/import.d.ts +1 -1
- package/dist/src/user-context/import.js +6 -1
- package/dist/src/user-context/import.js.map +1 -1
- package/dist/src/user-context/owner.d.ts +5 -0
- package/dist/src/user-context/owner.js +9 -0
- package/dist/src/user-context/owner.js.map +1 -0
- package/dist/src/user-context/projection.d.ts +11 -9
- package/dist/src/user-context/projection.js +74 -47
- package/dist/src/user-context/projection.js.map +1 -1
- package/dist/src/user-context/runtime.d.ts +13 -0
- package/dist/src/user-context/runtime.js +36 -0
- package/dist/src/user-context/runtime.js.map +1 -0
- package/dist/src/work-discovery/analyzer.d.ts +11 -0
- package/dist/src/work-discovery/analyzer.js +171 -0
- package/dist/src/work-discovery/analyzer.js.map +1 -0
- package/dist/src/work-discovery/index.d.ts +5 -0
- package/dist/src/work-discovery/index.js +5 -0
- package/dist/src/work-discovery/probe.d.ts +12 -0
- package/dist/src/work-discovery/probe.js +335 -0
- package/dist/src/work-discovery/probe.js.map +1 -0
- package/dist/src/work-discovery/repository.d.ts +11 -0
- package/dist/src/work-discovery/repository.js +100 -0
- package/dist/src/work-discovery/repository.js.map +1 -0
- package/dist/src/work-discovery/service.d.ts +30 -0
- package/dist/src/work-discovery/service.js +387 -0
- package/dist/src/work-discovery/service.js.map +1 -0
- package/dist/src/work-discovery/types.d.ts +114 -0
- package/dist/src/work-discovery/types.js +1 -0
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js.map +1 -1
- package/package.json +4 -3
- package/skills/engineering/build-xopc-local-app/SKILL.md +45 -0
- package/skills/engineering/build-xopc-local-app/references/app-contract.md +33 -0
- package/skills/engineering/build-xopc-local-app/scripts/validate-local-app.mjs +72 -0
- package/dist/gateway/static/root/assets/Combination-DolwnuKi.js +0 -41
- package/dist/gateway/static/root/assets/activity-center-store-3l9ahUqb.js +0 -1
- package/dist/gateway/static/root/assets/agents-BLp5ItD3.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-CgOy905b.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Bdj0A_IC.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-D73ClpC2.js +0 -8
- package/dist/gateway/static/root/assets/capability-presets-api-DZwIrY_P.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Dw2uinRX.js +0 -2
- package/dist/gateway/static/root/assets/channels-settings-g9TZdnQh.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CJauF1CW.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CJLsXBB0.js +0 -2
- package/dist/gateway/static/root/assets/dist-C99RGfAH.js +0 -1
- package/dist/gateway/static/root/assets/dreaming-settings-B_LcHWcv.js +0 -3
- package/dist/gateway/static/root/assets/extension-debug-page-BqguEetG.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-BnUrr9_O.js +0 -4
- package/dist/gateway/static/root/assets/goals-page-BgDCoiG0.js +0 -2
- package/dist/gateway/static/root/assets/index-BJGusbyV.js +0 -259
- package/dist/gateway/static/root/assets/index-CSLF84-Q.css +0 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-D1rVyDdf.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-C35Xa_mx.js +0 -7
- package/dist/gateway/static/root/assets/messages-Cb1VMeqP.js +0 -5
- package/dist/gateway/static/root/assets/models-hub-panel-CqehWxbT.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-CCuL7qlg.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-DTWPEtSE.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-NnJpsIAD.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-wbk1GCvg.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-Do0ZNuqM.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-HeYP_JCr.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-bjbH7U6x.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Cl_bE9gQ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DcqbKYgB.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D_Xkjxtr.js +0 -2
- package/dist/gateway/static/root/assets/user-context-page-BtU2sQoK.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BIcSMf0O.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-ChCKymS7.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CheHRVox.js +0 -11
- package/dist/src/agent/context/workspace-templates/MEMORY.md +0 -33
- package/dist/src/agent/memory/access-policy.d.ts +0 -12
- package/dist/src/agent/memory/access-policy.js +0 -44
- package/dist/src/agent/memory/access-policy.js.map +0 -1
|
@@ -4,7 +4,7 @@ export type PreparedUserContextImport = {
|
|
|
4
4
|
kind: MemoryRecord['kind'];
|
|
5
5
|
sensitivity: NonNullable<MemoryRecord['sensitivity']>;
|
|
6
6
|
durability: MemoryRecord['durability'];
|
|
7
|
-
|
|
7
|
+
disclosurePolicy: MemoryRecord['disclosurePolicy'];
|
|
8
8
|
};
|
|
9
9
|
export declare function prepareUserContextImport(candidates: unknown[], existingStatements: Iterable<string>): {
|
|
10
10
|
imports: PreparedUserContextImport[];
|
|
@@ -29,12 +29,17 @@ function prepareUserContextImport(candidates, existingStatements) {
|
|
|
29
29
|
"recurring"
|
|
30
30
|
].includes(item.durability) ? item.durability : "durable";
|
|
31
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";
|
|
32
37
|
imports.push({
|
|
33
38
|
statement,
|
|
34
39
|
kind,
|
|
35
40
|
sensitivity,
|
|
36
41
|
durability,
|
|
37
|
-
|
|
42
|
+
disclosurePolicy
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","names":[],"sources":["../../../src/user-context/import.ts"],"sourcesContent":["import type { MemoryRecord } from '../agent/memory/types.js';\nimport { isUserContextMemoryKind } from './projection.js';\n\nexport type PreparedUserContextImport = {\n statement: string;\n kind: MemoryRecord['kind'];\n sensitivity: NonNullable<MemoryRecord['sensitivity']>;\n durability: MemoryRecord['durability'];\n
|
|
1
|
+
{"version":3,"file":"import.js","names":[],"sources":["../../../src/user-context/import.ts"],"sourcesContent":["import type { MemoryRecord } from '../agent/memory/types.js';\nimport { isUserContextMemoryKind } from './projection.js';\n\nexport type PreparedUserContextImport = {\n statement: string;\n kind: MemoryRecord['kind'];\n sensitivity: NonNullable<MemoryRecord['sensitivity']>;\n durability: MemoryRecord['durability'];\n disclosurePolicy: MemoryRecord['disclosurePolicy'];\n};\n\nexport function prepareUserContextImport(\n candidates: unknown[],\n existingStatements: Iterable<string>,\n): { imports: PreparedUserContextImport[]; skippedCount: number } {\n const known = new Set(Array.from(existingStatements, (statement) => statement.trim().toLocaleLowerCase()));\n const imports: PreparedUserContextImport[] = [];\n let skippedCount = 0;\n\n for (const candidate of candidates) {\n if (!candidate || typeof candidate !== 'object' || Array.isArray(candidate)) {\n skippedCount += 1;\n continue;\n }\n const item = candidate as Record<string, unknown>;\n const statement = typeof item.statement === 'string' ? item.statement.trim() : '';\n const normalized = statement.toLocaleLowerCase();\n if (\n !statement\n || statement.length > 5_000\n || known.has(normalized)\n || item.status === 'archived'\n || item.status === 'rejected'\n ) {\n skippedCount += 1;\n continue;\n }\n const kind = isUserContextMemoryKind(item.kind) ? item.kind : 'preference';\n const sensitivity = typeof item.sensitivity === 'string'\n && ['normal', 'personal', 'secret', 'regulated'].includes(item.sensitivity)\n ? item.sensitivity as NonNullable<MemoryRecord['sensitivity']>\n : 'normal';\n const durability = typeof item.durability === 'string'\n && ['ephemeral', 'durable', 'recurring'].includes(item.durability)\n ? item.durability as MemoryRecord['durability']\n : 'durable';\n known.add(normalized);\n const disclosurePolicy = typeof item.disclosurePolicy === 'string'\n && ['silent', 'referenceable', 'ask_before_reference'].includes(item.disclosurePolicy)\n ? item.disclosurePolicy as MemoryRecord['disclosurePolicy']\n : 'referenceable';\n imports.push({ statement, kind, sensitivity, durability, disclosurePolicy });\n }\n\n return { imports, skippedCount };\n}\n"],"mappings":";;AAWA,SAAgB,yBACd,YACA,oBACgE;CAChE,MAAM,QAAQ,IAAI,IAAI,MAAM,KAAK,qBAAqB,cAAc,UAAU,MAAM,CAAC,mBAAmB,CAAC,CAAC;CAC1G,MAAM,UAAuC,EAAE;CAC/C,IAAI,eAAe;AAEnB,MAAK,MAAM,aAAa,YAAY;AAClC,MAAI,CAAC,aAAa,OAAO,cAAc,YAAY,MAAM,QAAQ,UAAU,EAAE;AAC3E,mBAAgB;AAChB;;EAEF,MAAM,OAAO;EACb,MAAM,YAAY,OAAO,KAAK,cAAc,WAAW,KAAK,UAAU,MAAM,GAAG;EAC/E,MAAM,aAAa,UAAU,mBAAmB;AAChD,MACE,CAAC,aACE,UAAU,SAAS,OACnB,MAAM,IAAI,WAAW,IACrB,KAAK,WAAW,cAChB,KAAK,WAAW,YACnB;AACA,mBAAgB;AAChB;;EAEF,MAAM,OAAO,wBAAwB,KAAK,KAAK,GAAG,KAAK,OAAO;EAC9D,MAAM,cAAc,OAAO,KAAK,gBAAgB,YAC3C;GAAC;GAAU;GAAY;GAAU;GAAY,CAAC,SAAS,KAAK,YAAY,GACzE,KAAK,cACL;EACJ,MAAM,aAAa,OAAO,KAAK,eAAe,YACzC;GAAC;GAAa;GAAW;GAAY,CAAC,SAAS,KAAK,WAAW,GAChE,KAAK,aACL;AACJ,QAAM,IAAI,WAAW;EACrB,MAAM,mBAAmB,OAAO,KAAK,qBAAqB,YACrD;GAAC;GAAU;GAAiB;GAAuB,CAAC,SAAS,KAAK,iBAAiB,GACpF,KAAK,mBACL;AACJ,UAAQ,KAAK;GAAE;GAAW;GAAM;GAAa;GAAY;GAAkB,CAAC;;AAG9E,QAAO;EAAE;EAAS;EAAc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/user-context/owner.ts
|
|
2
|
+
const LOCAL_USER_ID = "local-owner";
|
|
3
|
+
function resolveLocalUserContextOwner() {
|
|
4
|
+
return { userId: LOCAL_USER_ID };
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
export { LOCAL_USER_ID, resolveLocalUserContextOwner };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=owner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner.js","names":[],"sources":["../../../src/user-context/owner.ts"],"sourcesContent":["export const LOCAL_USER_ID = 'local-owner';\n\nexport interface UserContextOwner {\n userId: string;\n}\n\nexport function resolveLocalUserContextOwner(): UserContextOwner {\n return { userId: LOCAL_USER_ID };\n}\n"],"mappings":";AAAA,MAAa,gBAAgB;AAM7B,SAAgB,+BAAiD;AAC/D,QAAO,EAAE,QAAQ,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MemoryKind, MemoryRecord } from '../agent/memory/types.js';
|
|
2
|
-
import type { ConnectorDefinition, ConnectorInstance } from '../connectors/types.js';
|
|
2
|
+
import type { ConnectorConnection, ConnectorDefinition, ConnectorInstance } from '../connectors/types.js';
|
|
3
3
|
import type { KnowledgeSourceItem, KnowledgeSyncRun } from '../knowledge/types.js';
|
|
4
4
|
export type UserContextFacet = 'basics' | 'collaboration' | 'boundaries' | 'priorities' | 'people' | 'current';
|
|
5
5
|
export type UserContextOrigin = 'told_by_you' | 'observed' | 'inferred' | 'connected_source';
|
|
@@ -19,7 +19,7 @@ export declare function projectUserContextRecord(record: MemoryRecord): {
|
|
|
19
19
|
sensitivity: import("../agent/memory/types.js").MemorySensitivity;
|
|
20
20
|
explicitness: import("../agent/memory/types.js").MemoryExplicitness;
|
|
21
21
|
durability: import("../agent/memory/types.js").MemoryDurability;
|
|
22
|
-
|
|
22
|
+
disclosurePolicy: import("../agent/memory/types.js").MemoryDisclosurePolicy;
|
|
23
23
|
stability: import("../agent/memory/lifecycle.js").MemoryStabilityBand;
|
|
24
24
|
stabilityScore: number;
|
|
25
25
|
reviewAt: string;
|
|
@@ -29,10 +29,11 @@ export declare function projectUserContextRecord(record: MemoryRecord): {
|
|
|
29
29
|
latestEvidenceAt: string;
|
|
30
30
|
};
|
|
31
31
|
export declare function isPersonalContextConnector(definition: ConnectorDefinition): boolean;
|
|
32
|
-
export declare function recordsDerivedFromPersonalContextSource(records: MemoryRecord[],
|
|
32
|
+
export declare function recordsDerivedFromPersonalContextSource(records: MemoryRecord[], sourceInstanceId: string): MemoryRecord[];
|
|
33
33
|
export declare function projectPersonalContextSources(definitions: ConnectorDefinition[], instances: ConnectorInstance[], records?: MemoryRecord[], knowledge?: {
|
|
34
34
|
sourceItems?: KnowledgeSourceItem[];
|
|
35
35
|
syncRuns?: KnowledgeSyncRun[];
|
|
36
|
+
connections?: ConnectorConnection[];
|
|
36
37
|
}): {
|
|
37
38
|
category: import("../connectors/types.js").ConnectorCategory;
|
|
38
39
|
capabilities: ("context" | "tools" | "events" | "memory_source")[];
|
|
@@ -44,12 +45,12 @@ export declare function projectPersonalContextSources(definitions: ConnectorDefi
|
|
|
44
45
|
};
|
|
45
46
|
permissionDetails: string[];
|
|
46
47
|
installed: boolean;
|
|
47
|
-
enabled:
|
|
48
|
-
status:
|
|
49
|
-
instanceId:
|
|
50
|
-
lastConnectedAt:
|
|
51
|
-
lastHealthCheckAt:
|
|
52
|
-
lastHealthStatus:
|
|
48
|
+
enabled: any;
|
|
49
|
+
status: any;
|
|
50
|
+
instanceId: any;
|
|
51
|
+
lastConnectedAt: any;
|
|
52
|
+
lastHealthCheckAt: any;
|
|
53
|
+
lastHealthStatus: any;
|
|
53
54
|
lastActivityAt: string;
|
|
54
55
|
derivedUnderstandingCount: number;
|
|
55
56
|
knowledgeItemCount: number;
|
|
@@ -58,6 +59,7 @@ export declare function projectPersonalContextSources(definitions: ConnectorDefi
|
|
|
58
59
|
lastSyncError: string;
|
|
59
60
|
branding?: import("../connectors/types.js").ConnectorBranding;
|
|
60
61
|
id: string;
|
|
62
|
+
accountLabel: any;
|
|
61
63
|
displayName: string;
|
|
62
64
|
description: string;
|
|
63
65
|
}[];
|
|
@@ -54,7 +54,7 @@ function projectUserContextRecord(record) {
|
|
|
54
54
|
sensitivity: record.sensitivity ?? "normal",
|
|
55
55
|
explicitness: record.explicitness,
|
|
56
56
|
durability: record.durability,
|
|
57
|
-
|
|
57
|
+
disclosurePolicy: record.disclosurePolicy,
|
|
58
58
|
stability: lifecycle.band,
|
|
59
59
|
stabilityScore: lifecycle.score,
|
|
60
60
|
reviewAt: lifecycle.reviewAt,
|
|
@@ -67,8 +67,8 @@ function projectUserContextRecord(record) {
|
|
|
67
67
|
function isPersonalContextConnector(definition) {
|
|
68
68
|
return definition.capabilities.includes("context") || definition.capabilities.includes("memory_source");
|
|
69
69
|
}
|
|
70
|
-
function recordsDerivedFromPersonalContextSource(records,
|
|
71
|
-
return records.filter((record) => record.
|
|
70
|
+
function recordsDerivedFromPersonalContextSource(records, sourceInstanceId) {
|
|
71
|
+
return records.filter((record) => record.source.sourceInstanceId === sourceInstanceId && isUserContextRecord(record));
|
|
72
72
|
}
|
|
73
73
|
function projectPersonalContextSources(definitions, instances, records = [], knowledge = {}) {
|
|
74
74
|
const instanceByConnector = /* @__PURE__ */ new Map();
|
|
@@ -77,51 +77,78 @@ function projectPersonalContextSources(definitions, instances, records = [], kno
|
|
|
77
77
|
current.push(instance);
|
|
78
78
|
instanceByConnector.set(instance.connectorId, current);
|
|
79
79
|
}
|
|
80
|
-
return definitions.filter(isPersonalContextConnector).
|
|
80
|
+
return definitions.filter(isPersonalContextConnector).flatMap((definition) => {
|
|
81
81
|
const connected = instanceByConnector.get(definition.id) ?? [];
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
82
|
+
const accounts = (knowledge.connections ?? []).filter((connection) => connection.provider === "composio" && connection.connectorId === definition.id && connection.status !== "revoked");
|
|
83
|
+
return (accounts.length > 0 ? accounts.map((connection) => ({
|
|
84
|
+
instanceId: connection.id,
|
|
85
|
+
sourceInstanceId: `composio:${definition.id}:${connection.id}`,
|
|
86
|
+
accountLabel: connection.alias ?? (typeof connection.identity.email === "string" ? connection.identity.email : void 0) ?? (typeof connection.identity.username === "string" ? connection.identity.username : void 0),
|
|
87
|
+
enabled: connection.status === "active",
|
|
88
|
+
status: connection.status,
|
|
89
|
+
lastConnectedAt: connection.connectedAt,
|
|
90
|
+
instances: connected
|
|
91
|
+
})) : connected.length > 0 ? connected.map((instance) => ({
|
|
92
|
+
instanceId: instance.instanceId,
|
|
93
|
+
sourceInstanceId: instance.instanceId,
|
|
94
|
+
accountLabel: void 0,
|
|
95
|
+
enabled: instance.enabled,
|
|
96
|
+
status: instance.status,
|
|
97
|
+
lastConnectedAt: instance.lastConnectedAt,
|
|
98
|
+
instances: [instance]
|
|
99
|
+
})) : [{
|
|
100
|
+
instanceId: void 0,
|
|
101
|
+
sourceInstanceId: void 0,
|
|
102
|
+
accountLabel: void 0,
|
|
103
|
+
enabled: false,
|
|
104
|
+
status: "not_installed",
|
|
105
|
+
lastConnectedAt: void 0,
|
|
106
|
+
instances: []
|
|
107
|
+
}]).map((row) => {
|
|
108
|
+
const relatedRecords = row.sourceInstanceId ? records.filter((record) => record.source.sourceInstanceId === row.sourceInstanceId) : [];
|
|
109
|
+
const sourceItems = row.sourceInstanceId ? (knowledge.sourceItems ?? []).filter((item) => item.sourceInstanceId === row.sourceInstanceId) : [];
|
|
110
|
+
const latestSync = (knowledge.syncRuns ?? []).filter((run) => run.sourceInstanceId === row.sourceInstanceId).sort((left, right) => Date.parse(right.startedAt) - Date.parse(left.startedAt))[0];
|
|
111
|
+
const latestHealth = row.instances.filter((instance) => instance.usage.lastHealthCheckAt && instance.usage.lastHealthStatus).sort((left, right) => Date.parse(right.usage.lastHealthCheckAt) - Date.parse(left.usage.lastHealthCheckAt))[0]?.usage;
|
|
112
|
+
const permissionDetails = definition.permissions?.data ?? [];
|
|
113
|
+
const canWrite = permissionDetails.some((permission) => /(?:^|[.:/_-])(write|create|update|delete|manage|send|admin)(?:$|[.:/_-])/i.test(permission));
|
|
114
|
+
return {
|
|
115
|
+
id: definition.id,
|
|
116
|
+
accountLabel: row.accountLabel,
|
|
117
|
+
displayName: definition.displayName,
|
|
118
|
+
description: definition.description,
|
|
119
|
+
...definition.branding ? { branding: definition.branding } : {},
|
|
120
|
+
category: definition.category,
|
|
121
|
+
capabilities: definition.capabilities.filter((capability) => capability === "context" || capability === "memory_source" || capability === "tools" || capability === "events"),
|
|
122
|
+
access: {
|
|
123
|
+
context: definition.capabilities.includes("context"),
|
|
124
|
+
memory: definition.capabilities.includes("memory_source"),
|
|
125
|
+
read: definition.capabilities.includes("context") || definition.capabilities.includes("resources") || definition.capabilities.includes("tools"),
|
|
126
|
+
write: canWrite
|
|
127
|
+
},
|
|
128
|
+
permissionDetails,
|
|
129
|
+
installed: row.instanceId !== void 0,
|
|
130
|
+
enabled: row.enabled,
|
|
131
|
+
status: row.status,
|
|
132
|
+
instanceId: row.instanceId,
|
|
133
|
+
lastConnectedAt: row.lastConnectedAt,
|
|
134
|
+
lastHealthCheckAt: latestHealth?.lastHealthCheckAt,
|
|
135
|
+
lastHealthStatus: latestHealth?.lastHealthStatus,
|
|
136
|
+
lastActivityAt: [
|
|
137
|
+
...row.instances.flatMap((instance) => [
|
|
138
|
+
instance.lastConnectedAt,
|
|
139
|
+
instance.usage.lastHealthCheckAt,
|
|
140
|
+
...instance.audit.map((entry) => entry.at)
|
|
141
|
+
]),
|
|
142
|
+
latestSync?.finishedAt,
|
|
143
|
+
latestSync?.startedAt
|
|
144
|
+
].filter((value) => Boolean(value)).sort().at(-1),
|
|
145
|
+
derivedUnderstandingCount: relatedRecords.length,
|
|
146
|
+
knowledgeItemCount: sourceItems.filter((item) => !item.deletedAt).length,
|
|
147
|
+
lastSyncAt: latestSync?.finishedAt ?? latestSync?.startedAt,
|
|
148
|
+
lastSyncStatus: latestSync?.status,
|
|
149
|
+
lastSyncError: latestSync?.error
|
|
150
|
+
};
|
|
151
|
+
});
|
|
125
152
|
}).sort((left, right) => {
|
|
126
153
|
if (left.installed !== right.installed) return left.installed ? -1 : 1;
|
|
127
154
|
return left.displayName.localeCompare(right.displayName);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","names":[],"sources":["../../../src/user-context/projection.ts"],"sourcesContent":["import type { MemoryKind, MemoryRecord } from '../agent/memory/types.js';\nimport { effectiveMemoryStatus, resolveMemoryStability } from '../agent/memory/lifecycle.js';\nimport { classifyMemoryContextOrigin } from '../agent/memory/source-origin.js';\nimport type { ConnectorDefinition, ConnectorInstance } from '../connectors/types.js';\nimport type { KnowledgeSourceItem, KnowledgeSyncRun } from '../knowledge/types.js';\n\nexport type UserContextFacet =\n | 'basics'\n | 'collaboration'\n | 'boundaries'\n | 'priorities'\n | 'people'\n | 'current';\n\nexport type UserContextOrigin = 'told_by_you' | 'observed' | 'inferred' | 'connected_source';\n\nconst ALWAYS_PERSONAL_KINDS = new Set<MemoryKind>([\n 'user_profile',\n 'preference',\n 'boundary',\n 'relationship',\n 'commitment',\n 'routine',\n 'personal_logistics',\n 'current_state',\n 'tool_preference',\n 'long_term_goal',\n]);\n\nconst CONTEXTUAL_USER_KINDS = new Set<MemoryKind>([\n 'project_context',\n 'open_question',\n 'milestone',\n 'derived_insight',\n 'task_lesson',\n]);\n\nexport function isUserContextRecord(record: MemoryRecord): boolean {\n if (ALWAYS_PERSONAL_KINDS.has(record.kind)) return true;\n return CONTEXTUAL_USER_KINDS.has(record.kind) && record.tags?.includes('user-understanding') === true;\n}\n\nexport function isUserContextMemoryKind(value: unknown): value is MemoryKind {\n return typeof value === 'string'\n && (ALWAYS_PERSONAL_KINDS.has(value as MemoryKind) || CONTEXTUAL_USER_KINDS.has(value as MemoryKind));\n}\n\nexport function facetForMemoryKind(kind: MemoryKind): UserContextFacet {\n if (kind === 'user_profile' || kind === 'personal_logistics') return 'basics';\n if (kind === 'preference' || kind === 'routine' || kind === 'tool_preference' || kind === 'task_lesson') {\n return 'collaboration';\n }\n if (kind === 'boundary') return 'boundaries';\n if (kind === 'relationship') return 'people';\n if (kind === 'current_state' || kind === 'open_question') return 'current';\n return 'priorities';\n}\n\nexport function originForMemoryRecord(record: MemoryRecord): UserContextOrigin {\n const origin = classifyMemoryContextOrigin(record);\n return origin === 'told_by_user' ? 'told_by_you' : origin;\n}\n\nexport function projectUserContextRecord(record: MemoryRecord) {\n const lifecycle = resolveMemoryStability(record);\n const latestEvidenceAt = record.evidence\n ?.map((evidence) => evidence.observedAt)\n .filter((value): value is string => Boolean(value))\n .sort()\n .at(-1);\n return {\n id: record.id,\n statement: record.content,\n facet: facetForMemoryKind(record.kind),\n kind: record.kind,\n status: effectiveMemoryStatus(record),\n origin: originForMemoryRecord(record),\n sourceName: record.source.provider ?? 'local',\n updatedAt: record.updatedAt,\n sensitivity: record.sensitivity ?? 'normal',\n explicitness: record.explicitness,\n durability: record.durability,\n canReference: record.disclosurePolicy !== 'silent',\n stability: lifecycle.band,\n stabilityScore: lifecycle.score,\n reviewAt: lifecycle.reviewAt,\n reviewDue: lifecycle.reviewDue,\n evidenceCount: record.evidence?.length ?? 0,\n sourcePath: record.source.path,\n latestEvidenceAt,\n };\n}\n\nexport function isPersonalContextConnector(definition: ConnectorDefinition): boolean {\n return definition.capabilities.includes('context') || definition.capabilities.includes('memory_source');\n}\n\nexport function recordsDerivedFromPersonalContextSource(\n records: MemoryRecord[],\n agentId: string,\n connectorId: string,\n): MemoryRecord[] {\n return records.filter((record) => (\n record.scope.agentId === agentId\n && record.source.provider === connectorId\n && isUserContextRecord(record)\n ));\n}\n\nexport function projectPersonalContextSources(\n definitions: ConnectorDefinition[],\n instances: ConnectorInstance[],\n records: MemoryRecord[] = [],\n knowledge: { sourceItems?: KnowledgeSourceItem[]; syncRuns?: KnowledgeSyncRun[] } = {},\n) {\n const instanceByConnector = new Map<string, ConnectorInstance[]>();\n for (const instance of instances) {\n const current = instanceByConnector.get(instance.connectorId) ?? [];\n current.push(instance);\n instanceByConnector.set(instance.connectorId, current);\n }\n return definitions\n .filter(isPersonalContextConnector)\n .map((definition) => {\n const connected = instanceByConnector.get(definition.id) ?? [];\n const relatedRecords = records.filter((record) => record.source.provider === definition.id);\n const sourceItems = (knowledge.sourceItems ?? []).filter((item) => item.metadata.connectorId === definition.id);\n const sourceInstanceIds = new Set(sourceItems.map((item) => item.sourceInstanceId));\n const latestSync = (knowledge.syncRuns ?? [])\n .filter((run) => (\n sourceInstanceIds.has(run.sourceInstanceId)\n || run.sourceInstanceId.startsWith(`composio:${definition.id}:`)\n || run.sourceInstanceId.startsWith(`${definition.id}:`)\n ))\n .sort((left, right) => Date.parse(right.startedAt) - Date.parse(left.startedAt))[0];\n const latestHealth = connected\n .filter((instance) => instance.usage.lastHealthCheckAt && instance.usage.lastHealthStatus)\n .sort((left, right) => (\n Date.parse(right.usage.lastHealthCheckAt!) - Date.parse(left.usage.lastHealthCheckAt!)\n ))[0]?.usage;\n const permissionDetails = definition.permissions?.data ?? [];\n const canWrite = permissionDetails.some((permission) => (\n /(?:^|[.:/_-])(write|create|update|delete|manage|send|admin)(?:$|[.:/_-])/i.test(permission)\n ));\n return {\n id: definition.id,\n displayName: definition.displayName,\n description: definition.description,\n ...(definition.branding ? { branding: definition.branding } : {}),\n category: definition.category,\n capabilities: definition.capabilities.filter((capability) => (\n capability === 'context' || capability === 'memory_source' || capability === 'tools' || capability === 'events'\n )),\n access: {\n context: definition.capabilities.includes('context'),\n memory: definition.capabilities.includes('memory_source'),\n read: definition.capabilities.includes('context')\n || definition.capabilities.includes('resources')\n || definition.capabilities.includes('tools'),\n write: canWrite,\n },\n permissionDetails,\n installed: connected.length > 0,\n enabled: connected.some((instance) => instance.enabled),\n status: connected[0]?.status ?? 'not_installed',\n instanceId: connected[0]?.instanceId,\n lastConnectedAt: connected\n .map((instance) => instance.lastConnectedAt)\n .filter((value): value is string => Boolean(value))\n .sort()\n .at(-1),\n lastHealthCheckAt: latestHealth?.lastHealthCheckAt,\n lastHealthStatus: latestHealth?.lastHealthStatus,\n lastActivityAt: [\n ...connected.flatMap((instance) => [\n instance.lastConnectedAt,\n instance.usage.lastHealthCheckAt,\n ...instance.audit.map((entry) => entry.at),\n ]),\n latestSync?.finishedAt,\n latestSync?.startedAt,\n ]\n .filter((value): value is string => Boolean(value))\n .sort()\n .at(-1),\n derivedUnderstandingCount: relatedRecords.length,\n knowledgeItemCount: sourceItems.filter((item) => !item.deletedAt).length,\n lastSyncAt: latestSync?.finishedAt ?? latestSync?.startedAt,\n lastSyncStatus: latestSync?.status,\n lastSyncError: latestSync?.error,\n };\n })\n .sort((left, right) => {\n if (left.installed !== right.installed) return left.installed ? -1 : 1;\n return left.displayName.localeCompare(right.displayName);\n });\n}\n"],"mappings":";;;AAgBA,MAAM,wBAAwB,IAAI,IAAgB;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,wBAAwB,IAAI,IAAgB;CAChD;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAgB,oBAAoB,QAA+B;AACjE,KAAI,sBAAsB,IAAI,OAAO,KAAK,CAAE,QAAO;AACnD,QAAO,sBAAsB,IAAI,OAAO,KAAK,IAAI,OAAO,MAAM,SAAS,qBAAqB,KAAK;;AAGnG,SAAgB,wBAAwB,OAAqC;AAC3E,QAAO,OAAO,UAAU,aAClB,sBAAsB,IAAI,MAAoB,IAAI,sBAAsB,IAAI,MAAoB;;AAGxG,SAAgB,mBAAmB,MAAoC;AACrE,KAAI,SAAS,kBAAkB,SAAS,qBAAsB,QAAO;AACrE,KAAI,SAAS,gBAAgB,SAAS,aAAa,SAAS,qBAAqB,SAAS,cACxF,QAAO;AAET,KAAI,SAAS,WAAY,QAAO;AAChC,KAAI,SAAS,eAAgB,QAAO;AACpC,KAAI,SAAS,mBAAmB,SAAS,gBAAiB,QAAO;AACjE,QAAO;;AAGT,SAAgB,sBAAsB,QAAyC;CAC7E,MAAM,SAAS,4BAA4B,OAAO;AAClD,QAAO,WAAW,iBAAiB,gBAAgB;;AAGrD,SAAgB,yBAAyB,QAAsB;CAC7D,MAAM,YAAY,uBAAuB,OAAO;CAChD,MAAM,mBAAmB,OAAO,U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,UAAU,IAAI,UAAU;GAChC,YAAY,UAAU,IAAI;GAC1B,iBAAiB,UACd,KAAK,aAAa,SAAS,gBAAgB,CAC3C,QAAQ,UAA2B,QAAQ,MAAM,CAAC,CAClD,MAAM,CACN,GAAG,GAAG;GACT,mBAAmB,cAAc;GACjC,kBAAkB,cAAc;GAChC,gBAAgB;IACd,GAAG,UAAU,SAAS,aAAa;KACjC,SAAS;KACT,SAAS,MAAM;KACf,GAAG,SAAS,MAAM,KAAK,UAAU,MAAM,GAAG;KAC3C,CAAC;IACF,YAAY;IACZ,YAAY;IACb,CACE,QAAQ,UAA2B,QAAQ,MAAM,CAAC,CAClD,MAAM,CACN,GAAG,GAAG;GACT,2BAA2B,eAAe;GAC1C,oBAAoB,YAAY,QAAQ,SAAS,CAAC,KAAK,UAAU,CAAC;GAClE,YAAY,YAAY,cAAc,YAAY;GAClD,gBAAgB,YAAY;GAC5B,eAAe,YAAY;GAC5B;GACD,CACD,MAAM,MAAM,UAAU;AACrB,MAAI,KAAK,cAAc,MAAM,UAAW,QAAO,KAAK,YAAY,KAAK;AACrE,SAAO,KAAK,YAAY,cAAc,MAAM,YAAY;GACxD"}
|
|
1
|
+
{"version":3,"file":"projection.js","names":[],"sources":["../../../src/user-context/projection.ts"],"sourcesContent":["import type { MemoryKind, MemoryRecord } from '../agent/memory/types.js';\nimport { effectiveMemoryStatus, resolveMemoryStability } from '../agent/memory/lifecycle.js';\nimport { classifyMemoryContextOrigin } from '../agent/memory/source-origin.js';\nimport type { ConnectorConnection, ConnectorDefinition, ConnectorInstance } from '../connectors/types.js';\nimport type { KnowledgeSourceItem, KnowledgeSyncRun } from '../knowledge/types.js';\n\nexport type UserContextFacet =\n | 'basics'\n | 'collaboration'\n | 'boundaries'\n | 'priorities'\n | 'people'\n | 'current';\n\nexport type UserContextOrigin = 'told_by_you' | 'observed' | 'inferred' | 'connected_source';\n\nconst ALWAYS_PERSONAL_KINDS = new Set<MemoryKind>([\n 'user_profile',\n 'preference',\n 'boundary',\n 'relationship',\n 'commitment',\n 'routine',\n 'personal_logistics',\n 'current_state',\n 'tool_preference',\n 'long_term_goal',\n]);\n\nconst CONTEXTUAL_USER_KINDS = new Set<MemoryKind>([\n 'project_context',\n 'open_question',\n 'milestone',\n 'derived_insight',\n 'task_lesson',\n]);\n\nexport function isUserContextRecord(record: MemoryRecord): boolean {\n if (ALWAYS_PERSONAL_KINDS.has(record.kind)) return true;\n return CONTEXTUAL_USER_KINDS.has(record.kind) && record.tags?.includes('user-understanding') === true;\n}\n\nexport function isUserContextMemoryKind(value: unknown): value is MemoryKind {\n return typeof value === 'string'\n && (ALWAYS_PERSONAL_KINDS.has(value as MemoryKind) || CONTEXTUAL_USER_KINDS.has(value as MemoryKind));\n}\n\nexport function facetForMemoryKind(kind: MemoryKind): UserContextFacet {\n if (kind === 'user_profile' || kind === 'personal_logistics') return 'basics';\n if (kind === 'preference' || kind === 'routine' || kind === 'tool_preference' || kind === 'task_lesson') {\n return 'collaboration';\n }\n if (kind === 'boundary') return 'boundaries';\n if (kind === 'relationship') return 'people';\n if (kind === 'current_state' || kind === 'open_question') return 'current';\n return 'priorities';\n}\n\nexport function originForMemoryRecord(record: MemoryRecord): UserContextOrigin {\n const origin = classifyMemoryContextOrigin(record);\n return origin === 'told_by_user' ? 'told_by_you' : origin;\n}\n\nexport function projectUserContextRecord(record: MemoryRecord) {\n const lifecycle = resolveMemoryStability(record);\n const latestEvidenceAt = record.evidence\n ?.map((evidence) => evidence.observedAt)\n .filter((value): value is string => Boolean(value))\n .sort()\n .at(-1);\n return {\n id: record.id,\n statement: record.content,\n facet: facetForMemoryKind(record.kind),\n kind: record.kind,\n status: effectiveMemoryStatus(record),\n origin: originForMemoryRecord(record),\n sourceName: record.source.provider ?? 'local',\n updatedAt: record.updatedAt,\n sensitivity: record.sensitivity ?? 'normal',\n explicitness: record.explicitness,\n durability: record.durability,\n disclosurePolicy: record.disclosurePolicy,\n stability: lifecycle.band,\n stabilityScore: lifecycle.score,\n reviewAt: lifecycle.reviewAt,\n reviewDue: lifecycle.reviewDue,\n evidenceCount: record.evidence?.length ?? 0,\n sourcePath: record.source.path,\n latestEvidenceAt,\n };\n}\n\nexport function isPersonalContextConnector(definition: ConnectorDefinition): boolean {\n return definition.capabilities.includes('context') || definition.capabilities.includes('memory_source');\n}\n\nexport function recordsDerivedFromPersonalContextSource(\n records: MemoryRecord[],\n sourceInstanceId: string,\n): MemoryRecord[] {\n return records.filter((record) => (\n record.source.sourceInstanceId === sourceInstanceId\n && isUserContextRecord(record)\n ));\n}\n\nexport function projectPersonalContextSources(\n definitions: ConnectorDefinition[],\n instances: ConnectorInstance[],\n records: MemoryRecord[] = [],\n knowledge: {\n sourceItems?: KnowledgeSourceItem[];\n syncRuns?: KnowledgeSyncRun[];\n connections?: ConnectorConnection[];\n } = {},\n) {\n const instanceByConnector = new Map<string, ConnectorInstance[]>();\n for (const instance of instances) {\n const current = instanceByConnector.get(instance.connectorId) ?? [];\n current.push(instance);\n instanceByConnector.set(instance.connectorId, current);\n }\n return definitions\n .filter(isPersonalContextConnector)\n .flatMap((definition) => {\n const connected = instanceByConnector.get(definition.id) ?? [];\n const accounts = (knowledge.connections ?? []).filter((connection) => (\n connection.provider === 'composio'\n && connection.connectorId === definition.id\n && connection.status !== 'revoked'\n ));\n const rows = accounts.length > 0\n ? accounts.map((connection) => ({\n instanceId: connection.id,\n sourceInstanceId: `composio:${definition.id}:${connection.id}`,\n accountLabel: connection.alias\n ?? (typeof connection.identity.email === 'string' ? connection.identity.email : undefined)\n ?? (typeof connection.identity.username === 'string' ? connection.identity.username : undefined),\n enabled: connection.status === 'active',\n status: connection.status,\n lastConnectedAt: connection.connectedAt,\n instances: connected,\n }))\n : connected.length > 0\n ? connected.map((instance) => ({\n instanceId: instance.instanceId,\n sourceInstanceId: instance.instanceId,\n accountLabel: undefined,\n enabled: instance.enabled,\n status: instance.status,\n lastConnectedAt: instance.lastConnectedAt,\n instances: [instance],\n }))\n : [{\n instanceId: undefined,\n sourceInstanceId: undefined,\n accountLabel: undefined,\n enabled: false,\n status: 'not_installed',\n lastConnectedAt: undefined,\n instances: [] as ConnectorInstance[],\n }];\n return rows.map((row) => {\n const relatedRecords = row.sourceInstanceId\n ? records.filter((record) => record.source.sourceInstanceId === row.sourceInstanceId)\n : [];\n const sourceItems = row.sourceInstanceId\n ? (knowledge.sourceItems ?? []).filter((item) => item.sourceInstanceId === row.sourceInstanceId)\n : [];\n const latestSync = (knowledge.syncRuns ?? [])\n .filter((run) => run.sourceInstanceId === row.sourceInstanceId)\n .sort((left, right) => Date.parse(right.startedAt) - Date.parse(left.startedAt))[0];\n const latestHealth = row.instances\n .filter((instance) => instance.usage.lastHealthCheckAt && instance.usage.lastHealthStatus)\n .sort((left, right) => (\n Date.parse(right.usage.lastHealthCheckAt!) - Date.parse(left.usage.lastHealthCheckAt!)\n ))[0]?.usage;\n const permissionDetails = definition.permissions?.data ?? [];\n const canWrite = permissionDetails.some((permission) => (\n /(?:^|[.:/_-])(write|create|update|delete|manage|send|admin)(?:$|[.:/_-])/i.test(permission)\n ));\n return {\n id: definition.id,\n accountLabel: row.accountLabel,\n displayName: definition.displayName,\n description: definition.description,\n ...(definition.branding ? { branding: definition.branding } : {}),\n category: definition.category,\n capabilities: definition.capabilities.filter((capability) => (\n capability === 'context' || capability === 'memory_source' || capability === 'tools' || capability === 'events'\n )),\n access: {\n context: definition.capabilities.includes('context'),\n memory: definition.capabilities.includes('memory_source'),\n read: definition.capabilities.includes('context')\n || definition.capabilities.includes('resources')\n || definition.capabilities.includes('tools'),\n write: canWrite,\n },\n permissionDetails,\n installed: row.instanceId !== undefined,\n enabled: row.enabled,\n status: row.status,\n instanceId: row.instanceId,\n lastConnectedAt: row.lastConnectedAt,\n lastHealthCheckAt: latestHealth?.lastHealthCheckAt,\n lastHealthStatus: latestHealth?.lastHealthStatus,\n lastActivityAt: [\n ...row.instances.flatMap((instance) => [\n instance.lastConnectedAt,\n instance.usage.lastHealthCheckAt,\n ...instance.audit.map((entry) => entry.at),\n ]),\n latestSync?.finishedAt,\n latestSync?.startedAt,\n ]\n .filter((value): value is string => Boolean(value))\n .sort()\n .at(-1),\n derivedUnderstandingCount: relatedRecords.length,\n knowledgeItemCount: sourceItems.filter((item) => !item.deletedAt).length,\n lastSyncAt: latestSync?.finishedAt ?? latestSync?.startedAt,\n lastSyncStatus: latestSync?.status,\n lastSyncError: latestSync?.error,\n };\n });\n })\n .sort((left, right) => {\n if (left.installed !== right.installed) return left.installed ? -1 : 1;\n return left.displayName.localeCompare(right.displayName);\n });\n}\n"],"mappings":";;;AAgBA,MAAM,wBAAwB,IAAI,IAAgB;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,wBAAwB,IAAI,IAAgB;CAChD;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,SAAgB,oBAAoB,QAA+B;AACjE,KAAI,sBAAsB,IAAI,OAAO,KAAK,CAAE,QAAO;AACnD,QAAO,sBAAsB,IAAI,OAAO,KAAK,IAAI,OAAO,MAAM,SAAS,qBAAqB,KAAK;;AAGnG,SAAgB,wBAAwB,OAAqC;AAC3E,QAAO,OAAO,UAAU,aAClB,sBAAsB,IAAI,MAAoB,IAAI,sBAAsB,IAAI,MAAoB;;AAGxG,SAAgB,mBAAmB,MAAoC;AACrE,KAAI,SAAS,kBAAkB,SAAS,qBAAsB,QAAO;AACrE,KAAI,SAAS,gBAAgB,SAAS,aAAa,SAAS,qBAAqB,SAAS,cACxF,QAAO;AAET,KAAI,SAAS,WAAY,QAAO;AAChC,KAAI,SAAS,eAAgB,QAAO;AACpC,KAAI,SAAS,mBAAmB,SAAS,gBAAiB,QAAO;AACjE,QAAO;;AAGT,SAAgB,sBAAsB,QAAyC;CAC7E,MAAM,SAAS,4BAA4B,OAAO;AAClD,QAAO,WAAW,iBAAiB,gBAAgB;;AAGrD,SAAgB,yBAAyB,QAAsB;CAC7D,MAAM,YAAY,uBAAuB,OAAO;CAChD,MAA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,YAAY,KAAK;AACrE,SAAO,KAAK,YAAY,cAAc,MAAM,YAAY;GACxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Config } from '../config/schema.js';
|
|
2
|
+
import { BuiltinMemoryStore } from '../agent/memory/builtin-memory-store.js';
|
|
3
|
+
import type { MemoryManager } from '../agent/memory/manager.js';
|
|
4
|
+
export interface UserContextRuntime {
|
|
5
|
+
builtinMemoryStore: BuiltinMemoryStore;
|
|
6
|
+
memoryManager: MemoryManager;
|
|
7
|
+
}
|
|
8
|
+
/** Owns the process-wide user context runtime shared by every agent and workspace. */
|
|
9
|
+
export declare class UserContextRuntimeRegistry {
|
|
10
|
+
private runtime?;
|
|
11
|
+
getOrCreate(config: Config): UserContextRuntime;
|
|
12
|
+
clear(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { init_paths, resolveUserDir } from "../config/paths.js";
|
|
4
|
+
import { resolveBuiltinMemoryStoreConfig } from "../agent/memory/memory-config.js";
|
|
5
|
+
import { BuiltinMemoryStore } from "../agent/memory/builtin-memory-store.js";
|
|
6
|
+
import { createMemoryManagerFromConfig } from "../agent/memory/create-memory-manager.js";
|
|
7
|
+
//#region src/user-context/runtime.ts
|
|
8
|
+
init_paths();
|
|
9
|
+
init_logger();
|
|
10
|
+
const log = createLogger("UserContextRuntimeRegistry");
|
|
11
|
+
/** Owns the process-wide user context runtime shared by every agent and workspace. */
|
|
12
|
+
var UserContextRuntimeRegistry = class {
|
|
13
|
+
runtime;
|
|
14
|
+
getOrCreate(config) {
|
|
15
|
+
if (this.runtime) return this.runtime;
|
|
16
|
+
const userContextRoot = resolveUserDir();
|
|
17
|
+
const builtinMemoryStore = new BuiltinMemoryStore(resolveBuiltinMemoryStoreConfig(userContextRoot, config));
|
|
18
|
+
this.runtime = {
|
|
19
|
+
builtinMemoryStore,
|
|
20
|
+
memoryManager: createMemoryManagerFromConfig(userContextRoot, builtinMemoryStore, config)
|
|
21
|
+
};
|
|
22
|
+
return this.runtime;
|
|
23
|
+
}
|
|
24
|
+
async clear() {
|
|
25
|
+
const runtime = this.runtime;
|
|
26
|
+
this.runtime = void 0;
|
|
27
|
+
if (!runtime) return;
|
|
28
|
+
await runtime.memoryManager.shutdownAll().catch((err) => {
|
|
29
|
+
log.warn({ err }, "Shared memory manager shutdown failed");
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { UserContextRuntimeRegistry };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","names":[],"sources":["../../../src/user-context/runtime.ts"],"sourcesContent":["import type { Config } from '../config/schema.js';\nimport { resolveUserDir } from '../config/paths.js';\nimport { BuiltinMemoryStore } from '../agent/memory/builtin-memory-store.js';\nimport { createMemoryManagerFromConfig } from '../agent/memory/create-memory-manager.js';\nimport { resolveBuiltinMemoryStoreConfig } from '../agent/memory/memory-config.js';\nimport type { MemoryManager } from '../agent/memory/manager.js';\nimport { createLogger } from '../utils/logger.js';\n\nconst log = createLogger('UserContextRuntimeRegistry');\n\nexport interface UserContextRuntime {\n builtinMemoryStore: BuiltinMemoryStore;\n memoryManager: MemoryManager;\n}\n\n/** Owns the process-wide user context runtime shared by every agent and workspace. */\nexport class UserContextRuntimeRegistry {\n private runtime?: UserContextRuntime;\n\n getOrCreate(config: Config): UserContextRuntime {\n if (this.runtime) return this.runtime;\n const userContextRoot = resolveUserDir();\n const builtinMemoryStore = new BuiltinMemoryStore(\n resolveBuiltinMemoryStoreConfig(userContextRoot, config),\n );\n this.runtime = {\n builtinMemoryStore,\n memoryManager: createMemoryManagerFromConfig(userContextRoot, builtinMemoryStore, config),\n };\n return this.runtime;\n }\n\n async clear(): Promise<void> {\n const runtime = this.runtime;\n this.runtime = undefined;\n if (!runtime) return;\n await runtime.memoryManager.shutdownAll().catch((err) => {\n log.warn({ err }, 'Shared memory manager shutdown failed');\n });\n }\n}\n"],"mappings":";;;;;;;YACoD;aAKF;AAElD,MAAM,MAAM,aAAa,6BAA6B;;AAQtD,IAAa,6BAAb,MAAwC;CACtC;CAEA,YAAY,QAAoC;AAC9C,MAAI,KAAK,QAAS,QAAO,KAAK;EAC9B,MAAM,kBAAkB,gBAAgB;EACxC,MAAM,qBAAqB,IAAI,mBAC7B,gCAAgC,iBAAiB,OAAO,CACzD;AACD,OAAK,UAAU;GACb;GACA,eAAe,8BAA8B,iBAAiB,oBAAoB,OAAO;GAC1F;AACD,SAAO,KAAK;;CAGd,MAAM,QAAuB;EAC3B,MAAM,UAAU,KAAK;AACrB,OAAK,UAAU,KAAA;AACf,MAAI,CAAC,QAAS;AACd,QAAM,QAAQ,cAAc,aAAa,CAAC,OAAO,QAAQ;AACvD,OAAI,KAAK,EAAE,KAAK,EAAE,wCAAwC;IAC1D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Config } from '../config/schema.js';
|
|
2
|
+
import type { WorkContextSnapshot, WorkDiscoveryResult } from './types.js';
|
|
3
|
+
export declare function analyzeWorkContext(input: {
|
|
4
|
+
config: Config;
|
|
5
|
+
snapshot: WorkContextSnapshot;
|
|
6
|
+
signal?: AbortSignal;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
modelRef: string;
|
|
9
|
+
result: WorkDiscoveryResult;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function workDiscoveryResultMarkdown(result: WorkDiscoveryResult): string;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
2
|
+
import { init_providers, resolveModel } from "../providers/index.js";
|
|
3
|
+
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
//#region src/work-discovery/analyzer.ts
|
|
6
|
+
init_schema();
|
|
7
|
+
init_providers();
|
|
8
|
+
const MAX_MODEL_CONTEXT_CHARS = 12e4;
|
|
9
|
+
function extractText(content) {
|
|
10
|
+
if (typeof content === "string") return content;
|
|
11
|
+
if (!Array.isArray(content)) return "";
|
|
12
|
+
return content.map((part) => {
|
|
13
|
+
if (!part || typeof part !== "object") return "";
|
|
14
|
+
const value = part;
|
|
15
|
+
return value.type === "text" && typeof value.text === "string" ? value.text : "";
|
|
16
|
+
}).join("");
|
|
17
|
+
}
|
|
18
|
+
function parseJson(raw) {
|
|
19
|
+
const fenced = /```(?:json)?\s*([\s\S]*?)```/i.exec(raw)?.[1];
|
|
20
|
+
const start = raw.indexOf("{");
|
|
21
|
+
const end = raw.lastIndexOf("}");
|
|
22
|
+
const candidate = fenced ?? (start >= 0 && end > start ? raw.slice(start, end + 1) : raw);
|
|
23
|
+
try {
|
|
24
|
+
const value = JSON.parse(candidate);
|
|
25
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function strings(value, max) {
|
|
31
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.trim().length > 0).slice(0, max).map((item) => item.trim()) : [];
|
|
32
|
+
}
|
|
33
|
+
function validateSuggestion(value, allowedPaths) {
|
|
34
|
+
if (!value || typeof value !== "object") return null;
|
|
35
|
+
const item = value;
|
|
36
|
+
if (typeof item.title !== "string" || !item.title.trim()) return null;
|
|
37
|
+
if (typeof item.rationale !== "string" || !item.rationale.trim()) return null;
|
|
38
|
+
if (typeof item.actionPrompt !== "string" || !item.actionPrompt.trim()) return null;
|
|
39
|
+
const confidence = item.confidence === "high" || item.confidence === "medium" || item.confidence === "low" ? item.confidence : "medium";
|
|
40
|
+
const evidence = Array.isArray(item.evidence) ? item.evidence.flatMap((raw) => {
|
|
41
|
+
if (!raw || typeof raw !== "object") return [];
|
|
42
|
+
const candidate = raw;
|
|
43
|
+
if (typeof candidate.observation !== "string" || !candidate.observation.trim()) return [];
|
|
44
|
+
const path = typeof candidate.path === "string" && allowedPaths.has(candidate.path) ? candidate.path : void 0;
|
|
45
|
+
return [{
|
|
46
|
+
...path ? { path } : {},
|
|
47
|
+
observation: candidate.observation.trim().slice(0, 500)
|
|
48
|
+
}];
|
|
49
|
+
}).slice(0, 4) : [];
|
|
50
|
+
if (evidence.length === 0) return null;
|
|
51
|
+
return {
|
|
52
|
+
id: randomUUID(),
|
|
53
|
+
title: item.title.trim().slice(0, 120),
|
|
54
|
+
rationale: item.rationale.trim().slice(0, 600),
|
|
55
|
+
evidence,
|
|
56
|
+
actionPrompt: item.actionPrompt.trim().slice(0, 2e3),
|
|
57
|
+
confidence
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function snapshotForModel(snapshot) {
|
|
61
|
+
let remaining = MAX_MODEL_CONTEXT_CHARS;
|
|
62
|
+
return {
|
|
63
|
+
...snapshot,
|
|
64
|
+
structure: {
|
|
65
|
+
...snapshot.structure,
|
|
66
|
+
sampledPaths: snapshot.structure.sampledPaths.slice(0, 200),
|
|
67
|
+
metadataOnlyFiles: snapshot.structure.metadataOnlyFiles.slice(0, 200)
|
|
68
|
+
},
|
|
69
|
+
documents: snapshot.documents.flatMap((document) => {
|
|
70
|
+
if (remaining <= 0) return [];
|
|
71
|
+
const excerpt = document.excerpt.slice(0, remaining);
|
|
72
|
+
remaining -= excerpt.length;
|
|
73
|
+
return [{
|
|
74
|
+
...document,
|
|
75
|
+
excerpt,
|
|
76
|
+
truncated: document.truncated || excerpt.length < document.excerpt.length
|
|
77
|
+
}];
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function lowConfidenceResult(snapshot, question) {
|
|
82
|
+
return {
|
|
83
|
+
projectSummary: snapshot.root.projectKind === "coding" ? `${snapshot.root.displayName} appears to be a software project.` : `${snapshot.root.displayName} is a local work folder.`,
|
|
84
|
+
currentState: snapshot.git?.changedPaths.length ? `${snapshot.git.changedPaths.length} changed paths were detected, but there was not enough reliable context to recommend work.` : "There was not enough recent, readable context to determine the current objective.",
|
|
85
|
+
uncertainties: ["The current objective is not explicit in the selected files."],
|
|
86
|
+
suggestions: [],
|
|
87
|
+
lowConfidence: true,
|
|
88
|
+
contextQuestion: question ?? "What are you trying to move forward in this folder?"
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
async function analyzeWorkContext(input) {
|
|
92
|
+
const modelRef = getAgentDefaultModelRef(input.config);
|
|
93
|
+
if (!modelRef) throw new Error("No default model configured");
|
|
94
|
+
if (input.snapshot.documents.length === 0 && !input.snapshot.git?.changedPaths.length) return {
|
|
95
|
+
modelRef,
|
|
96
|
+
result: lowConfidenceResult(input.snapshot)
|
|
97
|
+
};
|
|
98
|
+
const model = resolveModel(modelRef);
|
|
99
|
+
const compactSnapshot = snapshotForModel(input.snapshot);
|
|
100
|
+
const parsed = parseJson(extractText((await completeWithResolvedCredentials(model, { messages: [{
|
|
101
|
+
role: "user",
|
|
102
|
+
content: [
|
|
103
|
+
"You help a user resume real work in one explicitly selected local folder.",
|
|
104
|
+
"Analyze only the supplied bounded snapshot. Never claim that you ran commands, tests, or inspected anything absent from it.",
|
|
105
|
+
"Return only one JSON object with projectSummary, currentState, uncertainties, suggestions, lowConfidence, and contextQuestion.",
|
|
106
|
+
"For a normal result, suggestions must contain exactly 3 materially different next steps.",
|
|
107
|
+
"Each suggestion must include title, rationale, evidence, actionPrompt, and confidence (high, medium, or low).",
|
|
108
|
+
"Each evidence item contains an optional exact relative path from the snapshot and one concrete observation.",
|
|
109
|
+
"actionPrompt asks the assistant to investigate or continue the step; it does not silently authorize file changes.",
|
|
110
|
+
"If the current objective is unclear or fewer than three credible suggestions exist, set lowConfidence=true, return suggestions=[], and ask one concise contextQuestion.",
|
|
111
|
+
"Use Simplified Chinese for every user-facing string when the visible snapshot documents are mainly Chinese; otherwise use English.",
|
|
112
|
+
"",
|
|
113
|
+
JSON.stringify(compactSnapshot)
|
|
114
|
+
].join("\n"),
|
|
115
|
+
timestamp: Date.now()
|
|
116
|
+
}] }, {
|
|
117
|
+
maxTokens: 2500,
|
|
118
|
+
temperature: .1,
|
|
119
|
+
signal: input.signal
|
|
120
|
+
})).content));
|
|
121
|
+
if (!parsed) throw new Error("Analysis did not return valid JSON");
|
|
122
|
+
if (parsed.lowConfidence === true) return {
|
|
123
|
+
modelRef,
|
|
124
|
+
result: lowConfidenceResult(input.snapshot, typeof parsed.contextQuestion === "string" ? parsed.contextQuestion.trim().slice(0, 500) : void 0)
|
|
125
|
+
};
|
|
126
|
+
const allowedPaths = new Set([
|
|
127
|
+
...input.snapshot.structure.sampledPaths,
|
|
128
|
+
...input.snapshot.documents.map((document) => document.relativePath),
|
|
129
|
+
...input.snapshot.git?.changedPaths ?? []
|
|
130
|
+
]);
|
|
131
|
+
const suggestions = Array.isArray(parsed.suggestions) ? parsed.suggestions.map((value) => validateSuggestion(value, allowedPaths)).filter((value) => Boolean(value)) : [];
|
|
132
|
+
if (suggestions.length !== 3) return {
|
|
133
|
+
modelRef,
|
|
134
|
+
result: lowConfidenceResult(input.snapshot)
|
|
135
|
+
};
|
|
136
|
+
const projectSummary = typeof parsed.projectSummary === "string" ? parsed.projectSummary.trim() : "";
|
|
137
|
+
const currentState = typeof parsed.currentState === "string" ? parsed.currentState.trim() : "";
|
|
138
|
+
if (!projectSummary || !currentState) throw new Error("Analysis result is missing its summary");
|
|
139
|
+
return {
|
|
140
|
+
modelRef,
|
|
141
|
+
result: {
|
|
142
|
+
projectSummary: projectSummary.slice(0, 1200),
|
|
143
|
+
currentState: currentState.slice(0, 1200),
|
|
144
|
+
uncertainties: strings(parsed.uncertainties, 6).map((value) => value.slice(0, 500)),
|
|
145
|
+
suggestions
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function workDiscoveryResultMarkdown(result) {
|
|
150
|
+
const lines = [
|
|
151
|
+
`## What I found`,
|
|
152
|
+
"",
|
|
153
|
+
result.projectSummary,
|
|
154
|
+
"",
|
|
155
|
+
result.currentState
|
|
156
|
+
];
|
|
157
|
+
if (result.lowConfidence) {
|
|
158
|
+
if (result.contextQuestion) lines.push("", `**${result.contextQuestion}**`);
|
|
159
|
+
return lines.join("\n");
|
|
160
|
+
}
|
|
161
|
+
lines.push("", "## Suggested next steps");
|
|
162
|
+
for (const [index, suggestion] of result.suggestions.entries()) {
|
|
163
|
+
lines.push("", `### ${index + 1}. ${suggestion.title}`, "", suggestion.rationale, "");
|
|
164
|
+
for (const evidence of suggestion.evidence) lines.push(`- ${evidence.path ? `\`${evidence.path}\`: ` : ""}${evidence.observation}`);
|
|
165
|
+
}
|
|
166
|
+
return lines.join("\n");
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
export { analyzeWorkContext, workDiscoveryResultMarkdown };
|
|
170
|
+
|
|
171
|
+
//# sourceMappingURL=analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.js","names":[],"sources":["../../../src/work-discovery/analyzer.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\n\nimport type { UserMessage } from '@earendil-works/pi-ai/compat';\n\nimport type { Config } from '../config/schema.js';\nimport { getAgentDefaultModelRef } from '../config/schema.js';\nimport { completeWithResolvedCredentials } from '../providers/model-call.js';\nimport { resolveModel } from '../providers/index.js';\n\nimport type {\n WorkContextSnapshot,\n WorkDiscoveryResult,\n WorkDiscoverySuggestion,\n} from './types.js';\n\nconst MAX_MODEL_CONTEXT_CHARS = 120_000;\n\nfunction extractText(content: unknown): string {\n if (typeof content === 'string') return content;\n if (!Array.isArray(content)) return '';\n return content.map((part) => {\n if (!part || typeof part !== 'object') return '';\n const value = part as { type?: unknown; text?: unknown };\n return value.type === 'text' && typeof value.text === 'string' ? value.text : '';\n }).join('');\n}\n\nfunction parseJson(raw: string): Record<string, unknown> | null {\n const fenced = /```(?:json)?\\s*([\\s\\S]*?)```/i.exec(raw)?.[1];\n const start = raw.indexOf('{');\n const end = raw.lastIndexOf('}');\n const candidate = fenced ?? (start >= 0 && end > start ? raw.slice(start, end + 1) : raw);\n try {\n const value = JSON.parse(candidate) as unknown;\n return value && typeof value === 'object' && !Array.isArray(value)\n ? value as Record<string, unknown>\n : null;\n } catch {\n return null;\n }\n}\n\nfunction strings(value: unknown, max: number): string[] {\n return Array.isArray(value)\n ? value.filter((item): item is string => typeof item === 'string' && item.trim().length > 0)\n .slice(0, max)\n .map((item) => item.trim())\n : [];\n}\n\nfunction validateSuggestion(value: unknown, allowedPaths: Set<string>): WorkDiscoverySuggestion | null {\n if (!value || typeof value !== 'object') return null;\n const item = value as Record<string, unknown>;\n if (typeof item.title !== 'string' || !item.title.trim()) return null;\n if (typeof item.rationale !== 'string' || !item.rationale.trim()) return null;\n if (typeof item.actionPrompt !== 'string' || !item.actionPrompt.trim()) return null;\n const confidence = item.confidence === 'high' || item.confidence === 'medium' || item.confidence === 'low'\n ? item.confidence\n : 'medium';\n const evidence = Array.isArray(item.evidence)\n ? item.evidence.flatMap((raw) => {\n if (!raw || typeof raw !== 'object') return [];\n const candidate = raw as Record<string, unknown>;\n if (typeof candidate.observation !== 'string' || !candidate.observation.trim()) return [];\n const path = typeof candidate.path === 'string' && allowedPaths.has(candidate.path)\n ? candidate.path\n : undefined;\n return [{ ...(path ? { path } : {}), observation: candidate.observation.trim().slice(0, 500) }];\n }).slice(0, 4)\n : [];\n if (evidence.length === 0) return null;\n return {\n id: randomUUID(),\n title: item.title.trim().slice(0, 120),\n rationale: item.rationale.trim().slice(0, 600),\n evidence,\n actionPrompt: item.actionPrompt.trim().slice(0, 2_000),\n confidence,\n };\n}\n\nfunction snapshotForModel(snapshot: WorkContextSnapshot): WorkContextSnapshot {\n let remaining = MAX_MODEL_CONTEXT_CHARS;\n return {\n ...snapshot,\n structure: {\n ...snapshot.structure,\n sampledPaths: snapshot.structure.sampledPaths.slice(0, 200),\n metadataOnlyFiles: snapshot.structure.metadataOnlyFiles.slice(0, 200),\n },\n documents: snapshot.documents.flatMap((document) => {\n if (remaining <= 0) return [];\n const excerpt = document.excerpt.slice(0, remaining);\n remaining -= excerpt.length;\n return [{ ...document, excerpt, truncated: document.truncated || excerpt.length < document.excerpt.length }];\n }),\n };\n}\n\nfunction lowConfidenceResult(snapshot: WorkContextSnapshot, question?: string): WorkDiscoveryResult {\n return {\n projectSummary: snapshot.root.projectKind === 'coding'\n ? `${snapshot.root.displayName} appears to be a software project.`\n : `${snapshot.root.displayName} is a local work folder.`,\n currentState: snapshot.git?.changedPaths.length\n ? `${snapshot.git.changedPaths.length} changed paths were detected, but there was not enough reliable context to recommend work.`\n : 'There was not enough recent, readable context to determine the current objective.',\n uncertainties: ['The current objective is not explicit in the selected files.'],\n suggestions: [],\n lowConfidence: true,\n contextQuestion: question ?? 'What are you trying to move forward in this folder?',\n };\n}\n\nexport async function analyzeWorkContext(input: {\n config: Config;\n snapshot: WorkContextSnapshot;\n signal?: AbortSignal;\n}): Promise<{ modelRef: string; result: WorkDiscoveryResult }> {\n const modelRef = getAgentDefaultModelRef(input.config);\n if (!modelRef) throw new Error('No default model configured');\n if (input.snapshot.documents.length === 0 && !input.snapshot.git?.changedPaths.length) {\n return { modelRef, result: lowConfidenceResult(input.snapshot) };\n }\n\n const model = resolveModel(modelRef);\n const compactSnapshot = snapshotForModel(input.snapshot);\n const prompt = [\n 'You help a user resume real work in one explicitly selected local folder.',\n 'Analyze only the supplied bounded snapshot. Never claim that you ran commands, tests, or inspected anything absent from it.',\n 'Return only one JSON object with projectSummary, currentState, uncertainties, suggestions, lowConfidence, and contextQuestion.',\n 'For a normal result, suggestions must contain exactly 3 materially different next steps.',\n 'Each suggestion must include title, rationale, evidence, actionPrompt, and confidence (high, medium, or low).',\n 'Each evidence item contains an optional exact relative path from the snapshot and one concrete observation.',\n 'actionPrompt asks the assistant to investigate or continue the step; it does not silently authorize file changes.',\n 'If the current objective is unclear or fewer than three credible suggestions exist, set lowConfidence=true, return suggestions=[], and ask one concise contextQuestion.',\n 'Use Simplified Chinese for every user-facing string when the visible snapshot documents are mainly Chinese; otherwise use English.',\n '',\n JSON.stringify(compactSnapshot),\n ].join('\\n');\n const message: UserMessage = { role: 'user', content: prompt, timestamp: Date.now() };\n const response = await completeWithResolvedCredentials(model, { messages: [message] }, {\n maxTokens: 2_500,\n temperature: 0.1,\n signal: input.signal,\n });\n const parsed = parseJson(extractText(response.content));\n if (!parsed) throw new Error('Analysis did not return valid JSON');\n\n const lowConfidence = parsed.lowConfidence === true;\n if (lowConfidence) {\n return {\n modelRef,\n result: lowConfidenceResult(\n input.snapshot,\n typeof parsed.contextQuestion === 'string' ? parsed.contextQuestion.trim().slice(0, 500) : undefined,\n ),\n };\n }\n\n const allowedPaths = new Set([\n ...input.snapshot.structure.sampledPaths,\n ...input.snapshot.documents.map((document) => document.relativePath),\n ...(input.snapshot.git?.changedPaths ?? []),\n ]);\n const suggestions = Array.isArray(parsed.suggestions)\n ? parsed.suggestions.map((value) => validateSuggestion(value, allowedPaths)).filter((value): value is WorkDiscoverySuggestion => Boolean(value))\n : [];\n if (suggestions.length !== 3) return { modelRef, result: lowConfidenceResult(input.snapshot) };\n const projectSummary = typeof parsed.projectSummary === 'string' ? parsed.projectSummary.trim() : '';\n const currentState = typeof parsed.currentState === 'string' ? parsed.currentState.trim() : '';\n if (!projectSummary || !currentState) throw new Error('Analysis result is missing its summary');\n return {\n modelRef,\n result: {\n projectSummary: projectSummary.slice(0, 1_200),\n currentState: currentState.slice(0, 1_200),\n uncertainties: strings(parsed.uncertainties, 6).map((value) => value.slice(0, 500)),\n suggestions,\n },\n };\n}\n\nexport function workDiscoveryResultMarkdown(result: WorkDiscoveryResult): string {\n const lines = [`## What I found`, '', result.projectSummary, '', result.currentState];\n if (result.lowConfidence) {\n if (result.contextQuestion) lines.push('', `**${result.contextQuestion}**`);\n return lines.join('\\n');\n }\n lines.push('', '## Suggested next steps');\n for (const [index, suggestion] of result.suggestions.entries()) {\n lines.push('', `### ${index + 1}. ${suggestion.title}`, '', suggestion.rationale, '');\n for (const evidence of suggestion.evidence) {\n lines.push(`- ${evidence.path ? `\\`${evidence.path}\\`: ` : ''}${evidence.observation}`);\n }\n }\n return lines.join('\\n');\n}\n"],"mappings":";;;;;aAK8D;gBAET;AAQrD,MAAM,0BAA0B;AAEhC,SAAS,YAAY,SAA0B;AAC7C,KAAI,OAAO,YAAY,SAAU,QAAO;AACxC,KAAI,CAAC,MAAM,QAAQ,QAAQ,CAAE,QAAO;AACpC,QAAO,QAAQ,KAAK,SAAS;AAC3B,MAAI,CAAC,QAAQ,OAAO,SAAS,SAAU,QAAO;EAC9C,MAAM,QAAQ;AACd,SAAO,MAAM,SAAS,UAAU,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO;GAC9E,CAAC,KAAK,GAAG;;AAGb,SAAS,UAAU,KAA6C;CAC9D,MAAM,SAAS,gCAAgC,KAAK,IAAI,GAAG;CAC3D,MAAM,QAAQ,IAAI,QAAQ,IAAI;CAC9B,MAAM,MAAM,IAAI,YAAY,IAAI;CAChC,MAAM,YAAY,WAAW,SAAS,KAAK,MAAM,QAAQ,IAAI,MAAM,OAAO,MAAM,EAAE,GAAG;AACrF,KAAI;EACF,MAAM,QAAQ,KAAK,MAAM,UAAU;AACnC,SAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM,GAC9D,QACA;SACE;AACN,SAAO;;;AAIX,SAAS,QAAQ,OAAgB,KAAuB;AACtD,QAAO,MAAM,QAAQ,MAAM,GACvB,MAAM,QAAQ,SAAyB,OAAO,SAAS,YAAY,KAAK,MAAM,CAAC,SAAS,EAAE,CACzF,MAAM,GAAG,IAAI,CACb,KAAK,SAAS,KAAK,MAAM,CAAC,GAC3B,EAAE;;AAGR,SAAS,mBAAmB,OAAgB,cAA2D;AACrG,KAAI,CAAC,SAAS,OAAO,UAAU,SAAU,QAAO;CAChD,MAAM,OAAO;AACb,KAAI,OAAO,KAAK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AAM,KAAK,IAAI,0BAA0B;AACzC,MAAK,MAAM,CAAC,OAAO,eAAe,OAAO,YAAY,SAAS,EAAE;AAC9D,QAAM,KAAK,IAAI,OAAO,QAAQ,EAAE,IAAI,WAAW,SAAS,IAAI,WAAW,WAAW,GAAG;AACrF,OAAK,MAAM,YAAY,WAAW,SAChC,OAAM,KAAK,KAAK,SAAS,OAAO,KAAK,SAAS,KAAK,QAAQ,KAAK,SAAS,cAAc;;AAG3F,QAAO,MAAM,KAAK,KAAK"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { WORK_DISCOVERY_SCAN_POLICY_VERSION, canonicalWorkDiscoveryRoot, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, summarizeWorkContextSnapshot } from "./probe.js";
|
|
2
|
+
import { analyzeWorkContext, workDiscoveryResultMarkdown } from "./analyzer.js";
|
|
3
|
+
import { createWorkDiscoveryRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, setWorkDiscoveryOnboardingState, updateWorkDiscoveryRun } from "./repository.js";
|
|
4
|
+
import { WorkDiscoveryService } from "./service.js";
|
|
5
|
+
export { WORK_DISCOVERY_SCAN_POLICY_VERSION, WorkDiscoveryService, analyzeWorkContext, canonicalWorkDiscoveryRoot, createWorkDiscoveryRun, getWorkDiscoveryOnboardingState, getWorkDiscoveryRun, getWorkDiscoveryRunByIdempotencyKey, previewWorkDiscoveryRoot, probeWorkDiscoveryRoot, setWorkDiscoveryOnboardingState, summarizeWorkContextSnapshot, updateWorkDiscoveryRun, workDiscoveryResultMarkdown };
|