@xopcai/xopc 0.0.189 → 0.0.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/README.zh-CN.md +0 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DTFKTPs8.js → activity-store-DstnJCS5.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DqO25Qe5.js → agent-avatar-dicebear-DvEkT222.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CXyivfqY.js +68 -0
- package/dist/gateway/static/root/assets/{api-DWeXfwVU.js → api-BTL9kayv.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BRpV8PXG.js → app-management-settings-panel-COpP_pKN.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-3ntKM9nQ.js → appearance-settings-DTVNUEDq.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-DsE67BSO.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Df7Ycj_7.js → archive-plugin-IpX6VA0o.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-UHgfZYtj.js → attachment-load-CKVFNUi1.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-D0TVev47.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BJah99wE.js → binary-plugins-BrfvfOS4.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DNlY5KqF.js → block-editor-D9sEfg32.js} +48 -48
- package/dist/gateway/static/root/assets/browser-settings-page-DpZzq8j2.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-vyUfdzAd.js → browser-workflow-inputs-BixZ5lCR.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-C1cKZjx-.js → browser-workflows-page-YEFuodJI.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B9Cmcuff.js +7 -0
- package/dist/gateway/static/root/assets/capability-presets-api-BB8t4Ja7.js +1 -0
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C_EpuQtk.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BGG2kpJB.js → channel-recipient-api-BThDGiO3.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CvzD5qSv.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-Cz7SAAkm.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-BMMqC0_9.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BKrm7tJ9.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-Bm8koRoD.js +2 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BUuBEJuP.js → desktop-pet-CMG3mcaJ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BGfVIJM3.js → desktop-pet-settings-D8aaPb0x.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DrQFfHH_.js → directory-picker-path-field-C95yW03b.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-CEnIFOX-.js → extension-debug-page-DsG7Z9lV.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CCqHbexs.js → extension-page-CUAXEbAt.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CsR7QOJo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-CgUE2Ii1.js → gateway-config-api-DL70Nakc.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BgDxQ08c.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DxhKNiCF.js → gateway-startup-retry-EO9mKvzE.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BX7q55uZ.js +1 -0
- package/dist/gateway/static/root/assets/home-page-C08Nen5T.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DCFdc-HD.js → image-generation-api-Bu7PyVSh.js} +1 -1
- package/dist/gateway/static/root/assets/index-B-_CEvIX.js +150 -0
- package/dist/gateway/static/root/assets/index-D6e3tPL-.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-Bf2VLtXW.js → keyboard-shortcuts-settings-Dt6wS5zW.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BQVC0tWq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Ca1RuI13.js → local-apps-page-DcD3-N00.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-deR2zRaE.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-D6yvW-E4.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-B3Eop1zn.js → management-settings-B6EVkJQy.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BGOYjgnM.js → markdown-split-CHUjCnBh.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CT0txyM4.js → media-plugins-DRrtI2O0.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B4XqB8I6.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-DfKgAe78.js → notes-page-fermYvpI.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BVCwabjq.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-DNrbCgmC.js → page-tabs-BO262zuu.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-BTqViDOR.js → preview-open-alternatives-yZYTy-2e.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-C_2L4_Iu.js → product-open-page-Dgy8XWhR.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CS4Ujor7.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DMtPC8c4.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BpfHZT88.js +1 -0
- package/dist/gateway/static/root/assets/{schema-form-BFLfkDGG.js → schema-form-DdE4gtw_.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BZkyrJBM.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DQlK0A4l.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CiYU8AvV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-C9a-EbTZ.js → settings-loading-skeleton-Bv03cWib.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DI9qDH5x.js → settings-page-C-LdINFj.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-D-LWQdI5.js → settings-page-layout-t_Ox1slk.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CJwmPvgs.js → setup-status-panel-HRG_lK4_.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BKSMG9r5.js → share-preview-page-DF8gW6bo.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-v_iLhxxa.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-S-bjtsXX.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BiNBfaX5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-zsz2HIlZ.js → skills-page.utils-DlnGtvAH.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-IWNDBI1O.js → system-settings-panel-Bv7GXFc6.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-CgtK02kP.js → task-detail-page-BhQcOpnx.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BkJe7UDo.js → theme-store-DnBOcGXi.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-C07LGthO.js → typed-models-lib-4XBsLEuv.js} +1 -1
- package/dist/gateway/static/root/assets/use-autosave-BN2QgFGn.js +1 -0
- package/dist/gateway/static/root/assets/user-context-page-PtcY7BoJ.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Boue1D46.js → voice-api-key-field-DnhJtC5l.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-bbmvCmc8.js → work-discovery-overlay-nmEAafFl.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C5Kwe_bc.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DlHv-GZC.js → workflow-run-setup-panel-BnNWBDwz.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Z_qzaohv.js +11 -0
- package/dist/gateway/static/root/index.html +7 -7
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tool-activity.js +0 -36
- package/dist/packages/realtime-client/src/index.js +105 -48
- package/dist/packages/realtime-protocol/src/index.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +0 -1
- package/dist/src/agent/agent-manager.js +6 -13
- package/dist/src/agent/background-review/coordinator.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +5 -7
- package/dist/src/agent/bootstrap/bootstrap-cache.d.ts +0 -1
- package/dist/src/agent/bootstrap/bootstrap-cache.js +3 -4
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
- package/dist/src/agent/bootstrap/bootstrap-files.js +3 -4
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -4
- package/dist/src/agent/bootstrap/load-bootstrap-files.d.ts +0 -1
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +1 -14
- package/dist/src/agent/bootstrap/types.d.ts +1 -1
- package/dist/src/agent/context/workspace-templates/SOUL.md +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/provider-registry.d.ts +2 -0
- package/dist/src/agent/image/generation/provider-registry.js +20 -10
- package/dist/src/agent/image/generation/providers/xopc-cloud.d.ts +2 -0
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +74 -0
- package/dist/src/agent/image/generation/types.d.ts +2 -2
- package/dist/src/agent/memory/builtin-provider.d.ts +2 -4
- package/dist/src/agent/memory/builtin-provider.js +35 -15
- package/dist/src/agent/memory/context/types.d.ts +3 -1
- package/dist/src/agent/memory/create-memory-manager.js +2 -0
- package/dist/src/agent/memory/index.d.ts +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/memory/manager.d.ts +9 -1
- package/dist/src/agent/memory/manager.js +39 -9
- package/dist/src/agent/memory/memory-config.d.ts +1 -1
- package/dist/src/agent/memory/memory-config.js +1 -1
- package/dist/src/agent/memory/source-origin.js +0 -2
- package/dist/src/agent/memory/types.d.ts +5 -1
- package/dist/src/agent/memory/understanding/service.d.ts +10 -10
- package/dist/src/agent/memory/understanding/service.js +108 -176
- package/dist/src/agent/memory/understanding/types.d.ts +7 -8
- package/dist/src/agent/memory/user-context-coordinator.d.ts +2 -1
- package/dist/src/agent/memory/user-context-coordinator.js +27 -41
- package/dist/src/agent/orchestration/agent-orchestrator.js +4 -7
- package/dist/src/agent/prompt/sections/memory-skills.js +4 -4
- package/dist/src/agent/prompt/sections/tooling.js +0 -10
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +0 -1
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -33
- package/dist/src/agent/prompt/system-prompt.js +1 -2
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service.d.ts +1 -2
- package/dist/src/agent/service.js +4 -17
- package/dist/src/agent/skills/marketplace/adapters/clawhub/adapter.js +1 -1
- package/dist/src/agent/tools/dreaming-tool.d.ts +0 -2
- package/dist/src/agent/tools/dreaming-tool.js +13 -38
- package/dist/src/agent/tools/factory.d.ts +0 -3
- package/dist/src/agent/tools/factory.js +1 -10
- package/dist/src/agent/tools/index.d.ts +0 -1
- package/dist/src/agent/tools/index.js +1 -2
- package/dist/src/agent/tools/memory-tool.js +1 -1
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -5
- package/dist/src/agent/workspace-runtime/registry.js +2 -15
- package/dist/src/agent-manifest/schema.d.ts +17 -17
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/memory-runtime.d.ts +2 -2
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/automations/domain/validation.d.ts +28 -28
- package/dist/src/automations/draft/automation-draft-validator.d.ts +3 -3
- package/dist/src/chat-commands/builtins/understanding.js +2 -5
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/init.js +3 -22
- package/dist/src/cli/commands/onboard/model.d.ts +3 -0
- package/dist/src/cli/commands/onboard/model.js +19 -4
- package/dist/src/cli/commands/update.js +1 -1
- package/dist/src/cli/templates.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/paths.d.ts +0 -5
- package/dist/src/config/paths.js +2 -11
- package/dist/src/config/schema.d.ts +24 -117
- package/dist/src/config/schema.js +9 -39
- package/dist/src/connectors/learning-coordinator.js +75 -3
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agent-builtin-tools.js +0 -5
- package/dist/src/gateway/agents-admin.d.ts +0 -7
- package/dist/src/gateway/agents-admin.js +4 -33
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +3 -3
- package/dist/src/gateway/dreaming-automation-reconciler.js +48 -88
- package/dist/src/gateway/hono/lib/config-payload.d.ts +19 -7
- package/dist/src/gateway/hono/lib/config-payload.js +3 -1
- package/dist/src/gateway/hono/oauth-async.d.ts +1 -0
- package/dist/src/gateway/hono/oauth-async.js +17 -2
- package/dist/src/gateway/hono/routes/agents.js +1 -33
- package/dist/src/gateway/hono/routes/config-patch/misc.js +17 -1
- package/dist/src/gateway/hono/routes/connectors.js +13 -12
- package/dist/src/gateway/hono/routes/index.js +2 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +1 -5
- package/dist/src/gateway/hono/routes/local-apps.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +9 -8
- package/dist/src/gateway/hono/routes/status.js +0 -7
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +3 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +203 -0
- package/dist/src/gateway/hono/routes/update.js +2 -2
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +2 -0
- package/dist/src/gateway/hono/routes/work-discovery.js +3 -134
- package/dist/src/gateway/hono/routes/you.d.ts +0 -22
- package/dist/src/gateway/hono/routes/you.js +234 -1118
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +2 -4
- package/dist/src/gateway/service.js +5 -5
- package/dist/src/infra/gateway-processes.js +1 -1
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/infra/update-runner.js +2 -2
- package/dist/src/infra/update-startup.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +2 -4
- package/dist/src/knowledge/connected-understanding-pipeline.js +31 -81
- package/dist/src/knowledge/index.js +2 -2
- package/dist/src/knowledge/people-graph.d.ts +22 -25
- package/dist/src/knowledge/people-graph.js +76 -43
- package/dist/src/proactive/execution/context.js +8 -13
- package/dist/src/providers/model-catalog-store.d.ts +15 -0
- package/dist/src/providers/model-catalog-store.js +14 -1
- package/dist/src/providers/model-catalog-sync-service.js +6 -0
- package/dist/src/providers/model-registry.js +4 -4
- package/dist/src/providers/register-runtime-providers.js +4 -4
- package/dist/src/providers/xopc-cloud-model-source.js +55 -8
- package/dist/src/realtime/broker.d.ts +1 -0
- package/dist/src/realtime/broker.js +19 -2
- package/dist/src/realtime/runtime.js +6 -1
- package/dist/src/storage/sqlite/connector-account-repository.js +0 -1
- package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +37 -0
- package/dist/src/storage/sqlite/context-consolidation-repository.js +64 -0
- package/dist/src/storage/sqlite/fts.d.ts +2 -0
- package/dist/src/storage/sqlite/fts.js +29 -1
- package/dist/src/storage/sqlite/index.d.ts +4 -6
- package/dist/src/storage/sqlite/index.js +5 -7
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +9 -2
- package/dist/src/storage/sqlite/knowledge-repository.js +58 -10
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +7 -56
- package/dist/src/storage/sqlite/memory-records-repository.js +68 -218
- package/dist/src/storage/sqlite/migrations/113_memory_evidence_single_source.sql +54 -0
- package/dist/src/storage/sqlite/migrations/114_user_context_domain.sql +193 -0
- package/dist/src/storage/sqlite/migrations/115_remove_legacy_user_context.sql +6 -0
- package/dist/src/storage/sqlite/migrations/116_structured_context_consolidation.sql +38 -0
- package/dist/src/storage/sqlite/migrations/117_unified_understanding_sources.sql +110 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +0 -20
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +34 -0
- package/dist/src/storage/sqlite/user-context-quality-repository.js +74 -0
- package/dist/src/storage/sqlite/user-context-repository.d.ts +64 -0
- package/dist/src/storage/sqlite/user-context-repository.js +383 -0
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/tool-summary.js +1 -7
- package/dist/src/tui/tui-startup-resources.js +1 -2
- package/dist/src/user-context/config.d.ts +17 -210
- package/dist/src/user-context/config.js +19 -85
- package/dist/src/user-context/consolidation.d.ts +26 -0
- package/dist/src/user-context/consolidation.js +115 -0
- package/dist/src/user-context/domain.d.ts +75 -0
- package/dist/src/user-context/domain.js +4 -0
- package/dist/src/user-context/manual-understanding.d.ts +7 -14
- package/dist/src/user-context/manual-understanding.js +19 -54
- package/dist/src/{agent/memory/context → user-context}/planner.d.ts +5 -6
- package/dist/src/user-context/planner.js +311 -0
- package/dist/src/user-context/relationship-continuity.d.ts +3 -6
- package/dist/src/user-context/relationship-continuity.js +39 -32
- package/dist/src/user-context/sources/catalog.d.ts +2 -0
- package/dist/src/user-context/sources/catalog.js +149 -0
- package/dist/src/user-context/sources/index.d.ts +3 -0
- package/dist/src/user-context/sources/index.js +3 -0
- package/dist/src/user-context/sources/repository.d.ts +40 -0
- package/dist/src/user-context/sources/repository.js +164 -0
- package/dist/src/user-context/sources/types.d.ts +83 -0
- package/dist/src/work-discovery/analyzer.d.ts +4 -3
- package/dist/src/work-discovery/analyzer.js +21 -16
- package/dist/src/work-discovery/incremental-repository.js +42 -40
- package/dist/src/work-discovery/index.js +3 -3
- package/dist/src/work-discovery/service.d.ts +7 -7
- package/dist/src/work-discovery/service.js +241 -190
- package/dist/src/work-discovery/source-repository.js +42 -53
- package/dist/src/work-discovery/types.d.ts +2 -14
- package/package.json +3 -8
- package/dist/gateway/static/root/assets/agents-BvdqdER9.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-nKLsfy6C.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Dh5bdZiN.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CRJ_nAuh.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DeQR5BZt.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-D7tkhDMv.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D7uK3q1p.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-Bw6Dniyq.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-BrUTz4uU.js +0 -1
- package/dist/gateway/static/root/assets/connector-logo-8YU53RUT.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-k9tMiOL5.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-B3B1eqnr.js +0 -2
- package/dist/gateway/static/root/assets/extension-settings-page-DEZw_7zN.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dg8qCiIp.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-27tRzDEo.js +0 -1
- package/dist/gateway/static/root/assets/home-page-VA511kMr.js +0 -3
- package/dist/gateway/static/root/assets/index-BvR-i-m6.js +0 -216
- package/dist/gateway/static/root/assets/index-zybP34zk.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CaJq4-wV.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-DUW5YE3R.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BLTCg69e.js +0 -2
- package/dist/gateway/static/root/assets/messages-CMjnbdbn.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-Bp1w9UM1.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-CZmbPDQN.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D5pzqfm5.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CC-XhVGI.js +0 -1
- package/dist/gateway/static/root/assets/segmented-styles-BL8oLBEp.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B2eTLVDV.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CRuZ_bl0.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-C4GXGeA4.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-YzSDS4G_.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CwOo8zZk.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-xd1cgSGN.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-CstQ___Y.js +0 -1
- package/dist/gateway/static/root/assets/use-save-bar-registration-CQYE0l6z.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-BnQAWS_B.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CAszL1y8.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DxGzo3-x.js +0 -11
- package/dist/src/agent/code-intelligence/binary.d.ts +0 -15
- package/dist/src/agent/code-intelligence/binary.js +0 -372
- package/dist/src/agent/code-intelligence/index.d.ts +0 -4
- package/dist/src/agent/code-intelligence/index.js +0 -4
- package/dist/src/agent/code-intelligence/runtime.d.ts +0 -34
- package/dist/src/agent/code-intelligence/runtime.js +0 -280
- package/dist/src/agent/code-intelligence/tool-gating.d.ts +0 -5
- package/dist/src/agent/code-intelligence/tool-gating.js +0 -6
- package/dist/src/agent/code-intelligence/tools.d.ts +0 -6
- package/dist/src/agent/code-intelligence/tools.js +0 -266
- package/dist/src/agent/code-intelligence/types.d.ts +0 -22
- package/dist/src/agent/memory/context/planner.js +0 -286
- package/dist/src/agent/memory/dreaming/config.d.ts +0 -48
- package/dist/src/agent/memory/dreaming/config.js +0 -98
- package/dist/src/agent/memory/dreaming/constants.d.ts +0 -12
- package/dist/src/agent/memory/dreaming/constants.js +0 -18
- package/dist/src/agent/memory/dreaming/deep-promotion.d.ts +0 -19
- package/dist/src/agent/memory/dreaming/deep-promotion.js +0 -152
- package/dist/src/agent/memory/dreaming/light-sweep.d.ts +0 -16
- package/dist/src/agent/memory/dreaming/light-sweep.js +0 -115
- package/dist/src/agent/memory/dreaming/preview.d.ts +0 -23
- package/dist/src/agent/memory/dreaming/preview.js +0 -52
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.d.ts +0 -16
- package/dist/src/agent/memory/dreaming/promotion-lifecycle.js +0 -44
- package/dist/src/agent/memory/dreaming/rem-patterns.d.ts +0 -19
- package/dist/src/agent/memory/dreaming/rem-patterns.js +0 -150
- package/dist/src/agent/memory/dreaming/runner.d.ts +0 -10
- package/dist/src/agent/memory/dreaming/runner.js +0 -78
- package/dist/src/agent/memory/dreaming/schedule.d.ts +0 -23
- package/dist/src/agent/memory/dreaming/schedule.js +0 -38
- package/dist/src/agent/memory/dreaming/scope.d.ts +0 -11
- package/dist/src/agent/memory/dreaming/scope.js +0 -33
- package/dist/src/agent/memory/dreaming/utils.d.ts +0 -3
- package/dist/src/agent/memory/dreaming/utils.js +0 -31
- package/dist/src/gateway/hono/routes/memory.d.ts +0 -3
- package/dist/src/gateway/hono/routes/memory.js +0 -460
- package/dist/src/storage/sqlite/dreaming-repository.d.ts +0 -61
- package/dist/src/storage/sqlite/dreaming-repository.js +0 -88
- package/dist/src/storage/sqlite/memory-readiness-repository.d.ts +0 -7
- package/dist/src/storage/sqlite/memory-readiness-repository.js +0 -30
- package/dist/src/storage/sqlite/memory-reference-consent-repository.d.ts +0 -27
- package/dist/src/storage/sqlite/memory-reference-consent-repository.js +0 -107
- package/dist/src/storage/sqlite/user-claims-repository.d.ts +0 -101
- package/dist/src/storage/sqlite/user-claims-repository.js +0 -241
- package/dist/src/storage/sqlite/user-profile-setup-repository.d.ts +0 -3
- package/dist/src/storage/sqlite/user-profile-setup-repository.js +0 -32
- package/dist/src/user-context/actionableInsights.d.ts +0 -14
- package/dist/src/user-context/actionableInsights.js +0 -34
- package/dist/src/user-context/context-compiler.d.ts +0 -27
- package/dist/src/user-context/context-compiler.js +0 -48
- package/dist/src/user-context/import.d.ts +0 -12
- package/dist/src/user-context/import.js +0 -51
- package/dist/src/user-context/memory-episode-evaluator.d.ts +0 -32
- package/dist/src/user-context/memory-episode-evaluator.js +0 -35
- package/dist/src/user-context/memory-readiness.d.ts +0 -33
- package/dist/src/user-context/memory-readiness.js +0 -41
- package/dist/src/user-context/memory-use-audit.d.ts +0 -10
- package/dist/src/user-context/memory-use-audit.js +0 -26
- package/dist/src/user-context/personal-playbook.d.ts +0 -11
- package/dist/src/user-context/personal-playbook.js +0 -41
- package/dist/src/user-context/profile.d.ts +0 -37
- package/dist/src/user-context/profile.js +0 -163
- package/dist/src/user-context/projection.d.ts +0 -120
- package/dist/src/user-context/projection.js +0 -262
- package/dist/src/user-context/source-recommendations.d.ts +0 -13
- package/dist/src/user-context/source-recommendations.js +0 -85
- /package/dist/src/{agent/code-intelligence → user-context/sources}/types.js +0 -0
|
@@ -1,100 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { resolveDreamingAgentScope } from "../agent/memory/dreaming/scope.js";
|
|
1
|
+
import { init_agent_scope, normalizeAgentId, resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agent/agent-scope.js";
|
|
2
|
+
import { USER_CONTEXT_CONSOLIDATION_AUTOMATION_ID, USER_CONTEXT_CONSOLIDATION_TOKEN, compileContextConsolidationCron, resolveContextConsolidationConfig } from "../user-context/consolidation.js";
|
|
4
3
|
//#region src/gateway/dreaming-automation-reconciler.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
phase: "rem",
|
|
18
|
-
name: DREAMING_REM_AUTOMATION_NAME,
|
|
19
|
-
token: DREAMING_REM_SWEEP_TOKEN
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
function phaseDescription(phase) {
|
|
23
|
-
return `${phase === "light" ? "Light sweep" : phase === "deep" ? "Deep promotion" : "REM pattern discovery"} for memory dreaming. ${DREAMING_AUTOMATION_TAG}`;
|
|
24
|
-
}
|
|
25
|
-
function buildTrigger(config, phase) {
|
|
26
|
-
const phaseConfig = config.phases[phase];
|
|
27
|
-
return {
|
|
4
|
+
init_agent_scope();
|
|
5
|
+
async function reconcileDreamingAutomations(params) {
|
|
6
|
+
const result = {
|
|
7
|
+
created: false,
|
|
8
|
+
updated: false,
|
|
9
|
+
disabled: false
|
|
10
|
+
};
|
|
11
|
+
const resolved = resolveContextConsolidationConfig(params.config);
|
|
12
|
+
const agentId = normalizeAgentId(resolveDefaultAgentId(params.config));
|
|
13
|
+
const workingDirectory = resolveAgentWorkspaceDir(params.config, agentId);
|
|
14
|
+
const trigger = {
|
|
28
15
|
kind: "schedule",
|
|
29
16
|
schedule: {
|
|
30
17
|
kind: "cron",
|
|
31
|
-
expr:
|
|
32
|
-
tz:
|
|
18
|
+
expr: compileContextConsolidationCron(resolved.time),
|
|
19
|
+
tz: resolved.timezone
|
|
33
20
|
}
|
|
34
21
|
};
|
|
35
|
-
|
|
36
|
-
function dreamingAutomationId(phase) {
|
|
37
|
-
return `system-user-context-dreaming:${phase}`;
|
|
38
|
-
}
|
|
39
|
-
function buildAction(scope, token) {
|
|
40
|
-
return {
|
|
22
|
+
const action = {
|
|
41
23
|
kind: "agent",
|
|
42
|
-
agentId
|
|
43
|
-
instruction:
|
|
44
|
-
workingDirectory
|
|
45
|
-
timeoutSeconds:
|
|
24
|
+
agentId,
|
|
25
|
+
instruction: USER_CONTEXT_CONSOLIDATION_TOKEN,
|
|
26
|
+
workingDirectory,
|
|
27
|
+
timeoutSeconds: 300
|
|
46
28
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const { config, automationService } = params;
|
|
53
|
-
const result = {
|
|
54
|
-
created: [],
|
|
55
|
-
updated: [],
|
|
56
|
-
disabled: []
|
|
57
|
-
};
|
|
58
|
-
const scope = resolveDreamingAgentScope(config);
|
|
59
|
-
const resolved = scope.config;
|
|
60
|
-
for (const spec of DREAMING_AUTOMATIONS) {
|
|
61
|
-
const id = dreamingAutomationId(spec.phase);
|
|
62
|
-
const current = await automationService.get(id);
|
|
63
|
-
const enabled = resolved.enabled && resolved.phases[spec.phase].enabled;
|
|
64
|
-
if (!resolved.enabled) {
|
|
65
|
-
if (current?.enabled) {
|
|
66
|
-
await automationService.update(id, { enabled: false });
|
|
67
|
-
result.disabled.push(id);
|
|
68
|
-
}
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
const next = {
|
|
72
|
-
name: spec.name,
|
|
73
|
-
description: phaseDescription(spec.phase),
|
|
74
|
-
enabled,
|
|
75
|
-
trigger: buildTrigger(resolved, spec.phase),
|
|
76
|
-
action: buildAction(scope, spec.token)
|
|
77
|
-
};
|
|
78
|
-
if (!current) {
|
|
79
|
-
await automationService.create({
|
|
80
|
-
id,
|
|
81
|
-
...next,
|
|
82
|
-
safety: { mode: "auto_apply" },
|
|
83
|
-
afterRun: { kind: "none" },
|
|
84
|
-
reliability: { disableAfterConsecutiveFailures: 3 }
|
|
85
|
-
});
|
|
86
|
-
result.created.push(id);
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if (automationNeedsUpdate(current, next)) {
|
|
90
|
-
await automationService.update(id, {
|
|
91
|
-
...next,
|
|
92
|
-
safety: { mode: "auto_apply" },
|
|
93
|
-
afterRun: { kind: "none" },
|
|
94
|
-
reliability: { disableAfterConsecutiveFailures: 3 }
|
|
95
|
-
});
|
|
96
|
-
result.updated.push(id);
|
|
29
|
+
const current = await params.automationService.get(USER_CONTEXT_CONSOLIDATION_AUTOMATION_ID);
|
|
30
|
+
if (!resolved.enabled) {
|
|
31
|
+
if (current?.enabled) {
|
|
32
|
+
await params.automationService.update(USER_CONTEXT_CONSOLIDATION_AUTOMATION_ID, { enabled: false });
|
|
33
|
+
result.disabled = true;
|
|
97
34
|
}
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
const next = {
|
|
38
|
+
name: "User context review",
|
|
39
|
+
description: "Deterministically review structured user understanding for expiry and sufficient evidence.",
|
|
40
|
+
enabled: true,
|
|
41
|
+
trigger,
|
|
42
|
+
action,
|
|
43
|
+
safety: { mode: "auto_apply" },
|
|
44
|
+
afterRun: { kind: "none" },
|
|
45
|
+
reliability: { disableAfterConsecutiveFailures: 3 }
|
|
46
|
+
};
|
|
47
|
+
if (!current) {
|
|
48
|
+
await params.automationService.create({
|
|
49
|
+
id: USER_CONTEXT_CONSOLIDATION_AUTOMATION_ID,
|
|
50
|
+
...next
|
|
51
|
+
});
|
|
52
|
+
result.created = true;
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
if (current.name !== next.name || current.description !== next.description || !current.enabled || JSON.stringify(current.trigger) !== JSON.stringify(trigger) || JSON.stringify(current.action) !== JSON.stringify(action) || current.safety?.mode !== "auto_apply" || current.afterRun?.kind !== "none" || current.reliability?.disableAfterConsecutiveFailures !== 3) {
|
|
56
|
+
await params.automationService.update(USER_CONTEXT_CONSOLIDATION_AUTOMATION_ID, next);
|
|
57
|
+
result.updated = true;
|
|
98
58
|
}
|
|
99
59
|
return result;
|
|
100
60
|
}
|
|
@@ -66,7 +66,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
66
66
|
};
|
|
67
67
|
tools: {
|
|
68
68
|
builtin?: Record<string, {
|
|
69
|
-
mode: "allow" | "
|
|
69
|
+
mode: "allow" | "deny" | "confirm";
|
|
70
70
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
71
71
|
limits?: {
|
|
72
72
|
maxCallsPerTurn?: number;
|
|
@@ -75,7 +75,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
75
75
|
}>;
|
|
76
76
|
mcp?: {
|
|
77
77
|
servers?: Record<string, {
|
|
78
|
-
mode: "allow" | "
|
|
78
|
+
mode: "allow" | "deny" | "confirm";
|
|
79
79
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
80
80
|
limits?: {
|
|
81
81
|
maxCallsPerTurn?: number;
|
|
@@ -83,7 +83,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
83
83
|
};
|
|
84
84
|
}>;
|
|
85
85
|
tools?: Record<string, {
|
|
86
|
-
mode: "allow" | "
|
|
86
|
+
mode: "allow" | "deny" | "confirm";
|
|
87
87
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
88
88
|
limits?: {
|
|
89
89
|
maxCallsPerTurn?: number;
|
|
@@ -143,7 +143,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
143
143
|
};
|
|
144
144
|
tools?: {
|
|
145
145
|
builtin?: Record<string, {
|
|
146
|
-
mode: "allow" | "
|
|
146
|
+
mode: "allow" | "deny" | "confirm";
|
|
147
147
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
148
148
|
limits?: {
|
|
149
149
|
maxCallsPerTurn?: number;
|
|
@@ -152,7 +152,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
152
152
|
}>;
|
|
153
153
|
mcp?: {
|
|
154
154
|
servers?: Record<string, {
|
|
155
|
-
mode: "allow" | "
|
|
155
|
+
mode: "allow" | "deny" | "confirm";
|
|
156
156
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
157
157
|
limits?: {
|
|
158
158
|
maxCallsPerTurn?: number;
|
|
@@ -160,7 +160,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
160
160
|
};
|
|
161
161
|
}>;
|
|
162
162
|
tools?: Record<string, {
|
|
163
|
-
mode: "allow" | "
|
|
163
|
+
mode: "allow" | "deny" | "confirm";
|
|
164
164
|
scope?: "workspace" | "readonly" | "unrestricted";
|
|
165
165
|
limits?: {
|
|
166
166
|
maxCallsPerTurn?: number;
|
|
@@ -290,6 +290,18 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
290
290
|
preferences: {
|
|
291
291
|
responseLanguage: "auto" | "zh-CN" | "en";
|
|
292
292
|
};
|
|
293
|
+
dreaming: {
|
|
294
|
+
mode: "off" | "review";
|
|
295
|
+
schedule: {
|
|
296
|
+
time: string;
|
|
297
|
+
};
|
|
298
|
+
minEvidenceSources: number;
|
|
299
|
+
limit: number;
|
|
300
|
+
timezone?: string;
|
|
301
|
+
};
|
|
302
|
+
privacy: {
|
|
303
|
+
sensitiveWritePolicy: "allow" | "deny" | "confirm";
|
|
304
|
+
};
|
|
293
305
|
memory: {
|
|
294
306
|
retention: {
|
|
295
307
|
compaction: {
|
|
@@ -345,7 +357,7 @@ export declare function buildSafeWebConfigPayload(service: GatewayService, optio
|
|
|
345
357
|
language?: "en" | "zh";
|
|
346
358
|
input?: {
|
|
347
359
|
refinement?: {
|
|
348
|
-
mode: "off" | "
|
|
360
|
+
mode: "off" | "custom" | "punctuation" | "light";
|
|
349
361
|
model?: string;
|
|
350
362
|
customInstruction?: string;
|
|
351
363
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextCompactionPolicySchema, init_config } from "../../../user-context/config.js";
|
|
1
|
+
import { ContextCompactionPolicySchema, UserContextDreamingSchema, UserContextPrivacySchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
4
|
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
@@ -178,6 +178,8 @@ async function buildSafeWebConfigPayload(service, options = {}) {
|
|
|
178
178
|
session: resolveSessionConfigForWeb(config),
|
|
179
179
|
userContext: {
|
|
180
180
|
preferences: config.userContext?.preferences ?? { responseLanguage: "auto" },
|
|
181
|
+
dreaming: UserContextDreamingSchema.parse(config.userContext?.dreaming),
|
|
182
|
+
privacy: UserContextPrivacySchema.parse(config.userContext?.privacy),
|
|
181
183
|
memory: { retention: { compaction: ContextCompactionPolicySchema.parse(config.userContext?.memory.retention?.compaction) } }
|
|
182
184
|
},
|
|
183
185
|
tui: { defaultAgent: config.tui?.defaultAgent ?? "coder" },
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { Hono } from 'hono';
|
|
9
9
|
import type { GatewayService } from '../service.js';
|
|
10
10
|
import { type OAuthCredentials } from '../../auth/oauth/types.js';
|
|
11
|
+
export declare function refreshModelCatalogAfterOAuth(provider: string, service: Pick<GatewayService, 'getModelCatalogSync'>): Promise<void>;
|
|
11
12
|
export declare function resolveOAuthLoginMethodPreference(params: {
|
|
12
13
|
requestedMethod?: unknown;
|
|
13
14
|
supportedMethods?: readonly string[];
|
|
@@ -17,6 +17,19 @@ init_registry();
|
|
|
17
17
|
init_credentials();
|
|
18
18
|
init_logger();
|
|
19
19
|
const log = createLogger("OAuthAsync");
|
|
20
|
+
async function refreshModelCatalogAfterOAuth(provider, service) {
|
|
21
|
+
if (provider !== "xopc-cloud") return;
|
|
22
|
+
try {
|
|
23
|
+
await service.getModelCatalogSync().refreshNow();
|
|
24
|
+
} catch (err) {
|
|
25
|
+
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
26
|
+
log.warn({
|
|
27
|
+
err,
|
|
28
|
+
provider,
|
|
29
|
+
errorMessage
|
|
30
|
+
}, `OAuth completed, but the model catalog could not be refreshed: ${errorMessage}`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
20
33
|
/** User-facing message when undici/fetch fails (often DNS, firewall, or wrong machine for localhost callback). */
|
|
21
34
|
function formatOAuthAsyncError(err) {
|
|
22
35
|
const base = err instanceof Error ? err.message : "OAuth login failed";
|
|
@@ -200,7 +213,7 @@ function createOAuthAsyncHandler(service) {
|
|
|
200
213
|
/**
|
|
201
214
|
* Run OAuth flow in background
|
|
202
215
|
*/
|
|
203
|
-
async function runOAuthFlow(session, oauthProvider,
|
|
216
|
+
async function runOAuthFlow(session, oauthProvider, service) {
|
|
204
217
|
const abortController = new AbortController();
|
|
205
218
|
session.abortController = abortController;
|
|
206
219
|
let manualCodePromise = null;
|
|
@@ -276,6 +289,8 @@ async function runOAuthFlow(session, oauthProvider, _service) {
|
|
|
276
289
|
const credentials = await oauthProvider.login(callbacks);
|
|
277
290
|
setOAuthCredentialsToCache(session.provider, credentials);
|
|
278
291
|
await new CredentialResolver().saveOAuthCredentials(session.provider, credentials);
|
|
292
|
+
session.message = session.provider === "xopc-cloud" ? "OAuth login successful. Syncing available models..." : "OAuth login successful";
|
|
293
|
+
await refreshModelCatalogAfterOAuth(session.provider, service);
|
|
279
294
|
session.status = "completed";
|
|
280
295
|
session.credentials = credentials;
|
|
281
296
|
session.message = "OAuth login successful";
|
|
@@ -313,4 +328,4 @@ function deleteOAuthCredentialsFromCache(provider) {
|
|
|
313
328
|
oauthCredentialsCache.delete(provider);
|
|
314
329
|
}
|
|
315
330
|
//#endregion
|
|
316
|
-
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, resolveOAuthLoginMethodPreference, setOAuthCredentialsToCache };
|
|
331
|
+
export { createOAuthAsyncHandler, deleteOAuthCredentialsFromCache, getOAuthCredentialsFromCache, refreshModelCatalogAfterOAuth, resolveOAuthLoginMethodPreference, setOAuthCredentialsToCache };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToolPolicySetSchema, init_schema } from "../../../agent-manifest/schema.js";
|
|
2
2
|
import { AgentModelsSchema, init_schema as init_schema$1 } from "../../../config/schema.js";
|
|
3
3
|
import { init_agent_scope, normalizeAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { deleteAgentAvatarFile, finalizeCreateAgentDirs, getGatewayAgentEffectiveManifest, listAgentProfileFiles, listGatewayAgents, prepareCreateAgent, prepareDeleteAgent, prepareUpdateAgent, readAgentAvatarFile, readAgentProfileFile,
|
|
4
|
+
import { deleteAgentAvatarFile, finalizeCreateAgentDirs, getGatewayAgentEffectiveManifest, listAgentProfileFiles, listGatewayAgents, prepareCreateAgent, prepareDeleteAgent, prepareUpdateAgent, readAgentAvatarFile, readAgentProfileFile, runAfterDeletePurge, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
5
5
|
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
6
6
|
//#region src/gateway/hono/routes/agents.ts
|
|
7
7
|
init_schema$1();
|
|
@@ -89,38 +89,6 @@ function registerAgentsRoutes(authenticated, deps) {
|
|
|
89
89
|
payload
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
-
authenticated.get("/api/user-profile", async (c) => {
|
|
93
|
-
const res = await readUserProfileFile();
|
|
94
|
-
if (res.ok === false) return c.json({
|
|
95
|
-
ok: false,
|
|
96
|
-
error: { message: res.error }
|
|
97
|
-
}, res.status ?? 400);
|
|
98
|
-
return c.json({
|
|
99
|
-
ok: true,
|
|
100
|
-
payload: res.data
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
authenticated.put("/api/user-profile", strictRateLimitMiddleware, async (c) => {
|
|
104
|
-
let content = "";
|
|
105
|
-
try {
|
|
106
|
-
const body = await c.req.json();
|
|
107
|
-
content = typeof body.content === "string" ? body.content : "";
|
|
108
|
-
} catch {
|
|
109
|
-
return c.json({
|
|
110
|
-
ok: false,
|
|
111
|
-
error: { message: "Invalid JSON" }
|
|
112
|
-
}, 400);
|
|
113
|
-
}
|
|
114
|
-
const res = await writeUserProfileFile(content);
|
|
115
|
-
if (res.ok === false) return c.json({
|
|
116
|
-
ok: false,
|
|
117
|
-
error: { message: res.error }
|
|
118
|
-
}, res.status ?? 400);
|
|
119
|
-
return c.json({
|
|
120
|
-
ok: true,
|
|
121
|
-
payload: res.data
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
92
|
authenticated.post("/api/agents", strictRateLimitMiddleware, async (c) => {
|
|
125
93
|
let body = {};
|
|
126
94
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextCompactionPolicySchema, init_config } from "../../../../user-context/config.js";
|
|
1
|
+
import { ContextCompactionPolicySchema, UserContextDreamingSchema, UserContextPrivacySchema, init_config } from "../../../../user-context/config.js";
|
|
2
2
|
import { BindingsConfigSchema, BrowserConfigSchema, McpConfigSchema, VoiceConfigSchema, init_schema } from "../../../../config/schema.js";
|
|
3
3
|
import { CredentialResolver, init_credentials } from "../../../../auth/credentials.js";
|
|
4
4
|
import { canonicalizeConfiguredMcpServer } from "../../../../config/mcp-config-normalize.js";
|
|
@@ -28,6 +28,22 @@ async function applyMiscPatch(config, body) {
|
|
|
28
28
|
if (body.userContext !== void 0) {
|
|
29
29
|
if (typeof body.userContext !== "object" || body.userContext === null || Array.isArray(body.userContext)) return patchError("userContext must be an object");
|
|
30
30
|
const userContextPatch = body.userContext;
|
|
31
|
+
if (userContextPatch.dreaming !== void 0) {
|
|
32
|
+
const parsed = UserContextDreamingSchema.safeParse(userContextPatch.dreaming);
|
|
33
|
+
if (!parsed.success) return patchError(parsed.error.issues.map((issue) => issue.message).join("; "));
|
|
34
|
+
config.userContext = {
|
|
35
|
+
...config.userContext,
|
|
36
|
+
dreaming: parsed.data
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (userContextPatch.privacy !== void 0) {
|
|
40
|
+
const parsed = UserContextPrivacySchema.safeParse(userContextPatch.privacy);
|
|
41
|
+
if (!parsed.success) return patchError(parsed.error.issues.map((issue) => issue.message).join("; "));
|
|
42
|
+
config.userContext = {
|
|
43
|
+
...config.userContext,
|
|
44
|
+
privacy: parsed.data
|
|
45
|
+
};
|
|
46
|
+
}
|
|
31
47
|
if (userContextPatch.memory !== void 0) {
|
|
32
48
|
if (typeof userContextPatch.memory !== "object" || userContextPatch.memory === null || Array.isArray(userContextPatch.memory)) return patchError("userContext.memory must be an object");
|
|
33
49
|
const memoryPatch = userContextPatch.memory;
|
|
@@ -11,6 +11,7 @@ import { createConnectorSetupSecretRequest, submitConnectorSetupSecret } from ".
|
|
|
11
11
|
import { configureComposioApiKey, executeComposioTool, getComposioInstallationPolicy, getComposioToolkitScope, inspectComposioConnectorHealth, listComposioConnections, listComposioTools, refreshComposioConnection, revokeComposioConnection, setComposioToolkitScope, updateComposioConnection, updateComposioInstallationPolicy } from "../../../connectors/composio.js";
|
|
12
12
|
import { listConnectorProviders } from "../../../connectors/providers.js";
|
|
13
13
|
import { getConnectorDefinition, listConnectorCatalog } from "../../../connectors/catalog.js";
|
|
14
|
+
import { listUnderstandingSourceGrants, revokeUnderstandingSourceGrant } from "../../../user-context/sources/repository.js";
|
|
14
15
|
import { recordConnectorHealthUsage } from "../../../connectors/usage.js";
|
|
15
16
|
import { getConnectorInstance, listConnectorInstances } from "../../../connectors/instances.js";
|
|
16
17
|
import { installConnector, installConnectorDefinition, uninstallConnector, updateConnectorConfig } from "../../../connectors/install.js";
|
|
@@ -159,8 +160,11 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
159
160
|
...allowedScenarioKeys ? { allowedScenarioKeys } : {}
|
|
160
161
|
});
|
|
161
162
|
const connectionId = account.currentConnectionId;
|
|
162
|
-
if (connectionId && !policy.scanEnabled)
|
|
163
|
-
|
|
163
|
+
if (connectionId && !policy.scanEnabled) {
|
|
164
|
+
service.setConnectorLearningPaused(connectionId, true);
|
|
165
|
+
const grant = listUnderstandingSourceGrants().find((item) => item.sourceKey === `connector-account:${account.id}`);
|
|
166
|
+
if (grant) revokeUnderstandingSourceGrant(grant.id);
|
|
167
|
+
} else if (connectionId && previous?.scanEnabled === false) {
|
|
164
168
|
if (service.setConnectorLearningPaused(connectionId, false) === 0) service.requestConnectorLearning(connectionId, {
|
|
165
169
|
mode: "incremental",
|
|
166
170
|
reason: "schedule"
|
|
@@ -179,15 +183,6 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
179
183
|
ok: false,
|
|
180
184
|
error: "Connector account has no usable authorization."
|
|
181
185
|
}, 409);
|
|
182
|
-
const config = service.currentConfig;
|
|
183
|
-
if (!config.userContext.memory.sources.includes("connectedSources")) {
|
|
184
|
-
config.userContext.memory.sources = [...config.userContext.memory.sources, "connectedSources"];
|
|
185
|
-
const saved = await service.saveConfig(config);
|
|
186
|
-
if (!saved.saved) return c.json({
|
|
187
|
-
ok: false,
|
|
188
|
-
error: saved.error
|
|
189
|
-
}, 500);
|
|
190
|
-
}
|
|
191
186
|
const job = service.requestConnectorLearning(account.currentConnectionId, { reason: "manual" });
|
|
192
187
|
if (!job) return c.json({
|
|
193
188
|
ok: false,
|
|
@@ -255,7 +250,13 @@ function registerConnectorRoutes(authenticated, deps) {
|
|
|
255
250
|
});
|
|
256
251
|
authenticated.delete("/api/connectors/composio/connections/:id", strictRateLimitMiddleware, async (c) => {
|
|
257
252
|
try {
|
|
258
|
-
|
|
253
|
+
const connectionId = c.req.param("id");
|
|
254
|
+
const connection = listConnectorConnections().find((item) => item.id === connectionId);
|
|
255
|
+
await revokeComposioConnection(connectionId);
|
|
256
|
+
if (connection?.accountId) {
|
|
257
|
+
const grant = listUnderstandingSourceGrants().find((item) => item.sourceKey === `connector-account:${connection.accountId}`);
|
|
258
|
+
if (grant) revokeUnderstandingSourceGrant(grant.id);
|
|
259
|
+
}
|
|
259
260
|
return c.json({
|
|
260
261
|
ok: true,
|
|
261
262
|
payload: { revoked: true }
|
|
@@ -3,7 +3,6 @@ import { registerAgentStreamRoutes } from "./agent-stream.js";
|
|
|
3
3
|
import { registerDiscussionRoutes } from "./discussions.js";
|
|
4
4
|
import { registerSessionsRoutes } from "./sessions.js";
|
|
5
5
|
import { registerStatusRoutes } from "./status.js";
|
|
6
|
-
import { registerMemoryRoutes } from "./memory.js";
|
|
7
6
|
import { registerProjectsRoutes } from "./projects.js";
|
|
8
7
|
import { registerProjectSkillRoutes } from "./project-skills.js";
|
|
9
8
|
import { registerSearchRoutes } from "./search.js";
|
|
@@ -14,6 +13,7 @@ import { registerEndpointToolRoutes } from "./endpoint-tools.js";
|
|
|
14
13
|
import { registerRealtimeRoutes } from "./realtime.js";
|
|
15
14
|
import { registerLocalAppsRoutes } from "./local-apps.js";
|
|
16
15
|
import { registerWorkDiscoveryRoutes } from "./work-discovery.js";
|
|
16
|
+
import { registerUnderstandingSourceRoutes } from "./understanding-sources.js";
|
|
17
17
|
import { registerTaskRoutes } from "./tasks.js";
|
|
18
18
|
import { registerProactiveRoutes } from "./proactive.js";
|
|
19
19
|
import { mountAppLazyRoutePrefixes, registerAuthenticatedLazyRouteFallback } from "./lazy-fallback.js";
|
|
@@ -22,13 +22,13 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
22
22
|
registerStatusRoutes(authenticated, deps);
|
|
23
23
|
registerAgentStreamRoutes(authenticated, deps);
|
|
24
24
|
registerSessionsRoutes(authenticated, deps);
|
|
25
|
-
registerMemoryRoutes(authenticated, deps);
|
|
26
25
|
registerActivityRoutes(authenticated, deps);
|
|
27
26
|
registerDiscussionRoutes(authenticated, deps);
|
|
28
27
|
registerProjectsRoutes(authenticated, deps);
|
|
29
28
|
registerProjectSkillRoutes(authenticated, deps);
|
|
30
29
|
registerLocalAppsRoutes(authenticated, deps);
|
|
31
30
|
registerWorkDiscoveryRoutes(authenticated, deps);
|
|
31
|
+
registerUnderstandingSourceRoutes(authenticated, deps);
|
|
32
32
|
registerTaskRoutes(authenticated, deps);
|
|
33
33
|
registerProactiveRoutes(authenticated, deps);
|
|
34
34
|
registerSearchRoutes(authenticated, deps);
|
|
@@ -94,11 +94,7 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
id: "agents",
|
|
97
|
-
match: (path) => startsWithAny(path, [
|
|
98
|
-
"/api/agents",
|
|
99
|
-
"/api/user-profile",
|
|
100
|
-
"/api/voice/models"
|
|
101
|
-
]),
|
|
97
|
+
match: (path) => startsWithAny(path, ["/api/agents", "/api/voice/models"]),
|
|
102
98
|
load: async () => {
|
|
103
99
|
const { registerAgentsRoutes } = await import("./agents.js");
|
|
104
100
|
return { register: registerAgentsRoutes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readLocalAppAcceptanceConfig } from "../../../local-apps/acceptance.js";
|
|
2
|
-
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
3
2
|
import { LOCAL_APP_RUNTIME_BRIDGE_HASH, injectLocalAppRuntimeBridge } from "../../../local-apps/preview-runtime-bridge.js";
|
|
3
|
+
import { extensionAssetMimeType } from "../lib/extension-assets.js";
|
|
4
4
|
import { relative, resolve } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
//#region src/gateway/hono/routes/local-apps.ts
|
|
@@ -7,7 +7,7 @@ import { CredentialResolver, init_credentials } from "../../../auth/credentials.
|
|
|
7
7
|
import "../../../providers/constants.js";
|
|
8
8
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
9
9
|
import { PROVIDER_META, getAllModels, getAllProviders, getAvailableModels, getProviderAuthState, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
10
|
-
import { getImageGenerationProvider, reloadImageGenerationProviders } from "../../../agent/image/generation/provider-registry.js";
|
|
10
|
+
import { getImageGenerationProvider, reloadImageGenerationProviders, resolveImageGenerationCredentialMode } from "../../../agent/image/generation/provider-registry.js";
|
|
11
11
|
import { SessionConfigStore } from "../../../session/config-store.js";
|
|
12
12
|
import { deleteCustomImageProvider, listCustomImageProviders, upsertCustomImageProvider } from "../../custom-image-providers.js";
|
|
13
13
|
import { getDomesticProviderPreset, getDomesticProviderPresetIds } from "../../../providers/domestic-presets.js";
|
|
@@ -346,7 +346,7 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
346
346
|
ok: false,
|
|
347
347
|
error: { message: `Unknown image provider: ${providerId}` }
|
|
348
348
|
}, 404);
|
|
349
|
-
if (provider
|
|
349
|
+
if (resolveImageGenerationCredentialMode(provider) !== "api-key") return c.json({
|
|
350
350
|
ok: false,
|
|
351
351
|
error: { message: "This provider does not use an API key" }
|
|
352
352
|
}, 400);
|
|
@@ -473,14 +473,15 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
473
473
|
error: { message: prepared.error }
|
|
474
474
|
}, 400);
|
|
475
475
|
const resolver = new CredentialResolver();
|
|
476
|
-
const
|
|
476
|
+
const usesApiKey = resolveImageGenerationCredentialMode(getImageGenerationProvider(prepared.providerId)) === "api-key";
|
|
477
|
+
const previousKey = usesApiKey ? await resolver.revealGatewayStoredApiKey(prepared.providerId) : void 0;
|
|
477
478
|
const suppliedKey = typeof body.apiKey === "string" ? body.apiKey.trim() : "";
|
|
478
|
-
const effectiveKey = suppliedKey || await resolver.resolveApiKey(prepared.providerId);
|
|
479
|
-
if (
|
|
479
|
+
const effectiveKey = usesApiKey ? suppliedKey || await resolver.resolveApiKey(prepared.providerId) : void 0;
|
|
480
|
+
if (usesApiKey && !effectiveKey) return c.json({
|
|
480
481
|
ok: false,
|
|
481
482
|
error: { message: "API key is required" }
|
|
482
483
|
}, 400);
|
|
483
|
-
const verification = suppliedKey ? await verifyImageGenerationCredential({
|
|
484
|
+
const verification = usesApiKey && suppliedKey ? await verifyImageGenerationCredential({
|
|
484
485
|
providerId: prepared.providerId,
|
|
485
486
|
apiKey: suppliedKey,
|
|
486
487
|
baseUrl: typeof body.baseUrl === "string" ? body.baseUrl : void 0
|
|
@@ -492,10 +493,10 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
492
493
|
ok: false,
|
|
493
494
|
error: { message: verification.message ?? "Credential verification failed" }
|
|
494
495
|
}, 400);
|
|
495
|
-
if (suppliedKey) await resolver.saveApiKey(prepared.providerId, suppliedKey, { profileName: "default" });
|
|
496
|
+
if (usesApiKey && suppliedKey) await resolver.saveApiKey(prepared.providerId, suppliedKey, { profileName: "default" });
|
|
496
497
|
const saved = await service.saveConfig(prepared.config);
|
|
497
498
|
if (!saved.saved) {
|
|
498
|
-
if (suppliedKey) if (previousKey) await resolver.saveApiKey(prepared.providerId, previousKey, { profileName: "default" });
|
|
499
|
+
if (usesApiKey && suppliedKey) if (previousKey) await resolver.saveApiKey(prepared.providerId, previousKey, { profileName: "default" });
|
|
499
500
|
else await resolver.deleteProfile(`${prepared.providerId}:default`);
|
|
500
501
|
return c.json({
|
|
501
502
|
ok: false,
|
|
@@ -34,7 +34,6 @@ function buildEvalRuntimeIdentity(service, agentId) {
|
|
|
34
34
|
const models = asRecord(manifest.models);
|
|
35
35
|
const tools = asRecord(manifest.tools);
|
|
36
36
|
const skills = manifest.skills ?? [];
|
|
37
|
-
const codeIntelligence = config.codeIntelligence;
|
|
38
37
|
return {
|
|
39
38
|
ok: true,
|
|
40
39
|
payload: {
|
|
@@ -48,12 +47,6 @@ function buildEvalRuntimeIdentity(service, agentId) {
|
|
|
48
47
|
systemPromptConfigHash: contentHash(manifest.systemPrompt ?? null),
|
|
49
48
|
toolPolicyHash: contentHash(tools),
|
|
50
49
|
skillPolicyHash: contentHash(skills),
|
|
51
|
-
codeIntelligence: {
|
|
52
|
-
enabled: codeIntelligence?.enabled === true,
|
|
53
|
-
configuredForAgent: codeIntelligence?.agentIds?.includes(agentId) === true,
|
|
54
|
-
indexMode: codeIntelligence?.indexMode ?? null,
|
|
55
|
-
configHash: contentHash(codeIntelligence ?? null)
|
|
56
|
-
},
|
|
57
50
|
presetChain: effective.data.sources
|
|
58
51
|
}
|
|
59
52
|
};
|