@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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { deleteUnderstanding, listUnderstandingEvidence, listUnderstandings } from "../../../storage/sqlite/user-context-repository.js";
|
|
2
|
+
import { getConnectorAccount } from "../../../storage/sqlite/connector-account-repository.js";
|
|
3
|
+
import "../../../storage/sqlite/index.js";
|
|
4
|
+
import { getUnderstandingSourceGrant, listUnderstandingSourceGrants, listUserFocuses, revokeUnderstandingSourceGrant, setUserFocusStatus } from "../../../user-context/sources/repository.js";
|
|
5
|
+
import { getWorkDiscoveryService } from "./work-discovery.js";
|
|
6
|
+
import { listUnderstandingSourceDefinitions } from "../../../user-context/sources/catalog.js";
|
|
7
|
+
//#region src/gateway/hono/routes/understanding-sources.ts
|
|
8
|
+
function stringField(body, field) {
|
|
9
|
+
if (!body || typeof body !== "object") return "";
|
|
10
|
+
const value = body[field];
|
|
11
|
+
return typeof value === "string" ? value.trim() : "";
|
|
12
|
+
}
|
|
13
|
+
function decisionsFrom(body) {
|
|
14
|
+
return (body && typeof body === "object" && Array.isArray(body.decisions) ? body.decisions : []).flatMap((value) => {
|
|
15
|
+
if (!value || typeof value !== "object") return [];
|
|
16
|
+
const item = value;
|
|
17
|
+
const understandingId = typeof item.understandingId === "string" ? item.understandingId.trim() : "";
|
|
18
|
+
const status = item.status === "accepted" || item.status === "edited" || item.status === "rejected" ? item.status : null;
|
|
19
|
+
if (!understandingId || !status) return [];
|
|
20
|
+
return [{
|
|
21
|
+
understandingId,
|
|
22
|
+
status,
|
|
23
|
+
...typeof item.statement === "string" ? { statement: item.statement } : {}
|
|
24
|
+
}];
|
|
25
|
+
}).slice(0, 20);
|
|
26
|
+
}
|
|
27
|
+
function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
28
|
+
const service = getWorkDiscoveryService(deps);
|
|
29
|
+
const limited = deps.strictRateLimitMiddleware;
|
|
30
|
+
authenticated.get("/api/understanding/sources/catalog", (c) => {
|
|
31
|
+
const requested = c.req.query("platform");
|
|
32
|
+
const platform = requested === "darwin" || requested === "win32" || requested === "linux" ? requested : process.platform;
|
|
33
|
+
return c.json({
|
|
34
|
+
ok: true,
|
|
35
|
+
sources: listUnderstandingSourceDefinitions(platform)
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
authenticated.get("/api/understanding/sources/grants", (c) => c.json({
|
|
39
|
+
ok: true,
|
|
40
|
+
grants: listUnderstandingSourceGrants({ includeRevoked: c.req.query("includeRevoked") === "true" })
|
|
41
|
+
}));
|
|
42
|
+
authenticated.delete("/api/understanding/sources/grants/:grantId", limited, (c) => {
|
|
43
|
+
const current = getUnderstandingSourceGrant(c.req.param("grantId"));
|
|
44
|
+
const accountId = typeof current?.config.accountId === "string" ? current.config.accountId : void 0;
|
|
45
|
+
const connectionId = accountId ? getConnectorAccount(accountId)?.currentConnectionId : void 0;
|
|
46
|
+
if (connectionId) deps.service.setConnectorLearningPaused(connectionId, true);
|
|
47
|
+
const grant = revokeUnderstandingSourceGrant(c.req.param("grantId"));
|
|
48
|
+
if (grant && c.req.query("deleteDerived") === "true") {
|
|
49
|
+
const activeGrantIds = new Set(listUnderstandingSourceGrants().map((item) => item.id));
|
|
50
|
+
for (const understanding of listUnderstandings()) {
|
|
51
|
+
const grantEvidence = listUnderstandingEvidence(understanding.id).map((evidence) => /^understanding-source-grant:([^:]+):/.exec(evidence.sourceRef)?.[1]).filter((id) => Boolean(id));
|
|
52
|
+
if (grantEvidence.includes(grant.id) && !grantEvidence.some((id) => id !== grant.id && activeGrantIds.has(id))) deleteUnderstanding(understanding.id);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return grant ? c.json({
|
|
56
|
+
ok: true,
|
|
57
|
+
grant
|
|
58
|
+
}) : c.json({
|
|
59
|
+
ok: false,
|
|
60
|
+
error: "Source grant not found"
|
|
61
|
+
}, 404);
|
|
62
|
+
});
|
|
63
|
+
authenticated.post("/api/understanding/sources/grants/:grantId/refresh", limited, async (c) => {
|
|
64
|
+
const grant = getUnderstandingSourceGrant(c.req.param("grantId"));
|
|
65
|
+
if (!grant || grant.status !== "active") return c.json({
|
|
66
|
+
ok: false,
|
|
67
|
+
error: "Active source grant not found"
|
|
68
|
+
}, 404);
|
|
69
|
+
try {
|
|
70
|
+
if (grant.adapterId === "local-work-folders") {
|
|
71
|
+
const result = await service.refreshDirectorySourceIfChanged({
|
|
72
|
+
id: grant.id,
|
|
73
|
+
idempotencyKey: crypto.randomUUID()
|
|
74
|
+
});
|
|
75
|
+
return c.json({
|
|
76
|
+
ok: true,
|
|
77
|
+
result
|
|
78
|
+
}, result.changed ? 202 : 200);
|
|
79
|
+
}
|
|
80
|
+
const accountId = typeof grant.config.accountId === "string" ? grant.config.accountId : "";
|
|
81
|
+
const connectionId = accountId ? getConnectorAccount(accountId)?.currentConnectionId : void 0;
|
|
82
|
+
if (connectionId) {
|
|
83
|
+
const job = deps.service.requestConnectorLearning(connectionId, {
|
|
84
|
+
mode: "incremental",
|
|
85
|
+
reason: "manual"
|
|
86
|
+
});
|
|
87
|
+
return job ? c.json({
|
|
88
|
+
ok: true,
|
|
89
|
+
job
|
|
90
|
+
}, 202) : c.json({
|
|
91
|
+
ok: false,
|
|
92
|
+
error: "Source does not support learning"
|
|
93
|
+
}, 409);
|
|
94
|
+
}
|
|
95
|
+
return c.json({
|
|
96
|
+
ok: false,
|
|
97
|
+
error: "This source is collected from the desktop app"
|
|
98
|
+
}, 409);
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return c.json({
|
|
101
|
+
ok: false,
|
|
102
|
+
error: error instanceof Error ? error.message : String(error)
|
|
103
|
+
}, 400);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
authenticated.get("/api/understanding/sources/work-folders", (c) => c.json({
|
|
107
|
+
ok: true,
|
|
108
|
+
sources: service.listDirectorySources()
|
|
109
|
+
}));
|
|
110
|
+
authenticated.post("/api/understanding/sources/work-folders", limited, async (c) => {
|
|
111
|
+
const rootPath = stringField(await c.req.json().catch(() => null), "rootPath");
|
|
112
|
+
if (!rootPath) return c.json({
|
|
113
|
+
ok: false,
|
|
114
|
+
error: "Missing rootPath"
|
|
115
|
+
}, 400);
|
|
116
|
+
try {
|
|
117
|
+
return c.json({
|
|
118
|
+
ok: true,
|
|
119
|
+
source: await service.grantDirectorySource(rootPath)
|
|
120
|
+
}, 201);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
return c.json({
|
|
123
|
+
ok: false,
|
|
124
|
+
error: error instanceof Error ? error.message : String(error)
|
|
125
|
+
}, 400);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
authenticated.post("/api/understanding/sources/work-folders/:grantId/runs", limited, async (c) => {
|
|
129
|
+
try {
|
|
130
|
+
const run = await service.rescanDirectorySource({
|
|
131
|
+
id: c.req.param("grantId"),
|
|
132
|
+
idempotencyKey: crypto.randomUUID()
|
|
133
|
+
});
|
|
134
|
+
return c.json({
|
|
135
|
+
ok: true,
|
|
136
|
+
run
|
|
137
|
+
}, 202);
|
|
138
|
+
} catch (error) {
|
|
139
|
+
return c.json({
|
|
140
|
+
ok: false,
|
|
141
|
+
error: error instanceof Error ? error.message : String(error)
|
|
142
|
+
}, 400);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
authenticated.post("/api/understanding/bootstrap", limited, async (c) => {
|
|
146
|
+
const body = await c.req.json().catch(() => null);
|
|
147
|
+
const items = body && typeof body === "object" && Array.isArray(body.items) ? body.items.slice(0, 150) : [];
|
|
148
|
+
if (!items.length) return c.json({
|
|
149
|
+
ok: false,
|
|
150
|
+
error: "No understanding source items were provided"
|
|
151
|
+
}, 400);
|
|
152
|
+
try {
|
|
153
|
+
const result = await service.importUnderstandingSources(items, c.req.raw.signal, stringField(body, "workDiscoveryRunId") || void 0);
|
|
154
|
+
return c.json({
|
|
155
|
+
ok: true,
|
|
156
|
+
...result
|
|
157
|
+
}, 201);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
return c.json({
|
|
160
|
+
ok: false,
|
|
161
|
+
error: error instanceof Error ? error.message : String(error)
|
|
162
|
+
}, 400);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
authenticated.post("/api/understanding/review", limited, async (c) => {
|
|
166
|
+
const decisions = decisionsFrom(await c.req.json().catch(() => null));
|
|
167
|
+
if (!decisions.length) return c.json({
|
|
168
|
+
ok: false,
|
|
169
|
+
error: "At least one valid decision is required"
|
|
170
|
+
}, 400);
|
|
171
|
+
return c.json({
|
|
172
|
+
ok: true,
|
|
173
|
+
decisions: service.updateUnderstandingSourceProfile({ decisions })
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
authenticated.get("/api/understanding/focuses", (c) => c.json({
|
|
177
|
+
ok: true,
|
|
178
|
+
focuses: listUserFocuses()
|
|
179
|
+
}));
|
|
180
|
+
authenticated.patch("/api/understanding/focuses/:focusId", limited, async (c) => {
|
|
181
|
+
const requested = stringField(await c.req.json().catch(() => null), "status");
|
|
182
|
+
if (!new Set([
|
|
183
|
+
"candidate",
|
|
184
|
+
"active",
|
|
185
|
+
"paused",
|
|
186
|
+
"completed",
|
|
187
|
+
"rejected"
|
|
188
|
+
]).has(requested)) return c.json({
|
|
189
|
+
ok: false,
|
|
190
|
+
error: "Invalid focus status"
|
|
191
|
+
}, 400);
|
|
192
|
+
const focus = setUserFocusStatus(c.req.param("focusId"), requested);
|
|
193
|
+
return focus ? c.json({
|
|
194
|
+
ok: true,
|
|
195
|
+
focus
|
|
196
|
+
}) : c.json({
|
|
197
|
+
ok: false,
|
|
198
|
+
error: "Focus not found"
|
|
199
|
+
}, 404);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
export { registerUnderstandingSourceRoutes };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PACKAGE_VERSION, init_package_version } from "../../../package-version.js";
|
|
2
2
|
import { loadConfig } from "../../../config/loader.js";
|
|
3
3
|
import "../../../config/index.js";
|
|
4
|
-
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
5
4
|
import { normalizeUpdateChannel } from "../../../infra/update-channels.js";
|
|
5
|
+
import { acquireUpdateLock } from "../../../infra/update-lock.js";
|
|
6
|
+
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
6
7
|
import { getUpdateAvailable, runGatewayUpdateCheck } from "../../../infra/update-startup.js";
|
|
7
8
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
8
|
-
import { formatUpdateApiResult, runGatewayUpdateWithPostSteps } from "../../../infra/update-runner.js";
|
|
9
9
|
import { streamSSE } from "hono/streaming";
|
|
10
10
|
//#region src/gateway/hono/routes/update.ts
|
|
11
11
|
init_package_version();
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
+
import { WorkDiscoveryService } from '../../../work-discovery/service.js';
|
|
2
3
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
4
|
+
export declare function getWorkDiscoveryService(deps: AuthenticatedRouteDeps): WorkDiscoveryService;
|
|
3
5
|
export declare function registerWorkDiscoveryRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -7,7 +7,7 @@ import { WorkDiscoveryService } from "../../../work-discovery/service.js";
|
|
|
7
7
|
init_schema();
|
|
8
8
|
init_providers();
|
|
9
9
|
const services = /* @__PURE__ */ new WeakMap();
|
|
10
|
-
function
|
|
10
|
+
function getWorkDiscoveryService(deps) {
|
|
11
11
|
const existing = services.get(deps.service);
|
|
12
12
|
if (existing) return existing;
|
|
13
13
|
const service = new WorkDiscoveryService({
|
|
@@ -25,7 +25,7 @@ function stringField(body, field) {
|
|
|
25
25
|
return typeof value === "string" ? value.trim() : "";
|
|
26
26
|
}
|
|
27
27
|
function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
28
|
-
const service =
|
|
28
|
+
const service = getWorkDiscoveryService(deps);
|
|
29
29
|
const limited = deps.strictRateLimitMiddleware;
|
|
30
30
|
authenticated.get("/api/onboarding/work-discovery", (c) => c.json({
|
|
31
31
|
enabled: service.isEnabled(),
|
|
@@ -95,137 +95,6 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
95
95
|
}, 500);
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
-
authenticated.get("/api/work-discovery/sources/directories", (c) => c.json({
|
|
99
|
-
ok: true,
|
|
100
|
-
sources: service.listDirectorySources()
|
|
101
|
-
}));
|
|
102
|
-
authenticated.post("/api/work-discovery/sources/directories", limited, async (c) => {
|
|
103
|
-
const rootPath = stringField(await c.req.json().catch(() => null), "rootPath");
|
|
104
|
-
if (!rootPath) return c.json({
|
|
105
|
-
ok: false,
|
|
106
|
-
error: "Missing rootPath"
|
|
107
|
-
}, 400);
|
|
108
|
-
try {
|
|
109
|
-
const source = await service.grantDirectorySource(rootPath);
|
|
110
|
-
return c.json({
|
|
111
|
-
ok: true,
|
|
112
|
-
source
|
|
113
|
-
}, 201);
|
|
114
|
-
} catch (error) {
|
|
115
|
-
return c.json({
|
|
116
|
-
ok: false,
|
|
117
|
-
error: error instanceof Error ? error.message : String(error)
|
|
118
|
-
}, 400);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
authenticated.delete("/api/work-discovery/sources/directories/:sourceId", limited, (c) => {
|
|
122
|
-
const source = service.revokeDirectorySource(c.req.param("sourceId"));
|
|
123
|
-
return source ? c.json({
|
|
124
|
-
ok: true,
|
|
125
|
-
source
|
|
126
|
-
}) : c.json({
|
|
127
|
-
ok: false,
|
|
128
|
-
error: "Source not found"
|
|
129
|
-
}, 404);
|
|
130
|
-
});
|
|
131
|
-
authenticated.post("/api/work-discovery/sources/directories/:sourceId/runs", limited, async (c) => {
|
|
132
|
-
const idempotencyKey = stringField(await c.req.json().catch(() => null), "idempotencyKey");
|
|
133
|
-
if (!idempotencyKey) return c.json({
|
|
134
|
-
ok: false,
|
|
135
|
-
error: "Missing idempotencyKey"
|
|
136
|
-
}, 400);
|
|
137
|
-
try {
|
|
138
|
-
const run = await service.rescanDirectorySource({
|
|
139
|
-
id: c.req.param("sourceId"),
|
|
140
|
-
idempotencyKey
|
|
141
|
-
});
|
|
142
|
-
return c.json({
|
|
143
|
-
ok: true,
|
|
144
|
-
run
|
|
145
|
-
}, 202);
|
|
146
|
-
} catch (error) {
|
|
147
|
-
return c.json({
|
|
148
|
-
ok: false,
|
|
149
|
-
error: error instanceof Error ? error.message : String(error)
|
|
150
|
-
}, 400);
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
authenticated.post("/api/work-discovery/sources/directories/check", limited, async (c) => {
|
|
154
|
-
return c.json({
|
|
155
|
-
ok: true,
|
|
156
|
-
checks: await service.checkDirectorySources()
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
authenticated.post("/api/work-discovery/sources/directories/:sourceId/refresh-if-changed", limited, async (c) => {
|
|
160
|
-
const idempotencyKey = stringField(await c.req.json().catch(() => null), "idempotencyKey");
|
|
161
|
-
if (!idempotencyKey) return c.json({
|
|
162
|
-
ok: false,
|
|
163
|
-
error: "Missing idempotencyKey"
|
|
164
|
-
}, 400);
|
|
165
|
-
try {
|
|
166
|
-
const result = await service.refreshDirectorySourceIfChanged({
|
|
167
|
-
id: c.req.param("sourceId"),
|
|
168
|
-
idempotencyKey
|
|
169
|
-
});
|
|
170
|
-
return c.json({
|
|
171
|
-
ok: true,
|
|
172
|
-
...result
|
|
173
|
-
}, result.changed ? 202 : 200);
|
|
174
|
-
} catch (error) {
|
|
175
|
-
return c.json({
|
|
176
|
-
ok: false,
|
|
177
|
-
error: error instanceof Error ? error.message : String(error)
|
|
178
|
-
}, 400);
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
authenticated.post("/api/work-discovery/personal-context/import", limited, async (c) => {
|
|
182
|
-
if (!service.isEnabled()) return c.json({
|
|
183
|
-
ok: false,
|
|
184
|
-
error: "Work discovery is disabled"
|
|
185
|
-
}, 404);
|
|
186
|
-
const body = await c.req.json().catch(() => null);
|
|
187
|
-
const items = body && typeof body === "object" && Array.isArray(body.items) ? body.items.slice(0, 150) : [];
|
|
188
|
-
const runId = stringField(body, "runId");
|
|
189
|
-
if (!items.length) return c.json({
|
|
190
|
-
ok: false,
|
|
191
|
-
error: "No personal context was provided"
|
|
192
|
-
}, 400);
|
|
193
|
-
try {
|
|
194
|
-
const result = await service.importPersonalContext(items, c.req.raw.signal, runId || void 0);
|
|
195
|
-
return c.json({
|
|
196
|
-
ok: true,
|
|
197
|
-
...result
|
|
198
|
-
}, 201);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
return c.json({
|
|
201
|
-
ok: false,
|
|
202
|
-
error: error instanceof Error ? error.message : String(error)
|
|
203
|
-
}, 400);
|
|
204
|
-
}
|
|
205
|
-
});
|
|
206
|
-
authenticated.post("/api/work-discovery/personal-context/profile", limited, async (c) => {
|
|
207
|
-
const body = await c.req.json().catch(() => null);
|
|
208
|
-
const decisions = (body && typeof body === "object" && Array.isArray(body.decisions) ? body.decisions : []).flatMap((value) => {
|
|
209
|
-
if (!value || typeof value !== "object") return [];
|
|
210
|
-
const item = value;
|
|
211
|
-
const memoryRecordId = typeof item.memoryRecordId === "string" ? item.memoryRecordId.trim() : "";
|
|
212
|
-
const status = item.status === "accepted" || item.status === "edited" || item.status === "rejected" ? item.status : void 0;
|
|
213
|
-
if (!memoryRecordId || !status) return [];
|
|
214
|
-
return [{
|
|
215
|
-
memoryRecordId,
|
|
216
|
-
status,
|
|
217
|
-
...typeof item.statement === "string" ? { statement: item.statement } : {}
|
|
218
|
-
}];
|
|
219
|
-
}).slice(0, 10);
|
|
220
|
-
if (!decisions.length) return c.json({
|
|
221
|
-
ok: false,
|
|
222
|
-
error: "At least one valid decision is required"
|
|
223
|
-
}, 400);
|
|
224
|
-
return c.json({
|
|
225
|
-
ok: true,
|
|
226
|
-
decisions: service.updatePersonalContextProfile({ decisions })
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
98
|
authenticated.post("/api/work-discovery/quick-runs", limited, async (c) => {
|
|
230
99
|
if (!service.isEnabled()) return c.json({
|
|
231
100
|
ok: false,
|
|
@@ -389,4 +258,4 @@ function registerWorkDiscoveryRoutes(authenticated, deps) {
|
|
|
389
258
|
});
|
|
390
259
|
}
|
|
391
260
|
//#endregion
|
|
392
|
-
export { registerWorkDiscoveryRoutes };
|
|
261
|
+
export { getWorkDiscoveryService, registerWorkDiscoveryRoutes };
|
|
@@ -1,25 +1,3 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
-
import type { MemoryRecord } from '../../../agent/memory/types.js';
|
|
3
|
-
import { type PersonalPlaybookContext } from '../../../user-context/personal-playbook.js';
|
|
4
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
5
|
-
export declare function buildPersonalPlaybooks(records: MemoryRecord[]): {
|
|
6
|
-
id: "communication" | "execution" | "routines";
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
rules: {
|
|
9
|
-
id: string;
|
|
10
|
-
statement: string;
|
|
11
|
-
origin: import("../../../agent/memory/types.js").MemoryExplicitness;
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
order: number;
|
|
14
|
-
context: PersonalPlaybookContext;
|
|
15
|
-
versions: {
|
|
16
|
-
id: string;
|
|
17
|
-
statement: string;
|
|
18
|
-
updatedAt: string;
|
|
19
|
-
current: boolean;
|
|
20
|
-
}[];
|
|
21
|
-
}[];
|
|
22
|
-
updatedAt: string;
|
|
23
|
-
}[];
|
|
24
|
-
export declare function buildRoutineAutomationDraftHref(record: Pick<MemoryRecord, 'id' | 'content'>): string;
|
|
25
3
|
export declare function registerYouRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|