@xopcai/xopc 0.0.208 → 0.0.211
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-D0mYZqhc.js → activity-store-BzjFoSr0.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-MWLQWL_i.js → agent-avatar-dicebear-DTfjhfVE.js} +1 -1
- package/dist/gateway/static/root/assets/agents-CjhgfuVJ.js +68 -0
- package/dist/gateway/static/root/assets/{api-DZA1yVzM.js → api-D269PnU9.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B2X6quAF.js → app-management-settings-panel-BFpfQDWc.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BZW-c38q.js → appearance-settings-DLxFdqhY.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-CjmlGB5V.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CK-gsjsJ.js → archive-plugin-DPlH4dnc.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-EJGP4rCw.js → attachment-load-xqfLLd0I.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-4m6Ey6wG.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-Tbss_4P-.js → binary-plugins-C0tuoPXk.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C-dOWigw.js → block-editor-Deyphj1o.js} +6 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CAGCYx8U.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-DW06Zo1N.js → browser-workflow-inputs-CYEbXyRF.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B6RnRGwm.js → browser-workflows-page-Bf0tPbGi.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CKfLsxTI.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-Cc3BtQar.js → capability-presets-api-DPkFA_-R.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CpipKNqX.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-BvZO5FaO.js → channel-recipient-api-DqKaAcnZ.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Bvq-O4pt.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-CrMld2l7.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-CTDRZa7e.js +36 -0
- package/dist/gateway/static/root/assets/{connectors-api-CUl6_EQJ.js → connectors-api-Buu8fif8.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-CSQRzaVn.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BD9MgoE_.js → cron-expression-DTLR82NB.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-ChqNmoxw.js → date-picker-DyNogHQH.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CDUmFs6H.js → dependency-picker-BpnCuo7B.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D61gqxaD.js → desktop-pet-CDKI4gVB.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-QvuJvIX_.js → desktop-pet-settings-DjT5C2a3.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DvXMvDNY.js → directory-picker-path-field-DlJY90TM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DMdVTAQ3.js → extension-debug-page-DWf2z7q5.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BNzxZtaK.js → extension-page-Dorx0kf9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DoEfyizU.js → extension-settings-page-B1wU9ZOB.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-o7AKvthC.js → gateway-config-api-B1lG4dNr.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BQbkUP5X.js → gateway-config-swr-BIxuwPQi.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-TO5YYZ9a.js → gateway-settings-DqIOqJjM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DIgdpHgk.js → gateway-startup-retry-BpZgd4U-.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DG4Kmgkc.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BhqItS_s.js +1 -0
- package/dist/gateway/static/root/assets/image-generation-api-PkhYohDa.js +1 -0
- package/dist/gateway/static/root/assets/index-DLhvsU9B.css +2 -0
- package/dist/gateway/static/root/assets/index-_cuTcWjB.js +107 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-4xaM3jjU.js → keyboard-shortcuts-settings-6OQT3gQF.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DWjTmzxw.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C1xDicdr.js → local-apps-page-DfruRAmE.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-pByvK12G.js → locale-store-C5MK9WcP.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-BA5efZ8B.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-D1XdHm7v.js → management-settings-L1VYkywO.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-B_Ijq1Fr.js → markdown-split-oqgHbqt-.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-DD_PgVue.css +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-CyJlGUxB.js → markdown-view-V4rcPPH0.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CXXNRROJ.js → media-plugins-Bb6gSX2o.js} +1 -1
- package/dist/gateway/static/root/assets/messages-ctG2e-ix.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-rkePB4CB.js → notes-page-B1rOXjpT.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-CkHXVmKP.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-gw-RMQCV.js → page-tabs-CBuCKeyy.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-B8aMScJ2.js → preview-open-alternatives-BQ0tLfPO.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CjcpkWAz.js → product-open-page-DPeFn7Hu.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DCqet9-L.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-D0t_AjzG.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BUWPoBvw.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Ch5qq86o.js → runtime-tools-settings-panel-BCfQNzjG.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DHYWYUFt.js → schema-form-Bo7YbHYN.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-vLhrrM3m.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-OP1y0Y8M.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-DlzZx0-i.js → settings-form-section-B9dnKr3M.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BVLhreQi.js → settings-loading-skeleton-CYDV2JtY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BJU-kUnN.js → settings-page-DbrIYfS9.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Cxc-Ejl5.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-hvIuZXMe.js → share-preview-page-olgr7LLN.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-ZOqC6-aA.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DwvC3Iuf.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Dlvuh7D-.js → skills-page-PE16CNw5.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-B6ddOpnf.js → skills-page.utils-nXmBcBxt.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BdbCAyoA.js → system-settings-panel-C3qPwAdY.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DCRB-5q-.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BtdGacMI.js → theme-store-KR5Otp5w.js} +1 -1
- package/dist/gateway/static/root/assets/{typed-models-lib-CL6qHYJA.js → typed-models-lib-lMZodtDF.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DysNnqCS.js → use-autosave-CKpatP3S.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CoiedRuA.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-UEsO9Jr-.js → voice-api-key-field-CDcv0Wbh.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-B9disASf.js → work-discovery-overlay-CGdT22un.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-BwaU1RqI.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-A0zTQHFQ.js → workflow-run-setup-panel-BAHYNlQt.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DHYmh9G7.js +5 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/coordinator.d.ts +1 -1
- package/dist/src/agent/background-review/coordinator.js +4 -5
- package/dist/src/agent/background-review/run-background-review.js +0 -1
- package/dist/src/agent/background-review/settings.d.ts +1 -2
- package/dist/src/agent/background-review/settings.js +3 -4
- package/dist/src/agent/external-tools/composio-provider.js +8 -4
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +2 -1
- package/dist/src/agent/image/tool-model-config.js +15 -9
- package/dist/src/agent/memory/builtin-provider.js +1 -2
- package/dist/src/agent/memory/manager.js +2 -0
- package/dist/src/agent/memory/sensitivity.js +1 -1
- package/dist/src/agent/memory/understanding/service.js +43 -19
- package/dist/src/agent/memory/user-context-coordinator.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +23 -7
- package/dist/src/automations/domain/validation.d.ts +7 -7
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/capabilities/readiness/from-config.d.ts +10 -0
- package/dist/src/capabilities/readiness/from-config.js +128 -0
- package/dist/src/capabilities/readiness/index.d.ts +3 -0
- package/dist/src/capabilities/readiness/index.js +3 -0
- package/dist/src/capabilities/readiness/planner.d.ts +3 -0
- package/dist/src/capabilities/readiness/planner.js +56 -0
- package/dist/src/capabilities/readiness/types.d.ts +35 -0
- package/dist/src/capabilities/readiness/types.js +1 -0
- package/dist/src/cli/commands/agent.js +9 -0
- package/dist/src/cli/commands/auth.js +4 -3
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/models.js +2 -1
- package/dist/src/cli/commands/onboard/model.d.ts +3 -21
- package/dist/src/cli/commands/onboard/model.js +10 -86
- package/dist/src/cli/utils/oauth-login.d.ts +2 -0
- package/dist/src/cli/utils/oauth-login.js +9 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/paths-state.d.ts +2 -0
- package/dist/src/config/paths-state.js +5 -1
- package/dist/src/config/paths.d.ts +1 -1
- package/dist/src/config/paths.js +2 -2
- package/dist/src/config/schema.js +1 -1
- package/dist/src/connectors/auth-provider-registry.d.ts +2 -1
- package/dist/src/connectors/auth-provider-registry.js +5 -2
- package/dist/src/connectors/composio-sessions.d.ts +39 -0
- package/dist/src/connectors/composio-sessions.js +66 -7
- package/dist/src/connectors/composio.d.ts +4 -1
- package/dist/src/connectors/composio.js +34 -7
- package/dist/src/connectors/connected-source-cursor.d.ts +9 -0
- package/dist/src/connectors/connected-source-cursor.js +30 -0
- package/dist/src/connectors/connected-source-ingestion.js +67 -46
- package/dist/src/connectors/connected-source-normalizers.d.ts +1 -0
- package/dist/src/connectors/connected-source-normalizers.js +33 -2
- package/dist/src/connectors/connected-source-sanitization.d.ts +1 -0
- package/dist/src/connectors/connected-source-sanitization.js +21 -0
- package/dist/src/connectors/connector-identity.js +10 -2
- package/dist/src/connectors/content-enrichment.d.ts +29 -0
- package/dist/src/connectors/content-enrichment.js +273 -0
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/learning-coordinator.js +1 -2
- package/dist/src/connectors/learning-recipes.js +28 -33
- package/dist/src/connectors/runtime-adapter-registry.js +14 -1
- package/dist/src/discussions/live-worker.d.ts +1 -0
- package/dist/src/discussions/live-worker.js +7 -1
- package/dist/src/discussions/repository.js +11 -1
- package/dist/src/discussions/sealer.d.ts +1 -1
- package/dist/src/discussions/sealer.js +16 -7
- package/dist/src/discussions/transcript.js +27 -1
- package/dist/src/discussions/types.d.ts +4 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +8 -3
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +8 -1
- package/dist/src/gateway/hono/oauth-async.d.ts +11 -5
- package/dist/src/gateway/hono/oauth-async.js +29 -16
- package/dist/src/gateway/hono/oauth.d.ts +1 -3
- package/dist/src/gateway/hono/oauth.js +22 -22
- package/dist/src/gateway/hono/routes/agent-stream.js +4 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +16 -3
- package/dist/src/gateway/hono/routes/deps.d.ts +1 -0
- package/dist/src/gateway/hono/routes/discussions.js +2 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +2 -1
- package/dist/src/gateway/hono/routes/mcp.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +59 -5
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +75 -1
- package/dist/src/gateway/hono/routes/understanding-sources.js +29 -0
- package/dist/src/gateway/hono/routes/voice.d.ts +1 -2
- package/dist/src/gateway/hono/routes/voice.js +16 -35
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/service/agent-runner.d.ts +9 -1
- package/dist/src/gateway/service/agent-runner.js +9 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
- package/dist/src/gateway/service/session-input-coordinator.js +63 -6
- package/dist/src/gateway/service.d.ts +8 -0
- package/dist/src/gateway/service.js +18 -0
- package/dist/src/knowledge/connected-understanding-pipeline.d.ts +1 -1
- package/dist/src/knowledge/connected-understanding-pipeline.js +74 -25
- package/dist/src/knowledge/ingestion-service.js +33 -15
- package/dist/src/knowledge/types.d.ts +2 -0
- package/dist/src/media-understanding/audio-transcription-runner.d.ts +2 -0
- package/dist/src/media-understanding/audio-transcription-runner.js +3 -1
- package/dist/src/media-understanding/runner.js +3 -1
- package/dist/src/media-understanding/types.d.ts +2 -0
- package/dist/src/providers/model-catalog-persistence.d.ts +9 -0
- package/dist/src/providers/model-catalog-persistence.js +172 -0
- package/dist/src/providers/model-catalog-ranking.d.ts +2 -0
- package/dist/src/providers/model-catalog-ranking.js +17 -0
- package/dist/src/providers/model-catalog-store.d.ts +13 -3
- package/dist/src/providers/model-catalog-store.js +24 -5
- package/dist/src/providers/model-catalog-sync-service.d.ts +3 -3
- package/dist/src/providers/model-catalog-sync-service.js +12 -7
- package/dist/src/providers/provider-auth-service.d.ts +1 -0
- package/dist/src/providers/provider-auth-service.js +3 -0
- package/dist/src/providers/provider-disconnect.d.ts +11 -0
- package/dist/src/providers/provider-disconnect.js +33 -0
- package/dist/src/providers/xopc-cloud-catalog-coordinator.d.ts +56 -0
- package/dist/src/providers/xopc-cloud-catalog-coordinator.js +182 -0
- package/dist/src/providers/xopc-cloud-model-source.d.ts +6 -10
- package/dist/src/providers/xopc-cloud-model-source.js +49 -27
- package/dist/src/retrieval/audit.d.ts +1 -0
- package/dist/src/retrieval/audit.js +8 -0
- package/dist/src/retrieval/candidateFusion.d.ts +5 -0
- package/dist/src/retrieval/candidateFusion.js +20 -0
- package/dist/src/retrieval/queryProfile.d.ts +16 -0
- package/dist/src/retrieval/queryProfile.js +66 -0
- package/dist/src/retrieval/textFeatures.d.ts +5 -0
- package/dist/src/retrieval/textFeatures.js +71 -0
- package/dist/src/session/client-history.d.ts +1 -0
- package/dist/src/session/client-history.js +4 -0
- package/dist/src/session/index.js +1 -1
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/fts.d.ts +0 -4
- package/dist/src/storage/sqlite/fts.js +2 -49
- package/dist/src/storage/sqlite/index.d.ts +3 -2
- package/dist/src/storage/sqlite/index.js +6 -5
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +4 -0
- package/dist/src/storage/sqlite/memory-records-repository.js +60 -38
- package/dist/src/storage/sqlite/row-mappers.js +2 -2
- package/dist/src/storage/sqlite/session-repository.js +2 -2
- package/dist/src/storage/sqlite/session-turn-replace-repository.d.ts +34 -0
- package/dist/src/storage/sqlite/session-turn-replace-repository.js +110 -0
- package/dist/src/storage/sqlite/transcript-repository.js +1 -1
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +15 -0
- package/dist/src/storage/sqlite/user-context-quality-repository.js +46 -2
- package/dist/src/storage/sqlite/user-context-repository.d.ts +4 -0
- package/dist/src/storage/sqlite/user-context-repository.js +29 -3
- package/dist/src/tasks/home-query-service.d.ts +3 -1
- package/dist/src/tasks/home-query-service.js +73 -70
- package/dist/src/tui/backends/embedded-backend.js +12 -4
- package/dist/src/tui/tui-oauth-login.js +5 -0
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/user-context/planner.d.ts +1 -0
- package/dist/src/user-context/planner.js +16 -29
- package/dist/src/user-context/retriever.d.ts +15 -0
- package/dist/src/user-context/retriever.js +65 -0
- package/dist/src/user-context/scope.d.ts +7 -0
- package/dist/src/user-context/scope.js +9 -0
- package/dist/src/user-context/sources/activity-clustering.js +30 -117
- package/dist/src/user-context/sources/index.d.ts +1 -0
- package/dist/src/user-context/sources/index.js +2 -1
- package/dist/src/user-context/sources/signal-clustering.d.ts +18 -0
- package/dist/src/user-context/sources/signal-clustering.js +131 -0
- package/dist/src/voice/audio/normalize.d.ts +17 -0
- package/dist/src/voice/audio/normalize.js +155 -0
- package/dist/src/voice/language-profile.d.ts +1 -4
- package/dist/src/voice/language-profile.js +2 -25
- package/dist/src/voice/local/runtime-client.d.ts +2 -0
- package/dist/src/voice/local/runtime-client.js +20 -1
- package/dist/src/voice/local/runtime-worker.js +7 -13
- package/dist/src/voice/local/wav.js +1 -1
- package/dist/src/voice/stt/availability.d.ts +1 -4
- package/dist/src/voice/stt/availability.js +3 -15
- package/dist/src/voice/stt/config.js +1 -0
- package/dist/src/voice/stt/factory.js +23 -0
- package/dist/src/voice/stt/index.d.ts +1 -0
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/list-providers.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +7 -3
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +3 -1
- package/dist/src/voice/stt/transcribe-core.d.ts +5 -1
- package/dist/src/voice/stt/transcribe-core.js +13 -5
- package/dist/src/voice/stt/types.d.ts +2 -0
- package/dist/src/voice/tts/factory.d.ts +1 -1
- package/dist/src/voice/tts/factory.js +23 -1
- package/dist/src/voice/tts/merge-config.js +5 -3
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +3 -1
- package/dist/src/voice/tts/types.d.ts +2 -0
- package/dist/src/voice/tts/types.js +4 -2
- package/dist/src/work-discovery/evaluation.d.ts +23 -0
- package/dist/src/work-discovery/evaluation.js +18 -1
- package/dist/src/work-discovery/index.js +2 -2
- package/package.json +4 -3
- package/dist/gateway/static/root/assets/agents-Bl8FQZxW.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-CRUgTO10.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-DrSwolhG.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-NlvDyMwD.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BWXUznw5.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D0loEbzq.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-CcivCw8U.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DkHAD2Zn.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-DVedGAeX.js +0 -36
- package/dist/gateway/static/root/assets/connectors-page-DlBSlfkv.js +0 -2
- package/dist/gateway/static/root/assets/heartbeat-settings-UZAn1aAQ.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CRJDpy5E.js +0 -3
- package/dist/gateway/static/root/assets/index-BSjP0Wsx.css +0 -2
- package/dist/gateway/static/root/assets/index-C2ZYFBGL.js +0 -85
- package/dist/gateway/static/root/assets/local-app-workbench-page-D9bguWRo.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Gr-nE4nW.js +0 -2
- package/dist/gateway/static/root/assets/markdown-view-B12xeflb.css +0 -1
- package/dist/gateway/static/root/assets/messages-yG5P43Q9.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-CpbD4XG2.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-GvSYDbjR.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DPRxKGbs.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-WIzeu-gB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-2XEJM0YE.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-g1GThZ0O.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C6qj2L-q.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BBpE1bep.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DXORBJNk.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DC0hc8hp.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Bwg4KV8B.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-CmPfOfHl.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DhQNh7W6.js +0 -5
- package/dist/src/voice/local/runtime-dispatcher.d.ts +0 -9
- package/dist/src/voice/local/runtime-dispatcher.js +0 -20
|
@@ -65,11 +65,13 @@ function normalizeCalendar(result) {
|
|
|
65
65
|
const externalId = text(event, "id", "eventId", "event_id");
|
|
66
66
|
if (!externalId) return [];
|
|
67
67
|
const occurredAt = time(event.start ?? event.startTime ?? event.start_time);
|
|
68
|
+
const sourceUpdatedAt = time(event.updated ?? event.updatedAt ?? event.updated_at);
|
|
68
69
|
return [{
|
|
69
70
|
externalId,
|
|
70
71
|
itemType: "calendar_event",
|
|
71
72
|
occurredAt,
|
|
72
|
-
sourceUpdatedAt
|
|
73
|
+
sourceUpdatedAt,
|
|
74
|
+
...event.status === "cancelled" ? { deletedAt: sourceUpdatedAt ?? (/* @__PURE__ */ new Date()).toISOString() } : {},
|
|
73
75
|
value: compact({
|
|
74
76
|
id: externalId,
|
|
75
77
|
title: text(event, "summary", "title", "name"),
|
|
@@ -88,6 +90,34 @@ function normalizeCalendar(result) {
|
|
|
88
90
|
}];
|
|
89
91
|
});
|
|
90
92
|
}
|
|
93
|
+
function normalizeGoogleDrive(result) {
|
|
94
|
+
return rows(payload(result), "files", "items").flatMap((file) => {
|
|
95
|
+
const externalId = text(file, "id", "fileId", "file_id");
|
|
96
|
+
const name = text(file, "name", "title");
|
|
97
|
+
if (!externalId || !name || file.trashed === true) return [];
|
|
98
|
+
const modifiedAt = time(file.modifiedTime ?? file.modified_time ?? file.modifiedDate);
|
|
99
|
+
return [{
|
|
100
|
+
externalId,
|
|
101
|
+
itemType: "cloud_document",
|
|
102
|
+
occurredAt: modifiedAt ?? time(file.createdTime ?? file.created_time ?? file.createdDate),
|
|
103
|
+
sourceUpdatedAt: modifiedAt,
|
|
104
|
+
value: compact({
|
|
105
|
+
id: externalId,
|
|
106
|
+
title: name,
|
|
107
|
+
mimeType: text(file, "mimeType", "mime_type"),
|
|
108
|
+
modifiedAt,
|
|
109
|
+
owners: file.owners,
|
|
110
|
+
webViewLink: text(file, "webViewLink", "web_view_link")
|
|
111
|
+
}),
|
|
112
|
+
metadata: {
|
|
113
|
+
observationKind: "document_metadata",
|
|
114
|
+
logicalEventKey: `googledrive:file:${externalId}`,
|
|
115
|
+
mimeType: text(file, "mimeType", "mime_type")
|
|
116
|
+
},
|
|
117
|
+
synthesisStatus: "ignored"
|
|
118
|
+
}];
|
|
119
|
+
});
|
|
120
|
+
}
|
|
91
121
|
function repositoryName(row) {
|
|
92
122
|
const explicit = text(record(row.repository) ?? record(row.repo), "full_name", "name") ?? text(row, "repository_full_name", "full_name", "repo");
|
|
93
123
|
if (explicit) return explicit;
|
|
@@ -178,8 +208,9 @@ function normalizeExternalTasks(result, toolkit) {
|
|
|
178
208
|
function normalizeConnectedSourceResult(input) {
|
|
179
209
|
if (input.toolkit === "gmail") return normalizeGmail(input.result);
|
|
180
210
|
if (input.toolkit === "googlecalendar") return normalizeCalendar(input.result);
|
|
211
|
+
if (input.toolkit === "googledrive") return normalizeGoogleDrive(input.result);
|
|
181
212
|
if (input.toolkit === "github") return normalizeGitHub(input.result, input.actionId);
|
|
182
|
-
if (input.toolkit === "linear"
|
|
213
|
+
if (input.toolkit === "linear") return normalizeExternalTasks(input.result, input.toolkit);
|
|
183
214
|
return [];
|
|
184
215
|
}
|
|
185
216
|
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sanitizeConnectedSourceValue(value: unknown, depth?: number): unknown;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/connectors/connected-source-sanitization.ts
|
|
2
|
+
const SENSITIVE_KEY_RE = /(?:^|_)(?:api_?key|token|secret|password|passwd|authorization|credential|private_?key)(?:$|_)/i;
|
|
3
|
+
const INLINE_SECRET_PATTERNS = [
|
|
4
|
+
/\bsk-[A-Za-z0-9_-]{8,}\b/g,
|
|
5
|
+
/\bghp_[A-Za-z0-9]{20,}\b/g,
|
|
6
|
+
/\bxox[baprs]-[A-Za-z0-9-]{20,}\b/g,
|
|
7
|
+
/-----BEGIN [^-]*PRIVATE KEY-----[\s\S]*?-----END [^-]*PRIVATE KEY-----/g
|
|
8
|
+
];
|
|
9
|
+
function record(value) {
|
|
10
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
11
|
+
}
|
|
12
|
+
function sanitizeConnectedSourceValue(value, depth = 0) {
|
|
13
|
+
if (depth > 12) return "[MaxDepth]";
|
|
14
|
+
if (typeof value === "string") return INLINE_SECRET_PATTERNS.reduce((text, pattern) => text.replace(pattern, "[REDACTED]"), value);
|
|
15
|
+
if (Array.isArray(value)) return value.map((item) => sanitizeConnectedSourceValue(item, depth + 1));
|
|
16
|
+
const source = record(value);
|
|
17
|
+
if (!source) return value;
|
|
18
|
+
return Object.fromEntries(Object.entries(source).map(([key, nested]) => [key, SENSITIVE_KEY_RE.test(key) ? "[REDACTED]" : sanitizeConnectedSourceValue(nested, depth + 1)]));
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { sanitizeConnectedSourceValue };
|
|
@@ -23,6 +23,13 @@ function normalizeConnectorIdentity(toolkit, result) {
|
|
|
23
23
|
profileUrl: text(row, ["html_url"])
|
|
24
24
|
};
|
|
25
25
|
if (toolkit === "gmail") return { email: text(row, ["emailAddress", "email"]) };
|
|
26
|
+
if (toolkit === "googledrive") {
|
|
27
|
+
const user = object(row.user);
|
|
28
|
+
return {
|
|
29
|
+
email: text(user, ["emailAddress", "email"]) ?? text(row, ["emailAddress", "email"]),
|
|
30
|
+
displayName: text(user, ["displayName", "name"])
|
|
31
|
+
};
|
|
32
|
+
}
|
|
26
33
|
if (toolkit === "slack") return {
|
|
27
34
|
enterpriseId: text(row, ["enterprise_id", "enterpriseId"]),
|
|
28
35
|
workspaceId: text(row, ["team_id", "teamId"]),
|
|
@@ -62,9 +69,9 @@ function connectorIdentityKey(toolkit, identity) {
|
|
|
62
69
|
if (!workspaceId || !subjectId) return void 0;
|
|
63
70
|
return `slack:${text(identity, ["enterpriseId", "enterprise_id"]) ?? "-"}:${workspaceId}:${subjectId}`;
|
|
64
71
|
}
|
|
65
|
-
if (normalizedToolkit === "gmail") {
|
|
72
|
+
if (normalizedToolkit === "gmail" || normalizedToolkit === "googledrive") {
|
|
66
73
|
const email = text(identity, ["email"]);
|
|
67
|
-
return email ?
|
|
74
|
+
return email ? `${normalizedToolkit}:${email.toLowerCase()}` : void 0;
|
|
68
75
|
}
|
|
69
76
|
if (normalizedToolkit === "github") {
|
|
70
77
|
const username = text(identity, ["username"]);
|
|
@@ -75,6 +82,7 @@ function mergeConnectorIdentity(toolkit, current, incoming) {
|
|
|
75
82
|
const normalizedToolkit = toolkit.trim().toLowerCase();
|
|
76
83
|
if (![
|
|
77
84
|
"gmail",
|
|
85
|
+
"googledrive",
|
|
78
86
|
"github",
|
|
79
87
|
"slack"
|
|
80
88
|
].includes(normalizedToolkit)) return {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComposioSessionsAdapter } from './composio-sessions.js';
|
|
2
|
+
type ContentReadAdapter = Pick<ComposioSessionsAdapter, 'executeWithPolicy'>;
|
|
3
|
+
export type ConnectedContentCandidate = {
|
|
4
|
+
sourceItemId: string;
|
|
5
|
+
sourceInstanceId: string;
|
|
6
|
+
toolkit: 'gmail' | 'googledrive';
|
|
7
|
+
title: string;
|
|
8
|
+
occurredAt?: string;
|
|
9
|
+
mimeType?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ConnectedContentReadResult = {
|
|
12
|
+
requested: number;
|
|
13
|
+
completed: number;
|
|
14
|
+
failed: Array<{
|
|
15
|
+
sourceItemId: string;
|
|
16
|
+
error: string;
|
|
17
|
+
}>;
|
|
18
|
+
recordIds: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare function listConnectedContentCandidates(options: {
|
|
21
|
+
agentId: string;
|
|
22
|
+
limit?: number;
|
|
23
|
+
}): ConnectedContentCandidate[];
|
|
24
|
+
export declare function readConnectedContent(input: {
|
|
25
|
+
sourceItemIds: string[];
|
|
26
|
+
agentId: string;
|
|
27
|
+
adapterFactory?: (downloadDirectory: string) => ContentReadAdapter;
|
|
28
|
+
}): Promise<ConnectedContentReadResult>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { getKnowledgeSourceItem, listKnowledgeSourceItems, upsertKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
2
|
+
import { getConnectorConnection, getConnectorInstallation } from "../storage/sqlite/connector-repository.js";
|
|
3
|
+
import "../storage/sqlite/index.js";
|
|
4
|
+
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
5
|
+
import { ConnectedKnowledgePipeline } from "../knowledge/connected-knowledge-pipeline.js";
|
|
6
|
+
import { sanitizeConnectedSourceValue } from "./connected-source-sanitization.js";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
|
+
import { isAbsolute, join, relative, sep } from "node:path";
|
|
9
|
+
import { createHash } from "node:crypto";
|
|
10
|
+
import { mkdtemp, readFile, realpath, rm } from "node:fs/promises";
|
|
11
|
+
//#region src/connectors/content-enrichment.ts
|
|
12
|
+
const MAX_SELECTION = 5;
|
|
13
|
+
const MAX_CONTENT_BYTES = 1e6;
|
|
14
|
+
const MAX_CONTENT_CHARS = 24e3;
|
|
15
|
+
const GOOGLE_DOCUMENT_MIME = "application/vnd.google-apps.document";
|
|
16
|
+
const DOWNLOADABLE_TEXT_MIMES = new Set([
|
|
17
|
+
"application/json",
|
|
18
|
+
"application/xml",
|
|
19
|
+
"text/csv",
|
|
20
|
+
"text/html",
|
|
21
|
+
"text/markdown",
|
|
22
|
+
"text/plain",
|
|
23
|
+
"text/tab-separated-values",
|
|
24
|
+
"text/xml"
|
|
25
|
+
]);
|
|
26
|
+
function record(value) {
|
|
27
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
28
|
+
}
|
|
29
|
+
function normalizedRecord(item) {
|
|
30
|
+
if (!item.normalizedText) return {};
|
|
31
|
+
try {
|
|
32
|
+
return record(JSON.parse(item.normalizedText));
|
|
33
|
+
} catch {
|
|
34
|
+
return {};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function text(value) {
|
|
38
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
39
|
+
}
|
|
40
|
+
function candidateFor(item) {
|
|
41
|
+
if (item.deletedAt || item.sensitivity === "secret" || item.sensitivity === "regulated") return void 0;
|
|
42
|
+
const toolkit = text(item.metadata.toolkit);
|
|
43
|
+
const value = normalizedRecord(item);
|
|
44
|
+
const title = text(value.title) ?? text(value.subject);
|
|
45
|
+
if (!title) return void 0;
|
|
46
|
+
if (toolkit === "gmail" && item.itemType === "email") return {
|
|
47
|
+
sourceItemId: item.id,
|
|
48
|
+
sourceInstanceId: item.sourceInstanceId,
|
|
49
|
+
toolkit,
|
|
50
|
+
title,
|
|
51
|
+
occurredAt: item.occurredAt
|
|
52
|
+
};
|
|
53
|
+
const mimeType = text(item.metadata.mimeType) ?? text(value.mimeType);
|
|
54
|
+
if (toolkit === "googledrive" && item.itemType === "cloud_document" && mimeType && (mimeType === GOOGLE_DOCUMENT_MIME || DOWNLOADABLE_TEXT_MIMES.has(mimeType))) return {
|
|
55
|
+
sourceItemId: item.id,
|
|
56
|
+
sourceInstanceId: item.sourceInstanceId,
|
|
57
|
+
toolkit,
|
|
58
|
+
title,
|
|
59
|
+
occurredAt: item.occurredAt,
|
|
60
|
+
mimeType
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function listConnectedContentCandidates(options) {
|
|
64
|
+
const limit = Math.max(1, Math.min(20, options.limit ?? 10));
|
|
65
|
+
const items = listKnowledgeSourceItems({
|
|
66
|
+
agentId: options.agentId,
|
|
67
|
+
includeDeleted: false,
|
|
68
|
+
limit: 500
|
|
69
|
+
});
|
|
70
|
+
const completedReads = new Set(items.map((item) => text(item.metadata.sourceMetadataItemId)).filter((id) => Boolean(id)));
|
|
71
|
+
return items.filter((item) => !completedReads.has(item.id)).map(candidateFor).filter((candidate) => Boolean(candidate)).slice(0, limit);
|
|
72
|
+
}
|
|
73
|
+
function contentRecipe(item) {
|
|
74
|
+
const toolkit = text(item.metadata.toolkit);
|
|
75
|
+
if (toolkit === "gmail" && item.itemType === "email") return {
|
|
76
|
+
actionId: "GMAIL_GET_EMAIL",
|
|
77
|
+
args: { message_id: item.externalId },
|
|
78
|
+
mode: "inline"
|
|
79
|
+
};
|
|
80
|
+
const value = normalizedRecord(item);
|
|
81
|
+
const mimeType = text(item.metadata.mimeType) ?? text(value.mimeType);
|
|
82
|
+
if (toolkit === "googledrive" && item.itemType === "cloud_document" && mimeType === GOOGLE_DOCUMENT_MIME) return {
|
|
83
|
+
actionId: "GOOGLEDRIVE_EXPORT_GOOGLE_WORKSPACE_FILE",
|
|
84
|
+
args: {
|
|
85
|
+
fileId: item.externalId,
|
|
86
|
+
mimeType: "text/plain"
|
|
87
|
+
},
|
|
88
|
+
mode: "file"
|
|
89
|
+
};
|
|
90
|
+
if (toolkit === "googledrive" && item.itemType === "cloud_document" && mimeType && DOWNLOADABLE_TEXT_MIMES.has(mimeType)) return {
|
|
91
|
+
actionId: "GOOGLEDRIVE_DOWNLOAD_FILE",
|
|
92
|
+
args: { file_id: item.externalId },
|
|
93
|
+
mode: "file"
|
|
94
|
+
};
|
|
95
|
+
throw new Error("This source item does not support bounded content reading.");
|
|
96
|
+
}
|
|
97
|
+
function collectInlineText(value, output, depth = 0) {
|
|
98
|
+
if (depth > 8 || output.join("\n").length >= MAX_CONTENT_CHARS) return;
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
for (const item of value) collectInlineText(item, output, depth + 1);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const row = record(value);
|
|
104
|
+
for (const [key, nested] of Object.entries(row)) {
|
|
105
|
+
if (typeof nested === "string" && [
|
|
106
|
+
"body",
|
|
107
|
+
"content",
|
|
108
|
+
"plainText",
|
|
109
|
+
"plain_text",
|
|
110
|
+
"snippet",
|
|
111
|
+
"text"
|
|
112
|
+
].includes(key)) {
|
|
113
|
+
if (nested.trim()) output.push(nested.trim());
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (nested && typeof nested === "object") collectInlineText(nested, output, depth + 1);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function inlineContent(result) {
|
|
120
|
+
const values = [];
|
|
121
|
+
collectInlineText(result, values);
|
|
122
|
+
return [...new Set(values)].join("\n\n").slice(0, MAX_CONTENT_CHARS);
|
|
123
|
+
}
|
|
124
|
+
function candidateFilePaths(value, output, depth = 0) {
|
|
125
|
+
if (depth > 8) return;
|
|
126
|
+
if (typeof value === "string") {
|
|
127
|
+
if (value.startsWith("file://")) output.push(new URL(value).pathname);
|
|
128
|
+
else if (isAbsolute(value)) output.push(value);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (Array.isArray(value)) {
|
|
132
|
+
for (const item of value) candidateFilePaths(item, output, depth + 1);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
for (const nested of Object.values(record(value))) candidateFilePaths(nested, output, depth + 1);
|
|
136
|
+
}
|
|
137
|
+
async function downloadedContent(result, downloadDirectory) {
|
|
138
|
+
const directory = await realpath(downloadDirectory);
|
|
139
|
+
const paths = [];
|
|
140
|
+
candidateFilePaths(result, paths);
|
|
141
|
+
for (const path of paths) {
|
|
142
|
+
const resolved = await realpath(path).catch(() => void 0);
|
|
143
|
+
if (!resolved) continue;
|
|
144
|
+
const pathFromDirectory = relative(directory, resolved);
|
|
145
|
+
if (pathFromDirectory.startsWith(`..${sep}`) || pathFromDirectory === ".." || isAbsolute(pathFromDirectory)) continue;
|
|
146
|
+
const content = await readFile(resolved);
|
|
147
|
+
if (content.byteLength > MAX_CONTENT_BYTES) throw new Error("Downloaded content exceeds the 1 MB read limit.");
|
|
148
|
+
return content.toString("utf8").slice(0, MAX_CONTENT_CHARS);
|
|
149
|
+
}
|
|
150
|
+
throw new Error("The connector did not return readable text content.");
|
|
151
|
+
}
|
|
152
|
+
function updatedSourceItem(item, content, actionId) {
|
|
153
|
+
const contentReadAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
154
|
+
const sanitizedContent = String(sanitizeConnectedSourceValue(content));
|
|
155
|
+
const normalizedText = JSON.stringify({
|
|
156
|
+
...normalizedRecord(item),
|
|
157
|
+
content: sanitizedContent,
|
|
158
|
+
contentReadAt
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
sourceInstanceId: item.sourceInstanceId,
|
|
162
|
+
collectionScope: "content-reads",
|
|
163
|
+
externalId: item.id,
|
|
164
|
+
itemType: "connected_content",
|
|
165
|
+
authorRole: item.authorRole,
|
|
166
|
+
occurredAt: item.occurredAt,
|
|
167
|
+
sourceUpdatedAt: item.sourceUpdatedAt,
|
|
168
|
+
contentHash: createHash("sha256").update(normalizedText).digest("hex"),
|
|
169
|
+
normalizedText,
|
|
170
|
+
payloadRef: item.payloadRef,
|
|
171
|
+
metadata: {
|
|
172
|
+
...item.metadata,
|
|
173
|
+
explicitContentRead: true,
|
|
174
|
+
sourceMetadataItemId: item.id,
|
|
175
|
+
contentReadActionId: actionId,
|
|
176
|
+
contentReadAt
|
|
177
|
+
},
|
|
178
|
+
sensitivity: item.sensitivity,
|
|
179
|
+
retentionClass: "bounded",
|
|
180
|
+
synthesisPipeline: "connected_knowledge",
|
|
181
|
+
synthesisStatus: "pending"
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
async function readConnectedContent(input) {
|
|
185
|
+
const sourceItemIds = [...new Set(input.sourceItemIds.map((id) => id.trim()).filter(Boolean))];
|
|
186
|
+
if (!sourceItemIds.length || sourceItemIds.length > MAX_SELECTION) throw new Error(`Select between 1 and ${MAX_SELECTION} source items.`);
|
|
187
|
+
const downloadDirectory = await mkdtemp(join(tmpdir(), "xopc-content-read-"));
|
|
188
|
+
const adapter = input.adapterFactory?.(downloadDirectory) ?? new ComposioSessionsAdapter({ fileDownloadDir: downloadDirectory });
|
|
189
|
+
const result = {
|
|
190
|
+
requested: sourceItemIds.length,
|
|
191
|
+
completed: 0,
|
|
192
|
+
failed: [],
|
|
193
|
+
recordIds: []
|
|
194
|
+
};
|
|
195
|
+
const updatedSources = /* @__PURE__ */ new Set();
|
|
196
|
+
const completedReads = new Set(listKnowledgeSourceItems({
|
|
197
|
+
agentId: input.agentId,
|
|
198
|
+
includeDeleted: false,
|
|
199
|
+
limit: 500
|
|
200
|
+
}).map((item) => text(item.metadata.sourceMetadataItemId)).filter((id) => Boolean(id)));
|
|
201
|
+
try {
|
|
202
|
+
for (const sourceItemId of sourceItemIds) try {
|
|
203
|
+
const item = getKnowledgeSourceItem(sourceItemId);
|
|
204
|
+
if (!item || item.deletedAt || item.metadata.agentId !== input.agentId) throw new Error("Source item is unavailable.");
|
|
205
|
+
if (completedReads.has(item.id)) throw new Error("Source item content was already read.");
|
|
206
|
+
if (!candidateFor(item)) throw new Error("Source item is not eligible for content reading.");
|
|
207
|
+
const connectorId = text(item.metadata.connectorId);
|
|
208
|
+
const connectionId = text(item.metadata.connectionId);
|
|
209
|
+
const toolkit = text(item.metadata.toolkit);
|
|
210
|
+
if (!connectorId || !connectionId || !toolkit) throw new Error("Source item has incomplete connector provenance.");
|
|
211
|
+
const connection = getConnectorConnection(connectionId);
|
|
212
|
+
const installation = getConnectorInstallation(`${connectorId}-local-owner`);
|
|
213
|
+
if (!connection || connection.status !== "active" || !installation?.enabled) throw new Error("The connected account is not active.");
|
|
214
|
+
const recipe = contentRecipe(item);
|
|
215
|
+
const execution = await adapter.executeWithPolicy({
|
|
216
|
+
context: {
|
|
217
|
+
principalId: connection.principalId,
|
|
218
|
+
toolkits: [toolkit]
|
|
219
|
+
},
|
|
220
|
+
installation: {
|
|
221
|
+
...installation,
|
|
222
|
+
maxScope: "read",
|
|
223
|
+
confirmationPolicy: "always"
|
|
224
|
+
},
|
|
225
|
+
connection,
|
|
226
|
+
agentId: input.agentId,
|
|
227
|
+
action: {
|
|
228
|
+
connectorId,
|
|
229
|
+
actionId: recipe.actionId,
|
|
230
|
+
toolkit,
|
|
231
|
+
scope: "read",
|
|
232
|
+
curated: true,
|
|
233
|
+
cachedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
234
|
+
},
|
|
235
|
+
args: recipe.args,
|
|
236
|
+
confirmed: true
|
|
237
|
+
});
|
|
238
|
+
if (execution.decision !== "allowed") throw new Error(execution.reason);
|
|
239
|
+
const content = recipe.mode === "inline" ? inlineContent(execution.result) : await downloadedContent(execution.result, downloadDirectory);
|
|
240
|
+
if (!content.trim()) throw new Error("The connector returned empty text content.");
|
|
241
|
+
upsertKnowledgeSourceItems([updatedSourceItem(item, content, recipe.actionId)]);
|
|
242
|
+
completedReads.add(item.id);
|
|
243
|
+
updatedSources.add(item.sourceInstanceId);
|
|
244
|
+
result.completed += 1;
|
|
245
|
+
} catch (error) {
|
|
246
|
+
result.failed.push({
|
|
247
|
+
sourceItemId,
|
|
248
|
+
error: error instanceof Error ? error.message : String(error)
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
for (const sourceInstanceId of updatedSources) {
|
|
252
|
+
const item = listKnowledgeSourceItems({
|
|
253
|
+
sourceInstanceId,
|
|
254
|
+
synthesisStatus: "pending",
|
|
255
|
+
limit: 1
|
|
256
|
+
})[0];
|
|
257
|
+
if (!item) continue;
|
|
258
|
+
const synthesized = await new ConnectedKnowledgePipeline({
|
|
259
|
+
agentId: input.agentId,
|
|
260
|
+
workspaceId: text(item.metadata.workspaceId) ?? "default"
|
|
261
|
+
}).processPending(sourceInstanceId);
|
|
262
|
+
result.recordIds.push(...synthesized.recordIds);
|
|
263
|
+
}
|
|
264
|
+
return result;
|
|
265
|
+
} finally {
|
|
266
|
+
await rm(downloadDirectory, {
|
|
267
|
+
recursive: true,
|
|
268
|
+
force: true
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
//#endregion
|
|
273
|
+
export { listConnectedContentCandidates, readConnectedContent };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
1
2
|
import { materializeConnectorMcpServer } from "./materialize.js";
|
|
2
3
|
import { getConnectorInstance } from "./instances.js";
|
|
3
|
-
import { getWorkspacePath } from "../config/workspace-path-helpers.js";
|
|
4
4
|
import { listBundleMcpServerCapabilitiesForGateway } from "../agent/mcp/bundle-mcp-gateway.js";
|
|
5
5
|
//#region src/connectors/health.ts
|
|
6
6
|
function classifyConnectorHealthError(error) {
|
|
@@ -27,7 +27,6 @@ function connectorSourceCategory(toolkit) {
|
|
|
27
27
|
if (toolkit === "gmail") return "mail";
|
|
28
28
|
if (toolkit === "googlecalendar") return "calendar";
|
|
29
29
|
if (toolkit === "github" || toolkit === "linear") return "code_activity";
|
|
30
|
-
if (toolkit === "slack") return "messages";
|
|
31
30
|
return "files";
|
|
32
31
|
}
|
|
33
32
|
function ensureUnderstandingSourceRun(job, toolkit, displayName) {
|
|
@@ -189,7 +188,7 @@ function startConnectorLearningCoordinator(options) {
|
|
|
189
188
|
itemsIndexed
|
|
190
189
|
}));
|
|
191
190
|
publish(updateConnectorLearningJob(job.id, { phase: "deriving" }));
|
|
192
|
-
const understanding = await new ConnectedUnderstandingPipeline(options.getMemoryManager()).process(job.
|
|
191
|
+
const understanding = await new ConnectedUnderstandingPipeline(options.getMemoryManager()).process(job.agentId);
|
|
193
192
|
for (const record of understanding.createdRecords.filter((item) => item.kind === "project_context")) upsertUserFocus({
|
|
194
193
|
canonicalKey: `connector-focus:${job.accountId}:${record.id}`,
|
|
195
194
|
title: record.content.slice(0, 120),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { decodeConnectedSourceCursor } from "./connected-source-cursor.js";
|
|
1
2
|
//#region src/connectors/learning-recipes.ts
|
|
2
3
|
function buildConnectorLearningArguments(plan, stream, input, identity) {
|
|
4
|
+
const cursor = decodeConnectedSourceCursor(input.cursor);
|
|
3
5
|
if (plan.toolkit === "github" && stream.scope === "authored-work") {
|
|
4
6
|
const username = typeof identity.username === "string" ? identity.username.trim() : "";
|
|
5
7
|
if (!username) throw new Error("GitHub activity sync requires the authenticated username.");
|
|
@@ -8,18 +10,28 @@ function buildConnectorLearningArguments(plan, stream, input, identity) {
|
|
|
8
10
|
q: `author:${username} sort:updated-desc`
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
if (!input.cursor) return { ...stream.arguments };
|
|
12
13
|
if (plan.toolkit === "gmail") {
|
|
13
|
-
const after = Math.floor(Date.parse(
|
|
14
|
-
return
|
|
14
|
+
const after = cursor?.checkpoint ? Math.floor(Date.parse(cursor.checkpoint) / 1e3) : NaN;
|
|
15
|
+
return {
|
|
15
16
|
...stream.arguments,
|
|
16
|
-
query: `after:${after} -in:spam -in:trash`
|
|
17
|
-
|
|
17
|
+
...Number.isFinite(after) ? { query: `after:${after} -in:spam -in:trash` } : {},
|
|
18
|
+
...cursor?.pageToken ? { page_token: cursor.pageToken } : {}
|
|
19
|
+
};
|
|
18
20
|
}
|
|
19
21
|
if (plan.toolkit === "googlecalendar") return {
|
|
20
22
|
...stream.arguments,
|
|
21
|
-
|
|
23
|
+
...cursor?.syncToken ? { sync_token: cursor.syncToken } : {},
|
|
24
|
+
...cursor?.pageToken ? { page_token: cursor.pageToken } : {}
|
|
22
25
|
};
|
|
26
|
+
if (plan.toolkit === "googledrive") {
|
|
27
|
+
const checkpoint = cursor?.checkpoint && Number.isFinite(Date.parse(cursor.checkpoint)) ? cursor.checkpoint : void 0;
|
|
28
|
+
const baseQuery = typeof stream.arguments.q === "string" ? stream.arguments.q : "";
|
|
29
|
+
return {
|
|
30
|
+
...stream.arguments,
|
|
31
|
+
...checkpoint ? { q: [baseQuery, `modifiedTime > '${checkpoint}'`].filter(Boolean).join(" and ") } : {},
|
|
32
|
+
...cursor?.pageToken ? { pageToken: cursor.pageToken } : {}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
23
35
|
return { ...stream.arguments };
|
|
24
36
|
}
|
|
25
37
|
const PLANS = {
|
|
@@ -42,47 +54,30 @@ const PLANS = {
|
|
|
42
54
|
toolkit: "googlecalendar",
|
|
43
55
|
streams: [{
|
|
44
56
|
scope: "events",
|
|
45
|
-
actionId: "
|
|
57
|
+
actionId: "GOOGLECALENDAR_SYNC_EVENTS",
|
|
46
58
|
kind: "activity",
|
|
47
|
-
arguments: { max_results:
|
|
59
|
+
arguments: { max_results: 500 }
|
|
48
60
|
}],
|
|
49
61
|
bootstrapWindowDays: 90,
|
|
50
62
|
intervalMinutes: 15
|
|
51
63
|
},
|
|
52
64
|
googledrive: {
|
|
53
65
|
toolkit: "googledrive",
|
|
66
|
+
identityProbe: { actionId: "GOOGLEDRIVE_GET_ABOUT" },
|
|
54
67
|
streams: [{
|
|
55
68
|
scope: "files",
|
|
56
|
-
actionId: "
|
|
69
|
+
actionId: "GOOGLEDRIVE_FIND_FILE",
|
|
57
70
|
kind: "inventory",
|
|
58
|
-
arguments: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
toolkit: "notion",
|
|
65
|
-
streams: [{
|
|
66
|
-
scope: "pages",
|
|
67
|
-
actionId: "NOTION_SEARCH",
|
|
68
|
-
kind: "inventory",
|
|
69
|
-
arguments: {}
|
|
71
|
+
arguments: {
|
|
72
|
+
q: "trashed = false",
|
|
73
|
+
orderBy: "modifiedTime desc",
|
|
74
|
+
pageSize: 100,
|
|
75
|
+
fields: "nextPageToken,files(id,name,mimeType,createdTime,modifiedTime,owners,webViewLink,trashed)"
|
|
76
|
+
}
|
|
70
77
|
}],
|
|
71
78
|
bootstrapWindowDays: 90,
|
|
72
79
|
intervalMinutes: 30
|
|
73
80
|
},
|
|
74
|
-
slack: {
|
|
75
|
-
toolkit: "slack",
|
|
76
|
-
identityProbe: { actionId: "SLACK_TEST_AUTH" },
|
|
77
|
-
streams: [{
|
|
78
|
-
scope: "channels",
|
|
79
|
-
actionId: "SLACK_LIST_CHANNELS",
|
|
80
|
-
kind: "inventory",
|
|
81
|
-
arguments: {}
|
|
82
|
-
}],
|
|
83
|
-
bootstrapWindowDays: 30,
|
|
84
|
-
intervalMinutes: 15
|
|
85
|
-
},
|
|
86
81
|
github: {
|
|
87
82
|
toolkit: "github",
|
|
88
83
|
identityProbe: { actionId: "GITHUB_GET_THE_AUTHENTICATED_USER" },
|
|
@@ -107,7 +107,7 @@ registerConnectorRuntimeAdapter({
|
|
|
107
107
|
if (definition.runtime.type !== "composio") throw new Error(`Invalid Composio connector definition: ${definition.id}`);
|
|
108
108
|
if (definition.runtime.role === "credential") await saveComposioApiKey(input, resolver);
|
|
109
109
|
if (definition.runtime.role === "toolkit") await assertComposioApiKeyConfigured(resolver);
|
|
110
|
-
const instance = installRecord(config, definition, definition.runtime.role === "toolkit" ? { scope: "read" } : {});
|
|
110
|
+
const instance = installRecord(config, definition, definition.runtime.role === "toolkit" ? { scope: "read" } : {}, definition.runtime.role === "toolkit" ? { config: input.config ?? {} } : {});
|
|
111
111
|
if (definition.runtime.role === "toolkit" && isXopcDatabaseOpen()) {
|
|
112
112
|
const installationId = `${definition.id}-local-owner`;
|
|
113
113
|
const existing = getConnectorInstallation(installationId);
|
|
@@ -129,6 +129,19 @@ registerConnectorRuntimeAdapter({
|
|
|
129
129
|
if (definition.runtime.type !== "composio") throw new Error(`Invalid Composio connector definition: ${definition.id}`);
|
|
130
130
|
uninstallRecord(config, instance.instanceId);
|
|
131
131
|
if (definition.runtime.role === "toolkit" && isXopcDatabaseOpen()) deleteConnectorInstallation(`${definition.id}-local-owner`);
|
|
132
|
+
},
|
|
133
|
+
update({ config, definition, input, instanceId }) {
|
|
134
|
+
if (definition.runtime.type !== "composio" || definition.runtime.role !== "toolkit") throw new Error(`Invalid Composio toolkit definition: ${definition.id}`);
|
|
135
|
+
const record = config.connectors?.instances?.[instanceId];
|
|
136
|
+
const marker = record?.xopcConnector;
|
|
137
|
+
if (!marker || typeof marker !== "object" || Array.isArray(marker)) throw new Error(`Connector instance not found: ${instanceId}`);
|
|
138
|
+
const markerRecord = marker;
|
|
139
|
+
if (markerRecord.managed !== true) throw new Error(`Connector instance not found: ${instanceId}`);
|
|
140
|
+
record.xopcConnector = {
|
|
141
|
+
...markerRecord,
|
|
142
|
+
config: input.config ?? {}
|
|
143
|
+
};
|
|
144
|
+
return installedInstance(config, instanceId, definition.id);
|
|
132
145
|
}
|
|
133
146
|
});
|
|
134
147
|
for (const type of [
|
|
@@ -42,13 +42,19 @@ var DiscussionLiveWorker = class {
|
|
|
42
42
|
if (this.running) return;
|
|
43
43
|
this.running = true;
|
|
44
44
|
try {
|
|
45
|
-
await Promise.all(Array.from({ length: this.
|
|
45
|
+
await Promise.all(Array.from({ length: this.resolveConcurrency() }, () => this.processOne()));
|
|
46
46
|
} finally {
|
|
47
47
|
this.running = false;
|
|
48
48
|
const waiters = this.stoppedWaiters.splice(0);
|
|
49
49
|
for (const resolve of waiters) resolve();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
resolveConcurrency() {
|
|
53
|
+
if (this.deps.transcribeSegment) return this.concurrency;
|
|
54
|
+
const config = this.deps.getConfig();
|
|
55
|
+
const sttConfig = mergeSttConfigFromAppConfig(config.tools?.media?.audio, config.tools?.media);
|
|
56
|
+
return sttConfig.provider === "xopc-local" || sttConfig.provider === "local" ? 1 : this.concurrency;
|
|
57
|
+
}
|
|
52
58
|
async processOne() {
|
|
53
59
|
const segment = claimNextDiscussionTranscriptSegment(this.owner);
|
|
54
60
|
if (!segment) return;
|
|
@@ -128,13 +128,23 @@ function getDiscussionMetrics() {
|
|
|
128
128
|
WHERE s.discussion_id = d.id AND s.status = 'confirmed') - d.recording_started_at) first_ms,
|
|
129
129
|
AVG(CASE WHEN d.completed_at IS NOT NULL THEN d.completed_at - d.recording_started_at END) complete_ms
|
|
130
130
|
FROM discussion_captures d`).get();
|
|
131
|
+
const segmentMetrics = db.prepare(`SELECT
|
|
132
|
+
COUNT(*) total,
|
|
133
|
+
SUM(CASE WHEN status = 'failed' THEN 1 ELSE 0 END) failed,
|
|
134
|
+
SUM(CASE WHEN attempt_count > 1 THEN 1 ELSE 0 END) retried,
|
|
135
|
+
AVG(CASE WHEN status = 'confirmed' THEN updated_at - created_at END) latency_ms
|
|
136
|
+
FROM discussion_transcript_segments`).get();
|
|
131
137
|
const byStatus = Object.fromEntries(DISCUSSION_STATUSES.map((status) => [status, 0]));
|
|
132
138
|
for (const row of rows) byStatus[row.status] = row.count;
|
|
133
139
|
return {
|
|
134
140
|
total: rows.reduce((sum, row) => sum + row.count, 0),
|
|
135
141
|
byStatus,
|
|
136
142
|
averageTimeToFirstTranscriptMs: timing.first_ms == null ? null : Math.max(0, Math.round(timing.first_ms)),
|
|
137
|
-
averageTimeToCompleteMs: timing.complete_ms == null ? null : Math.max(0, Math.round(timing.complete_ms))
|
|
143
|
+
averageTimeToCompleteMs: timing.complete_ms == null ? null : Math.max(0, Math.round(timing.complete_ms)),
|
|
144
|
+
totalSegments: segmentMetrics.total,
|
|
145
|
+
failedSegments: segmentMetrics.failed ?? 0,
|
|
146
|
+
retriedSegments: segmentMetrics.retried ?? 0,
|
|
147
|
+
averageSegmentLatencyMs: segmentMetrics.latency_ms == null ? null : Math.max(0, Math.round(segmentMetrics.latency_ms))
|
|
138
148
|
};
|
|
139
149
|
}
|
|
140
150
|
function updateDiscussionCapture(id, patch, expectedStatuses) {
|
|
@@ -4,7 +4,7 @@ import type { DiscussionCapture } from './types.js';
|
|
|
4
4
|
export interface DiscussionSealerDeps {
|
|
5
5
|
notes: NotesService;
|
|
6
6
|
getConfig: () => Config;
|
|
7
|
-
transcribeRecording?: (
|
|
7
|
+
transcribeRecording?: (filePath: string, capture: DiscussionCapture, signal?: AbortSignal) => Promise<{
|
|
8
8
|
text: string;
|
|
9
9
|
language?: string;
|
|
10
10
|
}>;
|