@xopcai/xopc 0.0.217 → 0.0.219
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-D6trMTyZ.js → activity-store-slG02hSm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CAQdFrcu.js → agent-avatar-dicebear-DZ6ETNIk.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DxaIH0Ep.js +68 -0
- package/dist/gateway/static/root/assets/{api-B9pZAyMB.js → api-Tz57QxiN.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-DdR1L4LR.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-wYbwqmee.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-CyWr6KyO.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BF0q7N24.js → archive-plugin-DKXa160O.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D1qmjGDo.js → attachment-load-CzwA9g2y.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Ccu4yRFa.js → automations-page-DwAXyWAY.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CL7ieYIt.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DooqxEZz.js → binary-plugins-DoQ_DnT7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dqg9kvb9.js → block-editor-Bj_Uxxng.js} +47 -47
- package/dist/gateway/static/root/assets/browser-settings-page-BYa_FNC1.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-CsIh8ySc.js → browser-workflow-inputs-D4roXE6r.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-BXQFxT0p.js → browser-workflows-page-CleKTAKD.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DYG37N0k.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BX9U0FRh.js → capability-presets-api-wtEN6Ss6.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C0Q4dFq-.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CUBTQ0Bz.js → channel-recipient-api-DhuS2RJ3.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CpO6Xg0n.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-CXhPeiNj.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-ClQMDe2n.js +36 -0
- package/dist/gateway/static/root/assets/connectors-page-BvyiPdKU.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-XzPZhzVM.js → cron-expression-4DvCFs-v.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-B6FSjt4Z.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-Za18eMp1.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-DZjW-7Tw.js → desktop-pet-DUUf3yyJ.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dwx3GfB8.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-C6dfTCsl.js +1 -0
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-D7APnE3n.js → extension-debug-page-Cordpg4X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BhV5hz70.js → extension-page-Dw0dGyMl.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-B2pUMaXm.js +1 -0
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +1 -0
- package/dist/gateway/static/root/assets/eye-off-DEAzt3g1.js +1 -0
- package/dist/gateway/static/root/assets/file-code-corner-byQA1VfD.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-DAZUOEQh.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-BTH9HVUk.js → gateway-config-swr-BIqRg-zo.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-ik2f-pmV.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DAEk_tnd.js → gateway-startup-retry-BFjWYOCS.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-BE81XJ8F.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BTWXJu_m.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-HqcQrSed.js → image-generation-api-HXAWlgm6.js} +1 -1
- package/dist/gateway/static/root/assets/index-B6gWYy08.js +108 -0
- package/dist/gateway/static/root/assets/index-CDkuz_YC.css +2 -0
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BG6lShzn.js → keyboard-shortcuts-settings-ROqQ_Xlo.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dcaf190G.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-vaz8ewe2.js → local-apps-page-Be79cyMG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-De8wYkd7.js → locale-store-DfK-Hofd.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C2pjbXno.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-tqTGCHt0.js → management-settings-CRspx0oY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-BGx8Aao0.js → markdown-split-G3PTpGw3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ybRARsPs.js → markdown-view-D4FPJZ91.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-xbM-SSP5.js → media-plugins-DT0P7j7u.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B701TEZ5.js +3 -0
- package/dist/gateway/static/root/assets/{notes-api-D9CCwyWK.js → notes-api-q7HjYO07.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CMNBbg6g.js → notes-page-Cgl2h7AR.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DFMQYyGJ.js +4 -0
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-CsNVTKC0.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CZdzgPZW.js → product-open-page-ComKLO4D.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DUFmQscH.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CTWxt3dv.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DYmKEwiG.js → registry-api-BBoJ7khF.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-qmG-3qjj.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DQ12tLCL.js → runtime-tools-settings-panel-CXHQc53b.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DNCDIkqC.js → schema-form-3jTDF2lJ.js} +1 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-D_We4_MV.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-B_QhPgU0.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CUDozALU.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-xgo41cfo.js → settings-loading-skeleton-H3ZH6a6l.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-8astk_1U.js → settings-page-tx29z21o.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-VunfXpTX.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BBZV4AGy.js → share-preview-page-MyThymEx.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DkZvY1cr.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DVDOh1iY.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-BOOyMnno.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-HmoDhJVh.js → skills-page.utils-Bl5Yv3Cx.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-DwQ3O1ta.js +1 -0
- package/dist/gateway/static/root/assets/tab-completion-input-D64VNmiA.js +1 -0
- package/dist/gateway/static/root/assets/tab-completion-input.utils-BP3NH_du.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BwOyrADL.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-STx6jo38.js → theme-store-Br4BtK4x.js} +1 -1
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CqFVx92z.js → use-autosave-DRS3RwS9.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-ClV2r3Cr.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-pYDiKKMo.js → voice-api-key-field-CGTE5156.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-LJLw9zf0.js → work-discovery-overlay-CW-HKD7h.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D0WhQ3kI.js → workflow-run-setup-panel-Dtr9fDC8.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-CDOyNgZf.js +5 -0
- package/dist/gateway/static/root/index.html +20 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/new-session.js +99 -0
- package/dist/packages/gateway-contract/src/tasks.js +5 -0
- package/dist/packages/gateway-contract/src/user-message-display.js +55 -0
- package/dist/src/agent/agent-manager.js +3 -2
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +6 -3
- package/dist/src/agent/background-review/run-background-review.js +144 -16
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +3 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
- package/dist/src/agent/memory/context/types.d.ts +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent/memory/manager.d.ts +2 -1
- package/dist/src/agent/memory/manager.js +2 -6
- package/dist/src/agent/memory/understanding/service.d.ts +1 -0
- package/dist/src/agent/memory/understanding/service.js +179 -36
- package/dist/src/agent/memory/understanding/types.d.ts +6 -0
- package/dist/src/agent/messaging/command-handler.d.ts +2 -0
- package/dist/src/agent/messaging/command-handler.js +3 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +3 -0
- package/dist/src/agent/service/direct-turn-helpers.js +13 -3
- package/dist/src/agent/service/process-direct-streaming.d.ts +2 -1
- package/dist/src/agent/service/process-direct-streaming.js +12 -11
- package/dist/src/agent/session/session-config-service.d.ts +1 -0
- package/dist/src/agent/session/session-config-service.js +11 -0
- package/dist/src/agent/session/session-inspector.d.ts +1 -0
- package/dist/src/agent/session/session-inspector.js +1 -0
- package/dist/src/agent/source-context/budget.d.ts +3 -0
- package/dist/src/agent/source-context/budget.js +21 -0
- package/dist/src/agent/source-context/index.js +3 -3
- package/dist/src/agent/source-context/injector.d.ts +2 -2
- package/dist/src/agent/source-context/injector.js +19 -9
- package/dist/src/agent/source-context/types.d.ts +16 -0
- package/dist/src/agent/source-context/types.js +25 -1
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +19 -2
- package/dist/src/agent/tools/xopc-use-tool.js +62 -2
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/browser/backend-from-config.d.ts +8 -0
- package/dist/src/browser/backend-from-config.js +16 -1
- package/dist/src/browser/providers/browser-ext-install.d.ts +3 -2
- package/dist/src/browser/providers/browser-ext-install.js +4 -2
- package/dist/src/chat-commands/builtins/review.js +11 -2
- package/dist/src/chat-commands/builtins/understanding.js +11 -4
- package/dist/src/chat-commands/types.d.ts +4 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/models-json.d.ts +20 -20
- package/dist/src/connectors/connected-source-ingestion.js +21 -4
- package/dist/src/connectors/connected-source-normalizers.js +51 -4
- package/dist/src/connectors/connected-source-understanding.d.ts +20 -0
- package/dist/src/connectors/connected-source-understanding.js +180 -0
- package/dist/src/connectors/content-enrichment.d.ts +1 -0
- package/dist/src/connectors/content-enrichment.js +11 -7
- package/dist/src/connectors/learning-coordinator.js +112 -15
- package/dist/src/connectors/learning-recipes.js +2 -2
- package/dist/src/document-understanding/extract.d.ts +1 -1
- package/dist/src/document-understanding/extract.js +54 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +18 -0
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +12 -2
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +1 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +46 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +23 -3
- package/dist/src/gateway/hono/routes/sessions.js +17 -20
- package/dist/src/gateway/hono/routes/tasks.js +25 -0
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +9 -0
- package/dist/src/gateway/hono/routes/understanding-sources.js +138 -24
- package/dist/src/gateway/hono/routes/you.js +71 -4
- package/dist/src/gateway/rate-limit/buckets.d.ts +1 -1
- package/dist/src/gateway/rate-limit/buckets.js +2 -2
- package/dist/src/gateway/service/agent-runner.d.ts +7 -2
- package/dist/src/gateway/service/agent-runner.js +21 -1
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -1
- package/dist/src/gateway/service/session-input-coordinator.d.ts +8 -2
- package/dist/src/gateway/service/session-input-coordinator.js +62 -3
- package/dist/src/gateway/service/sessions-api.d.ts +1 -0
- package/dist/src/gateway/service.d.ts +3 -2
- package/dist/src/gateway/service.js +16 -6
- package/dist/src/gateway/user-turn-input.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +3 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +16 -3
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.js +4 -2
- package/dist/src/retrieval/queryProfile.d.ts +1 -0
- package/dist/src/retrieval/queryProfile.js +9 -1
- package/dist/src/session/client-history.d.ts +11 -0
- package/dist/src/session/client-history.js +24 -2
- package/dist/src/session/config-types.d.ts +1 -1
- package/dist/src/session/session-title.js +2 -3
- package/dist/src/session/store.js +1 -0
- package/dist/src/session/transcript-outline.js +5 -2
- package/dist/src/session/types.d.ts +1 -0
- package/dist/src/session/user-message-display.d.ts +4 -0
- package/dist/src/session/user-message-display.js +22 -0
- package/dist/src/storage/sqlite/context-extraction-repository.d.ts +57 -0
- package/dist/src/storage/sqlite/context-extraction-repository.js +119 -0
- package/dist/src/storage/sqlite/context-relation-repository.d.ts +50 -0
- package/dist/src/storage/sqlite/context-relation-repository.js +97 -0
- package/dist/src/storage/sqlite/index.d.ts +4 -2
- package/dist/src/storage/sqlite/index.js +5 -3
- package/dist/src/storage/sqlite/migrations/126_focus_context_governance.sql +72 -0
- package/dist/src/storage/sqlite/migrations/127_context_object_origin.sql +36 -0
- package/dist/src/storage/sqlite/migrations/128_context_extraction.sql +73 -0
- package/dist/src/storage/sqlite/migrations/129_focus_versions.sql +51 -0
- package/dist/src/storage/sqlite/migrations/130_context_evidence_provenance.sql +18 -0
- package/dist/src/storage/sqlite/migrations/131_session_input_contexts.sql +2 -0
- package/dist/src/storage/sqlite/migrations/132_transcript_source_context_metadata.sql +34 -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/session-input-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-input-repository.js +19 -7
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +3 -2
- package/dist/src/storage/sqlite/transcript-repository.js +29 -3
- package/dist/src/storage/sqlite/user-context-repository.d.ts +4 -1
- package/dist/src/storage/sqlite/user-context-repository.js +65 -29
- package/dist/src/tasks/index.d.ts +1 -0
- package/dist/src/tasks/index.js +2 -1
- package/dist/src/tasks/task-deletion-service.d.ts +21 -0
- package/dist/src/tasks/task-deletion-service.js +35 -0
- package/dist/src/tasks/task-repository.js +22 -1
- package/dist/src/tui/backends/embedded-backend.js +5 -3
- package/dist/src/tui/backends/gateway-realtime-backend.js +5 -3
- package/dist/src/tui/chat-history.js +2 -1
- package/dist/src/tui/tui-agent-events.js +4 -2
- package/dist/src/tui/tui-commands.d.ts +1 -0
- package/dist/src/tui/tui-commands.js +8 -3
- package/dist/src/tui/tui-empty-session-cleanup.d.ts +0 -1
- package/dist/src/tui/tui-empty-session-cleanup.js +1 -11
- package/dist/src/tui/tui-new-session-preferences.d.ts +10 -0
- package/dist/src/tui/tui-new-session-preferences.js +32 -0
- package/dist/src/tui/tui-session-actions.d.ts +1 -0
- package/dist/src/tui/tui-session-actions.js +2 -1
- package/dist/src/tui/tui-settings.d.ts +2 -0
- package/dist/src/tui/tui-settings.js +4 -1
- package/dist/src/tui/tui-types.d.ts +1 -0
- package/dist/src/tui/tui.js +57 -4
- package/dist/src/tunnel/frpc-process.js +3 -0
- package/dist/src/tunnel/tunnel-service.d.ts +2 -0
- package/dist/src/tunnel/tunnel-service.js +40 -28
- package/dist/src/user-context/context-objects.d.ts +17 -0
- package/dist/src/user-context/context-objects.js +99 -0
- package/dist/src/user-context/domain.d.ts +13 -1
- package/dist/src/user-context/evaluation/harness.d.ts +13 -0
- package/dist/src/user-context/evaluation/harness.js +31 -0
- package/dist/src/user-context/extraction/registry.d.ts +26 -0
- package/dist/src/user-context/extraction/registry.js +113 -0
- package/dist/src/user-context/extraction/repair.d.ts +19 -0
- package/dist/src/user-context/extraction/repair.js +68 -0
- package/dist/src/user-context/planner.js +214 -57
- package/dist/src/user-context/retriever.js +69 -9
- package/dist/src/user-context/sources/catalog.js +9 -2
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/local-source-contract.d.ts +1 -1
- package/dist/src/user-context/sources/local-source-contract.js +1 -0
- package/dist/src/user-context/sources/processing-policy.d.ts +2 -0
- package/dist/src/user-context/sources/processing-policy.js +7 -0
- package/dist/src/user-context/sources/repository.d.ts +23 -4
- package/dist/src/user-context/sources/repository.js +122 -12
- package/dist/src/user-context/sources/types.d.ts +10 -1
- package/dist/src/user-context/understanding-writing.d.ts +1 -0
- package/dist/src/user-context/understanding-writing.js +4 -0
- package/dist/src/user-context/understanding.js +1 -1
- package/dist/src/work-discovery/analyzer.d.ts +6 -0
- package/dist/src/work-discovery/analyzer.js +181 -57
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/probe.js +20 -0
- package/dist/src/work-discovery/service.d.ts +9 -0
- package/dist/src/work-discovery/service.js +39 -11
- package/dist/src/work-discovery/source-repository.js +1 -1
- package/dist/src/work-discovery/types.d.ts +5 -0
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agents-C6q_vDzP.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-DRsTwFbF.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-B99NaPTf.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Dx66anqa.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CHbA8d-P.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CpRc-9Jy.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C89FGECN.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-XT6WEz9E.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-DhKk1oNT.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-CiwOOoVL.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-CTbkTsc2.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-BDn3HTzX.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BmZjs4Bq.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-ndtb88_T.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C7BLs783.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-BWiap88p.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BhbcGuiJ.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-CUt9bIpL.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-RafSECLG.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CwVPlPLB.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CbdBcCwC.js +0 -1
- package/dist/gateway/static/root/assets/index-AbNnQyKk.css +0 -2
- package/dist/gateway/static/root/assets/index-CMLkr37Y.js +0 -108
- package/dist/gateway/static/root/assets/local-app-workbench-page-DdaPtQ5M.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CjxMHTQO.js +0 -2
- package/dist/gateway/static/root/assets/messages-VI9m1xJl.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-V9C-8vSn.js +0 -4
- package/dist/gateway/static/root/assets/page-tabs-e99j9S9K.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-DW9MDOva.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DHmAUggu.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D0EiN69Y.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BuAVFk2O.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-hzlTfgOl.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BlCoA_9h.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-z0JH53Fu.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-fZQfoJAk.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-B5dPMq3Y.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-i1PGf1V2.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BSN2VaqR.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CSibO8vj.js +0 -1
- package/dist/gateway/static/root/assets/tab-completion-input-B-VsxKhC.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-HCKZ11E8.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-zrYg51t3.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CqG56cDS.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DQAJzV5w.js +0 -5
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
3
|
+
import { cancelQueuedSessionInput, claimNextSessionInput, findSessionInput, finishSessionInputRun, getSessionInputById, getSessionInputState, insertSessionInput, mutateQueuedSessionInput, recoverSessionInputState, setSessionInputStatus } from "../../storage/sqlite/session-input-repository.js";
|
|
4
4
|
import { replaceLatestSessionTurnAndQueueInput, validateLatestSessionTurnTarget } from "../../storage/sqlite/session-turn-replace-repository.js";
|
|
5
5
|
import "../../storage/sqlite/index.js";
|
|
6
|
+
import { summarizeSourceContext } from "../../agent/source-context/types.js";
|
|
6
7
|
import { deleteMediaUrisNoLongerReferenced } from "../../media/session-references.js";
|
|
7
8
|
import crypto from "node:crypto";
|
|
8
9
|
//#region src/gateway/service/session-input-coordinator.ts
|
|
9
10
|
init_logger();
|
|
10
11
|
const log = createLogger("SessionInputCoordinator");
|
|
11
12
|
const MAX_PENDING_INPUTS = 10;
|
|
13
|
+
function contextRefsMatchFrozenSnapshot(requested, frozen) {
|
|
14
|
+
if (requested.length !== (frozen?.length ?? 0)) return false;
|
|
15
|
+
return requested.every((ref, index) => {
|
|
16
|
+
const snapshot = frozen?.[index];
|
|
17
|
+
return snapshot?.kind === ref.kind && snapshot.sourceId === ref.sourceId && ref.expectedVersion === snapshot.version;
|
|
18
|
+
});
|
|
19
|
+
}
|
|
12
20
|
var SessionInputCoordinator = class {
|
|
13
21
|
draining = /* @__PURE__ */ new Set();
|
|
14
22
|
submissionTails = /* @__PURE__ */ new Map();
|
|
@@ -69,12 +77,27 @@ var SessionInputCoordinator = class {
|
|
|
69
77
|
if (target.ok === false) return target;
|
|
70
78
|
await beforeReplace();
|
|
71
79
|
const attachments = await this.deps.prepareAttachments(sessionKey, input.attachments);
|
|
80
|
+
let sourceContexts;
|
|
81
|
+
try {
|
|
82
|
+
sourceContexts = await this.deps.prepareContexts(input.contextRefs);
|
|
83
|
+
} catch (err) {
|
|
84
|
+
log.warn({
|
|
85
|
+
err,
|
|
86
|
+
sessionKey
|
|
87
|
+
}, "Session input context preparation failed");
|
|
88
|
+
return {
|
|
89
|
+
ok: false,
|
|
90
|
+
code: "CONTEXT_UNAVAILABLE"
|
|
91
|
+
};
|
|
92
|
+
}
|
|
72
93
|
const result = replaceLatestSessionTurnAndQueueInput({
|
|
73
94
|
sessionKey,
|
|
74
95
|
targetTurnId,
|
|
75
96
|
clientMessageId,
|
|
76
97
|
content,
|
|
77
98
|
attachments,
|
|
99
|
+
contextRefs: sourceContexts?.map(summarizeSourceContext),
|
|
100
|
+
contextSnapshots: sourceContexts,
|
|
78
101
|
thinking: input.thinking,
|
|
79
102
|
origin: input.origin
|
|
80
103
|
});
|
|
@@ -121,8 +144,21 @@ var SessionInputCoordinator = class {
|
|
|
121
144
|
code: "QUEUE_FULL"
|
|
122
145
|
};
|
|
123
146
|
const attachments = await this.deps.prepareAttachments(sessionKey, input.attachments);
|
|
147
|
+
let sourceContexts;
|
|
148
|
+
try {
|
|
149
|
+
sourceContexts = await this.deps.prepareContexts(input.contextRefs);
|
|
150
|
+
} catch (err) {
|
|
151
|
+
log.warn({
|
|
152
|
+
err,
|
|
153
|
+
sessionKey
|
|
154
|
+
}, "Session input context preparation failed");
|
|
155
|
+
return {
|
|
156
|
+
ok: false,
|
|
157
|
+
code: "CONTEXT_UNAVAILABLE"
|
|
158
|
+
};
|
|
159
|
+
}
|
|
124
160
|
const runtime = this.snapshot(sessionKey);
|
|
125
|
-
const canSteer = input.origin.type !== "endpoint" && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length;
|
|
161
|
+
const canSteer = input.origin.type !== "endpoint" && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && !sourceContexts?.length;
|
|
126
162
|
const effectiveDelivery = canSteer ? "steer" : "next";
|
|
127
163
|
const row = insertSessionInput({
|
|
128
164
|
id: crypto.randomUUID(),
|
|
@@ -133,6 +169,8 @@ var SessionInputCoordinator = class {
|
|
|
133
169
|
status: canSteer ? "injecting" : "queued",
|
|
134
170
|
content,
|
|
135
171
|
attachments,
|
|
172
|
+
contextRefs: sourceContexts?.map(summarizeSourceContext),
|
|
173
|
+
contextSnapshots: sourceContexts,
|
|
136
174
|
thinking: input.thinking,
|
|
137
175
|
origin: input.origin,
|
|
138
176
|
targetRunId: canSteer ? runtime.activeRunId : void 0
|
|
@@ -179,6 +217,7 @@ var SessionInputCoordinator = class {
|
|
|
179
217
|
sessionKey,
|
|
180
218
|
content: input.content,
|
|
181
219
|
attachments: input.attachments,
|
|
220
|
+
sourceContexts: input.contextSnapshots,
|
|
182
221
|
thinking: input.thinking,
|
|
183
222
|
origin: input.origin
|
|
184
223
|
});
|
|
@@ -204,11 +243,31 @@ var SessionInputCoordinator = class {
|
|
|
204
243
|
}
|
|
205
244
|
async update(sessionKey, id, body) {
|
|
206
245
|
const attachments = body.attachments === void 0 ? void 0 : await this.deps.prepareAttachments(sessionKey, body.attachments);
|
|
246
|
+
let sourceContexts;
|
|
247
|
+
if (body.contextRefs !== void 0) {
|
|
248
|
+
const existing = getSessionInputById(sessionKey, id);
|
|
249
|
+
if (!contextRefsMatchFrozenSnapshot(body.contextRefs, existing?.contextRefs)) try {
|
|
250
|
+
sourceContexts = await this.deps.prepareContexts(body.contextRefs) ?? [];
|
|
251
|
+
} catch (err) {
|
|
252
|
+
log.warn({
|
|
253
|
+
err,
|
|
254
|
+
sessionKey,
|
|
255
|
+
inputId: id
|
|
256
|
+
}, "Queued input context preparation failed");
|
|
257
|
+
return {
|
|
258
|
+
ok: false,
|
|
259
|
+
contextUnavailable: true,
|
|
260
|
+
state: this.snapshot(sessionKey)
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
207
264
|
const ok = mutateQueuedSessionInput({
|
|
208
265
|
sessionKey,
|
|
209
266
|
id,
|
|
210
267
|
...body,
|
|
211
|
-
attachments
|
|
268
|
+
attachments,
|
|
269
|
+
contextRefs: sourceContexts?.map(summarizeSourceContext),
|
|
270
|
+
contextSnapshots: sourceContexts
|
|
212
271
|
});
|
|
213
272
|
return {
|
|
214
273
|
ok,
|
|
@@ -93,6 +93,7 @@ export declare class GatewaySessionsApi {
|
|
|
93
93
|
verboseLevel?: string;
|
|
94
94
|
workingDirectory?: string;
|
|
95
95
|
responseLanguage?: string | null;
|
|
96
|
+
userContextMode?: 'enabled' | 'off' | 'temporary';
|
|
96
97
|
}): Promise<import("../../agent/session/session-config-service.js").PatchSessionAgentConfigResult>;
|
|
97
98
|
listCompactionBoundaries(key: string): Promise<import("../../session/types.js").CompactionBoundarySummary[]>;
|
|
98
99
|
restoreBeforeCompactionBoundary(key: string, compactionId: string): Promise<void>;
|
|
@@ -139,7 +139,7 @@ export declare class GatewayService {
|
|
|
139
139
|
state: import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
140
140
|
} | {
|
|
141
141
|
ok: false;
|
|
142
|
-
code: "BAD_REQUEST" | "QUEUE_FULL";
|
|
142
|
+
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE";
|
|
143
143
|
}>;
|
|
144
144
|
replaceLatestSessionTurn(...args: Parameters<GatewayAgentRunner['replaceLatestSessionTurn']>): Promise<{
|
|
145
145
|
ok: true;
|
|
@@ -147,12 +147,13 @@ export declare class GatewayService {
|
|
|
147
147
|
state: import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
148
148
|
} | {
|
|
149
149
|
ok: false;
|
|
150
|
-
code: "BAD_REQUEST" | "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY";
|
|
150
|
+
code: "BAD_REQUEST" | "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY" | "CONTEXT_UNAVAILABLE";
|
|
151
151
|
}>;
|
|
152
152
|
getSessionInputState(...args: Parameters<GatewayAgentRunner['getSessionInputState']>): import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
153
153
|
updateSessionInput(...args: Parameters<GatewayAgentRunner['updateSessionInput']>): Promise<{
|
|
154
154
|
ok: boolean;
|
|
155
155
|
state: import("../storage/sqlite/session-input-repository.js").SessionInputState;
|
|
156
|
+
contextUnavailable?: boolean;
|
|
156
157
|
}>;
|
|
157
158
|
removeSessionInput(...args: Parameters<GatewayAgentRunner['removeSessionInput']>): {
|
|
158
159
|
ok: boolean;
|
|
@@ -369,6 +369,18 @@ var GatewayService = class {
|
|
|
369
369
|
getAgentService: () => this.ensureAgentService(),
|
|
370
370
|
getChannelManager: () => this.channelManager,
|
|
371
371
|
getConfig: () => this.config,
|
|
372
|
+
resolveTurnContext: async (ref) => {
|
|
373
|
+
if (ref.kind !== "note") return null;
|
|
374
|
+
const note = await this.notesService.getNote(ref.sourceId);
|
|
375
|
+
if (!note || note.status === "trashed") return null;
|
|
376
|
+
if (ref.expectedVersion && ref.expectedVersion !== String(note.updatedAt)) return null;
|
|
377
|
+
const { images: _images, ...snapshot } = await buildNoteAgentContext({
|
|
378
|
+
note,
|
|
379
|
+
notesService: this.notesService,
|
|
380
|
+
config: this.config
|
|
381
|
+
});
|
|
382
|
+
return snapshot;
|
|
383
|
+
},
|
|
372
384
|
emit: (type, payload) => this.emit(type, payload),
|
|
373
385
|
publishRealtime: (topic, event, data) => {
|
|
374
386
|
this.realtime.broker.publish(topic, event, data);
|
|
@@ -1161,8 +1173,9 @@ var GatewayService = class {
|
|
|
1161
1173
|
* PATCH saves update config in memory without re-running gateway startup, so this must run on save too.
|
|
1162
1174
|
*/
|
|
1163
1175
|
async reconcileBrowserExtensionServer() {
|
|
1164
|
-
const {
|
|
1165
|
-
|
|
1176
|
+
const { resolveExtensionBridgeServerConfig } = await import("../browser/backend-from-config.js");
|
|
1177
|
+
const bridgeConfig = resolveExtensionBridgeServerConfig(this.config);
|
|
1178
|
+
if (!bridgeConfig) {
|
|
1166
1179
|
if (this.browserExtensionRelease) {
|
|
1167
1180
|
await this.browserExtensionRelease();
|
|
1168
1181
|
this.browserExtensionRelease = null;
|
|
@@ -1172,10 +1185,7 @@ var GatewayService = class {
|
|
|
1172
1185
|
}
|
|
1173
1186
|
return;
|
|
1174
1187
|
}
|
|
1175
|
-
const port =
|
|
1176
|
-
const host = "127.0.0.1";
|
|
1177
|
-
const connectionTimeout = void 0;
|
|
1178
|
-
const commandTimeout = void 0;
|
|
1188
|
+
const { port, host, connectionTimeout, commandTimeout } = bridgeConfig;
|
|
1179
1189
|
const bindKey = `${host}:${port}`;
|
|
1180
1190
|
if (this.browserExtensionRelease && this.browserExtensionBindKey === bindKey) return;
|
|
1181
1191
|
if (this.browserExtensionRelease) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MediaRef } from '../media/types.js';
|
|
2
|
+
import type { TurnContextRef } from '../agent/source-context/types.js';
|
|
2
3
|
export interface UserTurnAttachment {
|
|
3
4
|
id?: string;
|
|
4
5
|
type: string;
|
|
@@ -13,5 +14,6 @@ export interface UserTurnAttachment {
|
|
|
13
14
|
export interface UserTurnInput {
|
|
14
15
|
text: string;
|
|
15
16
|
attachments?: UserTurnAttachment[];
|
|
17
|
+
contextRefs?: TurnContextRef[];
|
|
16
18
|
}
|
|
17
19
|
export declare function mediaRefsToUserTurnAttachments(media: MediaRef[] | undefined): UserTurnAttachment[] | undefined;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Config } from '../config/schema.js';
|
|
2
2
|
import type { CatalogSource } from '../providers/model-catalog-store.js';
|
|
3
|
-
type CloudCapability = 'vision' | 'image-generation' | 'stt' | 'tts';
|
|
3
|
+
type CloudCapability = 'chat' | 'vision' | 'image-generation' | 'stt' | 'tts';
|
|
4
4
|
export interface XopcCloudCapabilitySelection {
|
|
5
|
+
chat: string;
|
|
5
6
|
vision: string;
|
|
6
7
|
imageGeneration: string;
|
|
7
8
|
stt: string;
|
|
@@ -29,7 +30,7 @@ export declare function selectXopcCloudCapabilities(source: CatalogSource): {
|
|
|
29
30
|
selection?: XopcCloudCapabilitySelection;
|
|
30
31
|
missing: CloudCapability[];
|
|
31
32
|
};
|
|
32
|
-
/** Build one atomic config update for
|
|
33
|
+
/** Build one atomic config update for the managed XOPC Cloud chat and media capabilities. */
|
|
33
34
|
export declare function prepareXopcCloudCapabilitySetup(config: Config, source: CatalogSource): PrepareXopcCloudCapabilitySetupResult;
|
|
34
35
|
export declare function applyXopcCloudCapabilitySetup(service: {
|
|
35
36
|
currentConfig: Config;
|
|
@@ -5,29 +5,33 @@ import { ensureGlobalDefaultsConfig, prepareUpdateGlobalDefaults } from "./globa
|
|
|
5
5
|
init_model_catalog_store();
|
|
6
6
|
function supportsCapability(model, capability) {
|
|
7
7
|
if (model.availability !== "available") return false;
|
|
8
|
+
if (capability === "chat") return model.kind === "language" && (model.operations.includes("chat.completions") || model.operations.includes("responses"));
|
|
8
9
|
if (capability === "vision") return model.kind === "language" && model.input.includes("image");
|
|
9
10
|
if (capability === "image-generation") return model.kind === "image" && model.operations.includes("images.generate");
|
|
10
11
|
if (capability === "stt") return model.kind === "stt" && model.operations.includes("audio.transcription");
|
|
11
12
|
return model.kind === "tts" && model.operations.includes("audio.speech") && Boolean(model.tts?.defaultVoice);
|
|
12
13
|
}
|
|
13
14
|
function recommendedModel(source, capability) {
|
|
14
|
-
const recommendation = source.recommended?.[capability];
|
|
15
|
+
const recommendation = capability === "chat" ? source.recommendedModel ?? void 0 : source.recommended?.[capability];
|
|
15
16
|
return source.models.filter((model) => supportsCapability(model, capability)).sort((left, right) => compareCatalogModels(left, right, recommendation))[0];
|
|
16
17
|
}
|
|
17
18
|
function selectXopcCloudCapabilities(source) {
|
|
19
|
+
const chat = recommendedModel(source, "chat");
|
|
18
20
|
const vision = recommendedModel(source, "vision");
|
|
19
21
|
const imageGeneration = recommendedModel(source, "image-generation");
|
|
20
22
|
const stt = recommendedModel(source, "stt");
|
|
21
23
|
const tts = recommendedModel(source, "tts");
|
|
22
24
|
const missing = [];
|
|
25
|
+
if (!chat) missing.push("chat");
|
|
23
26
|
if (!vision) missing.push("vision");
|
|
24
27
|
if (!imageGeneration) missing.push("image-generation");
|
|
25
28
|
if (!stt) missing.push("stt");
|
|
26
29
|
if (!tts) missing.push("tts");
|
|
27
|
-
if (!vision || !imageGeneration || !stt || !tts || !tts.tts?.defaultVoice) return { missing };
|
|
30
|
+
if (!chat || !vision || !imageGeneration || !stt || !tts || !tts.tts?.defaultVoice) return { missing };
|
|
28
31
|
return {
|
|
29
32
|
missing,
|
|
30
33
|
selection: {
|
|
34
|
+
chat: chat.id,
|
|
31
35
|
vision: vision.id,
|
|
32
36
|
imageGeneration: imageGeneration.id,
|
|
33
37
|
stt: stt.id,
|
|
@@ -36,7 +40,7 @@ function selectXopcCloudCapabilities(source) {
|
|
|
36
40
|
}
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
|
-
/** Build one atomic config update for
|
|
43
|
+
/** Build one atomic config update for the managed XOPC Cloud chat and media capabilities. */
|
|
40
44
|
function prepareXopcCloudCapabilitySetup(config, source) {
|
|
41
45
|
const selected = selectXopcCloudCapabilities(source);
|
|
42
46
|
if (!selected.selection) return {
|
|
@@ -48,8 +52,17 @@ function prepareXopcCloudCapabilitySetup(config, source) {
|
|
|
48
52
|
const normalized = ensureGlobalDefaultsConfig(config);
|
|
49
53
|
const presetId = normalized.agents.defaultPreset;
|
|
50
54
|
const currentModels = normalized.agents.capabilityPresets[presetId]?.models;
|
|
55
|
+
const defaultRole = currentModels?.defaultRole ?? "deep";
|
|
51
56
|
const defaultsUpdate = prepareUpdateGlobalDefaults(normalized, { models: {
|
|
52
57
|
...currentModels,
|
|
58
|
+
defaultRole,
|
|
59
|
+
roles: {
|
|
60
|
+
...currentModels?.roles ?? {},
|
|
61
|
+
[defaultRole]: {
|
|
62
|
+
...currentModels?.roles?.[defaultRole],
|
|
63
|
+
model: `xopc-cloud/${selection.chat}`
|
|
64
|
+
}
|
|
65
|
+
},
|
|
53
66
|
imageModel: {
|
|
54
67
|
...currentModels?.imageModel,
|
|
55
68
|
primary: `xopc-cloud/${selection.vision}`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, shouldSilence, stripHeartbeatToken } from "./tokens.js";
|
|
2
|
-
import { appendCronEventLines } from "./event-prompt.js";
|
|
3
2
|
import { isWithinActiveHours } from "./active-hours.js";
|
|
4
3
|
import { isHeartbeatContentEmpty } from "./content-check.js";
|
|
4
|
+
import { appendCronEventLines } from "./event-prompt.js";
|
|
5
5
|
import { createHeartbeatWake } from "./wake.js";
|
|
6
6
|
export { DEFAULT_ACK_MAX_CHARS, HEARTBEAT_OK, NO_REPLY, appendCronEventLines, createHeartbeatWake, isHeartbeatContentEmpty, isWithinActiveHours, shouldSilence, stripHeartbeatToken };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
2
1
|
import "./update-channels.js";
|
|
3
2
|
import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
|
|
4
3
|
import { readPackageName, readPackageVersion } from "./package-json.js";
|
|
@@ -8,6 +7,7 @@ import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
|
|
|
8
7
|
import { resolveStableNodePath } from "./stable-node-path.js";
|
|
9
8
|
import { trimLogTail } from "./update-log.js";
|
|
10
9
|
import { maybeRestartGatewayAfterUpdate } from "./update-restart.js";
|
|
10
|
+
import { runPostUpdateExtensionSync } from "../extensions/update.js";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import fs from "node:fs/promises";
|
|
13
13
|
//#region src/infra/update-runner.ts
|
|
@@ -13,5 +13,5 @@ export declare function renderConnectedObservation(observation: ClaimObservation
|
|
|
13
13
|
export declare class ConnectedUnderstandingPipeline {
|
|
14
14
|
private readonly memoryManager;
|
|
15
15
|
constructor(memoryManager: MemoryManager);
|
|
16
|
-
process(agentId: string): Promise<UnderstandingReviewResult>;
|
|
16
|
+
process(agentId: string, extractionRunId: string): Promise<UnderstandingReviewResult>;
|
|
17
17
|
}
|
|
@@ -226,7 +226,7 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
226
226
|
constructor(memoryManager) {
|
|
227
227
|
this.memoryManager = memoryManager;
|
|
228
228
|
}
|
|
229
|
-
async process(agentId) {
|
|
229
|
+
async process(agentId, extractionRunId) {
|
|
230
230
|
const observations = deriveConnectedClaimObservations(listKnowledgeSourceItems({
|
|
231
231
|
agentId,
|
|
232
232
|
includeDeleted: false,
|
|
@@ -253,12 +253,14 @@ var ConnectedUnderstandingPipeline = class {
|
|
|
253
253
|
provider: "connected-sources",
|
|
254
254
|
...sourceInstanceIds.length === 1 ? { sourceInstanceId: sourceInstanceIds[0] } : {}
|
|
255
255
|
},
|
|
256
|
-
reviewSource: "background"
|
|
256
|
+
reviewSource: "background",
|
|
257
|
+
extractionRunId
|
|
257
258
|
});
|
|
258
259
|
totals.created += result.created;
|
|
259
260
|
totals.deduplicated += result.deduplicated;
|
|
260
261
|
totals.rejected += result.rejected;
|
|
261
262
|
totals.createdRecords.push(...result.createdRecords);
|
|
263
|
+
totals.writeOutputs = [...totals.writeOutputs ?? [], ...result.writeOutputs ?? []];
|
|
262
264
|
}
|
|
263
265
|
return totals;
|
|
264
266
|
}
|
|
@@ -48,17 +48,25 @@ const TIME_RULES = [
|
|
|
48
48
|
pattern: /\b(?:future|next|later|upcoming)\b|未来|下次|之后|即将/i
|
|
49
49
|
}
|
|
50
50
|
];
|
|
51
|
+
const TIME_EXPANSIONS = {
|
|
52
|
+
current: "now current active today 现在 当前 今天",
|
|
53
|
+
recent: "recent recently latest 近期 最近 最新",
|
|
54
|
+
historical: "previous before history past 之前 以前 历史 上次",
|
|
55
|
+
future: "future next later upcoming 未来 下次 之后 即将"
|
|
56
|
+
};
|
|
51
57
|
function buildRetrievalQueryProfile(query, scope = {}) {
|
|
52
58
|
const normalized = normalizeRetrievalText(query);
|
|
53
59
|
const intentKinds = INTENT_RULES.filter((rule) => rule.pattern.test(normalized)).flatMap((rule) => rule.kinds);
|
|
54
60
|
const timeHints = TIME_RULES.filter((rule) => rule.pattern.test(normalized)).map((rule) => rule.hint);
|
|
61
|
+
const uniqueTimeHints = [...new Set(timeHints)];
|
|
55
62
|
return {
|
|
56
63
|
normalized,
|
|
64
|
+
expanded: [normalized, ...uniqueTimeHints.map((hint) => TIME_EXPANSIONS[hint])].join(" ").trim(),
|
|
57
65
|
terms: extractLexicalTerms(normalized),
|
|
58
66
|
cjkBigrams: extractCjkBigrams(normalized),
|
|
59
67
|
identifiers: extractRetrievalIdentifiers(normalized),
|
|
60
68
|
intentKinds: [...new Set(intentKinds)],
|
|
61
|
-
timeHints:
|
|
69
|
+
timeHints: uniqueTimeHints,
|
|
62
70
|
scope: { ...scope }
|
|
63
71
|
};
|
|
64
72
|
}
|
|
@@ -11,6 +11,17 @@ export interface ClientHistoryMessage {
|
|
|
11
11
|
/** Persisted inbound attachment metadata used by chat clients to reload media. */
|
|
12
12
|
media?: Message['media'];
|
|
13
13
|
timestamp?: number;
|
|
14
|
+
/** Whitelisted display metadata; never includes source snapshot text. */
|
|
15
|
+
metadata?: {
|
|
16
|
+
sourceContexts: Array<{
|
|
17
|
+
kind: 'note';
|
|
18
|
+
sourceId: string;
|
|
19
|
+
version: string;
|
|
20
|
+
title: string;
|
|
21
|
+
tokenEstimate?: number;
|
|
22
|
+
truncated?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
14
25
|
kind?: 'message' | 'compaction' | 'context' | 'bash' | 'custom' | 'branch';
|
|
15
26
|
tokensBefore?: number;
|
|
16
27
|
tokensAfter?: number;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
1
2
|
import { buildTranscriptOutline } from "./transcript-outline.js";
|
|
2
3
|
//#region src/session/client-history.ts
|
|
4
|
+
function sourceContextDisplayMetadata(metadata) {
|
|
5
|
+
if (!metadata || typeof metadata !== "object" || Array.isArray(metadata)) return void 0;
|
|
6
|
+
const rows = metadata.sourceContexts;
|
|
7
|
+
if (!Array.isArray(rows)) return void 0;
|
|
8
|
+
const sourceContexts = rows.flatMap((value) => {
|
|
9
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
10
|
+
const row = value;
|
|
11
|
+
if (row.kind !== "note" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
12
|
+
return [{
|
|
13
|
+
kind: "note",
|
|
14
|
+
sourceId: row.sourceId,
|
|
15
|
+
version: row.version,
|
|
16
|
+
title: row.title,
|
|
17
|
+
...typeof row.tokenEstimate === "number" ? { tokenEstimate: row.tokenEstimate } : {},
|
|
18
|
+
...row.truncated === true ? { truncated: true } : {}
|
|
19
|
+
}];
|
|
20
|
+
});
|
|
21
|
+
return sourceContexts.length ? { sourceContexts } : void 0;
|
|
22
|
+
}
|
|
3
23
|
function flattenMessageContent(content) {
|
|
4
24
|
if (typeof content === "string") return content;
|
|
5
25
|
if (!Array.isArray(content)) return "";
|
|
@@ -111,8 +131,9 @@ function messagesToClientHistory(messages, opts) {
|
|
|
111
131
|
out.push({
|
|
112
132
|
role: m.role,
|
|
113
133
|
...typeof m.turnId === "string" ? { turnId: m.turnId } : {},
|
|
114
|
-
content: text,
|
|
134
|
+
content: m.role === "user" ? stripRuntimeContextFromUserMessage(text) : text,
|
|
115
135
|
...m.media?.length ? { media: m.media } : {},
|
|
136
|
+
...sourceContextDisplayMetadata(m.metadata) ? { metadata: sourceContextDisplayMetadata(m.metadata) } : {},
|
|
116
137
|
timestamp: parseTimestamp(m.timestamp)
|
|
117
138
|
});
|
|
118
139
|
continue;
|
|
@@ -413,8 +434,9 @@ function transcriptRowsToClientHistory(rows, opts) {
|
|
|
413
434
|
...messageRow.turnId ? { turnId: messageRow.turnId } : {},
|
|
414
435
|
role: messageRow.role,
|
|
415
436
|
kind: "message",
|
|
416
|
-
content: flattenMessageContent(messageRow.content ?? ""),
|
|
437
|
+
content: messageRow.role === "user" ? stripRuntimeContextFromUserMessage(flattenMessageContent(messageRow.content ?? "")) : flattenMessageContent(messageRow.content ?? ""),
|
|
417
438
|
...messageRow.media?.length ? { media: messageRow.media } : {},
|
|
439
|
+
...sourceContextDisplayMetadata(messageRow.metadata) ? { metadata: sourceContextDisplayMetadata(messageRow.metadata) } : {},
|
|
418
440
|
...displayIndex !== void 0 ? { displayIndex } : {},
|
|
419
441
|
timestamp: parseTimestampValue(messageRow.timestamp)
|
|
420
442
|
});
|
|
@@ -13,6 +13,6 @@ export interface SessionAgentConfig {
|
|
|
13
13
|
providerOverride?: string;
|
|
14
14
|
workingDirectoryOverride?: string;
|
|
15
15
|
responseLanguage?: ResponseLanguage;
|
|
16
|
-
userContextMode?: 'enabled' | 'off';
|
|
16
|
+
userContextMode?: 'enabled' | 'off' | 'temporary';
|
|
17
17
|
updatedAt?: number;
|
|
18
18
|
}
|
|
@@ -5,8 +5,7 @@ import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
|
5
5
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
6
6
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
7
7
|
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
8
|
-
import {
|
|
9
|
-
import { stripEnvelopeTimestampPrefix } from "../channels/envelope-timestamp.js";
|
|
8
|
+
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
10
9
|
//#region src/session/session-title.ts
|
|
11
10
|
init_session_key();
|
|
12
11
|
init_providers();
|
|
@@ -56,7 +55,7 @@ function stripSkillCommandForTitle(text) {
|
|
|
56
55
|
return match[2]?.trim() || match[1]?.trim() || text;
|
|
57
56
|
}
|
|
58
57
|
function normalizeUserTextForTitle(raw) {
|
|
59
|
-
return stripSkillCommandForTitle(stripExpandedSkillBlockForTitle(stripMediaClaimChecks(
|
|
58
|
+
return stripSkillCommandForTitle(stripExpandedSkillBlockForTitle(stripMediaClaimChecks(stripRuntimeContextFromUserMessage(raw)))).trim();
|
|
60
59
|
}
|
|
61
60
|
/** First assistant message that has visible text (skips tool-only assistant rows). */
|
|
62
61
|
function firstAssistantText(messages) {
|
|
@@ -725,6 +725,7 @@ var SessionStore = class {
|
|
|
725
725
|
name: m.name
|
|
726
726
|
};
|
|
727
727
|
if (Array.isArray(m.media) && m.media.length > 0) row.media = m.media;
|
|
728
|
+
if (m.metadata && typeof m.metadata === "object") row.metadata = m.metadata;
|
|
728
729
|
const rawUsage = m.usage;
|
|
729
730
|
if (rawUsage && typeof rawUsage === "object") {
|
|
730
731
|
const inputTokens = typeof rawUsage.input === "number" ? rawUsage.input : void 0;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isTranscriptBashExecutionEntry, isTranscriptContextEntry, isTranscriptCustomMessageEntry, isTranscriptLabelEntry, isTranscriptMetadataEntry, isTranscriptSummaryMessageEntry } from "./session-context-for-llm.js";
|
|
2
|
+
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
2
3
|
//#region src/session/transcript-outline.ts
|
|
3
4
|
function asRecord(value) {
|
|
4
5
|
return value && typeof value === "object" ? value : null;
|
|
@@ -170,7 +171,8 @@ function rowPreview(row) {
|
|
|
170
171
|
}
|
|
171
172
|
const record = asRecord(row);
|
|
172
173
|
if (record?.type === "compaction") return truncateText(stringValue(record.summary) ?? "compaction checkpoint");
|
|
173
|
-
const
|
|
174
|
+
const content = contentText(record?.content);
|
|
175
|
+
const preview = truncateText(record?.role === "user" ? stripRuntimeContextFromUserMessage(content) : content);
|
|
174
176
|
if (record?.role === "assistant" && !preview) {
|
|
175
177
|
if (record.stopReason === "aborted") return "(aborted)";
|
|
176
178
|
const errorMessage = stringValue(record.errorMessage);
|
|
@@ -194,7 +196,8 @@ function rowContentText(row) {
|
|
|
194
196
|
if (isTranscriptSummaryMessageEntry(row)) return row.summary;
|
|
195
197
|
const record = asRecord(row);
|
|
196
198
|
if (record?.type === "compaction") return stringValue(record.summary);
|
|
197
|
-
const
|
|
199
|
+
const rawText = contentText(record?.content);
|
|
200
|
+
const text = (record?.role === "user" ? stripRuntimeContextFromUserMessage(rawText) : rawText).trim();
|
|
198
201
|
return text ? text : void 0;
|
|
199
202
|
}
|
|
200
203
|
function roleForTimeline(role) {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Client-facing form of a persisted model-facing user message. */
|
|
2
|
+
export declare function stripRuntimeContextFromUserMessage(text: string): string;
|
|
3
|
+
/** Preserve structured content while cleaning every user text block. */
|
|
4
|
+
export declare function stripRuntimeContextFromUserContent(content: string | unknown[]): string | unknown[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { stripRuntimeUserMessageEnvelope } from "../../packages/gateway-contract/src/user-message-display.js";
|
|
2
|
+
import { stripSessionStartupContextFromUserText } from "../agent/reply/startup-context.js";
|
|
3
|
+
//#region src/session/user-message-display.ts
|
|
4
|
+
/** Client-facing form of a persisted model-facing user message. */
|
|
5
|
+
function stripRuntimeContextFromUserMessage(text) {
|
|
6
|
+
return stripRuntimeUserMessageEnvelope(stripSessionStartupContextFromUserText(text));
|
|
7
|
+
}
|
|
8
|
+
/** Preserve structured content while cleaning every user text block. */
|
|
9
|
+
function stripRuntimeContextFromUserContent(content) {
|
|
10
|
+
if (typeof content === "string") return stripRuntimeContextFromUserMessage(content);
|
|
11
|
+
return content.map((block) => {
|
|
12
|
+
if (!block || typeof block !== "object") return block;
|
|
13
|
+
const row = block;
|
|
14
|
+
if (row.type !== "text" || typeof row.text !== "string") return block;
|
|
15
|
+
return {
|
|
16
|
+
...row,
|
|
17
|
+
text: stripRuntimeContextFromUserMessage(row.text)
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { stripRuntimeContextFromUserContent, stripRuntimeContextFromUserMessage };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type ContextExtractionStatus = 'running' | 'completed' | 'skipped' | 'failed';
|
|
2
|
+
export type ContextObjectType = 'profile' | 'rule' | 'focus' | 'understanding';
|
|
3
|
+
export type ContextExtractionRun = {
|
|
4
|
+
id: string;
|
|
5
|
+
principalId: string;
|
|
6
|
+
sourceRef: string;
|
|
7
|
+
extractorId: string;
|
|
8
|
+
extractorVersion: string;
|
|
9
|
+
processingPolicy: 'local_only' | 'remote_allowed';
|
|
10
|
+
destination: 'deterministic' | 'local_model' | 'remote_model';
|
|
11
|
+
inputHash: string;
|
|
12
|
+
status: ContextExtractionStatus;
|
|
13
|
+
errorCode?: string;
|
|
14
|
+
startedAt: number;
|
|
15
|
+
completedAt?: number;
|
|
16
|
+
};
|
|
17
|
+
export type ContextExtractionOutput = {
|
|
18
|
+
id: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
ordinal: number;
|
|
21
|
+
candidateKey: string;
|
|
22
|
+
objectType?: ContextObjectType;
|
|
23
|
+
objectId?: string;
|
|
24
|
+
versionId?: string;
|
|
25
|
+
outcome: 'created' | 'deduplicated' | 'rejected';
|
|
26
|
+
createdAt: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function claimContextExtractionRun(input: {
|
|
29
|
+
sourceRef: string;
|
|
30
|
+
extractorId: string;
|
|
31
|
+
extractorVersion: string;
|
|
32
|
+
processingPolicy: ContextExtractionRun['processingPolicy'];
|
|
33
|
+
destination: ContextExtractionRun['destination'];
|
|
34
|
+
inputHash: string;
|
|
35
|
+
principalId?: string;
|
|
36
|
+
nowMs?: number;
|
|
37
|
+
}): {
|
|
38
|
+
run: ContextExtractionRun;
|
|
39
|
+
shouldExecute: boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare function finishContextExtractionRun(input: {
|
|
42
|
+
runId: string;
|
|
43
|
+
status: Exclude<ContextExtractionStatus, 'running'>;
|
|
44
|
+
errorCode?: string;
|
|
45
|
+
outputs?: Array<Omit<ContextExtractionOutput, 'id' | 'runId' | 'ordinal' | 'createdAt'>>;
|
|
46
|
+
nowMs?: number;
|
|
47
|
+
}): ContextExtractionRun | null;
|
|
48
|
+
export declare function listContextExtractionRuns(filter?: {
|
|
49
|
+
sourceRef?: string;
|
|
50
|
+
extractorId?: string;
|
|
51
|
+
extractorVersion?: string;
|
|
52
|
+
status?: ContextExtractionStatus;
|
|
53
|
+
limit?: number;
|
|
54
|
+
}): ContextExtractionRun[];
|
|
55
|
+
export declare function getContextExtractionRun(id: string): ContextExtractionRun | null;
|
|
56
|
+
export declare function listContextExtractionOutputs(runId: string): ContextExtractionOutput[];
|
|
57
|
+
export declare function hasIndependentExtractionOutput(runIds: string[], objectType: ContextObjectType, objectId: string): boolean;
|