@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
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=20260713-1" />
|
|
12
12
|
<link rel="manifest" href="/site.webmanifest?v=20260713-1" />
|
|
13
13
|
<title>XOPC — Turn goals into loops. Keep what matters moving.</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-CYT5DOzr.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-aKtaBQYM.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-zJ_50EbN.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-BOUWij0V.js">
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-DPHK1VkS.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/check-DUBLcKHA.js">
|
|
25
25
|
<link rel="modulepreload" crossorigin href="/assets/middleware-Pd0e8Igk.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/messages-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/locale-store-
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/messages-B4XqB8I6.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/locale-store-deR2zRaE.js">
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/cn-JdwAhgNB.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/schemas-zIBW3wiV.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/product-delivery-tRr-7IxY.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/config-reload-event-Bjh2zoKp.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/copy-to-clipboard-HOJ79TWv.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-
|
|
34
|
-
<link rel="modulepreload" crossorigin href="/assets/activity-store-
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/theme-store-
|
|
36
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/gateway-startup-retry-EO9mKvzE.js">
|
|
34
|
+
<link rel="modulepreload" crossorigin href="/assets/activity-store-DstnJCS5.js">
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/theme-store-DnBOcGXi.js">
|
|
36
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D6e3tPL-.css">
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
|
39
39
|
<div id="root"></div>
|
package/dist/package.js
CHANGED
|
@@ -62,42 +62,6 @@ const TOOL_ACTIVITY_CATALOG = {
|
|
|
62
62
|
source: "internet",
|
|
63
63
|
sensitivity: "normal"
|
|
64
64
|
},
|
|
65
|
-
search_graph: {
|
|
66
|
-
category: "code",
|
|
67
|
-
action: "search",
|
|
68
|
-
source: "workspace",
|
|
69
|
-
sensitivity: "normal"
|
|
70
|
-
},
|
|
71
|
-
search_code: {
|
|
72
|
-
category: "code",
|
|
73
|
-
action: "search",
|
|
74
|
-
source: "workspace",
|
|
75
|
-
sensitivity: "normal"
|
|
76
|
-
},
|
|
77
|
-
query_graph: {
|
|
78
|
-
category: "code",
|
|
79
|
-
action: "search",
|
|
80
|
-
source: "workspace",
|
|
81
|
-
sensitivity: "normal"
|
|
82
|
-
},
|
|
83
|
-
trace_path: {
|
|
84
|
-
category: "code",
|
|
85
|
-
action: "search",
|
|
86
|
-
source: "workspace",
|
|
87
|
-
sensitivity: "normal"
|
|
88
|
-
},
|
|
89
|
-
get_architecture: {
|
|
90
|
-
category: "code",
|
|
91
|
-
action: "search",
|
|
92
|
-
source: "workspace",
|
|
93
|
-
sensitivity: "normal"
|
|
94
|
-
},
|
|
95
|
-
get_code_snippet: {
|
|
96
|
-
category: "file",
|
|
97
|
-
action: "read",
|
|
98
|
-
source: "workspace",
|
|
99
|
-
sensitivity: "normal"
|
|
100
|
-
},
|
|
101
65
|
grep: {
|
|
102
66
|
category: "code",
|
|
103
67
|
action: "search",
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { parseServerRealtimeMessage } from "../../realtime-protocol/src/index.js";
|
|
2
2
|
//#region packages/realtime-client/src/index.ts
|
|
3
|
-
function clientMessage(kind, payload) {
|
|
4
|
-
return {
|
|
5
|
-
protocolVersion: 1,
|
|
6
|
-
messageId: crypto.randomUUID(),
|
|
7
|
-
kind,
|
|
8
|
-
sentAt: Date.now(),
|
|
9
|
-
payload
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
3
|
function frameText(data) {
|
|
13
4
|
if (typeof data === "string") return data;
|
|
14
5
|
if (data instanceof ArrayBuffer) return new TextDecoder().decode(data);
|
|
@@ -24,10 +15,13 @@ var RealtimeClient = class {
|
|
|
24
15
|
socket;
|
|
25
16
|
reconnectTimer;
|
|
26
17
|
heartbeatTimer;
|
|
18
|
+
connectionTimer;
|
|
19
|
+
ticketAbort;
|
|
27
20
|
generation = 0;
|
|
28
21
|
reconnectAttempts = 0;
|
|
29
22
|
shouldReconnect = false;
|
|
30
23
|
ready = false;
|
|
24
|
+
lastServerMessageAt = 0;
|
|
31
25
|
endpointBinding;
|
|
32
26
|
constructor(options) {
|
|
33
27
|
this.options = options;
|
|
@@ -60,21 +54,19 @@ var RealtimeClient = class {
|
|
|
60
54
|
}
|
|
61
55
|
subscribe(topic, afterSeq) {
|
|
62
56
|
this.desiredSubscriptions.set(topic, afterSeq);
|
|
63
|
-
if (this.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.desiredSubscriptions.set(topic, void 0);
|
|
69
|
-
}
|
|
57
|
+
if (afterSeq !== void 0) this.cursors.set(topic, afterSeq);
|
|
58
|
+
if (this.ready) this.sendSubscriptions([{
|
|
59
|
+
topic,
|
|
60
|
+
afterSeq: this.cursors.get(topic) ?? afterSeq
|
|
61
|
+
}]);
|
|
70
62
|
}
|
|
71
63
|
unsubscribe(topic) {
|
|
72
64
|
this.desiredSubscriptions.delete(topic);
|
|
73
|
-
if (this.ready) this.send(clientMessage("realtime.unsubscribe", { topics: [topic] }));
|
|
65
|
+
if (this.ready) this.send(this.clientMessage("realtime.unsubscribe", { topics: [topic] }));
|
|
74
66
|
}
|
|
75
67
|
sendEndpointMessage(message) {
|
|
76
68
|
if (!this.ready) throw new Error("Realtime connection is not ready");
|
|
77
|
-
this.send(clientMessage("endpoint.message", message));
|
|
69
|
+
this.send(this.clientMessage("endpoint.message", message));
|
|
78
70
|
}
|
|
79
71
|
setEndpoint(binding) {
|
|
80
72
|
this.endpointBinding = binding;
|
|
@@ -89,20 +81,47 @@ var RealtimeClient = class {
|
|
|
89
81
|
}
|
|
90
82
|
async open(reconnecting) {
|
|
91
83
|
const generation = ++this.generation;
|
|
84
|
+
const timeoutMs = this.options.connectionTimeoutMs ?? 15e3;
|
|
85
|
+
const ticketAbort = new AbortController();
|
|
86
|
+
this.ticketAbort?.abort();
|
|
87
|
+
this.ticketAbort = ticketAbort;
|
|
88
|
+
let socket;
|
|
89
|
+
let closed = false;
|
|
90
|
+
let messageQueue;
|
|
91
|
+
const failAttempt = (error) => {
|
|
92
|
+
if (closed || generation !== this.generation) return;
|
|
93
|
+
closed = true;
|
|
94
|
+
this.clearConnectionTimer();
|
|
95
|
+
ticketAbort.abort();
|
|
96
|
+
if (this.ticketAbort === ticketAbort) this.ticketAbort = void 0;
|
|
97
|
+
this.ready = false;
|
|
98
|
+
this.endpointBinding?.onDisconnected?.();
|
|
99
|
+
this.clearHeartbeat();
|
|
100
|
+
if (this.socket === socket) this.socket = void 0;
|
|
101
|
+
if (socket) {
|
|
102
|
+
socket.onopen = null;
|
|
103
|
+
socket.onmessage = null;
|
|
104
|
+
socket.onerror = null;
|
|
105
|
+
socket.onclose = null;
|
|
106
|
+
socket.close(4e3, error.slice(0, 120));
|
|
107
|
+
}
|
|
108
|
+
if (this.shouldReconnect) this.scheduleReconnect(error);
|
|
109
|
+
else this.options.onStateChange?.("disconnected");
|
|
110
|
+
};
|
|
111
|
+
this.connectionTimer = setTimeout(() => failAttempt("Realtime connection timed out"), timeoutMs);
|
|
92
112
|
this.options.onStateChange?.(reconnecting ? "reconnecting" : "connecting");
|
|
93
113
|
try {
|
|
94
|
-
const [ticket, endpoint] = await Promise.all([this.options.issueTicket(), this.endpointBinding?.createHello()]);
|
|
95
|
-
if (!this.shouldReconnect || generation !== this.generation) return;
|
|
96
|
-
|
|
114
|
+
const [ticket, endpoint] = await Promise.all([this.options.issueTicket(ticketAbort.signal), this.endpointBinding?.createHello()]);
|
|
115
|
+
if (closed || !this.shouldReconnect || generation !== this.generation) return;
|
|
116
|
+
socket = this.options.createWebSocket(this.options.getWebSocketUrl());
|
|
97
117
|
this.socket = socket;
|
|
98
118
|
socket.onopen = () => {
|
|
99
119
|
if (generation !== this.generation) return;
|
|
100
120
|
const subscriptions = [...this.desiredSubscriptions].map(([topic, afterSeq]) => ({
|
|
101
121
|
topic,
|
|
102
|
-
afterSeq:
|
|
122
|
+
afterSeq: this.cursors.get(topic) ?? afterSeq
|
|
103
123
|
}));
|
|
104
|
-
|
|
105
|
-
this.send(clientMessage("realtime.hello", {
|
|
124
|
+
this.send(this.clientMessage("realtime.hello", {
|
|
106
125
|
ticket,
|
|
107
126
|
clientId: this.options.clientId,
|
|
108
127
|
clientKind: this.options.clientKind,
|
|
@@ -112,46 +131,68 @@ var RealtimeClient = class {
|
|
|
112
131
|
};
|
|
113
132
|
socket.onmessage = (event) => {
|
|
114
133
|
if (generation !== this.generation) return;
|
|
115
|
-
|
|
116
|
-
this.
|
|
117
|
-
|
|
118
|
-
|
|
134
|
+
const process = () => {
|
|
135
|
+
if (closed || generation !== this.generation) return;
|
|
136
|
+
return this.handleServerMessage(frameText(event.data));
|
|
137
|
+
};
|
|
138
|
+
if (!messageQueue) {
|
|
139
|
+
try {
|
|
140
|
+
const pending = process();
|
|
141
|
+
if (!pending) return;
|
|
142
|
+
const current = pending.catch((error) => failAttempt(error instanceof Error ? error.message : "Invalid realtime server message")).then(() => void 0);
|
|
143
|
+
messageQueue = current;
|
|
144
|
+
current.finally(() => {
|
|
145
|
+
if (messageQueue === current) messageQueue = void 0;
|
|
146
|
+
});
|
|
147
|
+
} catch (error) {
|
|
148
|
+
failAttempt(error instanceof Error ? error.message : "Invalid realtime server message");
|
|
149
|
+
}
|
|
150
|
+
return;
|
|
119
151
|
}
|
|
152
|
+
const current = messageQueue.then(process).catch((error) => failAttempt(error instanceof Error ? error.message : "Invalid realtime server message")).then(() => void 0);
|
|
153
|
+
messageQueue = current;
|
|
154
|
+
current.finally(() => {
|
|
155
|
+
if (messageQueue === current) messageQueue = void 0;
|
|
156
|
+
});
|
|
120
157
|
};
|
|
121
158
|
socket.onerror = () => {
|
|
122
|
-
|
|
159
|
+
failAttempt("Realtime WebSocket failed");
|
|
123
160
|
};
|
|
124
161
|
socket.onclose = (event) => {
|
|
125
|
-
|
|
126
|
-
this.ready = false;
|
|
127
|
-
this.endpointBinding?.onDisconnected?.();
|
|
128
|
-
this.socket = void 0;
|
|
129
|
-
this.clearHeartbeat();
|
|
130
|
-
if (this.shouldReconnect) this.scheduleReconnect(event.reason || `WebSocket closed (${event.code ?? 0})`);
|
|
131
|
-
else this.options.onStateChange?.("disconnected");
|
|
162
|
+
failAttempt(event.reason || `WebSocket closed (${event.code ?? 0})`);
|
|
132
163
|
};
|
|
133
164
|
} catch (error) {
|
|
134
|
-
|
|
135
|
-
this.scheduleReconnect(error instanceof Error ? error.message : "Realtime connection failed");
|
|
165
|
+
failAttempt(error instanceof Error ? error.message : "Realtime connection failed");
|
|
136
166
|
}
|
|
137
167
|
}
|
|
138
168
|
handleServerMessage(text) {
|
|
139
169
|
const message = parseServerRealtimeMessage(JSON.parse(text));
|
|
170
|
+
this.lastServerMessageAt = Date.now();
|
|
140
171
|
if (message.kind === "realtime.ready") {
|
|
141
172
|
this.ready = true;
|
|
142
173
|
this.reconnectAttempts = 0;
|
|
174
|
+
this.clearConnectionTimer();
|
|
175
|
+
this.ticketAbort = void 0;
|
|
143
176
|
this.options.onStateChange?.("connected");
|
|
144
177
|
if (message.payload.endpoint) this.endpointBinding?.onReady(message.payload.endpoint);
|
|
145
178
|
this.clearHeartbeat();
|
|
146
179
|
this.heartbeatTimer = setInterval(() => {
|
|
147
|
-
if (this.ready)
|
|
180
|
+
if (!this.ready) return;
|
|
181
|
+
if (Date.now() - this.lastServerMessageAt >= message.payload.heartbeatTimeoutMs) {
|
|
182
|
+
this.reconnect();
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.send(this.clientMessage("realtime.ping", {}));
|
|
148
186
|
}, message.payload.heartbeatIntervalMs);
|
|
149
187
|
} else if (message.kind === "realtime.event") {
|
|
150
|
-
this.cursors.
|
|
188
|
+
const cursor = this.cursors.get(message.payload.topic);
|
|
189
|
+
if (cursor !== void 0 && message.payload.seq <= cursor) return;
|
|
151
190
|
this.options.onEvent?.(message.payload);
|
|
152
|
-
|
|
191
|
+
this.cursors.set(message.payload.topic, message.payload.seq);
|
|
192
|
+
} else if (message.kind === "realtime.subscribed") this.cursors.set(message.payload.topic, message.payload.cursor);
|
|
193
|
+
else if (message.kind === "realtime.gap") {
|
|
153
194
|
this.cursors.set(message.payload.topic, message.payload.earliestSeq - 1);
|
|
154
|
-
this.options.onGap?.(message.payload);
|
|
195
|
+
return this.options.onGap?.(message.payload);
|
|
155
196
|
} else if (message.kind === "realtime.error") this.options.onStateChange?.("error", message.payload.message);
|
|
156
197
|
else if (message.kind === "endpoint.message") {
|
|
157
198
|
this.endpointBinding?.onMessage(message.payload);
|
|
@@ -159,7 +200,18 @@ var RealtimeClient = class {
|
|
|
159
200
|
}
|
|
160
201
|
}
|
|
161
202
|
sendSubscriptions(subscriptions) {
|
|
162
|
-
this.send(clientMessage("realtime.subscribe", { subscriptions }));
|
|
203
|
+
this.send(this.clientMessage("realtime.subscribe", { subscriptions }));
|
|
204
|
+
}
|
|
205
|
+
clientMessage(kind, payload) {
|
|
206
|
+
const messageId = this.options.createMessageId?.() ?? globalThis.crypto?.randomUUID?.();
|
|
207
|
+
if (!messageId) throw new Error("RealtimeClient requires createMessageId when crypto.randomUUID is unavailable");
|
|
208
|
+
return {
|
|
209
|
+
protocolVersion: 1,
|
|
210
|
+
messageId,
|
|
211
|
+
kind,
|
|
212
|
+
sentAt: Date.now(),
|
|
213
|
+
payload
|
|
214
|
+
};
|
|
163
215
|
}
|
|
164
216
|
send(message) {
|
|
165
217
|
if (!this.socket || this.socket.readyState !== 1) return;
|
|
@@ -175,16 +227,14 @@ var RealtimeClient = class {
|
|
|
175
227
|
return;
|
|
176
228
|
}
|
|
177
229
|
this.options.onStateChange?.("reconnecting", error);
|
|
178
|
-
const
|
|
230
|
+
const cap = Math.min(3e4, 1e3 * 2 ** Math.min(this.reconnectAttempts - 1, 5));
|
|
231
|
+
const delay = Math.round(cap * (.5 + Math.random() * .5));
|
|
232
|
+
if (this.reconnectTimer) clearTimeout(this.reconnectTimer);
|
|
179
233
|
this.reconnectTimer = setTimeout(() => {
|
|
180
234
|
this.reconnectTimer = void 0;
|
|
181
235
|
this.open(true);
|
|
182
236
|
}, delay);
|
|
183
237
|
}
|
|
184
|
-
fail(message) {
|
|
185
|
-
this.options.onStateChange?.("error", message);
|
|
186
|
-
this.socket?.close(4400, "Invalid server message");
|
|
187
|
-
}
|
|
188
238
|
clearHeartbeat() {
|
|
189
239
|
if (this.heartbeatTimer) clearInterval(this.heartbeatTimer);
|
|
190
240
|
this.heartbeatTimer = void 0;
|
|
@@ -192,8 +242,15 @@ var RealtimeClient = class {
|
|
|
192
242
|
clearTimers() {
|
|
193
243
|
if (this.reconnectTimer) clearTimeout(this.reconnectTimer);
|
|
194
244
|
this.reconnectTimer = void 0;
|
|
245
|
+
this.clearConnectionTimer();
|
|
246
|
+
this.ticketAbort?.abort();
|
|
247
|
+
this.ticketAbort = void 0;
|
|
195
248
|
this.clearHeartbeat();
|
|
196
249
|
}
|
|
250
|
+
clearConnectionTimer() {
|
|
251
|
+
if (this.connectionTimer) clearTimeout(this.connectionTimer);
|
|
252
|
+
this.connectionTimer = void 0;
|
|
253
|
+
}
|
|
197
254
|
};
|
|
198
255
|
//#endregion
|
|
199
256
|
export { RealtimeClient };
|
|
@@ -57,10 +57,15 @@ const serverRealtimeMessageSchema = z.discriminatedUnion("kind", [
|
|
|
57
57
|
}).optional()
|
|
58
58
|
})),
|
|
59
59
|
envelope("realtime.event", realtimeEventPayloadSchema),
|
|
60
|
+
envelope("realtime.subscribed", z.strictObject({
|
|
61
|
+
topic: realtimeTopicSchema,
|
|
62
|
+
cursor: z.number().int().nonnegative()
|
|
63
|
+
})),
|
|
60
64
|
envelope("realtime.gap", z.strictObject({
|
|
61
65
|
topic: realtimeTopicSchema,
|
|
62
66
|
requestedSeq: z.number().int().nonnegative(),
|
|
63
|
-
earliestSeq: sequenceSchema
|
|
67
|
+
earliestSeq: sequenceSchema,
|
|
68
|
+
recoverable: z.boolean()
|
|
64
69
|
})),
|
|
65
70
|
envelope("realtime.pong", z.strictObject({})),
|
|
66
71
|
envelope("realtime.error", z.strictObject({
|
|
@@ -191,7 +191,6 @@ export declare class AgentManager implements AgentInstanceGateway {
|
|
|
191
191
|
private buildToolsFactoryDeps;
|
|
192
192
|
getMemoryManager(): MemoryManager;
|
|
193
193
|
getMemoryManagerForSession(sessionKey: string): MemoryManager;
|
|
194
|
-
markCodeIntelligenceDirty(sessionKey: string, paths: readonly string[]): void;
|
|
195
194
|
/** Build the bounded, policy-filtered context used for this model turn. */
|
|
196
195
|
prepareUserTurnContext(userMessage: AgentMessage, sessionKey: string, turnId: string): Promise<UserContextPlan>;
|
|
197
196
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
+
import { getSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
4
5
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
5
6
|
import "../storage/sqlite/index.js";
|
|
6
7
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
@@ -8,7 +9,7 @@ import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
|
8
9
|
import { expandWorkspacePathString, init_workspace_path } from "../config/workspace-path.js";
|
|
9
10
|
import { init_agent_scope, resolveAgentProfileDir } from "./agent-scope.js";
|
|
10
11
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
11
|
-
import { init_paths, resolveBundledSkillsDir
|
|
12
|
+
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
12
13
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../auth/sync-provider-auth.js";
|
|
13
14
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
14
15
|
import { getApiKeySync, getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
@@ -126,6 +127,8 @@ var AgentManager = class {
|
|
|
126
127
|
getConfig: () => this.config.config,
|
|
127
128
|
isEnabledForSession: (sessionKey) => this.isUserContextEnabledForSession(sessionKey),
|
|
128
129
|
getAgentIdForSession: (sk) => this.agents.get(sk)?.effectiveProfile.agentId ?? "main",
|
|
130
|
+
getWorkspaceIdForSession: (sk) => this.getResolvedWorkspaceForSession(sk),
|
|
131
|
+
getProjectIdForSession: (sk) => getSessionMetadata(sk)?.projectId,
|
|
129
132
|
getMemoryManagerForSession: (sk) => this.getMemoryManagerForSession(sk),
|
|
130
133
|
getLastAssistantContent: (sk) => this.getLastAssistantContent(sk)
|
|
131
134
|
});
|
|
@@ -142,7 +145,7 @@ var AgentManager = class {
|
|
|
142
145
|
});
|
|
143
146
|
}
|
|
144
147
|
isUserContextEnabledForSession(sessionKey) {
|
|
145
|
-
return Boolean(this.config.config?.userContext.enabled &&
|
|
148
|
+
return Boolean(this.config.config?.userContext.enabled && getSessionConfig(sessionKey)?.userContextMode !== "off");
|
|
146
149
|
}
|
|
147
150
|
computeBaseWorkspacePath() {
|
|
148
151
|
const cfg = this.config.config;
|
|
@@ -272,8 +275,7 @@ var AgentManager = class {
|
|
|
272
275
|
for (const n of names) if (isValidSkillEnvVarName(n)) inst.skillEnvPassthroughKeys.add(n.trim());
|
|
273
276
|
},
|
|
274
277
|
installSkillFromSource: this.config.installSkillFromSource,
|
|
275
|
-
installSkillFromMarketplace: this.config.installSkillFromMarketplace
|
|
276
|
-
getCodeIntelligenceRuntime: (workspace) => this.workspaceRuntimes.getOrCreate(workspace, resolveEffectiveAgentProfileForSession(this.config.config, this.config.getCurrentContext?.()?.sessionKey).agentId).codeIntelligence
|
|
278
|
+
installSkillFromMarketplace: this.config.installSkillFromMarketplace
|
|
277
279
|
};
|
|
278
280
|
}
|
|
279
281
|
getMemoryManager() {
|
|
@@ -282,13 +284,6 @@ var AgentManager = class {
|
|
|
282
284
|
getMemoryManagerForSession(sessionKey) {
|
|
283
285
|
return this.getWorkspaceRuntimeForSession(sessionKey).memoryManager;
|
|
284
286
|
}
|
|
285
|
-
markCodeIntelligenceDirty(sessionKey, paths) {
|
|
286
|
-
if (paths.length === 0) return;
|
|
287
|
-
const instance = this.agents.get(sessionKey);
|
|
288
|
-
const config = this.config.config?.codeIntelligence;
|
|
289
|
-
if (!instance || !config?.enabled || !config.agentIds.includes(instance.effectiveProfile.agentId)) return;
|
|
290
|
-
this.getWorkspaceRuntimeForSession(sessionKey).codeIntelligence.markDirty(paths);
|
|
291
|
-
}
|
|
292
287
|
/** Build the bounded, policy-filtered context used for this model turn. */
|
|
293
288
|
prepareUserTurnContext(userMessage, sessionKey, turnId) {
|
|
294
289
|
return this.userContext.prepare(userMessage, sessionKey, turnId);
|
|
@@ -446,7 +441,6 @@ var AgentManager = class {
|
|
|
446
441
|
const contextInjection = "always";
|
|
447
442
|
const { contextFiles } = resolveBootstrapContextSync({
|
|
448
443
|
profileDir,
|
|
449
|
-
userProfilePath: resolveUserProfilePath(),
|
|
450
444
|
config: cfg,
|
|
451
445
|
sessionKey,
|
|
452
446
|
excludeHeartbeat: excludeHeartbeat ?? !heartbeatEnabled,
|
|
@@ -861,7 +855,6 @@ var AgentManager = class {
|
|
|
861
855
|
getMemoryManager: () => rt.memoryManager,
|
|
862
856
|
getSkillManager: () => rt.skillManager
|
|
863
857
|
});
|
|
864
|
-
if (this.config.config?.codeIntelligence?.enabled && this.config.config.codeIntelligence.agentIds.includes(profile.agentId)) rt.codeIntelligence.prime().catch(() => {});
|
|
865
858
|
const registeredToolNames = tools.map((t) => t.name);
|
|
866
859
|
const thinkingLevel = profile.thinkingDefault ?? this.config.thinkingLevel ?? "medium";
|
|
867
860
|
agent = new Agent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { summarizeUserUnderstandingQuality } from "../../storage/sqlite/
|
|
3
|
+
import { summarizeUserUnderstandingQuality } from "../../storage/sqlite/user-context-quality-repository.js";
|
|
4
4
|
import "../../storage/sqlite/index.js";
|
|
5
5
|
import { resolveAdaptiveUnderstandingCadence } from "../memory/understanding/quality.js";
|
|
6
6
|
import { isAssistantTurnAborted, isAssistantTurnFailed } from "../orchestration/llm-turn-retry.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
4
|
+
import "../../storage/sqlite/index.js";
|
|
3
5
|
import { init_sync_provider_auth, resolveProviderApiKeySync } from "../../auth/sync-provider-auth.js";
|
|
4
6
|
import { getApiKeySync, init_providers } from "../../providers/index.js";
|
|
5
7
|
import { createExtensionAwareStreamFn } from "../../providers/extension-stream-bridge.js";
|
|
@@ -23,14 +25,9 @@ const ALLOWED_UNDERSTANDING_KINDS = new Set([
|
|
|
23
25
|
"boundary",
|
|
24
26
|
"relationship",
|
|
25
27
|
"project_context",
|
|
26
|
-
"commitment",
|
|
27
28
|
"routine",
|
|
28
|
-
"personal_logistics",
|
|
29
|
-
"open_question",
|
|
30
|
-
"milestone",
|
|
31
29
|
"current_state",
|
|
32
30
|
"task_lesson",
|
|
33
|
-
"tool_preference",
|
|
34
31
|
"long_term_goal",
|
|
35
32
|
"derived_insight"
|
|
36
33
|
]);
|
|
@@ -77,8 +74,7 @@ function parseUnderstandingCandidates(raw) {
|
|
|
77
74
|
explicitness: "inferred",
|
|
78
75
|
durability,
|
|
79
76
|
sensitivity,
|
|
80
|
-
disclosurePolicy
|
|
81
|
-
tags: Array.isArray(item.tags) ? item.tags.filter((tag) => typeof tag === "string").slice(0, 8) : ["background-review"]
|
|
77
|
+
disclosurePolicy
|
|
82
78
|
});
|
|
83
79
|
}
|
|
84
80
|
return output;
|
|
@@ -121,9 +117,11 @@ async function runUnderstandingReview(params) {
|
|
|
121
117
|
}
|
|
122
118
|
if (isAssistantTurnAborted(reviewAgent) || isAssistantTurnFailed(reviewAgent)) return;
|
|
123
119
|
const candidates = parseUnderstandingCandidates(lastAssistantText(reviewAgent));
|
|
120
|
+
const projectId = getSessionMetadata(sessionKey)?.projectId;
|
|
124
121
|
await memoryManager.applyUnderstandingCandidates(candidates, {
|
|
125
122
|
agentId: settings.agentId,
|
|
126
123
|
sessionKey,
|
|
124
|
+
...projectId ? { projectId } : {},
|
|
127
125
|
sourceText: "Background review of the current session transcript",
|
|
128
126
|
reviewSource: "background"
|
|
129
127
|
});
|
|
@@ -3,7 +3,6 @@ export declare function wasBootstrapContextInjected(sessionKey: string): boolean
|
|
|
3
3
|
export declare function markBootstrapContextInjected(sessionKey: string): void;
|
|
4
4
|
export declare function getOrLoadBootstrapFiles(params: {
|
|
5
5
|
profileDir: string;
|
|
6
|
-
userProfilePath?: string;
|
|
7
6
|
sessionKey: string;
|
|
8
7
|
}): Promise<WorkspaceBootstrapFile[]>;
|
|
9
8
|
export declare function clearBootstrapSnapshot(sessionKey: string): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { loadProfileBootstrapFiles
|
|
1
|
+
import { loadProfileBootstrapFiles } from "./load-bootstrap-files.js";
|
|
2
2
|
//#region src/agent/bootstrap/bootstrap-cache.ts
|
|
3
3
|
const cache = /* @__PURE__ */ new Map();
|
|
4
4
|
const bootstrapContextInjected = /* @__PURE__ */ new Set();
|
|
@@ -17,11 +17,10 @@ function markBootstrapContextInjected(sessionKey) {
|
|
|
17
17
|
}
|
|
18
18
|
async function getOrLoadBootstrapFiles(params) {
|
|
19
19
|
const existing = cache.get(params.sessionKey);
|
|
20
|
-
const files =
|
|
21
|
-
if (existing && existing.profileDir === params.profileDir &&
|
|
20
|
+
const files = loadProfileBootstrapFiles(params.profileDir);
|
|
21
|
+
if (existing && existing.profileDir === params.profileDir && bootstrapFilesEqual(existing.files, files)) return existing.files;
|
|
22
22
|
cache.set(params.sessionKey, {
|
|
23
23
|
profileDir: params.profileDir,
|
|
24
|
-
userProfilePath: params.userProfilePath,
|
|
25
24
|
files
|
|
26
25
|
});
|
|
27
26
|
return files;
|
|
@@ -3,20 +3,17 @@ import type { EmbeddedContextFile, WorkspaceBootstrapFile } from './types.js';
|
|
|
3
3
|
export { clearAllBootstrapSnapshots, clearBootstrapSnapshot } from './bootstrap-cache.js';
|
|
4
4
|
export declare function resolveBootstrapFilesSync(params: {
|
|
5
5
|
profileDir: string;
|
|
6
|
-
userProfilePath?: string;
|
|
7
6
|
sessionKey?: string;
|
|
8
7
|
excludeHeartbeat?: boolean;
|
|
9
8
|
}): WorkspaceBootstrapFile[];
|
|
10
9
|
export declare function resolveBootstrapFilesForRun(params: {
|
|
11
10
|
profileDir: string;
|
|
12
|
-
userProfilePath?: string;
|
|
13
11
|
sessionKey?: string;
|
|
14
12
|
excludeHeartbeat?: boolean;
|
|
15
13
|
warn?: (message: string) => void;
|
|
16
14
|
}): Promise<WorkspaceBootstrapFile[]>;
|
|
17
15
|
export declare function resolveBootstrapContextSync(params: {
|
|
18
16
|
profileDir: string;
|
|
19
|
-
userProfilePath?: string;
|
|
20
17
|
config?: Config;
|
|
21
18
|
sessionKey?: string;
|
|
22
19
|
excludeHeartbeat?: boolean;
|
|
@@ -27,7 +24,6 @@ export declare function resolveBootstrapContextSync(params: {
|
|
|
27
24
|
};
|
|
28
25
|
export declare function resolveBootstrapContextForRun(params: {
|
|
29
26
|
profileDir: string;
|
|
30
|
-
userProfilePath?: string;
|
|
31
27
|
config?: Config;
|
|
32
28
|
sessionKey?: string;
|
|
33
29
|
excludeHeartbeat?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DEFAULT_HEARTBEAT_FILENAME } from "../context/workspace.js";
|
|
2
|
-
import { loadProfileBootstrapFiles
|
|
2
|
+
import { loadProfileBootstrapFiles } from "./load-bootstrap-files.js";
|
|
3
3
|
import { clearAllBootstrapSnapshots, clearBootstrapSnapshot, getOrLoadBootstrapFiles, markBootstrapContextInjected, wasBootstrapContextInjected } from "./bootstrap-cache.js";
|
|
4
4
|
import { buildBootstrapContextFiles, resolveBootstrapMaxChars, resolveBootstrapTotalMaxChars } from "./bootstrap-context.js";
|
|
5
5
|
import { filterBootstrapFilesForSession } from "./filter-bootstrap-files.js";
|
|
@@ -9,15 +9,14 @@ function filterHeartbeatBootstrapFile(files, exclude) {
|
|
|
9
9
|
return files.filter((file) => file.name !== DEFAULT_HEARTBEAT_FILENAME);
|
|
10
10
|
}
|
|
11
11
|
function resolveBootstrapFilesSync(params) {
|
|
12
|
-
return filterHeartbeatBootstrapFile(filterBootstrapFilesForSession(
|
|
12
|
+
return filterHeartbeatBootstrapFile(filterBootstrapFilesForSession(loadProfileBootstrapFiles(params.profileDir), params.sessionKey), params.excludeHeartbeat ?? false);
|
|
13
13
|
}
|
|
14
14
|
async function resolveBootstrapFilesForRun(params) {
|
|
15
15
|
const sessionKey = params.sessionKey;
|
|
16
16
|
return filterHeartbeatBootstrapFile(filterBootstrapFilesForSession(sessionKey ? await getOrLoadBootstrapFiles({
|
|
17
17
|
profileDir: params.profileDir,
|
|
18
|
-
userProfilePath: params.userProfilePath,
|
|
19
18
|
sessionKey
|
|
20
|
-
}) :
|
|
19
|
+
}) : loadProfileBootstrapFiles(params.profileDir), sessionKey), params.excludeHeartbeat ?? false);
|
|
21
20
|
}
|
|
22
21
|
function resolveBootstrapContextSync(params) {
|
|
23
22
|
const mode = params.contextInjection ?? "always";
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { isCronSessionKey, isSubagentSessionKey } from "../../routing/session-key-utils.js";
|
|
2
2
|
import { init_session_key } from "../../routing/session-key.js";
|
|
3
|
-
import { USER_PROFILE_FILENAME, init_paths } from "../../config/paths.js";
|
|
4
3
|
import { DEFAULT_AGENTS_FILENAME, DEFAULT_IDENTITY_FILENAME, DEFAULT_SOUL_FILENAME, DEFAULT_TOOLS_FILENAME } from "../context/workspace.js";
|
|
5
4
|
//#region src/agent/bootstrap/filter-bootstrap-files.ts
|
|
6
|
-
init_paths();
|
|
7
5
|
init_session_key();
|
|
8
6
|
const MINIMAL_BOOTSTRAP_ALLOWLIST = new Set([
|
|
9
7
|
DEFAULT_AGENTS_FILENAME,
|
|
10
8
|
DEFAULT_TOOLS_FILENAME,
|
|
11
9
|
DEFAULT_SOUL_FILENAME,
|
|
12
|
-
DEFAULT_IDENTITY_FILENAME
|
|
13
|
-
USER_PROFILE_FILENAME
|
|
10
|
+
DEFAULT_IDENTITY_FILENAME
|
|
14
11
|
]);
|
|
15
12
|
/** Subagent and cron sessions load only the minimal identity and instruction profile. */
|
|
16
13
|
function filterBootstrapFilesForSession(files, sessionKey) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { WorkspaceBootstrapFile } from './types.js';
|
|
2
|
-
export declare function loadUserProfileBootstrapFile(userProfilePath: string | undefined): WorkspaceBootstrapFile[];
|
|
3
2
|
/**
|
|
4
3
|
* Load bootstrap profile Markdown from `agents/<id>/profile/`.
|
|
5
4
|
* Required files emit missing markers; optional files are omitted when absent.
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { USER_PROFILE_FILENAME, init_paths } from "../../config/paths.js";
|
|
2
1
|
import { DEFAULT_AGENTS_FILENAME, DEFAULT_HEARTBEAT_FILENAME, DEFAULT_IDENTITY_FILENAME, DEFAULT_SOUL_FILENAME, DEFAULT_TOOLS_FILENAME, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET, stripFrontMatter } from "../context/workspace.js";
|
|
3
2
|
import { join, resolve } from "node:path";
|
|
4
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
4
|
//#region src/agent/bootstrap/load-bootstrap-files.ts
|
|
6
|
-
init_paths();
|
|
7
5
|
const PROFILE_LOAD_ORDER = [
|
|
8
6
|
DEFAULT_AGENTS_FILENAME,
|
|
9
7
|
DEFAULT_SOUL_FILENAME,
|
|
@@ -19,17 +17,6 @@ function readProfileFile(filePath) {
|
|
|
19
17
|
return null;
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
function loadUserProfileBootstrapFile(userProfilePath) {
|
|
23
|
-
if (!userProfilePath) return [];
|
|
24
|
-
const filePath = resolve(userProfilePath);
|
|
25
|
-
const content = readProfileFile(filePath);
|
|
26
|
-
return content !== null ? [{
|
|
27
|
-
name: USER_PROFILE_FILENAME,
|
|
28
|
-
path: filePath,
|
|
29
|
-
content,
|
|
30
|
-
missing: false
|
|
31
|
-
}] : [];
|
|
32
|
-
}
|
|
33
20
|
/**
|
|
34
21
|
* Load bootstrap profile Markdown from `agents/<id>/profile/`.
|
|
35
22
|
* Required files emit missing markers; optional files are omitted when absent.
|
|
@@ -55,4 +42,4 @@ function loadProfileBootstrapFiles(profileDir) {
|
|
|
55
42
|
return result;
|
|
56
43
|
}
|
|
57
44
|
//#endregion
|
|
58
|
-
export { loadProfileBootstrapFiles
|
|
45
|
+
export { loadProfileBootstrapFiles };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentProfileMarkdownFilename } from '../context/workspace.js';
|
|
2
|
-
export type BootstrapFileName = AgentProfileMarkdownFilename
|
|
2
|
+
export type BootstrapFileName = AgentProfileMarkdownFilename;
|
|
3
3
|
export type WorkspaceBootstrapFile = {
|
|
4
4
|
name: BootstrapFileName;
|
|
5
5
|
path: string;
|
|
@@ -34,7 +34,7 @@ Be the assistant you'd actually want to talk to. Concise when needed, thorough w
|
|
|
34
34
|
|
|
35
35
|
## Continuity
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
These files define your identity and operating principles. Durable user context is provided separately by xopc.
|
|
38
38
|
|
|
39
39
|
If you change this file, tell the user — it's your soul, and they should know.
|
|
40
40
|
|