@xopcai/xopc 0.0.218 → 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-DF2dYXG1.js → activity-store-slG02hSm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Dw9rF5o1.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-_H0Bam-t.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-DZCOhXch.js → archive-plugin-DKXa160O.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Bjb0FH2B.js → attachment-load-CzwA9g2y.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D4N3ZDhu.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-uXPt0s47.js → binary-plugins-DoQ_DnT7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-gukkIEro.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-DAhdS-XZ.js → browser-workflow-inputs-D4roXE6r.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-LKjYzXS_.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-BBUkH833.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-E5mo8M3a.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-BGNuaqvI.js → cron-expression-4DvCFs-v.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-k7mkklMU.js → date-picker-B6FSjt4Z.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-Za18eMp1.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-p9EZyGzV.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-Cd4BMKm_.js → extension-debug-page-Cordpg4X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CzEGCkOa.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-DNrttVr2.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-B1vD3vRb.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-BTR0Wk_k.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-CYlS4RGA.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-CNppYVew.js → local-apps-page-Be79cyMG.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-gf9Bg2gb.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-IYk9xLgt.js → management-settings-CRspx0oY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-D8e6pRMH.js → markdown-split-G3PTpGw3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D0fiJjBQ.js → markdown-view-D4FPJZ91.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CCq6TtEf.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-BBtWnlUU.js → notes-api-q7HjYO07.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-BKe1xa3U.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-DXe5iWI6.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-xj5gOva_.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-BJTvmBCA.js → runtime-tools-settings-panel-CXHQc53b.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DvGBa_7R.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-sbef7GTm.js → settings-loading-skeleton-H3ZH6a6l.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BNGxxXZe.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-C1523ij3.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-Ditgz7Vo.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/task-detail-page-BwOyrADL.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DgSjes3O.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-Bp_qFZkl.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-hbzDfErG.js → voice-api-key-field-CGTE5156.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DZVib-04.js → work-discovery-overlay-CW-HKD7h.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-C2RKay1p.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 +5 -4
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +144 -16
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- 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/ipc/inbox.js +1 -1
- package/dist/src/agent/memory/context/types.d.ts +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/service.js +2 -2
- 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 +2 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- 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/tasks/task-judge-service.js +3 -3
- 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/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- 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 +5 -3
- 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/doctor/checks/provider-auth.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/cli/commands/models.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.d.ts +20 -20
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -0
- package/dist/src/connectors/connected-source-understanding.js +82 -34
- package/dist/src/connectors/learning-coordinator.js +57 -11
- package/dist/src/extensions/lockfile.js +1 -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/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.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/models.js +1 -1
- 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 +127 -31
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/hono/routes/you.js +71 -4
- 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 +2 -2
- 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 +25 -15
- 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/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/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- 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-startup-resources.js +1 -1
- package/dist/src/tui/tui-types.d.ts +1 -0
- package/dist/src/tui/tui.js +58 -5
- 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/index.js +2 -2
- 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.js +1 -1
- package/dist/src/work-discovery/service.js +21 -5
- package/dist/src/work-discovery/source-repository.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agents-Dj86bHkl.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-D-M6GN-8.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-XDhmzdIc.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-sfO835uz.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-PptuZgoo.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BoCmzMFV.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DhkJsU8Z.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-Dm7T61fE.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-dG6UFVqt.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DgJxfNyK.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-CT5yoSMD.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-BC6Ft9SU.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-DZVSgLXH.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Bw4cCFzI.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-Cbst7IXR.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C1PAKSy2.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-Bch9vO6t.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DkDxZFGG.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DXNMxy5b.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CYcpVFNT.js +0 -1
- package/dist/gateway/static/root/assets/index-Dgb1R07E.css +0 -2
- package/dist/gateway/static/root/assets/index-DlOYwVFK.js +0 -108
- package/dist/gateway/static/root/assets/local-app-workbench-page-BFrgPwGE.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CPweLw3k.js +0 -2
- package/dist/gateway/static/root/assets/messages-B9WQcZ1V.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-wieRAd1y.js +0 -4
- package/dist/gateway/static/root/assets/page-tabs-Bsluqyfb.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BrpTWv44.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-Cww6V7HJ.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D0LKhCCw.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Sf4Pde6Z.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-S5gvgfu5.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B3XvdEy8.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-CiGFtdD8.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CGU_Mxjr.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-k0UQ8WxO.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DQ1GvL1w.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-OuHd9GcN.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CERqCsz2.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BnRNL2sn.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-abEJNkCO.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Cnkaiky5.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-B_VlcKiK.js +0 -5
|
@@ -15,7 +15,7 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
15
15
|
}, 401, "json">) | (Response & import("hono").TypedResponse<{
|
|
16
16
|
ok: false;
|
|
17
17
|
error: {
|
|
18
|
-
code: "BAD_REQUEST" | "QUEUE_FULL";
|
|
18
|
+
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE";
|
|
19
19
|
message: string;
|
|
20
20
|
};
|
|
21
21
|
}, 400 | 409, "json">) | (Response & import("hono").TypedResponse<{
|
|
@@ -38,6 +38,28 @@ export declare function submitSessionInput(c: Context, deps: AuthenticatedRouteD
|
|
|
38
38
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
39
39
|
content: string;
|
|
40
40
|
attachments?: import("hono/dist/types/utils/types.js").JSONValue[];
|
|
41
|
+
contextRefs?: {
|
|
42
|
+
kind: import("../../../agent/source-context/types.js").AgentSourceContext["kind"];
|
|
43
|
+
sourceId: string;
|
|
44
|
+
version: string;
|
|
45
|
+
title: string;
|
|
46
|
+
tokenEstimate?: number;
|
|
47
|
+
truncated?: boolean;
|
|
48
|
+
}[];
|
|
49
|
+
contextSnapshots?: {
|
|
50
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"];
|
|
51
|
+
sourceId: string;
|
|
52
|
+
version: string;
|
|
53
|
+
title: string;
|
|
54
|
+
text: string;
|
|
55
|
+
images?: {
|
|
56
|
+
type: "image";
|
|
57
|
+
data: string;
|
|
58
|
+
mimeType: string;
|
|
59
|
+
}[];
|
|
60
|
+
tokenEstimate?: number;
|
|
61
|
+
truncated?: boolean;
|
|
62
|
+
}[];
|
|
41
63
|
thinking?: string;
|
|
42
64
|
origin: {
|
|
43
65
|
type: "endpoint";
|
|
@@ -75,7 +97,7 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
75
97
|
}, 401, "json">) | (Response & import("hono").TypedResponse<{
|
|
76
98
|
ok: false;
|
|
77
99
|
error: {
|
|
78
|
-
code: "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY" | "BAD_REQUEST";
|
|
100
|
+
code: "TARGET_NOT_FOUND" | "NOT_LATEST" | "SESSION_BUSY" | "BAD_REQUEST" | "CONTEXT_UNAVAILABLE";
|
|
79
101
|
message: string;
|
|
80
102
|
};
|
|
81
103
|
}, 400 | 404 | 409, "json">) | (Response & import("hono").TypedResponse<{
|
|
@@ -98,6 +120,28 @@ export declare function replaceLatestSessionTurn(c: Context, deps: Authenticated
|
|
|
98
120
|
status: import("../../../storage/sqlite/session-input-repository.js").SessionInputStatus;
|
|
99
121
|
content: string;
|
|
100
122
|
attachments?: import("hono/dist/types/utils/types.js").JSONValue[];
|
|
123
|
+
contextRefs?: {
|
|
124
|
+
kind: import("../../../agent/source-context/types.js").AgentSourceContext["kind"];
|
|
125
|
+
sourceId: string;
|
|
126
|
+
version: string;
|
|
127
|
+
title: string;
|
|
128
|
+
tokenEstimate?: number;
|
|
129
|
+
truncated?: boolean;
|
|
130
|
+
}[];
|
|
131
|
+
contextSnapshots?: {
|
|
132
|
+
kind: import("../../../agent/source-context/types.js").SessionSourceBinding["kind"];
|
|
133
|
+
sourceId: string;
|
|
134
|
+
version: string;
|
|
135
|
+
title: string;
|
|
136
|
+
text: string;
|
|
137
|
+
images?: {
|
|
138
|
+
type: "image";
|
|
139
|
+
data: string;
|
|
140
|
+
mimeType: string;
|
|
141
|
+
}[];
|
|
142
|
+
tokenEstimate?: number;
|
|
143
|
+
truncated?: boolean;
|
|
144
|
+
}[];
|
|
101
145
|
thinking?: string;
|
|
102
146
|
origin: {
|
|
103
147
|
type: "endpoint";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { endpointTurnClaimSchema } from "../../../../packages/endpoint-tools-protocol/src/index.js";
|
|
2
|
+
import { parseTurnContextRefs } from "../../../agent/source-context/types.js";
|
|
2
3
|
import { validateWebchatAttachments, validateWebchatContent } from "../../chat-limits.js";
|
|
3
4
|
//#region src/gateway/hono/routes/session-input-handler.ts
|
|
5
|
+
const MAX_TURN_CONTEXTS = 5;
|
|
4
6
|
async function submitSessionInput(c, deps, sessionKey) {
|
|
5
7
|
const body = await c.req.json().catch(() => null);
|
|
6
8
|
if (!body || !sessionKey) return c.json({
|
|
@@ -11,6 +13,14 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
11
13
|
}
|
|
12
14
|
}, 400);
|
|
13
15
|
const attachments = Array.isArray(body.attachments) ? body.attachments : void 0;
|
|
16
|
+
const contextRefs = parseTurnContextRefs(body.contextRefs, MAX_TURN_CONTEXTS);
|
|
17
|
+
if (contextRefs === null) return c.json({
|
|
18
|
+
ok: false,
|
|
19
|
+
error: {
|
|
20
|
+
code: "BAD_REQUEST",
|
|
21
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid notes`
|
|
22
|
+
}
|
|
23
|
+
}, 400);
|
|
14
24
|
const content = typeof body.content === "string" ? body.content : "";
|
|
15
25
|
const contentError = validateWebchatContent(content);
|
|
16
26
|
if (contentError) return c.json({
|
|
@@ -57,6 +67,7 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
57
67
|
delivery,
|
|
58
68
|
content,
|
|
59
69
|
attachments,
|
|
70
|
+
contextRefs,
|
|
60
71
|
thinking: typeof body.thinking === "string" ? body.thinking : void 0,
|
|
61
72
|
origin: {
|
|
62
73
|
type: "endpoint",
|
|
@@ -67,9 +78,9 @@ async function submitSessionInput(c, deps, sessionKey) {
|
|
|
67
78
|
ok: false,
|
|
68
79
|
error: {
|
|
69
80
|
code: result.code,
|
|
70
|
-
message: "Input was not accepted"
|
|
81
|
+
message: result.code === "CONTEXT_UNAVAILABLE" ? "A referenced Note changed or is no longer available. Select it again." : "Input was not accepted"
|
|
71
82
|
}
|
|
72
|
-
}, result.code === "QUEUE_FULL" ? 409 : 400);
|
|
83
|
+
}, result.code === "QUEUE_FULL" || result.code === "CONTEXT_UNAVAILABLE" ? 409 : 400);
|
|
73
84
|
return c.json({
|
|
74
85
|
ok: true,
|
|
75
86
|
payload: {
|
|
@@ -88,6 +99,14 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
88
99
|
}
|
|
89
100
|
}, 400);
|
|
90
101
|
const attachments = Array.isArray(body.attachments) ? body.attachments : void 0;
|
|
102
|
+
const contextRefs = parseTurnContextRefs(body.contextRefs, MAX_TURN_CONTEXTS);
|
|
103
|
+
if (contextRefs === null) return c.json({
|
|
104
|
+
ok: false,
|
|
105
|
+
error: {
|
|
106
|
+
code: "BAD_REQUEST",
|
|
107
|
+
message: `contextRefs must contain at most ${MAX_TURN_CONTEXTS} valid notes`
|
|
108
|
+
}
|
|
109
|
+
}, 400);
|
|
91
110
|
const content = typeof body.content === "string" ? body.content : "";
|
|
92
111
|
const contentError = validateWebchatContent(content);
|
|
93
112
|
if (contentError) return c.json({
|
|
@@ -127,6 +146,7 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
127
146
|
delivery: "next",
|
|
128
147
|
content,
|
|
129
148
|
attachments,
|
|
149
|
+
contextRefs,
|
|
130
150
|
thinking: typeof body.thinking === "string" ? body.thinking : void 0,
|
|
131
151
|
origin: {
|
|
132
152
|
type: "endpoint",
|
|
@@ -135,7 +155,7 @@ async function replaceLatestSessionTurn(c, deps, sessionKey, targetTurnId) {
|
|
|
135
155
|
});
|
|
136
156
|
if (result.ok === false) {
|
|
137
157
|
const status = result.code === "TARGET_NOT_FOUND" ? 404 : result.code === "BAD_REQUEST" ? 400 : 409;
|
|
138
|
-
const message = result.code === "NOT_LATEST" ? "Only the latest user turn can be replaced" : result.code === "SESSION_BUSY" ? "Session has pending input" : result.code === "TARGET_NOT_FOUND" ? "User turn was not found" : "Replacement input was not accepted";
|
|
158
|
+
const message = result.code === "NOT_LATEST" ? "Only the latest user turn can be replaced" : result.code === "SESSION_BUSY" ? "Session has pending input" : result.code === "TARGET_NOT_FOUND" ? "User turn was not found" : result.code === "CONTEXT_UNAVAILABLE" ? "A referenced Note changed or is no longer available. Select it again." : "Replacement input was not accepted";
|
|
139
159
|
return c.json({
|
|
140
160
|
ok: false,
|
|
141
161
|
error: {
|
|
@@ -121,7 +121,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
121
121
|
});
|
|
122
122
|
authenticated.post("/api/sessions", async (c) => {
|
|
123
123
|
const body = await c.req.json().catch(() => ({}));
|
|
124
|
-
const channel = body.channel
|
|
124
|
+
const channel = typeof body.channel === "string" && body.channel.trim() ? body.channel.trim() : "webchat";
|
|
125
125
|
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
126
126
|
const routingCfg = service.currentConfig;
|
|
127
127
|
if (projectId && !service.projects.get(projectId)) return c.json({
|
|
@@ -134,25 +134,7 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
134
134
|
explicitAgentId: typeof body.agentId === "string" ? body.agentId : void 0,
|
|
135
135
|
projectId
|
|
136
136
|
});
|
|
137
|
-
|
|
138
|
-
const sessionKey = buildSessionKey({
|
|
139
|
-
agentId,
|
|
140
|
-
source: channel,
|
|
141
|
-
accountId: "default",
|
|
142
|
-
peerKind: "direct",
|
|
143
|
-
peerId: body.chat_id
|
|
144
|
-
});
|
|
145
|
-
await service.sessionIndexInstance.saveMessages(sessionKey, [], { metadata: buildDirectSessionMetadata({
|
|
146
|
-
agentId,
|
|
147
|
-
source: channel,
|
|
148
|
-
accountId: "default",
|
|
149
|
-
peerId: body.chat_id
|
|
150
|
-
}) });
|
|
151
|
-
if (projectId) service.projects.attachSession(sessionKey, projectId);
|
|
152
|
-
const session = await service.sessions.getSession(sessionKey);
|
|
153
|
-
return c.json({ session }, 201);
|
|
154
|
-
}
|
|
155
|
-
const chatId = `chat_${randomUUID()}`;
|
|
137
|
+
const chatId = (typeof body.chat_id === "string" && body.chat_id.trim() ? body.chat_id.trim() : void 0) ?? `chat_${randomUUID()}`;
|
|
156
138
|
const sessionKey = buildSessionKey({
|
|
157
139
|
agentId,
|
|
158
140
|
source: channel,
|
|
@@ -167,6 +149,21 @@ function registerSessionsRoutes(authenticated, deps) {
|
|
|
167
149
|
peerId: chatId
|
|
168
150
|
}) });
|
|
169
151
|
if (projectId) service.projects.attachSession(sessionKey, projectId);
|
|
152
|
+
const rawInitialConfig = body.initialAgentConfig && typeof body.initialAgentConfig === "object" ? body.initialAgentConfig : {};
|
|
153
|
+
const model = typeof rawInitialConfig.model === "string" && rawInitialConfig.model.trim() ? rawInitialConfig.model.trim() : void 0;
|
|
154
|
+
const thinkingLevel = typeof rawInitialConfig.thinkingLevel === "string" && rawInitialConfig.thinkingLevel.trim() ? rawInitialConfig.thinkingLevel.trim() : void 0;
|
|
155
|
+
const initialAgentConfig = {
|
|
156
|
+
...model ? { model } : {},
|
|
157
|
+
...thinkingLevel ? { thinkingLevel } : {},
|
|
158
|
+
...body.temporary === true ? { userContextMode: "temporary" } : {}
|
|
159
|
+
};
|
|
160
|
+
if (Object.keys(initialAgentConfig).length > 0) {
|
|
161
|
+
const result = await service.sessions.patchAgentConfig(sessionKey, initialAgentConfig);
|
|
162
|
+
if (!result.ok) return c.json({
|
|
163
|
+
ok: false,
|
|
164
|
+
error: result.error
|
|
165
|
+
}, 400);
|
|
166
|
+
}
|
|
170
167
|
const session = await service.sessions.getSession(sessionKey);
|
|
171
168
|
return c.json({ session }, 201);
|
|
172
169
|
});
|
|
@@ -15,6 +15,7 @@ import { ProjectMonitoringService } from "../../../tasks/project-monitoring-serv
|
|
|
15
15
|
import { ProjectOperatingViewService } from "../../../tasks/project-operating-view-service.js";
|
|
16
16
|
import { TaskValueMetricsService } from "../../../tasks/task-value-metrics-service.js";
|
|
17
17
|
import { TaskHandoffService } from "../../../tasks/task-handoff-service.js";
|
|
18
|
+
import { TaskDeletionService } from "../../../tasks/task-deletion-service.js";
|
|
18
19
|
import { TaskSignalService } from "../../../tasks/task-signal-service.js";
|
|
19
20
|
import { submitSessionInput } from "./session-input-handler.js";
|
|
20
21
|
import { TaskConversationQueryService } from "../../service/task-conversation-query-service.js";
|
|
@@ -33,6 +34,7 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
33
34
|
const projector = new TaskReadModelProjector();
|
|
34
35
|
const signals = new TaskSignalService(() => deps.service.dispatchTaskRuns());
|
|
35
36
|
const dependencies = new TaskDependencyService();
|
|
37
|
+
const deletion = new TaskDeletionService(tasks, runs);
|
|
36
38
|
const handoffs = new TaskHandoffService({
|
|
37
39
|
getConfig: () => deps.service.currentConfig,
|
|
38
40
|
sessionIndex: deps.service.sessionIndexInstance,
|
|
@@ -289,6 +291,29 @@ function registerTaskRoutes(authenticated, deps) {
|
|
|
289
291
|
task: updated
|
|
290
292
|
});
|
|
291
293
|
});
|
|
294
|
+
authenticated.delete("/api/tasks/:id", taskRateLimit, (c) => {
|
|
295
|
+
const taskId = c.req.param("id");
|
|
296
|
+
const result = deletion.delete(taskId);
|
|
297
|
+
if (result.ok === true) {
|
|
298
|
+
deps.service.dispatchTaskEvents();
|
|
299
|
+
return c.json({
|
|
300
|
+
ok: true,
|
|
301
|
+
deleted: true,
|
|
302
|
+
taskId
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
if (result.reason === "active_run") return c.json({
|
|
306
|
+
ok: false,
|
|
307
|
+
code: "task_active",
|
|
308
|
+
error: "Cancel the active TaskRun before deleting the Task",
|
|
309
|
+
runId: result.run.id
|
|
310
|
+
}, 409);
|
|
311
|
+
return c.json({
|
|
312
|
+
ok: false,
|
|
313
|
+
code: "task_not_found",
|
|
314
|
+
error: "Task not found"
|
|
315
|
+
}, 404);
|
|
316
|
+
});
|
|
292
317
|
authenticated.put("/api/tasks/:id/dependencies", taskRateLimit, async (c) => {
|
|
293
318
|
const parsed = TaskDependencyUpdateRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
294
319
|
if (!parsed.success) return c.json({
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
+
export declare function sourceRevocationImpact(grantId: string): {
|
|
4
|
+
grant: import("../../../user-context/sources/types.js").UnderstandingSourceGrant;
|
|
5
|
+
understandingIds: string[];
|
|
6
|
+
focusIds: string[];
|
|
7
|
+
derivedCount: number;
|
|
8
|
+
understandingCount: number;
|
|
9
|
+
focusCount: number;
|
|
10
|
+
boundedRawCount: number;
|
|
11
|
+
};
|
|
3
12
|
export declare function registerUnderstandingSourceRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { deleteUnderstanding, listUnderstandingEvidence, listUnderstandings } from "../../../storage/sqlite/user-context-repository.js";
|
|
1
|
+
import { deleteUnderstanding, listUnderstandingEvidence, listUnderstandings, setUnderstandingStatus } from "../../../storage/sqlite/user-context-repository.js";
|
|
2
2
|
import { getConnectorAccount } from "../../../storage/sqlite/connector-account-repository.js";
|
|
3
3
|
import "../../../storage/sqlite/index.js";
|
|
4
4
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
5
|
-
import { deleteUserFocus, getUnderstandingSourceGrant, listUnderstandingSourceGrants, listUnderstandingSourceRuns, listUserFocuses, revokeUnderstandingSourceGrant,
|
|
5
|
+
import { deleteUserFocus, getUnderstandingSourceGrant, getUnderstandingSourceRun, listUnderstandingSourceGrants, listUnderstandingSourceRuns, listUserFocusEvidence, listUserFocuses, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantPolicies, updateUserFocus } from "../../../user-context/sources/repository.js";
|
|
6
6
|
import { listConnectedContentCandidates, readConnectedContent } from "../../../connectors/content-enrichment.js";
|
|
7
7
|
import { getWorkDiscoveryService } from "./work-discovery.js";
|
|
8
8
|
import { listUnderstandingSourceDefinitions } from "../../../user-context/sources/catalog.js";
|
|
@@ -27,6 +27,33 @@ function decisionsFrom(body) {
|
|
|
27
27
|
}];
|
|
28
28
|
}).slice(0, 20);
|
|
29
29
|
}
|
|
30
|
+
function sourceRevocationImpact(grantId) {
|
|
31
|
+
const grant = getUnderstandingSourceGrant(grantId);
|
|
32
|
+
if (!grant) return null;
|
|
33
|
+
const accountId = typeof grant.config.accountId === "string" ? grant.config.accountId : void 0;
|
|
34
|
+
const connectorId = typeof grant.config.connectorId === "string" ? grant.config.connectorId : void 0;
|
|
35
|
+
const sourceInstanceId = accountId && connectorId ? `composio:${connectorId}:${accountId}` : void 0;
|
|
36
|
+
const belongs = (evidence) => evidence.sourceRef.startsWith(`understanding-source-grant:${grantId}:`) || Boolean(sourceInstanceId && evidence.sourceInstanceId === sourceInstanceId);
|
|
37
|
+
const understandings = listUnderstandings().flatMap((item) => {
|
|
38
|
+
if (item.explicitness === "explicit") return [];
|
|
39
|
+
const evidence = listUnderstandingEvidence(item.id);
|
|
40
|
+
return evidence.some(belongs) && !evidence.some((entry) => !belongs(entry)) ? [item] : [];
|
|
41
|
+
});
|
|
42
|
+
const focuses = listUserFocuses().flatMap((focus) => {
|
|
43
|
+
if (focus.explicitness === "explicit") return [];
|
|
44
|
+
if ((focus.sourceRunId ? getUnderstandingSourceRun(focus.sourceRunId) : null)?.grantId !== grantId) return [];
|
|
45
|
+
return listUserFocusEvidence(focus.id).some((entry) => !belongs(entry)) ? [] : [focus];
|
|
46
|
+
});
|
|
47
|
+
return {
|
|
48
|
+
grant,
|
|
49
|
+
understandingIds: understandings.map((item) => item.id),
|
|
50
|
+
focusIds: focuses.map((item) => item.id),
|
|
51
|
+
derivedCount: understandings.length + focuses.length,
|
|
52
|
+
understandingCount: understandings.length,
|
|
53
|
+
focusCount: focuses.length,
|
|
54
|
+
boundedRawCount: 0
|
|
55
|
+
};
|
|
56
|
+
}
|
|
30
57
|
function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
31
58
|
const service = getWorkDiscoveryService(deps);
|
|
32
59
|
const limited = deps.strictRateLimitMiddleware;
|
|
@@ -49,6 +76,54 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
49
76
|
}))
|
|
50
77
|
});
|
|
51
78
|
});
|
|
79
|
+
authenticated.patch("/api/understanding/sources/grants/:grantId", limited, async (c) => {
|
|
80
|
+
const body = await c.req.json().catch(() => null);
|
|
81
|
+
if (!body) return c.json({
|
|
82
|
+
ok: false,
|
|
83
|
+
error: "Invalid JSON"
|
|
84
|
+
}, 400);
|
|
85
|
+
const accessMode = body.accessMode;
|
|
86
|
+
const retentionPolicy = body.retentionPolicy;
|
|
87
|
+
const processingPolicy = body.processingPolicy;
|
|
88
|
+
if (accessMode !== void 0 && accessMode !== "once" && accessMode !== "continuous") return c.json({
|
|
89
|
+
ok: false,
|
|
90
|
+
error: "Invalid access mode"
|
|
91
|
+
}, 400);
|
|
92
|
+
if (retentionPolicy !== void 0 && retentionPolicy !== "metadata_only" && retentionPolicy !== "derived_only" && retentionPolicy !== "bounded_raw") return c.json({
|
|
93
|
+
ok: false,
|
|
94
|
+
error: "Invalid retention policy"
|
|
95
|
+
}, 400);
|
|
96
|
+
if (processingPolicy !== void 0 && processingPolicy !== "local_only" && processingPolicy !== "remote_allowed") return c.json({
|
|
97
|
+
ok: false,
|
|
98
|
+
error: "Invalid processing policy"
|
|
99
|
+
}, 400);
|
|
100
|
+
if (accessMode === void 0 && retentionPolicy === void 0 && processingPolicy === void 0) return c.json({
|
|
101
|
+
ok: false,
|
|
102
|
+
error: "At least one policy change is required"
|
|
103
|
+
}, 400);
|
|
104
|
+
const grant = updateUnderstandingSourceGrantPolicies(c.req.param("grantId"), {
|
|
105
|
+
...accessMode ? { accessMode } : {},
|
|
106
|
+
...retentionPolicy ? { retentionPolicy } : {},
|
|
107
|
+
...processingPolicy ? { processingPolicy } : {}
|
|
108
|
+
});
|
|
109
|
+
return grant ? c.json({
|
|
110
|
+
ok: true,
|
|
111
|
+
grant
|
|
112
|
+
}) : c.json({
|
|
113
|
+
ok: false,
|
|
114
|
+
error: "Source grant not found"
|
|
115
|
+
}, 404);
|
|
116
|
+
});
|
|
117
|
+
authenticated.get("/api/understanding/sources/grants/:grantId/impact", (c) => {
|
|
118
|
+
const impact = sourceRevocationImpact(c.req.param("grantId"));
|
|
119
|
+
return impact ? c.json({
|
|
120
|
+
ok: true,
|
|
121
|
+
impact
|
|
122
|
+
}) : c.json({
|
|
123
|
+
ok: false,
|
|
124
|
+
error: "Source grant not found"
|
|
125
|
+
}, 404);
|
|
126
|
+
});
|
|
52
127
|
authenticated.get("/api/understanding/sources/content-candidates", (c) => {
|
|
53
128
|
const agentId = resolveDefaultAgentId(deps.service.currentConfig);
|
|
54
129
|
return c.json({
|
|
@@ -76,32 +151,34 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
76
151
|
}
|
|
77
152
|
});
|
|
78
153
|
authenticated.delete("/api/understanding/sources/grants/:grantId", limited, (c) => {
|
|
79
|
-
const
|
|
154
|
+
const grantId = c.req.param("grantId");
|
|
155
|
+
const impact = sourceRevocationImpact(grantId);
|
|
156
|
+
const derived = c.req.query("derived");
|
|
157
|
+
const raw = c.req.query("raw");
|
|
158
|
+
if (derived !== "delete" && derived !== "retain") return c.json({
|
|
159
|
+
ok: false,
|
|
160
|
+
error: "derived must be delete or retain"
|
|
161
|
+
}, 400);
|
|
162
|
+
if (raw !== "delete" && raw !== "retain") return c.json({
|
|
163
|
+
ok: false,
|
|
164
|
+
error: "raw must be delete or retain"
|
|
165
|
+
}, 400);
|
|
166
|
+
const current = impact?.grant;
|
|
80
167
|
const accountId = typeof current?.config.accountId === "string" ? current.config.accountId : void 0;
|
|
81
|
-
const connectorId = typeof current?.config.connectorId === "string" ? current.config.connectorId : void 0;
|
|
82
|
-
const sourceInstanceId = accountId && connectorId ? `composio:${connectorId}:${accountId}` : void 0;
|
|
83
168
|
const connectionId = accountId ? getConnectorAccount(accountId)?.currentConnectionId : void 0;
|
|
84
169
|
if (connectionId) deps.service.setConnectorLearningPaused(connectionId, true);
|
|
85
|
-
const grant = revokeUnderstandingSourceGrant(
|
|
86
|
-
if (grant &&
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return activeAccountId && activeConnectorId ? [`composio:${activeConnectorId}:${activeAccountId}`] : [];
|
|
92
|
-
}));
|
|
93
|
-
for (const understanding of listUnderstandings()) {
|
|
94
|
-
const evidence = listUnderstandingEvidence(understanding.id);
|
|
95
|
-
const grantEvidence = evidence.map((evidence) => /^understanding-source-grant:([^:]+):/.exec(evidence.sourceRef)?.[1]).filter((id) => Boolean(id));
|
|
96
|
-
const connectorEvidence = evidence.map((item) => item.sourceInstanceId).filter((id) => Boolean(id));
|
|
97
|
-
const belongsToRevokedSource = grantEvidence.includes(grant.id) || Boolean(sourceInstanceId && connectorEvidence.includes(sourceInstanceId));
|
|
98
|
-
const hasActiveAlternative = grantEvidence.some((id) => id !== grant.id && activeGrantIds.has(id)) || connectorEvidence.some((id) => id !== sourceInstanceId && activeSourceInstanceIds.has(id));
|
|
99
|
-
if (belongsToRevokedSource && !hasActiveAlternative) deleteUnderstanding(understanding.id);
|
|
100
|
-
}
|
|
170
|
+
const grant = revokeUnderstandingSourceGrant(grantId);
|
|
171
|
+
if (grant && impact) {
|
|
172
|
+
for (const id of impact.focusIds) if (derived === "delete") deleteUserFocus(id);
|
|
173
|
+
else updateUserFocus(id, { status: "paused" });
|
|
174
|
+
for (const id of impact.understandingIds) if (derived === "delete") deleteUnderstanding(id);
|
|
175
|
+
else setUnderstandingStatus(id, "needs_review");
|
|
101
176
|
}
|
|
102
177
|
return grant ? c.json({
|
|
103
178
|
ok: true,
|
|
104
|
-
grant
|
|
179
|
+
grant,
|
|
180
|
+
impact,
|
|
181
|
+
rawDeleted: 0
|
|
105
182
|
}) : c.json({
|
|
106
183
|
ok: false,
|
|
107
184
|
error: "Source grant not found"
|
|
@@ -226,18 +303,41 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
226
303
|
focuses: listUserFocuses()
|
|
227
304
|
}));
|
|
228
305
|
authenticated.patch("/api/understanding/focuses/:focusId", limited, async (c) => {
|
|
229
|
-
const
|
|
230
|
-
|
|
306
|
+
const body = await c.req.json().catch(() => null);
|
|
307
|
+
const requestedStatus = stringField(body, "status");
|
|
308
|
+
const title = stringField(body, "title");
|
|
309
|
+
const summary = stringField(body, "summary");
|
|
310
|
+
if (requestedStatus && !new Set([
|
|
231
311
|
"candidate",
|
|
232
312
|
"active",
|
|
233
313
|
"paused",
|
|
234
314
|
"completed",
|
|
235
315
|
"rejected"
|
|
236
|
-
]).has(
|
|
316
|
+
]).has(requestedStatus)) return c.json({
|
|
237
317
|
ok: false,
|
|
238
318
|
error: "Invalid focus status"
|
|
239
319
|
}, 400);
|
|
240
|
-
|
|
320
|
+
if (body?.title !== void 0 && !title) return c.json({
|
|
321
|
+
ok: false,
|
|
322
|
+
error: "Focus title cannot be empty"
|
|
323
|
+
}, 400);
|
|
324
|
+
if (body?.summary !== void 0 && !summary) return c.json({
|
|
325
|
+
ok: false,
|
|
326
|
+
error: "Focus summary cannot be empty"
|
|
327
|
+
}, 400);
|
|
328
|
+
if (title.length > 300 || summary.length > 2e3) return c.json({
|
|
329
|
+
ok: false,
|
|
330
|
+
error: "Focus title or summary is too long"
|
|
331
|
+
}, 400);
|
|
332
|
+
if (!requestedStatus && !title && !summary) return c.json({
|
|
333
|
+
ok: false,
|
|
334
|
+
error: "At least one focus change is required"
|
|
335
|
+
}, 400);
|
|
336
|
+
const focus = updateUserFocus(c.req.param("focusId"), {
|
|
337
|
+
...requestedStatus ? { status: requestedStatus } : {},
|
|
338
|
+
...title ? { title } : {},
|
|
339
|
+
...summary ? { summary } : {}
|
|
340
|
+
});
|
|
241
341
|
return focus ? c.json({
|
|
242
342
|
ok: true,
|
|
243
343
|
focus
|
|
@@ -246,10 +346,6 @@ function registerUnderstandingSourceRoutes(authenticated, deps) {
|
|
|
246
346
|
error: "Focus not found"
|
|
247
347
|
}, 404);
|
|
248
348
|
});
|
|
249
|
-
authenticated.delete("/api/understanding/focuses/:focusId", limited, (c) => deleteUserFocus(c.req.param("focusId")) ? c.json({ ok: true }) : c.json({
|
|
250
|
-
ok: false,
|
|
251
|
-
error: "Focus not found"
|
|
252
|
-
}, 404));
|
|
253
349
|
}
|
|
254
350
|
//#endregion
|
|
255
|
-
export { registerUnderstandingSourceRoutes };
|
|
351
|
+
export { registerUnderstandingSourceRoutes, sourceRevocationImpact };
|
|
@@ -7,10 +7,10 @@ import { messagesToClientHistory } from "../../../session/client-history.js";
|
|
|
7
7
|
import "../../../workflows/domain/index.js";
|
|
8
8
|
import { resolveWorkflowRunArtifactsDir } from "../../../workflows/store/paths.js";
|
|
9
9
|
import { WorkflowDraftService } from "../../../workflows/draft/workflow-draft-service.js";
|
|
10
|
-
import "../../../workflows/draft/index.js";
|
|
11
|
-
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
12
10
|
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../../workflows/authoring/workflow-draft-store.js";
|
|
13
11
|
import "../../../workflows/authoring/index.js";
|
|
12
|
+
import "../../../workflows/draft/index.js";
|
|
13
|
+
import { ProjectWorkflowPresetRepository } from "../../../workflows/project-presets/project-workflow-preset-repository.js";
|
|
14
14
|
import { basename, join } from "node:path";
|
|
15
15
|
import { readFile, stat } from "node:fs/promises";
|
|
16
16
|
//#region src/gateway/hono/routes/workflows.ts
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { listContextConsolidationRuns } from "../../../storage/sqlite/context-consolidation-repository.js";
|
|
2
1
|
import { UNDERSTANDING_KINDS } from "../../../user-context/domain.js";
|
|
3
|
-
import {
|
|
2
|
+
import { listContextExtractionRuns } from "../../../storage/sqlite/context-extraction-repository.js";
|
|
3
|
+
import { listContextConsolidationRuns } from "../../../storage/sqlite/context-consolidation-repository.js";
|
|
4
4
|
import { createCollaborationRule, createUnderstanding, decideContextConsent, deleteCollaborationRule, deleteUnderstanding, getCollaborationRule, getTurnPersonalization, getUnderstanding, getUserProfile, listCollaborationRules, listUnderstandingEvidence, listUnderstandings, recordContextFeedback, rejectUnderstanding, reviseCollaborationRule, reviseUnderstanding, setCollaborationRuleStatus, setUnderstandingStatus, updateUserProfile } from "../../../storage/sqlite/user-context-repository.js";
|
|
5
5
|
import "../../../storage/sqlite/index.js";
|
|
6
|
+
import { listUserFocuses, updateUserFocus } from "../../../user-context/sources/repository.js";
|
|
6
7
|
import { canonicalUnderstandingKey, findDuplicateUnderstanding } from "../../../user-context/understanding.js";
|
|
8
|
+
import { listContextObjects } from "../../../user-context/context-objects.js";
|
|
9
|
+
import { repairExtractedContext } from "../../../user-context/extraction/repair.js";
|
|
7
10
|
import { userInfo } from "node:os";
|
|
8
11
|
//#region src/gateway/hono/routes/you.ts
|
|
9
12
|
const UNDERSTANDING_KIND_SET = new Set(UNDERSTANDING_KINDS);
|
|
@@ -34,6 +37,11 @@ const FEEDBACK_RATINGS = new Set([
|
|
|
34
37
|
"stale",
|
|
35
38
|
"sensitive"
|
|
36
39
|
]);
|
|
40
|
+
const CONTEXT_OBJECT_VIEWS = new Set([
|
|
41
|
+
"current",
|
|
42
|
+
"review",
|
|
43
|
+
"history"
|
|
44
|
+
]);
|
|
37
45
|
function asRecord(value) {
|
|
38
46
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
39
47
|
}
|
|
@@ -87,10 +95,64 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
87
95
|
authenticated.get("/api/you", (c) => c.json({
|
|
88
96
|
profile: getUserProfile(),
|
|
89
97
|
understandings: listUnderstandings(),
|
|
98
|
+
focuses: listUserFocuses(),
|
|
90
99
|
rules: listCollaborationRules(),
|
|
91
|
-
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null }
|
|
92
|
-
quality: summarizeUserUnderstandingQuality()
|
|
100
|
+
consolidation: { lastRun: listContextConsolidationRuns(1)[0] ?? null }
|
|
93
101
|
}));
|
|
102
|
+
authenticated.get("/api/you/context-objects", (c) => {
|
|
103
|
+
const view = c.req.query("view") ?? "current";
|
|
104
|
+
if (!CONTEXT_OBJECT_VIEWS.has(view)) return c.json({ error: "Invalid context object view" }, 400);
|
|
105
|
+
return c.json({ objects: listContextObjects(view) });
|
|
106
|
+
});
|
|
107
|
+
authenticated.get("/api/you/extraction-runs", (c) => c.json({ runs: listContextExtractionRuns({
|
|
108
|
+
...c.req.query("sourceRef") ? { sourceRef: c.req.query("sourceRef") } : {},
|
|
109
|
+
...c.req.query("extractorId") ? { extractorId: c.req.query("extractorId") } : {},
|
|
110
|
+
...c.req.query("extractorVersion") ? { extractorVersion: c.req.query("extractorVersion") } : {},
|
|
111
|
+
limit: 100
|
|
112
|
+
}) }));
|
|
113
|
+
authenticated.post("/api/you/context-repair", write, async (c) => {
|
|
114
|
+
const body = await readBody(c);
|
|
115
|
+
if (!body) return c.json({ error: "Invalid JSON" }, 400);
|
|
116
|
+
const filter = Object.fromEntries([
|
|
117
|
+
"runId",
|
|
118
|
+
"sourceRef",
|
|
119
|
+
"extractorId",
|
|
120
|
+
"extractorVersion",
|
|
121
|
+
"objectVersionId"
|
|
122
|
+
].flatMap((field) => typeof body[field] === "string" && body[field].trim() ? [[field, body[field].trim()]] : []));
|
|
123
|
+
if (!Object.keys(filter).length) return c.json({ error: "At least one repair filter is required" }, 400);
|
|
124
|
+
return c.json({ result: repairExtractedContext(filter) });
|
|
125
|
+
});
|
|
126
|
+
authenticated.post("/api/you/context-objects/batch-review", write, async (c) => {
|
|
127
|
+
const decisions = (await readBody(c))?.decisions;
|
|
128
|
+
if (!Array.isArray(decisions) || decisions.length < 1 || decisions.length > 50) return c.json({ error: "decisions must contain 1-50 items" }, 400);
|
|
129
|
+
const normalized = [];
|
|
130
|
+
const targets = /* @__PURE__ */ new Set();
|
|
131
|
+
for (const value of decisions) {
|
|
132
|
+
const item = asRecord(value);
|
|
133
|
+
const objectType = item?.objectType;
|
|
134
|
+
const objectId = nonEmptyString(item?.objectId, 200);
|
|
135
|
+
const action = item?.action;
|
|
136
|
+
if (objectType !== "focus" && objectType !== "understanding" || !objectId || action !== "accept" && action !== "reject" && action !== "pause") return c.json({ error: "Each decision must contain a valid objectType, objectId, and action" }, 400);
|
|
137
|
+
if (!(objectType === "understanding" ? Boolean(getUnderstanding(objectId)) : listUserFocuses().some((focus) => focus.id === objectId))) return c.json({ error: `Context object not found: ${objectId}` }, 404);
|
|
138
|
+
const target = `${objectType}:${objectId}`;
|
|
139
|
+
if (targets.has(target)) return c.json({ error: `Duplicate context object decision: ${objectId}` }, 400);
|
|
140
|
+
targets.add(target);
|
|
141
|
+
normalized.push({
|
|
142
|
+
objectType,
|
|
143
|
+
objectId,
|
|
144
|
+
action
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const objects = normalized.map(({ objectType, objectId, action }) => {
|
|
148
|
+
if (objectType === "understanding") return action === "accept" ? setUnderstandingStatus(objectId, "active", {
|
|
149
|
+
explicitness: "explicit",
|
|
150
|
+
confidence: 1
|
|
151
|
+
}) : action === "reject" ? rejectUnderstanding(objectId, "Rejected during context review") : setUnderstandingStatus(objectId, "needs_review");
|
|
152
|
+
return updateUserFocus(objectId, { status: action === "accept" ? "active" : action === "reject" ? "rejected" : "paused" });
|
|
153
|
+
});
|
|
154
|
+
return c.json({ objects });
|
|
155
|
+
});
|
|
94
156
|
authenticated.get("/api/you/profile", (c) => {
|
|
95
157
|
const profile = getUserProfile();
|
|
96
158
|
return c.json({
|
|
@@ -244,6 +306,7 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
244
306
|
if (objectType === void 0 !== (objectId === void 0) || objectType !== void 0 && ![
|
|
245
307
|
"profile",
|
|
246
308
|
"rule",
|
|
309
|
+
"focus",
|
|
247
310
|
"understanding"
|
|
248
311
|
].includes(String(objectType)) || objectId !== void 0 && typeof objectId !== "string") return c.json({ error: "objectType and objectId must be valid and provided together" }, 400);
|
|
249
312
|
if (objectType !== void 0 && !run.items.some((item) => item.objectType === objectType && item.objectId === objectId)) return c.json({ error: "The context object was not part of this turn" }, 400);
|
|
@@ -263,6 +326,10 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
263
326
|
if (rating === "stale") setUnderstandingStatus(objectId, "stale");
|
|
264
327
|
if (rating === "sensitive") setUnderstandingStatus(objectId, "needs_review");
|
|
265
328
|
}
|
|
329
|
+
if (objectType === "focus" && typeof objectId === "string") {
|
|
330
|
+
if (rating === "wrong") updateUserFocus(objectId, { status: "rejected" });
|
|
331
|
+
if (rating === "stale" || rating === "sensitive") updateUserFocus(objectId, { status: "paused" });
|
|
332
|
+
}
|
|
266
333
|
return c.json({ ok: true });
|
|
267
334
|
});
|
|
268
335
|
authenticated.patch("/api/you/consents/:id", write, async (c) => {
|